aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rename.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-28 02:12:30 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 02:54:29 -0400
commit993386c19afa53fa54d00c7721e56ba820b3400d (patch)
tree1715fdeb9cc5ea99466e179b54e84b168fd5e127 /fs/xfs/xfs_rename.c
parentb93bd20cd59eb7ec172f95d08b100fea688d8bcf (diff)
[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 <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_rename.c')
-rw-r--r--fs/xfs/xfs_rename.c18
1 files changed, 6 insertions, 12 deletions
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(
129 lock_mode = xfs_ilock_map_shared(dp2); 129 lock_mode = xfs_ilock_map_shared(dp2);
130 } 130 }
131 131
132 error = xfs_dir_lookup_int(XFS_ITOBHV(dp2), lock_mode, 132 error = xfs_dir_lookup_int(dp2, lock_mode, vname2, &inum2, &ip2);
133 vname2, &inum2, &ip2);
134 if (error == ENOENT) { /* target does not need to exist. */ 133 if (error == ENOENT) { /* target does not need to exist. */
135 inum2 = 0; 134 inum2 = 0;
136 } else if (error) { 135 } else if (error) {
@@ -222,15 +221,15 @@ xfs_lock_for_rename(
222 */ 221 */
223int 222int
224xfs_rename( 223xfs_rename(
225 bhv_desc_t *src_dir_bdp, 224 xfs_inode_t *src_dp,
226 bhv_vname_t *src_vname, 225 bhv_vname_t *src_vname,
227 bhv_vnode_t *target_dir_vp, 226 bhv_vnode_t *target_dir_vp,
228 bhv_vname_t *target_vname, 227 bhv_vname_t *target_vname)
229 cred_t *credp)
230{ 228{
229 bhv_vnode_t *src_dir_vp = XFS_ITOV(src_dp);
231 xfs_trans_t *tp; 230 xfs_trans_t *tp;
232 xfs_inode_t *src_dp, *target_dp, *src_ip, *target_ip; 231 xfs_inode_t *target_dp, *src_ip, *target_ip;
233 xfs_mount_t *mp; 232 xfs_mount_t *mp = src_dp->i_mount;
234 int new_parent; /* moving to a new dir */ 233 int new_parent; /* moving to a new dir */
235 int src_is_directory; /* src_name is a directory */ 234 int src_is_directory; /* src_name is a directory */
236 int error; 235 int error;
@@ -240,7 +239,6 @@ xfs_rename(
240 int committed; 239 int committed;
241 xfs_inode_t *inodes[4]; 240 xfs_inode_t *inodes[4];
242 int target_ip_dropped = 0; /* dropped target_ip link? */ 241 int target_ip_dropped = 0; /* dropped target_ip link? */
243 bhv_vnode_t *src_dir_vp;
244 int spaceres; 242 int spaceres;
245 int target_link_zero = 0; 243 int target_link_zero = 0;
246 int num_inodes; 244 int num_inodes;
@@ -249,7 +247,6 @@ xfs_rename(
249 int src_namelen = VNAMELEN(src_vname); 247 int src_namelen = VNAMELEN(src_vname);
250 int target_namelen = VNAMELEN(target_vname); 248 int target_namelen = VNAMELEN(target_vname);
251 249
252 src_dir_vp = BHV_TO_VNODE(src_dir_bdp);
253 vn_trace_entry(src_dir_vp, "xfs_rename", (inst_t *)__return_address); 250 vn_trace_entry(src_dir_vp, "xfs_rename", (inst_t *)__return_address);
254 vn_trace_entry(target_dir_vp, "xfs_rename", (inst_t *)__return_address); 251 vn_trace_entry(target_dir_vp, "xfs_rename", (inst_t *)__return_address);
255 252
@@ -262,9 +259,6 @@ xfs_rename(
262 return XFS_ERROR(EXDEV); 259 return XFS_ERROR(EXDEV);
263 } 260 }
264 261
265 src_dp = XFS_BHVTOI(src_dir_bdp);
266 mp = src_dp->i_mount;
267
268 if (DM_EVENT_ENABLED(src_dp, DM_EVENT_RENAME) || 262 if (DM_EVENT_ENABLED(src_dp, DM_EVENT_RENAME) ||
269 DM_EVENT_ENABLED(target_dp, DM_EVENT_RENAME)) { 263 DM_EVENT_ENABLED(target_dp, DM_EVENT_RENAME)) {
270 error = XFS_SEND_NAMESP(mp, DM_EVENT_RENAME, 264 error = XFS_SEND_NAMESP(mp, DM_EVENT_RENAME,