Message ID | 20241122203901.283703-2-henrique.carvalho@suse.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/2] smb: client: disable directory caching when dir_cache_timeout is zero | expand |
Henrique Carvalho <henrique.carvalho@suse.com> writes: > 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(-) Looks good, Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
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;
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(-)