aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-03-05 21:46:25 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-17 21:40:55 -0400
commitef1f5e7ad38e5414d016983a8cc5a8db7654a61d (patch)
tree6257477d68089b51a5dc352ef573344c42af0115
parent3937be5ba836a204d3d1df96b518eecd6cdacbb9 (diff)
[XFS] cleanup vnode use in xfs_lookup
SGI-PV: 976035 SGI-Modid: xfs-linux-melb:xfs-kern:30550a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
-rw-r--r--fs/xfs/linux-2.6/xfs_export.c9
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c6
-rw-r--r--fs/xfs/xfs_vnodeops.c4
-rw-r--r--fs/xfs/xfs_vnodeops.h2
4 files changed, 10 insertions, 11 deletions
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
index 21f0e8257590..66a9a9e76cbe 100644
--- a/fs/xfs/linux-2.6/xfs_export.c
+++ b/fs/xfs/linux-2.6/xfs_export.c
@@ -213,17 +213,16 @@ xfs_fs_get_parent(
213 struct dentry *child) 213 struct dentry *child)
214{ 214{
215 int error; 215 int error;
216 bhv_vnode_t *cvp; 216 struct xfs_inode *cip;
217 struct dentry *parent; 217 struct dentry *parent;
218 218
219 cvp = NULL; 219 error = xfs_lookup(XFS_I(child->d_inode), &dotdot, &cip);
220 error = xfs_lookup(XFS_I(child->d_inode), &dotdot, &cvp);
221 if (unlikely(error)) 220 if (unlikely(error))
222 return ERR_PTR(-error); 221 return ERR_PTR(-error);
223 222
224 parent = d_alloc_anon(vn_to_inode(cvp)); 223 parent = d_alloc_anon(cip->i_vnode);
225 if (unlikely(!parent)) { 224 if (unlikely(!parent)) {
226 VN_RELE(cvp); 225 iput(cip->i_vnode);
227 return ERR_PTR(-ENOMEM); 226 return ERR_PTR(-ENOMEM);
228 } 227 }
229 return parent; 228 return parent;
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 215158cbac43..01d9b3f1e044 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -372,13 +372,13 @@ xfs_vn_lookup(
372 struct dentry *dentry, 372 struct dentry *dentry,
373 struct nameidata *nd) 373 struct nameidata *nd)
374{ 374{
375 bhv_vnode_t *cvp; 375 struct xfs_inode *cip;
376 int error; 376 int error;
377 377
378 if (dentry->d_name.len >= MAXNAMELEN) 378 if (dentry->d_name.len >= MAXNAMELEN)
379 return ERR_PTR(-ENAMETOOLONG); 379 return ERR_PTR(-ENAMETOOLONG);
380 380
381 error = xfs_lookup(XFS_I(dir), dentry, &cvp); 381 error = xfs_lookup(XFS_I(dir), dentry, &cip);
382 if (unlikely(error)) { 382 if (unlikely(error)) {
383 if (unlikely(error != ENOENT)) 383 if (unlikely(error != ENOENT))
384 return ERR_PTR(-error); 384 return ERR_PTR(-error);
@@ -386,7 +386,7 @@ xfs_vn_lookup(
386 return NULL; 386 return NULL;
387 } 387 }
388 388
389 return d_splice_alias(vn_to_inode(cvp), dentry); 389 return d_splice_alias(cip->i_vnode, dentry);
390} 390}
391 391
392STATIC int 392STATIC int
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index fa694dc5d309..3418c94bcf17 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1763,7 +1763,7 @@ int
1763xfs_lookup( 1763xfs_lookup(
1764 xfs_inode_t *dp, 1764 xfs_inode_t *dp,
1765 bhv_vname_t *dentry, 1765 bhv_vname_t *dentry,
1766 bhv_vnode_t **vpp) 1766 xfs_inode_t **ipp)
1767{ 1767{
1768 xfs_inode_t *ip; 1768 xfs_inode_t *ip;
1769 xfs_ino_t e_inum; 1769 xfs_ino_t e_inum;
@@ -1778,7 +1778,7 @@ xfs_lookup(
1778 lock_mode = xfs_ilock_map_shared(dp); 1778 lock_mode = xfs_ilock_map_shared(dp);
1779 error = xfs_dir_lookup_int(dp, lock_mode, dentry, &e_inum, &ip); 1779 error = xfs_dir_lookup_int(dp, lock_mode, dentry, &e_inum, &ip);
1780 if (!error) { 1780 if (!error) {
1781 *vpp = XFS_ITOV(ip); 1781 *ipp = ip;
1782 xfs_itrace_ref(ip); 1782 xfs_itrace_ref(ip);
1783 } 1783 }
1784 xfs_iunlock_map_shared(dp, lock_mode); 1784 xfs_iunlock_map_shared(dp, lock_mode);
diff --git a/fs/xfs/xfs_vnodeops.h b/fs/xfs/xfs_vnodeops.h
index 71e9b15276f5..12e581865bdf 100644
--- a/fs/xfs/xfs_vnodeops.h
+++ b/fs/xfs/xfs_vnodeops.h
@@ -24,7 +24,7 @@ int xfs_fsync(struct xfs_inode *ip, int flag, xfs_off_t start,
24int xfs_release(struct xfs_inode *ip); 24int xfs_release(struct xfs_inode *ip);
25int xfs_inactive(struct xfs_inode *ip); 25int xfs_inactive(struct xfs_inode *ip);
26int xfs_lookup(struct xfs_inode *dp, bhv_vname_t *dentry, 26int xfs_lookup(struct xfs_inode *dp, bhv_vname_t *dentry,
27 bhv_vnode_t **vpp); 27 struct xfs_inode **ipp);
28int xfs_create(struct xfs_inode *dp, bhv_vname_t *dentry, mode_t mode, 28int xfs_create(struct xfs_inode *dp, bhv_vname_t *dentry, mode_t mode,
29 xfs_dev_t rdev, struct xfs_inode **ipp, struct cred *credp); 29 xfs_dev_t rdev, struct xfs_inode **ipp, struct cred *credp);
30int xfs_remove(struct xfs_inode *dp, bhv_vname_t *dentry); 30int xfs_remove(struct xfs_inode *dp, bhv_vname_t *dentry);