linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH] bfs_lookup(): use d_splice_alias()
@ 2018-05-13 21:11 Al Viro
  2018-05-13 21:13 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2018-05-13 21:11 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: aivazian.tigran, Tigran A. Aivazian


code is actually simpler that way.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC][PATCH] bfs_lookup(): use d_splice_alias()
  2018-05-13 21:11 [RFC][PATCH] bfs_lookup(): use d_splice_alias() Al Viro
@ 2018-05-13 21:13 ` Al Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2018-05-13 21:13 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel

Arrrrghh...  Buggered script, sorry for bogus Cc lists...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-13 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-13 21:11 [RFC][PATCH] bfs_lookup(): use d_splice_alias() Al Viro
2018-05-13 21:13 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).