xfs_vn_lookup: simplify a bit
have all post-xfs_lookup() branches converge on d_splice_alias() Cc: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
9a7dddcaff
commit
b113a6d3cf
|
@ -260,6 +260,7 @@ xfs_vn_lookup(
|
||||||
struct dentry *dentry,
|
struct dentry *dentry,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
struct inode *inode;
|
||||||
struct xfs_inode *cip;
|
struct xfs_inode *cip;
|
||||||
struct xfs_name name;
|
struct xfs_name name;
|
||||||
int error;
|
int error;
|
||||||
|
@ -269,14 +270,13 @@ xfs_vn_lookup(
|
||||||
|
|
||||||
xfs_dentry_to_name(&name, dentry);
|
xfs_dentry_to_name(&name, dentry);
|
||||||
error = xfs_lookup(XFS_I(dir), &name, &cip, NULL);
|
error = xfs_lookup(XFS_I(dir), &name, &cip, NULL);
|
||||||
if (unlikely(error)) {
|
if (likely(!error))
|
||||||
if (unlikely(error != -ENOENT))
|
inode = VFS_I(cip);
|
||||||
return ERR_PTR(error);
|
else if (likely(error == -ENOENT))
|
||||||
d_add(dentry, NULL);
|
inode = NULL;
|
||||||
return NULL;
|
else
|
||||||
}
|
inode = ERR_PTR(error);
|
||||||
|
return d_splice_alias(inode, dentry);
|
||||||
return d_splice_alias(VFS_I(cip), dentry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC struct dentry *
|
STATIC struct dentry *
|
||||||
|
|
Loading…
Reference in New Issue