From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:41050 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbeEMVaS (ORCPT ); Sun, 13 May 2018 17:30:18 -0400 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: "Tigran A. Aivazian" Subject: [PATCH 01/15] bfs_lookup(): use d_splice_alias() Date: Sun, 13 May 2018 22:30:03 +0100 Message-Id: <20180513213017.31269-1-viro@ZenIV.linux.org.uk> In-Reply-To: <20180513212612.GV30522@ZenIV.linux.org.uk> References: <20180513212612.GV30522@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Al Viro code is actually simpler that way. Cc: "Tigran A. Aivazian" Signed-off-by: Al Viro --- fs/bfs/dir.c | 7 +------ 1 file changed, 1 insertion(+), 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, -- 2.11.0