From: Jinliang Zheng <alexjlzheng@gmail.com>
To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz
Cc: alexjlzheng@tencent.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] fs: remove useless d_unhashed() retry in d_alloc_parallel()
Date: Thu, 13 Feb 2025 20:21:37 +0800 [thread overview]
Message-ID: <20250213122137.11830-1-alexjlzheng@tencent.com> (raw)
After commit 45f78b0a2743 ("fs/dcache: Move the wakeup from
__d_lookup_done() to the caller."), we will only wake up
d_wait_lookup() after adding dentry to dentry_hashtable.
Therefore, there is no need to keep retries about d_unhashed()
in d_alloc_parallel().
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
---
fs/dcache.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/dcache.c b/fs/dcache.c
index e3634916ffb9..543833eedd8c 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2584,8 +2584,6 @@ struct dentry *d_alloc_parallel(struct dentry *parent,
goto mismatch;
if (unlikely(dentry->d_parent != parent))
goto mismatch;
- if (unlikely(d_unhashed(dentry)))
- goto mismatch;
if (unlikely(!d_same_name(dentry, parent, name)))
goto mismatch;
/* OK, it *is* a hashed match; return it */
--
2.48.1
next reply other threads:[~2025-02-13 12:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 12:21 Jinliang Zheng [this message]
2025-02-13 13:20 ` [PATCH] fs: remove useless d_unhashed() retry in d_alloc_parallel() Al Viro
2025-02-14 1:43 ` Jinliang Zheng
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=20250213122137.11830-1-alexjlzheng@tencent.com \
--to=alexjlzheng@gmail.com \
--cc=alexjlzheng@tencent.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).