From: Al Viro Date: Mon, 30 Apr 2018 23:05:17 +0000 (-0400) Subject: bfs_lookup(): use d_splice_alias() X-Git-Tag: v4.19~853^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a596a23b9a08ce79553e55e0726502ca8bce852b;p=platform%2Fkernel%2Flinux-rpi.git bfs_lookup(): use d_splice_alias() code is actually simpler that way. Acked-by: "Tigran A. Aivazian" Signed-off-by: Al Viro --- diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index ee832ca..facf9614 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,