aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-04-30 23:04:19 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-05-22 14:27:57 -0400
commitb113a6d3cf939e9f26c89ba0ad6d8a1503bac1b2 (patch)
tree5c7e9e09efb8026787da6c0f3c037a76964f9f26
parent9a7dddcaffff3890b9991d014c9a2b5392806526 (diff)
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>
-rw-r--r--fs/xfs/xfs_iops.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index a3ed3c811dfa..df42e4cb4dc4 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -260,6 +260,7 @@ xfs_vn_lookup(
260 struct dentry *dentry, 260 struct dentry *dentry,
261 unsigned int flags) 261 unsigned int flags)
262{ 262{
263 struct inode *inode;
263 struct xfs_inode *cip; 264 struct xfs_inode *cip;
264 struct xfs_name name; 265 struct xfs_name name;
265 int error; 266 int error;
@@ -269,14 +270,13 @@ xfs_vn_lookup(
269 270
270 xfs_dentry_to_name(&name, dentry); 271 xfs_dentry_to_name(&name, dentry);
271 error = xfs_lookup(XFS_I(dir), &name, &cip, NULL); 272 error = xfs_lookup(XFS_I(dir), &name, &cip, NULL);
272 if (unlikely(error)) { 273 if (likely(!error))
273 if (unlikely(error != -ENOENT)) 274 inode = VFS_I(cip);
274 return ERR_PTR(error); 275 else if (likely(error == -ENOENT))
275 d_add(dentry, NULL); 276 inode = NULL;
276 return NULL; 277 else
277 } 278 inode = ERR_PTR(error);
278 279 return d_splice_alias(inode, dentry);
279 return d_splice_alias(VFS_I(cip), dentry);
280} 280}
281 281
282STATIC struct dentry * 282STATIC struct dentry *