aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rename.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-03-05 21:46:19 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-17 21:40:45 -0400
commit3937be5ba836a204d3d1df96b518eecd6cdacbb9 (patch)
tree89c21be058d0b1b43718f49025600346524cd68e /fs/xfs/xfs_rename.c
parenta3da789640871c897901c5f766e33be78d56f35a (diff)
[XFS] cleanup vnode use in xfs_symlink and xfs_rename
SGI-PV: 976035 SGI-Modid: xfs-linux-melb:xfs-kern:30548a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_rename.c')
-rw-r--r--fs/xfs/xfs_rename.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index 6f80cfdfbd88..c4d0bac56a5a 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -219,12 +219,11 @@ int
219xfs_rename( 219xfs_rename(
220 xfs_inode_t *src_dp, 220 xfs_inode_t *src_dp,
221 bhv_vname_t *src_vname, 221 bhv_vname_t *src_vname,
222 bhv_vnode_t *target_dir_vp, 222 xfs_inode_t *target_dp,
223 bhv_vname_t *target_vname) 223 bhv_vname_t *target_vname)
224{ 224{
225 bhv_vnode_t *src_dir_vp = XFS_ITOV(src_dp);
226 xfs_trans_t *tp; 225 xfs_trans_t *tp;
227 xfs_inode_t *target_dp, *src_ip, *target_ip; 226 xfs_inode_t *src_ip, *target_ip;
228 xfs_mount_t *mp = src_dp->i_mount; 227 xfs_mount_t *mp = src_dp->i_mount;
229 int new_parent; /* moving to a new dir */ 228 int new_parent; /* moving to a new dir */
230 int src_is_directory; /* src_name is a directory */ 229 int src_is_directory; /* src_name is a directory */
@@ -244,16 +243,7 @@ xfs_rename(
244 int target_namelen = VNAMELEN(target_vname); 243 int target_namelen = VNAMELEN(target_vname);
245 244
246 xfs_itrace_entry(src_dp); 245 xfs_itrace_entry(src_dp);
247 xfs_itrace_entry(xfs_vtoi(target_dir_vp)); 246 xfs_itrace_entry(target_dp);
248
249 /*
250 * Find the XFS behavior descriptor for the target directory
251 * vnode since it was not handed to us.
252 */
253 target_dp = xfs_vtoi(target_dir_vp);
254 if (target_dp == NULL) {
255 return XFS_ERROR(EXDEV);
256 }
257 247
258 if (DM_EVENT_ENABLED(src_dp, DM_EVENT_RENAME) || 248 if (DM_EVENT_ENABLED(src_dp, DM_EVENT_RENAME) ||
259 DM_EVENT_ENABLED(target_dp, DM_EVENT_RENAME)) { 249 DM_EVENT_ENABLED(target_dp, DM_EVENT_RENAME)) {
@@ -360,10 +350,10 @@ xfs_rename(
360 * them when they unlock the inodes. Also, we need to be careful 350 * them when they unlock the inodes. Also, we need to be careful
361 * not to add an inode to the transaction more than once. 351 * not to add an inode to the transaction more than once.
362 */ 352 */
363 VN_HOLD(src_dir_vp); 353 IHOLD(src_dp);
364 xfs_trans_ijoin(tp, src_dp, XFS_ILOCK_EXCL); 354 xfs_trans_ijoin(tp, src_dp, XFS_ILOCK_EXCL);
365 if (new_parent) { 355 if (new_parent) {
366 VN_HOLD(target_dir_vp); 356 IHOLD(target_dp);
367 xfs_trans_ijoin(tp, target_dp, XFS_ILOCK_EXCL); 357 xfs_trans_ijoin(tp, target_dp, XFS_ILOCK_EXCL);
368 } 358 }
369 if ((src_ip != src_dp) && (src_ip != target_dp)) { 359 if ((src_ip != src_dp) && (src_ip != target_dp)) {