diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-04-30 19:05:17 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-05-22 14:27:38 -0400 |
commit | a596a23b9a08ce79553e55e0726502ca8bce852b (patch) | |
tree | 9622be77bce16447d93fb4410adf1be9a819be61 | |
parent | 837f3ec6921e7b8b7a9a29d0b4134c04217636c5 (diff) | |
download | linux-stable-a596a23b9a08ce79553e55e0726502ca8bce852b.tar.gz linux-stable-a596a23b9a08ce79553e55e0726502ca8bce852b.tar.bz2 linux-stable-a596a23b9a08ce79553e55e0726502ca8bce852b.zip |
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>
-rw-r--r-- | fs/bfs/dir.c | 7 |
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, |