提交 ef1f5e7a 编写于 作者: C Christoph Hellwig 提交者: Lachlan McIlroy

[XFS] cleanup vnode use in xfs_lookup

SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30550a
Signed-off-by: NChristoph Hellwig <hch@infradead.org>
Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
上级 3937be5b
...@@ -213,17 +213,16 @@ xfs_fs_get_parent( ...@@ -213,17 +213,16 @@ xfs_fs_get_parent(
struct dentry *child) struct dentry *child)
{ {
int error; int error;
bhv_vnode_t *cvp; struct xfs_inode *cip;
struct dentry *parent; struct dentry *parent;
cvp = NULL; error = xfs_lookup(XFS_I(child->d_inode), &dotdot, &cip);
error = xfs_lookup(XFS_I(child->d_inode), &dotdot, &cvp);
if (unlikely(error)) if (unlikely(error))
return ERR_PTR(-error); return ERR_PTR(-error);
parent = d_alloc_anon(vn_to_inode(cvp)); parent = d_alloc_anon(cip->i_vnode);
if (unlikely(!parent)) { if (unlikely(!parent)) {
VN_RELE(cvp); iput(cip->i_vnode);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
return parent; return parent;
......
...@@ -372,13 +372,13 @@ xfs_vn_lookup( ...@@ -372,13 +372,13 @@ xfs_vn_lookup(
struct dentry *dentry, struct dentry *dentry,
struct nameidata *nd) struct nameidata *nd)
{ {
bhv_vnode_t *cvp; struct xfs_inode *cip;
int error; int error;
if (dentry->d_name.len >= MAXNAMELEN) if (dentry->d_name.len >= MAXNAMELEN)
return ERR_PTR(-ENAMETOOLONG); return ERR_PTR(-ENAMETOOLONG);
error = xfs_lookup(XFS_I(dir), dentry, &cvp); error = xfs_lookup(XFS_I(dir), dentry, &cip);
if (unlikely(error)) { if (unlikely(error)) {
if (unlikely(error != ENOENT)) if (unlikely(error != ENOENT))
return ERR_PTR(-error); return ERR_PTR(-error);
...@@ -386,7 +386,7 @@ xfs_vn_lookup( ...@@ -386,7 +386,7 @@ xfs_vn_lookup(
return NULL; return NULL;
} }
return d_splice_alias(vn_to_inode(cvp), dentry); return d_splice_alias(cip->i_vnode, dentry);
} }
STATIC int STATIC int
......
...@@ -1763,7 +1763,7 @@ int ...@@ -1763,7 +1763,7 @@ int
xfs_lookup( xfs_lookup(
xfs_inode_t *dp, xfs_inode_t *dp,
bhv_vname_t *dentry, bhv_vname_t *dentry,
bhv_vnode_t **vpp) xfs_inode_t **ipp)
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
xfs_ino_t e_inum; xfs_ino_t e_inum;
...@@ -1778,7 +1778,7 @@ xfs_lookup( ...@@ -1778,7 +1778,7 @@ xfs_lookup(
lock_mode = xfs_ilock_map_shared(dp); lock_mode = xfs_ilock_map_shared(dp);
error = xfs_dir_lookup_int(dp, lock_mode, dentry, &e_inum, &ip); error = xfs_dir_lookup_int(dp, lock_mode, dentry, &e_inum, &ip);
if (!error) { if (!error) {
*vpp = XFS_ITOV(ip); *ipp = ip;
xfs_itrace_ref(ip); xfs_itrace_ref(ip);
} }
xfs_iunlock_map_shared(dp, lock_mode); xfs_iunlock_map_shared(dp, lock_mode);
......
...@@ -24,7 +24,7 @@ int xfs_fsync(struct xfs_inode *ip, int flag, xfs_off_t start, ...@@ -24,7 +24,7 @@ int xfs_fsync(struct xfs_inode *ip, int flag, xfs_off_t start,
int xfs_release(struct xfs_inode *ip); int xfs_release(struct xfs_inode *ip);
int xfs_inactive(struct xfs_inode *ip); int xfs_inactive(struct xfs_inode *ip);
int xfs_lookup(struct xfs_inode *dp, bhv_vname_t *dentry, int xfs_lookup(struct xfs_inode *dp, bhv_vname_t *dentry,
bhv_vnode_t **vpp); struct xfs_inode **ipp);
int xfs_create(struct xfs_inode *dp, bhv_vname_t *dentry, mode_t mode, int xfs_create(struct xfs_inode *dp, bhv_vname_t *dentry, mode_t mode,
xfs_dev_t rdev, struct xfs_inode **ipp, struct cred *credp); xfs_dev_t rdev, struct xfs_inode **ipp, struct cred *credp);
int xfs_remove(struct xfs_inode *dp, bhv_vname_t *dentry); int xfs_remove(struct xfs_inode *dp, bhv_vname_t *dentry);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册