From: Henrique Carvalho <henrique.carvalho@suse.com>
To: sfrench@samba.org
Cc: ematsumiya@suse.de, pc@manguebit.com, ronniesahlberg@gmail.com,
sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com,
linux-cifs@vger.kernel.org,
Henrique Carvalho <henrique.carvalho@suse.com>
Subject: [PATCH 2/2] smb: client: remove unnecessary NULL check in open_cached_dir_by_dentry()
Date: Fri, 22 Nov 2024 17:39:01 -0300 [thread overview]
Message-ID: <20241122203901.283703-2-henrique.carvalho@suse.com> (raw)
In-Reply-To: <20241122203901.283703-1-henrique.carvalho@suse.com>
The function open_cached_dir_by_dentry() is only called by
cifs_dentry_needs_reval(), and it always passes dentry->d_parent as the
argument to dentry.
Since dentry->d_parent cannot be NULL, the check for dentry == NULL
is unnecessary and can be removed.
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
---
fs/smb/client/cached_dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
index d8b1cf1043c35..9ac503dee0793 100644
--- a/fs/smb/client/cached_dir.c
+++ b/fs/smb/client/cached_dir.c
@@ -400,7 +400,7 @@ int open_cached_dir_by_dentry(struct cifs_tcon *tcon,
spin_lock(&cfids->cfid_list_lock);
list_for_each_entry(cfid, &cfids->entries, entry) {
- if (dentry && cfid->dentry == dentry) {
+ if (cfid->dentry == dentry) {
cifs_dbg(FYI, "found a cached file handle by dentry\n");
kref_get(&cfid->refcount);
*ret_cfid = cfid;
--
2.46.0
next prev parent reply other threads:[~2024-11-22 20:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 20:39 [PATCH 1/2] smb: client: disable directory caching when dir_cache_timeout is zero Henrique Carvalho
2024-11-22 20:39 ` Henrique Carvalho [this message]
2024-11-22 22:21 ` [PATCH 2/2] smb: client: remove unnecessary NULL check in open_cached_dir_by_dentry() Paulo Alcantara
2024-11-22 22:07 ` [PATCH 1/2] smb: client: disable directory caching when dir_cache_timeout is zero Paulo Alcantara
2024-11-22 22:37 ` Henrique Carvalho
2024-11-22 22:55 ` Paulo Alcantara
2024-11-22 23:23 ` Henrique Carvalho
2024-11-22 23:59 ` Paulo Alcantara
2024-11-23 1:16 ` Henrique Carvalho
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=20241122203901.283703-2-henrique.carvalho@suse.com \
--to=henrique.carvalho@suse.com \
--cc=bharathsm@microsoft.com \
--cc=ematsumiya@suse.de \
--cc=linux-cifs@vger.kernel.org \
--cc=pc@manguebit.com \
--cc=ronniesahlberg@gmail.com \
--cc=sfrench@samba.org \
--cc=sprasad@microsoft.com \
--cc=tom@talpey.com \
/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