aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rename.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-03-05 21:44:50 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-17 21:39:14 -0400
commit43973964a386348af0a392266f008ba24170aa30 (patch)
tree17d21f1c23b4bdcd04b1057eaa8509ccad095d1d /fs/xfs/xfs_rename.c
parenta8b3acd57e3aaaf73a863a28e0e9f6cca37cd8e3 (diff)
[XFS] kill xfs_get_dir_entry
Instead of of xfs_get_dir_entry use a macro to get the xfs_inode from the dentry in the callers and grab the reference manually. Only grab the reference once as it's fine to keep it over the dmapi calls. (And even that reference is actually superflous in Linux but I'll leave that for another patch) SGI-PV: 976035 SGI-Modid: xfs-linux-melb:xfs-kern:30531a 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.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.