Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
342f0fa2
Commit
342f0fa2
authored
Mar 26, 2003
by
Nathan Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] Cleanup/remove a bunch of macros, comments and code.
SGI Modid: 2.5.x-xfs:slinx:141925a
parent
07c65489
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
44 additions
and
98 deletions
+44
-98
fs/xfs/linux/xfs_globals.c
fs/xfs/linux/xfs_globals.c
+3
-3
fs/xfs/linux/xfs_globals.h
fs/xfs/linux/xfs_globals.h
+4
-2
fs/xfs/support/atomic.h
fs/xfs/support/atomic.h
+5
-5
fs/xfs/support/debug.c
fs/xfs/support/debug.c
+3
-3
fs/xfs/support/mrlock.c
fs/xfs/support/mrlock.c
+1
-13
fs/xfs/support/mrlock.h
fs/xfs/support/mrlock.h
+5
-3
fs/xfs/support/mutex.h
fs/xfs/support/mutex.h
+1
-2
fs/xfs/xfs_bmap.h
fs/xfs/xfs_bmap.h
+1
-5
fs/xfs/xfs_clnt.h
fs/xfs/xfs_clnt.h
+1
-28
fs/xfs/xfs_iget.c
fs/xfs/xfs_iget.c
+2
-5
fs/xfs/xfs_inode.h
fs/xfs/xfs_inode.h
+2
-6
fs/xfs/xfs_iocore.c
fs/xfs/xfs_iocore.c
+2
-4
fs/xfs/xfs_trans.h
fs/xfs/xfs_trans.h
+0
-4
fs/xfs/xfsidbg.c
fs/xfs/xfsidbg.c
+14
-15
No files found.
fs/xfs/linux/xfs_globals.c
View file @
342f0fa2
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
...
...
@@ -51,7 +51,7 @@ xfs_param_t xfs_params = { 0, 1, 0, 0, 0, 3 };
/*
* Used to serialize atomicIncWithWrap.
*/
spinlock_t
A
tomic_spin
=
SPIN_LOCK_UNLOCKED
;
spinlock_t
xfs_a
tomic_spin
=
SPIN_LOCK_UNLOCKED
;
/*
* Global system credential structure.
...
...
fs/xfs/linux/xfs_globals.h
View file @
342f0fa2
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
...
...
@@ -41,6 +41,8 @@ extern uint64_t xfs_panic_mask; /* set to cause more panics */
extern
unsigned
long
xfs_physmem
;
extern
spinlock_t
xfs_atomic_spin
;
extern
struct
cred
*
sys_cred
;
#endif
/* __XFS_GLOBALS_H__ */
fs/xfs/support/atomic.h
View file @
342f0fa2
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
...
...
@@ -43,20 +43,20 @@
* This is used for two variables in XFS, one of which is a debug trace
* buffer index. They are not accessed via any other atomic operations
* so this is safe. All other atomic increments and decrements in XFS
* now use the
linux built
in functions.
* now use the
Linux built-
in functions.
*/
extern
spinlock_t
A
tomic_spin
;
extern
spinlock_t
xfs_a
tomic_spin
;
static
__inline__
int
atomicIncWithWrap
(
int
*
ip
,
int
val
)
{
unsigned
long
flags
;
int
ret
;
spin_lock_irqsave
(
&
A
tomic_spin
,
flags
);
spin_lock_irqsave
(
&
xfs_a
tomic_spin
,
flags
);
ret
=
*
ip
;
(
*
ip
)
++
;
if
(
*
ip
==
val
)
*
ip
=
0
;
spin_unlock_irqrestore
(
&
A
tomic_spin
,
flags
);
spin_unlock_irqrestore
(
&
xfs_a
tomic_spin
,
flags
);
return
ret
;
}
...
...
fs/xfs/support/debug.c
View file @
342f0fa2
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
...
...
@@ -55,7 +55,7 @@ assfail(char *a, char *f, int l)
BUG
();
}
#if (
defined(DEBUG) || defined(INDUCE_IO_ERRROR
))
#if (
(defined(DEBUG) || defined(INDUCE_IO_ERRROR)) && !defined(NO_WANT_RANDOM
))
unsigned
long
random
(
void
)
...
...
@@ -79,7 +79,7 @@ get_thread_id(void)
return
current
->
pid
;
}
#endif
/* DEBUG */
#endif
/* DEBUG
|| INDUCE_IO_ERRROR || !NO_WANT_RANDOM
*/
void
cmn_err
(
register
int
level
,
char
*
fmt
,
...)
...
...
fs/xfs/support/mrlock.c
View file @
342f0fa2
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
...
...
@@ -272,15 +272,3 @@ mrdemote(mrlock_t *mrp)
}
MRUNLOCK
(
mrp
);
}
int
mrislocked_access
(
mrlock_t
*
mrp
)
{
return
(
mrp
->
mr_count
>
0
);
}
int
mrislocked_update
(
mrlock_t
*
mrp
)
{
return
(
mrp
->
mr_count
<
0
);
}
fs/xfs/support/mrlock.h
View file @
342f0fa2
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
...
...
@@ -82,5 +82,7 @@ extern void mrfree(mrlock_t *);
#define mrinit(mrp, name) mrlock_init(mrp, MRLOCK_BARRIER, name, -1)
#define mraccess(mrp) mraccessf(mrp, 0)
/* grab for READ/ACCESS */
#define mrupdate(mrp) mrupdatef(mrp, 0)
/* grab for WRITE/UPDATE */
#define mrislocked_access(mrp) ((mrp)->mr_count > 0)
#define mrislocked_update(mrp) ((mrp)->mr_count < 0)
#endif
/* __XFS_SUPPORT_MRLOCK_H__ */
fs/xfs/support/mutex.h
View file @
342f0fa2
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
* Portions Copyright (c) 2002 Christoph Hellwig. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
...
...
@@ -46,7 +46,6 @@
typedef
struct
semaphore
mutex_t
;
#define mutex_init(lock, type, name) sema_init(lock, 1)
#define init_mutex(ptr, type, name, sequence) sema_init(lock, 1)
#define mutex_destroy(lock) sema_init(lock, -99)
#define mutex_lock(lock, num) down(lock)
#define mutex_trylock(lock) (down_trylock(lock) ? 0 : 1)
...
...
fs/xfs/xfs_bmap.h
View file @
342f0fa2
/*
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000
-2003
Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
...
...
@@ -76,10 +76,6 @@ typedef struct xfs_bmap_free
#define XFS_BMAPI_IGSTATE 0x200
/* Ignore state - */
/* combine contig. space */
#define XFS_BMAPI_CONTIG 0x400
/* must allocate only one extent */
#define XFS_BMAPI_DIRECT_IO 0x800
/* Flag from cxfs client, not used
* by xfs directly. Indicates alloc
* request is for direct I/O not
* extent conversion by server */
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAPI_AFLAG)
int
xfs_bmapi_aflag
(
int
w
);
...
...
fs/xfs/xfs_clnt.h
View file @
342f0fa2
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
...
...
@@ -64,16 +64,6 @@ struct xfs_mount_args {
int
sunit
;
/* stripe unit (BBs) */
int
swidth
;
/* stripe width (BBs), multiple of sunit */
uchar_t
iosizelog
;
/* log2 of the preferred I/O size */
/* The remainder is for CXFS support. */
char
**
servlist
;
/* Table of hosts which may be servers */
int
*
servlistlen
;
/* Table of hostname lengths. */
int
slcount
;
/* Count of hosts which may be servers. */
int
stimeout
;
/* Server timeout in milliseconds */
int
ctimeout
;
/* Client timeout in milliseconds */
char
*
server
;
/* Designated server hostname (for remount). */
int
servlen
;
/* Length of server hostname (for remount). */
int
servcell
;
/* Server cell (internal testing only) */
};
/*
...
...
@@ -101,17 +91,6 @@ struct xfs_mount_args {
#define XFSMNT_IOSIZE 0x00002000
/* optimize for I/O size */
#define XFSMNT_OSYNCISOSYNC 0x00004000
/* o_sync is REALLY o_sync */
/* (osyncisdsync is now default) */
#define XFSMNT_CLNTONLY 0x00008000
/* cxfs mount as client only */
#define XFSMNT_UNSHARED 0x00010000
/* cxfs filesystem mounted
* unshared */
#define XFSMNT_CHGCLNTONLY 0x00020000
/* changing client only flag */
/* (for remount only) */
#define XFSMNT_SERVCELL 0x00040000
/* setting server cell */
/* (allowed on remount) */
#define XFSMNT_MAKESERVER 0x00080000
/* become the server (remount */
/* only) */
#define XFSMNT_NOTSERVER 0x00100000
/* give up being the server */
/* (remount only) */
#define XFSMNT_32BITINODES 0x00200000
/* restrict inodes to 32
* bits of address space */
#define XFSMNT_GQUOTA 0x00400000
/* group quota accounting */
...
...
@@ -121,10 +100,4 @@ struct xfs_mount_args {
#define XFSMNT_DMAPI 0x02000000
/* enable dmapi/xdsm */
#define XFSMNT_NOLOGFLUSH 0x04000000
/* Don't flush for log blocks */
/* Did we get any args for CXFS to consume? */
#define XFSARGS_FOR_CXFSARR(ap) \
((ap)->servlist || (ap)->slcount >= 0 || \
(ap)->stimeout >= 0 || (ap)->ctimeout >= 0 || \
(ap)->flags & (XFSMNT_CLNTONLY | XFSMNT_UNSHARED))
#endif
/* __XFS_CLNT_H__ */
fs/xfs/xfs_iget.c
View file @
342f0fa2
...
...
@@ -609,11 +609,8 @@ xfs_ireclaim(xfs_inode_t *ip)
/*
* This routine removes an about-to-be-destroyed inode from
* all of the lists in which it is lcoated with the exception
* of the behavior chain. It is used by xfs_ireclaim and
* by cxfs relocation cocde, in which case, we are removing
* the xfs_inode but leaving the vnode alone since it has
* been transformed into a client vnode.
* all of the lists in which it is located with the exception
* of the behavior chain.
*/
void
xfs_iextract
(
...
...
fs/xfs/xfs_inode.h
View file @
342f0fa2
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
...
...
@@ -154,11 +154,7 @@ typedef struct xfs_iocore {
* Flags in the flags field
*/
#define XFS_IOCORE_ISXFS 0x01
#define XFS_IOCORE_ISCXFS 0x02
#define XFS_IOCORE_RT 0x04
#define IO_IS_XFS(io) ((io)->io_flags & XFS_IOCORE_ISXFS)
#define XFS_IOCORE_RT 0x1
/*
* xfs_iocore prototypes
...
...
fs/xfs/xfs_iocore.c
View file @
342f0fa2
...
...
@@ -77,11 +77,9 @@ xfs_iocore_inode_reinit(
{
xfs_iocore_t
*
io
=
&
ip
->
i_iocore
;
io
->
io_flags
=
XFS_IOCORE_ISXFS
;
if
(
ip
->
i_d
.
di_flags
&
XFS_DIFLAG_REALTIME
)
{
io
->
io_flags
=
0
;
if
(
ip
->
i_d
.
di_flags
&
XFS_DIFLAG_REALTIME
)
io
->
io_flags
|=
XFS_IOCORE_RT
;
}
io
->
io_dmevmask
=
ip
->
i_d
.
di_dmevmask
;
io
->
io_dmstate
=
ip
->
i_d
.
di_dmstate
;
}
...
...
fs/xfs/xfs_trans.h
View file @
342f0fa2
...
...
@@ -64,7 +64,6 @@ typedef struct xfs_trans_header {
#define XFS_LI_BUF 0x123c
/* v2 bufs, variable sized inode bufs */
#define XFS_LI_DQUOT 0x123d
#define XFS_LI_QUOTAOFF 0x123e
#define XFS_LI_RPC 0x123f
/* CXFS RPC return info */
/*
* Transaction types. Used to distinguish types of buffers.
...
...
@@ -1014,10 +1013,7 @@ void xfs_trans_log_efd_extent(xfs_trans_t *,
struct
xfs_efd_log_item
*
,
xfs_fsblock_t
,
xfs_extlen_t
);
void
xfs_trans_log_create_rpc
(
xfs_trans_t
*
,
int
,
xfs_ino_t
);
void
xfs_trans_log_setattr_rpc
(
xfs_trans_t
*
,
int
);
int
xfs_trans_commit
(
xfs_trans_t
*
,
uint
flags
,
xfs_lsn_t
*
);
void
xfs_trans_commit_async
(
struct
xfs_mount
*
);
void
xfs_trans_cancel
(
xfs_trans_t
*
,
int
);
void
xfs_trans_ail_init
(
struct
xfs_mount
*
);
xfs_lsn_t
xfs_trans_push_ail
(
struct
xfs_mount
*
,
xfs_lsn_t
);
...
...
fs/xfs/xfsidbg.c
View file @
342f0fa2
...
...
@@ -1320,13 +1320,13 @@ char *tab_vflags[] = {
"INVALID0x40000"
,
/* 0x40000 */
"INVALID0x80000"
,
/* 0x80000 */
"VROOT"
,
/* 0x100000 */
"
VNOSWAP"
,
/* 0x200000 */
"
VISSWAP"
,
/* 0x400000 */
"
VREPLICABLE"
,
/* 0x800000 */
"
VNOTREPLICABLE
"
,
/* 0x1000000 */
"
VDOCMP"
,
/* 0x2000000 */
"
INVALID0x200000"
,
/* 0x200000 */
"
INVALID00x400000"
,
/* 0x400000 */
"
INVALID0x800000"
,
/* 0x800000 */
"
INVALID0x1000000
"
,
/* 0x1000000 */
"
INVALID0x2000000"
,
/* 0x2000000 */
"VSHARE"
,
/* 0x4000000 */
"
VFRLOCKS"
,
/* 0x8000000 */
"
INVALID0x8000000"
,
/* 0x8000000 */
"VENF_LOCKING"
,
/* 0x10000000 */
"VOPLOCK"
,
/* 0x20000000 */
"VPURGE"
,
/* 0x40000000 */
...
...
@@ -1373,9 +1373,10 @@ static void printvnode(vnode_t *vp)
kdb_printf
(
"vnode: 0x%p type "
,
vp
);
if
((
size_t
)
vp
->
v_type
>=
sizeof
(
vnode_type
)
/
sizeof
(
vnode_type
[
0
]))
kdb_printf
(
"out of range 0x%x
\n
"
,
vp
->
v_type
);
kdb_printf
(
"out of range 0x%x"
,
vp
->
v_type
);
else
kdb_printf
(
"%s
\n
"
,
vnode_type
[
vp
->
v_type
]);
kdb_printf
(
"%s"
,
vnode_type
[
vp
->
v_type
]);
kdb_printf
(
" v_bh %p
\n
"
,
&
vp
->
v_bh
);
if
((
bh
=
vp
->
v_bh
.
bh_first
))
{
kdb_printf
(
" v_inode 0x%p v_bh->bh_first 0x%p pobj 0x%p
\n
"
,
...
...
@@ -1397,6 +1398,9 @@ static void printvnode(vnode_t *vp)
#ifdef CONFIG_XFS_VNODE_TRACING
kdb_printf
(
" v_trace 0x%p
\n
"
,
vp
->
v_trace
);
#endif
/* CONFIG_XFS_VNODE_TRACING */
kdb_printf
(
" v_vfsp 0x%p v_number %Lx
\n
"
,
vp
->
v_vfsp
,
vp
->
v_number
);
}
...
...
@@ -4808,13 +4812,8 @@ xfsidbg_xnode(xfs_inode_t *ip)
static
void
xfsidbg_xcore
(
xfs_iocore_t
*
io
)
{
if
(
IO_IS_XFS
(
io
))
{
kdb_printf
(
"io_obj 0x%p (xinode) io_mount 0x%p
\n
"
,
io
->
io_obj
,
io
->
io_mount
);
}
else
{
kdb_printf
(
"io_obj 0x%p (dcxvn) io_mount 0x%p
\n
"
,
io
->
io_obj
,
io
->
io_mount
);
}
kdb_printf
(
"io_obj 0x%p io_flags 0x%x io_mount 0x%p
\n
"
,
io
->
io_obj
,
io
->
io_flags
,
io
->
io_mount
);
kdb_printf
(
"new_size %Lx
\n
"
,
io
->
io_new_size
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment