Skip to content

Commit 3837d20

Browse files
author
Al Viro
committed
simplify btrfs_lookup()
d_splice_alias() is fine with ERR_PTR(-E...) for inode Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 8300807 commit 3837d20

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

fs/btrfs/inode.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5807,16 +5807,10 @@ static int btrfs_dentry_delete(const struct dentry *dentry)
58075807
static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry,
58085808
unsigned int flags)
58095809
{
5810-
struct inode *inode;
5811-
5812-
inode = btrfs_lookup_dentry(dir, dentry);
5813-
if (IS_ERR(inode)) {
5814-
if (PTR_ERR(inode) == -ENOENT)
5815-
inode = NULL;
5816-
else
5817-
return ERR_CAST(inode);
5818-
}
5810+
struct inode *inode = btrfs_lookup_dentry(dir, dentry);
58195811

5812+
if (inode == ERR_PTR(-ENOENT))
5813+
inode = NULL;
58205814
return d_splice_alias(inode, dentry);
58215815
}
58225816

0 commit comments

Comments
 (0)