Merge branch 'work.lookup' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[muen/linux.git] / fs / btrfs / inode.c
index f22f77172c5ff5299b37aa8e10be770929c61a44..181c58b231103e5a7381be49cddc10c2faf3fdc5 100644 (file)
@@ -5764,16 +5764,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);
 }