aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rename.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_rename.c')
-rw-r--r--fs/xfs/xfs_rename.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index 1c6d40ed6816..fd1244cf50a7 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -93,7 +93,8 @@ xfs_lock_for_rename(
93 xfs_inode_t **i_tab,/* array of inode returned, sorted */ 93 xfs_inode_t **i_tab,/* array of inode returned, sorted */
94 int *num_inodes) /* number of inodes in array */ 94 int *num_inodes) /* number of inodes in array */
95{ 95{
96 xfs_inode_t *ip1, *ip2, *temp; 96 xfs_inode_t *ip1 = VNAME_TO_INODE(vname1);
97 xfs_inode_t *ip2, *temp;
97 xfs_ino_t inum1, inum2; 98 xfs_ino_t inum1, inum2;
98 int error; 99 int error;
99 int i, j; 100 int i, j;
@@ -109,16 +110,11 @@ xfs_lock_for_rename(
109 * to see if we still have the right inodes, directories, etc. 110 * to see if we still have the right inodes, directories, etc.
110 */ 111 */
111 lock_mode = xfs_ilock_map_shared(dp1); 112 lock_mode = xfs_ilock_map_shared(dp1);
112 error = xfs_get_dir_entry(vname1, &ip1); 113 IHOLD(ip1);
113 if (error) { 114 xfs_itrace_ref(ip1);
114 xfs_iunlock_map_shared(dp1, lock_mode);
115 return error;
116 }
117 115
118 inum1 = ip1->i_ino; 116 inum1 = ip1->i_ino;
119 117
120 ASSERT(ip1);
121 xfs_itrace_ref(ip1);
122 118
123 /* 119 /*
124 * Unlock dp1 and lock dp2 if they are different. 120 * Unlock dp1 and lock dp2 if they are different.