From 993386c19afa53fa54d00c7721e56ba820b3400d Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 28 Aug 2007 16:12:30 +1000 Subject: [XFS] decontaminate vnode operations from behavior details All vnode ops now take struct xfs_inode pointers and the behaviour related glue is split out into methods of it's own. This required fixing xfs_create/mkdir/symlink to not mess with the inode pointer but rather use a separate boolean for error handling. Thanks to Dave Chinner for that fix. SGI-PV: 969608 SGI-Modid: xfs-linux-melb:xfs-kern:29492a Signed-off-by: Christoph Hellwig Signed-off-by: David Chinner Signed-off-by: Tim Shimmin --- fs/xfs/xfs_rename.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'fs/xfs/xfs_rename.c') diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c index 187318e8d259..b62b8771afcf 100644 --- a/fs/xfs/xfs_rename.c +++ b/fs/xfs/xfs_rename.c @@ -129,8 +129,7 @@ xfs_lock_for_rename( lock_mode = xfs_ilock_map_shared(dp2); } - error = xfs_dir_lookup_int(XFS_ITOBHV(dp2), lock_mode, - vname2, &inum2, &ip2); + error = xfs_dir_lookup_int(dp2, lock_mode, vname2, &inum2, &ip2); if (error == ENOENT) { /* target does not need to exist. */ inum2 = 0; } else if (error) { @@ -222,15 +221,15 @@ xfs_lock_for_rename( */ int xfs_rename( - bhv_desc_t *src_dir_bdp, + xfs_inode_t *src_dp, bhv_vname_t *src_vname, bhv_vnode_t *target_dir_vp, - bhv_vname_t *target_vname, - cred_t *credp) + bhv_vname_t *target_vname) { + bhv_vnode_t *src_dir_vp = XFS_ITOV(src_dp); xfs_trans_t *tp; - xfs_inode_t *src_dp, *target_dp, *src_ip, *target_ip; - xfs_mount_t *mp; + xfs_inode_t *target_dp, *src_ip, *target_ip; + xfs_mount_t *mp = src_dp->i_mount; int new_parent; /* moving to a new dir */ int src_is_directory; /* src_name is a directory */ int error; @@ -240,7 +239,6 @@ xfs_rename( int committed; xfs_inode_t *inodes[4]; int target_ip_dropped = 0; /* dropped target_ip link? */ - bhv_vnode_t *src_dir_vp; int spaceres; int target_link_zero = 0; int num_inodes; @@ -249,7 +247,6 @@ xfs_rename( int src_namelen = VNAMELEN(src_vname); int target_namelen = VNAMELEN(target_vname); - src_dir_vp = BHV_TO_VNODE(src_dir_bdp); vn_trace_entry(src_dir_vp, "xfs_rename", (inst_t *)__return_address); vn_trace_entry(target_dir_vp, "xfs_rename", (inst_t *)__return_address); @@ -262,9 +259,6 @@ xfs_rename( return XFS_ERROR(EXDEV); } - src_dp = XFS_BHVTOI(src_dir_bdp); - mp = src_dp->i_mount; - if (DM_EVENT_ENABLED(src_dp, DM_EVENT_RENAME) || DM_EVENT_ENABLED(target_dp, DM_EVENT_RENAME)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_RENAME, -- cgit v1.2.3-59-g8ed1b