summaryrefslogtreecommitdiff
path: root/fs/bfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-04-30 19:05:17 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-05-22 14:27:38 -0400
commita596a23b9a08ce79553e55e0726502ca8bce852b (patch)
tree9622be77bce16447d93fb4410adf1be9a819be61 /fs/bfs
parent837f3ec6921e7b8b7a9a29d0b4134c04217636c5 (diff)
bfs_lookup(): use d_splice_alias()
code is actually simpler that way. Acked-by: "Tigran A. Aivazian" <aivazian.tigran@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/bfs')
-rw-r--r--fs/bfs/dir.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c
index ee832ca5f734..facf9614a381 100644
--- a/fs/bfs/dir.c
+++ b/fs/bfs/dir.c
@@ -141,14 +141,9 @@ static struct dentry *bfs_lookup(struct inode *dir, struct dentry *dentry,
unsigned long ino = (unsigned long)le16_to_cpu(de->ino);
brelse(bh);
inode = bfs_iget(dir->i_sb, ino);
- if (IS_ERR(inode)) {
- mutex_unlock(&info->bfs_lock);
- return ERR_CAST(inode);
- }
}
mutex_unlock(&info->bfs_lock);
- d_add(dentry, inode);
- return NULL;
+ return d_splice_alias(inode, dentry);
}
static int bfs_link(struct dentry *old, struct inode *dir,