Commit 342f0fa2 authored by Nathan Scott's avatar Nathan Scott

[XFS] Cleanup/remove a bunch of macros, comments and code.

SGI Modid: 2.5.x-xfs:slinx:141925a
parent 07c65489
/* /*
* Copyright (c) 2000-2002 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 * 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 * 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 }; ...@@ -51,7 +51,7 @@ xfs_param_t xfs_params = { 0, 1, 0, 0, 0, 3 };
/* /*
* Used to serialize atomicIncWithWrap. * Used to serialize atomicIncWithWrap.
*/ */
spinlock_t Atomic_spin = SPIN_LOCK_UNLOCKED; spinlock_t xfs_atomic_spin = SPIN_LOCK_UNLOCKED;
/* /*
* Global system credential structure. * Global system credential structure.
......
/* /*
* Copyright (c) 2000-2002 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 * 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 * 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 */ ...@@ -41,6 +41,8 @@ extern uint64_t xfs_panic_mask; /* set to cause more panics */
extern unsigned long xfs_physmem; extern unsigned long xfs_physmem;
extern spinlock_t xfs_atomic_spin;
extern struct cred *sys_cred; extern struct cred *sys_cred;
#endif /* __XFS_GLOBALS_H__ */ #endif /* __XFS_GLOBALS_H__ */
/* /*
* Copyright (c) 2000-2002 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 * 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 * under the terms of version 2 of the GNU General Public License as
...@@ -43,20 +43,20 @@ ...@@ -43,20 +43,20 @@
* This is used for two variables in XFS, one of which is a debug trace * 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 * buffer index. They are not accessed via any other atomic operations
* so this is safe. All other atomic increments and decrements in XFS * 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 Atomic_spin; extern spinlock_t xfs_atomic_spin;
static __inline__ int atomicIncWithWrap(int *ip, int val) static __inline__ int atomicIncWithWrap(int *ip, int val)
{ {
unsigned long flags; unsigned long flags;
int ret; int ret;
spin_lock_irqsave(&Atomic_spin, flags); spin_lock_irqsave(&xfs_atomic_spin, flags);
ret = *ip; ret = *ip;
(*ip)++; (*ip)++;
if (*ip == val) *ip = 0; if (*ip == val) *ip = 0;
spin_unlock_irqrestore(&Atomic_spin, flags); spin_unlock_irqrestore(&xfs_atomic_spin, flags);
return ret; return ret;
} }
......
/* /*
* Copyright (c) 2000-2002 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 * 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 * under the terms of version 2 of the GNU General Public License as
...@@ -55,7 +55,7 @@ assfail(char *a, char *f, int l) ...@@ -55,7 +55,7 @@ assfail(char *a, char *f, int l)
BUG(); BUG();
} }
#if (defined(DEBUG) || defined(INDUCE_IO_ERRROR)) #if ((defined(DEBUG) || defined(INDUCE_IO_ERRROR)) && !defined(NO_WANT_RANDOM))
unsigned long unsigned long
random(void) random(void)
...@@ -79,7 +79,7 @@ get_thread_id(void) ...@@ -79,7 +79,7 @@ get_thread_id(void)
return current->pid; return current->pid;
} }
#endif /* DEBUG */ #endif /* DEBUG || INDUCE_IO_ERRROR || !NO_WANT_RANDOM */
void void
cmn_err(register int level, char *fmt, ...) cmn_err(register int level, char *fmt, ...)
......
/* /*
* Copyright (c) 2000-2002 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 * 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 * under the terms of version 2 of the GNU General Public License as
...@@ -272,15 +272,3 @@ mrdemote(mrlock_t *mrp) ...@@ -272,15 +272,3 @@ mrdemote(mrlock_t *mrp)
} }
MRUNLOCK(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);
}
/* /*
* Copyright (c) 2000-2002 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 * 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 * under the terms of version 2 of the GNU General Public License as
...@@ -82,5 +82,7 @@ extern void mrfree(mrlock_t *); ...@@ -82,5 +82,7 @@ extern void mrfree(mrlock_t *);
#define mrinit(mrp, name) mrlock_init(mrp, MRLOCK_BARRIER, name, -1) #define mrinit(mrp, name) mrlock_init(mrp, MRLOCK_BARRIER, name, -1)
#define mraccess(mrp) mraccessf(mrp, 0) /* grab for READ/ACCESS */ #define mraccess(mrp) mraccessf(mrp, 0) /* grab for READ/ACCESS */
#define mrupdate(mrp) mrupdatef(mrp, 0) /* grab for WRITE/UPDATE */ #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__ */ #endif /* __XFS_SUPPORT_MRLOCK_H__ */
/* /*
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
* Portions Copyright (c) 2002 Christoph Hellwig. 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 * This program is free software; you can redistribute it and/or modify it
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
typedef struct semaphore mutex_t; typedef struct semaphore mutex_t;
#define mutex_init(lock, type, name) sema_init(lock, 1) #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_destroy(lock) sema_init(lock, -99)
#define mutex_lock(lock, num) down(lock) #define mutex_lock(lock, num) down(lock)
#define mutex_trylock(lock) (down_trylock(lock) ? 0 : 1) #define mutex_trylock(lock) (down_trylock(lock) ? 0 : 1)
......
/* /*
* 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 * 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 * under the terms of version 2 of the GNU General Public License as
...@@ -76,10 +76,6 @@ typedef struct xfs_bmap_free ...@@ -76,10 +76,6 @@ typedef struct xfs_bmap_free
#define XFS_BMAPI_IGSTATE 0x200 /* Ignore state - */ #define XFS_BMAPI_IGSTATE 0x200 /* Ignore state - */
/* combine contig. space */ /* combine contig. space */
#define XFS_BMAPI_CONTIG 0x400 /* must allocate only one extent */ #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) #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BMAPI_AFLAG)
int xfs_bmapi_aflag(int w); int xfs_bmapi_aflag(int w);
......
/* /*
* Copyright (c) 2000-2002 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 * 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 * under the terms of version 2 of the GNU General Public License as
...@@ -64,16 +64,6 @@ struct xfs_mount_args { ...@@ -64,16 +64,6 @@ struct xfs_mount_args {
int sunit; /* stripe unit (BBs) */ int sunit; /* stripe unit (BBs) */
int swidth; /* stripe width (BBs), multiple of sunit */ int swidth; /* stripe width (BBs), multiple of sunit */
uchar_t iosizelog; /* log2 of the preferred I/O size */ 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 { ...@@ -101,17 +91,6 @@ struct xfs_mount_args {
#define XFSMNT_IOSIZE 0x00002000 /* optimize for I/O size */ #define XFSMNT_IOSIZE 0x00002000 /* optimize for I/O size */
#define XFSMNT_OSYNCISOSYNC 0x00004000 /* o_sync is REALLY o_sync */ #define XFSMNT_OSYNCISOSYNC 0x00004000 /* o_sync is REALLY o_sync */
/* (osyncisdsync is now default) */ /* (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 #define XFSMNT_32BITINODES 0x00200000 /* restrict inodes to 32
* bits of address space */ * bits of address space */
#define XFSMNT_GQUOTA 0x00400000 /* group quota accounting */ #define XFSMNT_GQUOTA 0x00400000 /* group quota accounting */
...@@ -121,10 +100,4 @@ struct xfs_mount_args { ...@@ -121,10 +100,4 @@ struct xfs_mount_args {
#define XFSMNT_DMAPI 0x02000000 /* enable dmapi/xdsm */ #define XFSMNT_DMAPI 0x02000000 /* enable dmapi/xdsm */
#define XFSMNT_NOLOGFLUSH 0x04000000 /* Don't flush for log blocks */ #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__ */ #endif /* __XFS_CLNT_H__ */
...@@ -609,11 +609,8 @@ xfs_ireclaim(xfs_inode_t *ip) ...@@ -609,11 +609,8 @@ xfs_ireclaim(xfs_inode_t *ip)
/* /*
* This routine removes an about-to-be-destroyed inode from * This routine removes an about-to-be-destroyed inode from
* all of the lists in which it is lcoated with the exception * all of the lists in which it is located with the exception
* of the behavior chain. It is used by xfs_ireclaim and * of the behavior chain.
* 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.
*/ */
void void
xfs_iextract( xfs_iextract(
......
/* /*
* Copyright (c) 2000-2002 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 * 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 * under the terms of version 2 of the GNU General Public License as
...@@ -154,11 +154,7 @@ typedef struct xfs_iocore { ...@@ -154,11 +154,7 @@ typedef struct xfs_iocore {
* Flags in the flags field * Flags in the flags field
*/ */
#define XFS_IOCORE_ISXFS 0x01 #define XFS_IOCORE_RT 0x1
#define XFS_IOCORE_ISCXFS 0x02
#define XFS_IOCORE_RT 0x04
#define IO_IS_XFS(io) ((io)->io_flags & XFS_IOCORE_ISXFS)
/* /*
* xfs_iocore prototypes * xfs_iocore prototypes
......
...@@ -77,11 +77,9 @@ xfs_iocore_inode_reinit( ...@@ -77,11 +77,9 @@ xfs_iocore_inode_reinit(
{ {
xfs_iocore_t *io = &ip->i_iocore; xfs_iocore_t *io = &ip->i_iocore;
io->io_flags = XFS_IOCORE_ISXFS; io->io_flags = 0;
if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) { if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)
io->io_flags |= XFS_IOCORE_RT; io->io_flags |= XFS_IOCORE_RT;
}
io->io_dmevmask = ip->i_d.di_dmevmask; io->io_dmevmask = ip->i_d.di_dmevmask;
io->io_dmstate = ip->i_d.di_dmstate; io->io_dmstate = ip->i_d.di_dmstate;
} }
......
...@@ -64,7 +64,6 @@ typedef struct xfs_trans_header { ...@@ -64,7 +64,6 @@ typedef struct xfs_trans_header {
#define XFS_LI_BUF 0x123c /* v2 bufs, variable sized inode bufs */ #define XFS_LI_BUF 0x123c /* v2 bufs, variable sized inode bufs */
#define XFS_LI_DQUOT 0x123d #define XFS_LI_DQUOT 0x123d
#define XFS_LI_QUOTAOFF 0x123e #define XFS_LI_QUOTAOFF 0x123e
#define XFS_LI_RPC 0x123f /* CXFS RPC return info */
/* /*
* Transaction types. Used to distinguish types of buffers. * Transaction types. Used to distinguish types of buffers.
...@@ -1014,10 +1013,7 @@ void xfs_trans_log_efd_extent(xfs_trans_t *, ...@@ -1014,10 +1013,7 @@ void xfs_trans_log_efd_extent(xfs_trans_t *,
struct xfs_efd_log_item *, struct xfs_efd_log_item *,
xfs_fsblock_t, xfs_fsblock_t,
xfs_extlen_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 *); 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_cancel(xfs_trans_t *, int);
void xfs_trans_ail_init(struct xfs_mount *); void xfs_trans_ail_init(struct xfs_mount *);
xfs_lsn_t xfs_trans_push_ail(struct xfs_mount *, xfs_lsn_t); xfs_lsn_t xfs_trans_push_ail(struct xfs_mount *, xfs_lsn_t);
......
...@@ -1320,13 +1320,13 @@ char *tab_vflags[] = { ...@@ -1320,13 +1320,13 @@ char *tab_vflags[] = {
"INVALID0x40000", /* 0x40000 */ "INVALID0x40000", /* 0x40000 */
"INVALID0x80000", /* 0x80000 */ "INVALID0x80000", /* 0x80000 */
"VROOT", /* 0x100000 */ "VROOT", /* 0x100000 */
"VNOSWAP", /* 0x200000 */ "INVALID0x200000", /* 0x200000 */
"VISSWAP", /* 0x400000 */ "INVALID00x400000", /* 0x400000 */
"VREPLICABLE", /* 0x800000 */ "INVALID0x800000", /* 0x800000 */
"VNOTREPLICABLE", /* 0x1000000 */ "INVALID0x1000000", /* 0x1000000 */
"VDOCMP", /* 0x2000000 */ "INVALID0x2000000", /* 0x2000000 */
"VSHARE", /* 0x4000000 */ "VSHARE", /* 0x4000000 */
"VFRLOCKS", /* 0x8000000 */ "INVALID0x8000000", /* 0x8000000 */
"VENF_LOCKING", /* 0x10000000 */ "VENF_LOCKING", /* 0x10000000 */
"VOPLOCK", /* 0x20000000 */ "VOPLOCK", /* 0x20000000 */
"VPURGE", /* 0x40000000 */ "VPURGE", /* 0x40000000 */
...@@ -1373,9 +1373,10 @@ static void printvnode(vnode_t *vp) ...@@ -1373,9 +1373,10 @@ static void printvnode(vnode_t *vp)
kdb_printf("vnode: 0x%p type ", vp); kdb_printf("vnode: 0x%p type ", vp);
if ((size_t)vp->v_type >= sizeof(vnode_type)/sizeof(vnode_type[0])) 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 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)) { if ((bh = vp->v_bh.bh_first)) {
kdb_printf(" v_inode 0x%p v_bh->bh_first 0x%p pobj 0x%p\n", 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) ...@@ -1397,6 +1398,9 @@ static void printvnode(vnode_t *vp)
#ifdef CONFIG_XFS_VNODE_TRACING #ifdef CONFIG_XFS_VNODE_TRACING
kdb_printf(" v_trace 0x%p\n", vp->v_trace); kdb_printf(" v_trace 0x%p\n", vp->v_trace);
#endif /* CONFIG_XFS_VNODE_TRACING */ #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) ...@@ -4808,13 +4812,8 @@ xfsidbg_xnode(xfs_inode_t *ip)
static void static void
xfsidbg_xcore(xfs_iocore_t *io) xfsidbg_xcore(xfs_iocore_t *io)
{ {
if (IO_IS_XFS(io)) { kdb_printf("io_obj 0x%p io_flags 0x%x io_mount 0x%p\n",
kdb_printf("io_obj 0x%p (xinode) io_mount 0x%p\n", io->io_obj, io->io_flags, io->io_mount);
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("new_size %Lx\n", io->io_new_size); kdb_printf("new_size %Lx\n", io->io_new_size);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment