diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-10-10 22:38:27 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-10-10 22:38:27 +0200 |
commit | 3837d208d8fe7437475c4a1c53fa5e517b16ceb0 (patch) | |
tree | 906f65e93009e0c901858dbd26ccf331d761ab4c /fs/btrfs | |
parent | clean erofs_lookup() (diff) | |
download | linux-3837d208d8fe7437475c4a1c53fa5e517b16ceb0.tar.xz linux-3837d208d8fe7437475c4a1c53fa5e517b16ceb0.zip |
simplify btrfs_lookup()
d_splice_alias() is fine with ERR_PTR(-E...) for inode
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 9357a19d2bff..fb688c4aa34f 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5807,16 +5807,10 @@ static int btrfs_dentry_delete(const struct dentry *dentry) static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) { - struct inode *inode; - - inode = btrfs_lookup_dentry(dir, dentry); - if (IS_ERR(inode)) { - if (PTR_ERR(inode) == -ENOENT) - inode = NULL; - else - return ERR_CAST(inode); - } + struct inode *inode = btrfs_lookup_dentry(dir, dentry); + if (inode == ERR_PTR(-ENOENT)) + inode = NULL; return d_splice_alias(inode, dentry); } |