From: Al Viro <viro@ftp.linux.org.uk>
To: linux-fsdevel@vger.kernel.org
Cc: <aivazian.tigran@gmail.com>, "Tigran A. Aivazian"@ftp.linux.org.uk
Subject: [RFC][PATCH] bfs_lookup(): use d_splice_alias()
Date: Sun, 13 May 2018 22:11:30 +0100 [thread overview]
Message-ID: <E1fHyHC-0007X1-RM@ZenIV.linux.org.uk> (raw)
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
next reply other threads:[~2018-05-13 21:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-13 21:11 Al Viro [this message]
2018-05-13 21:13 ` [RFC][PATCH] bfs_lookup(): use d_splice_alias() Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1fHyHC-0007X1-RM@ZenIV.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc="Tigran A. Aivazian"@ftp.linux.org.uk \
--cc=aivazian.tigran@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).