Commit f03a0682 authored by Nathan Scott's avatar Nathan Scott Committed by Christoph Hellwig

[XFS] Minor formatting and code consistency cleanups.

SGI Modid: 2.5.x-xfs:slinx:133828a
parent a1aed524
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
uint64_t vn_generation; /* vnode generation number */ uint64_t vn_generation; /* vnode generation number */
spinlock_t vnumber_lock = SPIN_LOCK_UNLOCKED; spinlock_t vnumber_lock = SPIN_LOCK_UNLOCKED;
/* /*
...@@ -59,9 +58,6 @@ u_short vttoif_tab[] = { ...@@ -59,9 +58,6 @@ u_short vttoif_tab[] = {
0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, S_IFIFO, 0, S_IFSOCK 0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, S_IFIFO, 0, S_IFSOCK
}; };
#define VN_LOCK(vp) spin_lock(&(vp)->v_lock)
#define VN_UNLOCK(vp) spin_unlock(&(vp)->v_lock)
void void
vn_init(void) vn_init(void)
...@@ -73,7 +69,6 @@ vn_init(void) ...@@ -73,7 +69,6 @@ vn_init(void)
init_sv(svp, SV_DEFAULT, "vsy", i); init_sv(svp, SV_DEFAULT, "vsy", i);
} }
/* /*
* Clean a vnode of filesystem-specific data and prepare it for reuse. * Clean a vnode of filesystem-specific data and prepare it for reuse.
*/ */
...@@ -98,7 +93,6 @@ vn_reclaim(struct vnode *vp) ...@@ -98,7 +93,6 @@ vn_reclaim(struct vnode *vp)
ASSERT(vp->v_fbhv == NULL); ASSERT(vp->v_fbhv == NULL);
VN_LOCK(vp); VN_LOCK(vp);
vp->v_flag &= (VRECLM|VWAIT); vp->v_flag &= (VRECLM|VWAIT);
VN_UNLOCK(vp); VN_UNLOCK(vp);
...@@ -189,7 +183,7 @@ vn_get(struct vnode *vp, vmap_t *vmap) ...@@ -189,7 +183,7 @@ vn_get(struct vnode *vp, vmap_t *vmap)
} }
/* /*
* "revalidate" the linux inode. * Revalidate the Linux inode from the vnode.
*/ */
int int
vn_revalidate(struct vnode *vp) vn_revalidate(struct vnode *vp)
...@@ -199,17 +193,12 @@ vn_revalidate(struct vnode *vp) ...@@ -199,17 +193,12 @@ vn_revalidate(struct vnode *vp)
vattr_t va; vattr_t va;
vn_trace_entry(vp, "vn_revalidate", (inst_t *)__return_address); vn_trace_entry(vp, "vn_revalidate", (inst_t *)__return_address);
ASSERT(vp->v_fbhv != NULL);
va.va_mask = XFS_AT_STAT|XFS_AT_GENCOUNT; va.va_mask = XFS_AT_STAT|XFS_AT_GENCOUNT;
ASSERT(vp->v_bh.bh_first != NULL);
VOP_GETATTR(vp, &va, 0, NULL, error); VOP_GETATTR(vp, &va, 0, NULL, error);
if (!error) {
if (! error) {
inode = LINVFS_GET_IP(vp); inode = LINVFS_GET_IP(vp);
ASSERT(inode);
inode->i_mode = VTTOIF(va.va_type) | va.va_mode; inode->i_mode = VTTOIF(va.va_type) | va.va_mode;
inode->i_nlink = va.va_nlink; inode->i_nlink = va.va_nlink;
inode->i_uid = va.va_uid; inode->i_uid = va.va_uid;
...@@ -224,11 +213,9 @@ vn_revalidate(struct vnode *vp) ...@@ -224,11 +213,9 @@ vn_revalidate(struct vnode *vp)
inode->i_atime.tv_nsec = va.va_atime.tv_nsec; inode->i_atime.tv_nsec = va.va_atime.tv_nsec;
VUNMODIFY(vp); VUNMODIFY(vp);
} }
return -error; return -error;
} }
/* /*
* purge a vnode from the cache * purge a vnode from the cache
* At this point the vnode is guaranteed to have no references (vn_count == 0) * At this point the vnode is guaranteed to have no references (vn_count == 0)
...@@ -317,12 +304,10 @@ void ...@@ -317,12 +304,10 @@ void
vn_rele(struct vnode *vp) vn_rele(struct vnode *vp)
{ {
int vcnt; int vcnt;
/* REFERENCED */
int cache; int cache;
XFS_STATS_INC(xfsstats.vn_rele); XFS_STATS_INC(xfsstats.vn_rele);
VN_LOCK(vp); VN_LOCK(vp);
vn_trace_entry(vp, "vn_rele", (inst_t *)__return_address); vn_trace_entry(vp, "vn_rele", (inst_t *)__return_address);
...@@ -365,7 +350,6 @@ vn_rele(struct vnode *vp) ...@@ -365,7 +350,6 @@ vn_rele(struct vnode *vp)
vn_trace_exit(vp, "vn_rele", (inst_t *)__return_address); vn_trace_exit(vp, "vn_rele", (inst_t *)__return_address);
} }
/* /*
* Finish the removal of a vnode. * Finish the removal of a vnode.
*/ */
......
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
#ifndef __XFS_VNODE_H__ #ifndef __XFS_VNODE_H__
#define __XFS_VNODE_H__ #define __XFS_VNODE_H__
struct uio;
struct file;
struct vattr;
struct page_buf_bmap_s;
struct attrlist_cursor_kern;
/* /*
* Vnode types (unrelated to on-disk inodes). VNON means no type. * Vnode types (unrelated to on-disk inodes). VNON means no type.
*/ */
...@@ -47,12 +53,9 @@ typedef enum vtype { ...@@ -47,12 +53,9 @@ typedef enum vtype {
VSOCK = 8 VSOCK = 8
} vtype_t; } vtype_t;
typedef __u64 vnumber_t; typedef xfs_ino_t vnumber_t;
typedef struct dentry vname_t;
/* typedef bhv_head_t vn_bhv_head_t;
* Define the type of behavior head used by vnodes.
*/
#define vn_bhv_head_t bhv_head_t
/* /*
* MP locking protocols: * MP locking protocols:
...@@ -62,17 +65,49 @@ typedef __u64 vnumber_t; ...@@ -62,17 +65,49 @@ typedef __u64 vnumber_t;
typedef struct vnode { typedef struct vnode {
__u32 v_flag; /* vnode flags (see below) */ __u32 v_flag; /* vnode flags (see below) */
enum vtype v_type; /* vnode type */ enum vtype v_type; /* vnode type */
struct vfs *v_vfsp; /* ptr to containing VFS*/ struct vfs *v_vfsp; /* ptr to containing VFS */
vnumber_t v_number; /* in-core vnode number */ vnumber_t v_number; /* in-core vnode number */
vn_bhv_head_t v_bh; /* behavior head */ vn_bhv_head_t v_bh; /* behavior head */
spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */
spinlock_t v_lock; /* don't use VLOCK on Linux */ struct inode v_inode; /* Linux inode */
struct inode v_inode; /* linux inode */
#ifdef CONFIG_XFS_VNODE_TRACING #ifdef CONFIG_XFS_VNODE_TRACING
struct ktrace *v_trace; /* trace header structure */ struct ktrace *v_trace; /* trace header structure */
#endif #endif
} vnode_t; } vnode_t;
#define v_fbhv v_bh.bh_first /* first behavior */
#define v_fops v_bh.bh_first->bd_ops /* first behavior ops */
#define VNODE_POSITION_BASE BHV_POSITION_BASE /* chain bottom */
#define VNODE_POSITION_TOP BHV_POSITION_TOP /* chain top */
#define VNODE_POSITION_INVALID BHV_POSITION_INVALID /* invalid pos. num */
typedef enum {
VN_BHV_UNKNOWN, /* not specified */
VN_BHV_XFS, /* xfs */
VN_BHV_END /* housekeeping end-of-range */
} vn_bhv_t;
#define VNODE_POSITION_XFS (VNODE_POSITION_BASE)
/*
* Macros for dealing with the behavior descriptor inside of the vnode.
*/
#define BHV_TO_VNODE(bdp) ((vnode_t *)BHV_VOBJ(bdp))
#define BHV_TO_VNODE_NULL(bdp) ((vnode_t *)BHV_VOBJNULL(bdp))
#define VNODE_TO_FIRST_BHV(vp) (BHV_HEAD_FIRST(&(vp)->v_bh))
#define VN_BHV_HEAD(vp) ((bhv_head_t *)(&((vp)->v_bh)))
#define VN_BHV_READ_LOCK(bhp) BHV_READ_LOCK(bhp)
#define VN_BHV_READ_UNLOCK(bhp) BHV_READ_UNLOCK(bhp)
#define VN_BHV_WRITE_LOCK(bhp) BHV_WRITE_LOCK(bhp)
#define VN_BHV_NOT_READ_LOCKED(bhp) BHV_NOT_READ_LOCKED(bhp)
#define VN_BHV_NOT_WRITE_LOCKED(bhp) BHV_NOT_WRITE_LOCKED(bhp)
#define vn_bhv_head_init(bhp,name) bhv_head_init(bhp,name)
#define vn_bhv_remove(bhp,bdp) bhv_remove(bhp,bdp)
#define vn_bhv_lookup(bhp,ops) bhv_lookup(bhp,ops)
#define vn_bhv_lookup_unlocked(bhp,ops) bhv_lookup_unlocked(bhp,ops)
/* /*
* Vnode to Linux inode mapping. * Vnode to Linux inode mapping.
*/ */
...@@ -91,23 +126,12 @@ extern ushort vttoif_tab[]; ...@@ -91,23 +126,12 @@ extern ushort vttoif_tab[];
/* /*
* Vnode flags. * Vnode flags.
*
* The vnode flags fall into two categories:
* 1) Local only -
* Flags that are relevant only to a particular cell
* 2) Single system image -
* Flags that must be maintained coherent across all cells
*/ */
/* Local only flags */
#define VINACT 0x1 /* vnode is being inactivated */ #define VINACT 0x1 /* vnode is being inactivated */
#define VRECLM 0x2 /* vnode is being reclaimed */ #define VRECLM 0x2 /* vnode is being reclaimed */
#define VWAIT 0x4 /* waiting for VINACT #define VWAIT 0x4 /* waiting for VINACT/VRECLM to end */
or VRECLM to finish */ #define VMODIFIED 0x8 /* XFS inode state possibly differs */
#define VMODIFIED 0x8 /* xfs inode state possibly different /* to the Linux inode state. */
* from linux inode state.
*/
/* Single system image flags */
#define VROOT 0x100000 /* root of its file system */ #define VROOT 0x100000 /* root of its file system */
#define VNOSWAP 0x200000 /* cannot be used as virt swap device */ #define VNOSWAP 0x200000 /* cannot be used as virt swap device */
#define VISSWAP 0x400000 /* vnode is part of virt swap device */ #define VISSWAP 0x400000 /* vnode is part of virt swap device */
...@@ -115,7 +139,6 @@ extern ushort vttoif_tab[]; ...@@ -115,7 +139,6 @@ extern ushort vttoif_tab[];
#define VNONREPLICABLE 0x1000000 /* Vnode has writers. Don't replicate */ #define VNONREPLICABLE 0x1000000 /* Vnode has writers. Don't replicate */
#define VDOCMP 0x2000000 /* Vnode has special VOP_CMP impl. */ #define VDOCMP 0x2000000 /* Vnode has special VOP_CMP impl. */
#define VSHARE 0x4000000 /* vnode part of global cache */ #define VSHARE 0x4000000 /* vnode part of global cache */
/* VSHARE applies to local cell only */
#define VFRLOCKS 0x8000000 /* vnode has FR locks applied */ #define VFRLOCKS 0x8000000 /* vnode has FR locks applied */
#define VENF_LOCKING 0x10000000 /* enf. mode FR locking in effect */ #define VENF_LOCKING 0x10000000 /* enf. mode FR locking in effect */
#define VOPLOCK 0x20000000 /* oplock set on the vnode */ #define VOPLOCK 0x20000000 /* oplock set on the vnode */
...@@ -143,35 +166,6 @@ typedef enum vchange { ...@@ -143,35 +166,6 @@ typedef enum vchange {
VCHANGE_FLAGS_IOEXCL_COUNT = 4 VCHANGE_FLAGS_IOEXCL_COUNT = 4
} vchange_t; } vchange_t;
/*
* Macros for dealing with the behavior descriptor inside of the vnode.
*/
#define BHV_TO_VNODE(bdp) ((vnode_t *)BHV_VOBJ(bdp))
#define BHV_TO_VNODE_NULL(bdp) ((vnode_t *)BHV_VOBJNULL(bdp))
#define VNODE_TO_FIRST_BHV(vp) (BHV_HEAD_FIRST(&(vp)->v_bh))
#define VN_BHV_HEAD(vp) ((vn_bhv_head_t *)(&((vp)->v_bh)))
#define VN_BHV_READ_LOCK(bhp) BHV_READ_LOCK(bhp)
#define VN_BHV_READ_UNLOCK(bhp) BHV_READ_UNLOCK(bhp)
#define VN_BHV_WRITE_LOCK(bhp) BHV_WRITE_LOCK(bhp)
#define VN_BHV_NOT_READ_LOCKED(bhp) BHV_NOT_READ_LOCKED(bhp)
#define VN_BHV_NOT_WRITE_LOCKED(bhp) BHV_NOT_WRITE_LOCKED(bhp)
#define vn_bhv_head_init(bhp,name) bhv_head_init(bhp,name)
#define vn_bhv_head_reinit(bhp) bhv_head_reinit(bhp)
#define vn_bhv_insert_initial(bhp,bdp) bhv_insert_initial(bhp,bdp)
#define vn_bhv_remove(bhp,bdp) bhv_remove(bhp,bdp)
#define vn_bhv_lookup(bhp,ops) bhv_lookup(bhp,ops)
#define vn_bhv_lookup_unlocked(bhp,ops) bhv_lookup_unlocked(bhp,ops)
#define v_fbhv v_bh.bh_first /* first behavior */
#define v_fops v_bh.bh_first->bd_ops /* ops for first behavior */
struct uio;
struct file;
struct vattr;
struct page_buf_bmap_s;
struct attrlist_cursor_kern;
typedef int (*vop_open_t)(bhv_desc_t *, struct cred *); typedef int (*vop_open_t)(bhv_desc_t *, struct cred *);
typedef ssize_t (*vop_read_t)(bhv_desc_t *, struct file *, typedef ssize_t (*vop_read_t)(bhv_desc_t *, struct file *,
...@@ -183,37 +177,39 @@ typedef ssize_t (*vop_write_t)(bhv_desc_t *, struct file *, ...@@ -183,37 +177,39 @@ typedef ssize_t (*vop_write_t)(bhv_desc_t *, struct file *,
typedef ssize_t (*vop_sendfile_t)(bhv_desc_t *, struct file *, typedef ssize_t (*vop_sendfile_t)(bhv_desc_t *, struct file *,
loff_t *, size_t, read_actor_t, loff_t *, size_t, read_actor_t,
void *, struct cred *); void *, struct cred *);
typedef int (*vop_ioctl_t)(bhv_desc_t *, struct inode *, struct file *, unsigned int, unsigned long); typedef int (*vop_ioctl_t)(bhv_desc_t *, struct inode *, struct file *,
unsigned int, unsigned long);
typedef int (*vop_getattr_t)(bhv_desc_t *, struct vattr *, int, typedef int (*vop_getattr_t)(bhv_desc_t *, struct vattr *, int,
struct cred *); struct cred *);
typedef int (*vop_setattr_t)(bhv_desc_t *, struct vattr *, int, typedef int (*vop_setattr_t)(bhv_desc_t *, struct vattr *, int,
struct cred *); struct cred *);
typedef int (*vop_access_t)(bhv_desc_t *, int, struct cred *); typedef int (*vop_access_t)(bhv_desc_t *, int, struct cred *);
typedef int (*vop_lookup_t)(bhv_desc_t *, struct dentry *, vnode_t **, typedef int (*vop_lookup_t)(bhv_desc_t *, vname_t *, vnode_t **,
int, vnode_t *, struct cred *); int, vnode_t *, struct cred *);
typedef int (*vop_create_t)(bhv_desc_t *, struct dentry *, struct vattr *, typedef int (*vop_create_t)(bhv_desc_t *, vname_t *, struct vattr *,
vnode_t **, struct cred *); vnode_t **, struct cred *);
typedef int (*vop_remove_t)(bhv_desc_t *, struct dentry *, struct cred *); typedef int (*vop_remove_t)(bhv_desc_t *, vname_t *, struct cred *);
typedef int (*vop_link_t)(bhv_desc_t *, vnode_t *, struct dentry *, typedef int (*vop_link_t)(bhv_desc_t *, vnode_t *, vname_t *,
struct cred *);
typedef int (*vop_rename_t)(bhv_desc_t *, vname_t *, vnode_t *, vname_t *,
struct cred *); struct cred *);
typedef int (*vop_rename_t)(bhv_desc_t *, struct dentry *, vnode_t *, typedef int (*vop_mkdir_t)(bhv_desc_t *, vname_t *, struct vattr *,
struct dentry *, struct cred *);
typedef int (*vop_mkdir_t)(bhv_desc_t *, struct dentry *, struct vattr *,
vnode_t **, struct cred *); vnode_t **, struct cred *);
typedef int (*vop_rmdir_t)(bhv_desc_t *, struct dentry *, struct cred *); typedef int (*vop_rmdir_t)(bhv_desc_t *, vname_t *, struct cred *);
typedef int (*vop_readdir_t)(bhv_desc_t *, struct uio *, struct cred *, typedef int (*vop_readdir_t)(bhv_desc_t *, struct uio *, struct cred *,
int *); int *);
typedef int (*vop_symlink_t)(bhv_desc_t *, struct dentry *, typedef int (*vop_symlink_t)(bhv_desc_t *, vname_t *, struct vattr *,
struct vattr *, char *, char *, vnode_t **, struct cred *);
vnode_t **, struct cred *);
typedef int (*vop_readlink_t)(bhv_desc_t *, struct uio *, struct cred *); typedef int (*vop_readlink_t)(bhv_desc_t *, struct uio *, struct cred *);
typedef int (*vop_fsync_t)(bhv_desc_t *, int, struct cred *, xfs_off_t, xfs_off_t); typedef int (*vop_fsync_t)(bhv_desc_t *, int, struct cred *,
xfs_off_t, xfs_off_t);
typedef int (*vop_inactive_t)(bhv_desc_t *, struct cred *); typedef int (*vop_inactive_t)(bhv_desc_t *, struct cred *);
typedef int (*vop_fid2_t)(bhv_desc_t *, struct fid *); typedef int (*vop_fid2_t)(bhv_desc_t *, struct fid *);
typedef int (*vop_release_t)(bhv_desc_t *); typedef int (*vop_release_t)(bhv_desc_t *);
typedef int (*vop_rwlock_t)(bhv_desc_t *, vrwlock_t); typedef int (*vop_rwlock_t)(bhv_desc_t *, vrwlock_t);
typedef void (*vop_rwunlock_t)(bhv_desc_t *, vrwlock_t); typedef void (*vop_rwunlock_t)(bhv_desc_t *, vrwlock_t);
typedef int (*vop_bmap_t)(bhv_desc_t *, xfs_off_t, ssize_t, int, struct page_buf_bmap_s *, int *); typedef int (*vop_bmap_t)(bhv_desc_t *, xfs_off_t, ssize_t, int,
struct page_buf_bmap_s *, int *);
typedef int (*vop_reclaim_t)(bhv_desc_t *); typedef int (*vop_reclaim_t)(bhv_desc_t *);
typedef int (*vop_attr_get_t)(bhv_desc_t *, char *, char *, int *, int, typedef int (*vop_attr_get_t)(bhv_desc_t *, char *, char *, int *, int,
struct cred *); struct cred *);
...@@ -226,7 +222,8 @@ typedef void (*vop_link_removed_t)(bhv_desc_t *, vnode_t *, int); ...@@ -226,7 +222,8 @@ typedef void (*vop_link_removed_t)(bhv_desc_t *, vnode_t *, int);
typedef void (*vop_vnode_change_t)(bhv_desc_t *, vchange_t, __psint_t); typedef void (*vop_vnode_change_t)(bhv_desc_t *, vchange_t, __psint_t);
typedef void (*vop_ptossvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int); typedef void (*vop_ptossvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int);
typedef void (*vop_pflushinvalvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int); typedef void (*vop_pflushinvalvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, int);
typedef int (*vop_pflushvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t, uint64_t, int); typedef int (*vop_pflushvp_t)(bhv_desc_t *, xfs_off_t, xfs_off_t,
uint64_t, int);
typedef int (*vop_iflush_t)(bhv_desc_t *, int); typedef int (*vop_iflush_t)(bhv_desc_t *, int);
...@@ -676,9 +673,17 @@ extern void vn_rele(struct vnode *); ...@@ -676,9 +673,17 @@ extern void vn_rele(struct vnode *);
#endif /* ! (defined(CONFIG_XFS_VNODE_TRACING) */ #endif /* ! (defined(CONFIG_XFS_VNODE_TRACING) */
/*
* Vname handling macros.
*/
#define VNAME(dentry) ((char *) (dentry)->d_name.name)
#define VNAMELEN(dentry) ((dentry)->d_name.len)
/* /*
* Vnode spinlock manipulation. * Vnode spinlock manipulation.
*/ */
#define VN_LOCK(vp) spin_lock(&(vp)->v_lock)
#define VN_UNLOCK(vp) spin_unlock(&(vp)->v_lock)
#define VN_FLAGSET(vp,b) vn_flagset(vp,b) #define VN_FLAGSET(vp,b) vn_flagset(vp,b)
#define VN_FLAGCLR(vp,b) vn_flagclr(vp,b) #define VN_FLAGCLR(vp,b) vn_flagclr(vp,b)
......
...@@ -78,8 +78,8 @@ STATIC int ...@@ -78,8 +78,8 @@ STATIC int
xfs_lock_for_rename( xfs_lock_for_rename(
xfs_inode_t *dp1, /* old (source) directory inode */ xfs_inode_t *dp1, /* old (source) directory inode */
xfs_inode_t *dp2, /* new (target) directory inode */ xfs_inode_t *dp2, /* new (target) directory inode */
struct dentry *dentry1, /* old entry name */ vname_t *dentry1, /* old entry name */
struct dentry *dentry2, /* new entry name */ vname_t *dentry2, /* new entry name */
xfs_inode_t **ipp1, /* inode of old entry */ xfs_inode_t **ipp1, /* inode of old entry */
xfs_inode_t **ipp2, /* inode of new entry, if it xfs_inode_t **ipp2, /* inode of new entry, if it
already exists, NULL otherwise. */ already exists, NULL otherwise. */
...@@ -224,9 +224,9 @@ int xfs_renames; ...@@ -224,9 +224,9 @@ int xfs_renames;
int int
xfs_rename( xfs_rename(
bhv_desc_t *src_dir_bdp, bhv_desc_t *src_dir_bdp,
struct dentry *src_dentry, vname_t *src_dentry,
vnode_t *target_dir_vp, vnode_t *target_dir_vp,
struct dentry *target_dentry, vname_t *target_dentry,
cred_t *credp) cred_t *credp)
{ {
xfs_trans_t *tp; xfs_trans_t *tp;
...@@ -246,8 +246,8 @@ xfs_rename( ...@@ -246,8 +246,8 @@ xfs_rename(
int spaceres; int spaceres;
int target_link_zero = 0; int target_link_zero = 0;
int num_inodes; int num_inodes;
char *src_name = (char *)src_dentry->d_name.name; char *src_name = VNAME(src_dentry);
char *target_name = (char *)target_dentry->d_name.name; char *target_name = VNAME(target_dentry);
int src_namelen; int src_namelen;
int target_namelen; int target_namelen;
#ifdef DEBUG #ifdef DEBUG
...@@ -268,10 +268,10 @@ xfs_rename( ...@@ -268,10 +268,10 @@ xfs_rename(
if (target_dir_bdp == NULL) { if (target_dir_bdp == NULL) {
return XFS_ERROR(EXDEV); return XFS_ERROR(EXDEV);
} }
src_namelen = src_dentry->d_name.len; src_namelen = VNAMELEN(src_dentry);
if (src_namelen >= MAXNAMELEN) if (src_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG); return XFS_ERROR(ENAMETOOLONG);
target_namelen = target_dentry->d_name.len; target_namelen = VNAMELEN(target_dentry);
if (target_namelen >= MAXNAMELEN) if (target_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG); return XFS_ERROR(ENAMETOOLONG);
src_dp = XFS_BHVTOI(src_dir_bdp); src_dp = XFS_BHVTOI(src_dir_bdp);
......
...@@ -45,7 +45,7 @@ struct xfsstats xfsstats; ...@@ -45,7 +45,7 @@ struct xfsstats xfsstats;
*/ */
int int
xfs_get_dir_entry( xfs_get_dir_entry(
struct dentry *dentry, vname_t *dentry,
xfs_inode_t **ipp) xfs_inode_t **ipp)
{ {
vnode_t *vp; vnode_t *vp;
...@@ -68,7 +68,7 @@ int ...@@ -68,7 +68,7 @@ int
xfs_dir_lookup_int( xfs_dir_lookup_int(
bhv_desc_t *dir_bdp, bhv_desc_t *dir_bdp,
uint lock_mode, uint lock_mode,
struct dentry *dentry, vname_t *dentry,
xfs_ino_t *inum, xfs_ino_t *inum,
xfs_inode_t **ipp) xfs_inode_t **ipp)
{ {
...@@ -77,13 +77,12 @@ xfs_dir_lookup_int( ...@@ -77,13 +77,12 @@ xfs_dir_lookup_int(
int error; int error;
dir_vp = BHV_TO_VNODE(dir_bdp); dir_vp = BHV_TO_VNODE(dir_bdp);
vn_trace_entry(dir_vp, "xfs_dir_lookup_int", vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address);
(inst_t *)__return_address);
dp = XFS_BHVTOI(dir_bdp); dp = XFS_BHVTOI(dir_bdp);
error = XFS_DIR_LOOKUP(dp->i_mount, NULL, dp, error = XFS_DIR_LOOKUP(dp->i_mount, NULL, dp,
(char *)dentry->d_name.name, dentry->d_name.len, inum); VNAME(dentry), VNAMELEN(dentry), inum);
if (!error) { if (!error) {
/* /*
* Unlock the directory. We do this because we can't * Unlock the directory. We do this because we can't
......
...@@ -37,66 +37,16 @@ ...@@ -37,66 +37,16 @@
#define ITRACE(ip) vn_trace_ref(XFS_ITOV(ip), __FILE__, __LINE__, \ #define ITRACE(ip) vn_trace_ref(XFS_ITOV(ip), __FILE__, __LINE__, \
(inst_t *)__return_address) (inst_t *)__return_address)
struct bhv_desc; extern int xfs_rename (bhv_desc_t *, vname_t *, vnode_t *, vname_t *, cred_t *);
struct cred; extern int xfs_get_dir_entry (vname_t *, xfs_inode_t **);
struct vnode; extern int xfs_dir_lookup_int (bhv_desc_t *, uint, vname_t *, xfs_ino_t *,
struct xfs_inode; xfs_inode_t **);
struct xfs_mount; extern int xfs_truncate_file (xfs_mount_t *, xfs_inode_t *);
struct xfs_trans; extern int xfs_dir_ialloc (xfs_trans_t **, xfs_inode_t *, mode_t, nlink_t,
xfs_dev_t, cred_t *, prid_t, int,
extern int xfs_inode_t **, int *);
xfs_rename( extern int xfs_droplink (xfs_trans_t *, xfs_inode_t *);
struct bhv_desc *src_dir_bdp, extern int xfs_bumplink (xfs_trans_t *, xfs_inode_t *);
struct dentry *src_dentry, extern void xfs_bump_ino_vers2 (xfs_trans_t *, xfs_inode_t *);
struct vnode *target_dir_vp,
struct dentry *target_dentry, #endif /* __XFS_UTILS_H__ */
struct cred *credp);
extern int
xfs_get_dir_entry(
struct dentry *dentry,
xfs_inode_t **ipp);
extern int
xfs_dir_lookup_int(
struct bhv_desc *dir_bdp,
uint lock_mode,
struct dentry *dentry,
xfs_ino_t *inum,
struct xfs_inode **ipp);
extern int
xfs_truncate_file(
struct xfs_mount *mp,
struct xfs_inode *ip);
extern int
xfs_dir_ialloc(
struct xfs_trans **tpp,
struct xfs_inode *dp,
mode_t mode,
nlink_t nlink,
xfs_dev_t rdev,
struct cred *credp,
prid_t prid,
int okalloc,
struct xfs_inode **ipp,
int *committed);
extern int
xfs_droplink(
struct xfs_trans *tp,
struct xfs_inode *ip);
extern int
xfs_bumplink(
struct xfs_trans *tp,
struct xfs_inode *ip);
extern void
xfs_bump_ino_vers2(
struct xfs_trans *tp,
struct xfs_inode *ip);
#endif /* XFS_UTILS_H */
This diff is collapsed.
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