From: Bharath SM <bharathsm.hsk@gmail.com>
To: Enzo Matsumiya <ematsumiya@suse.de>
Cc: linux-cifs@vger.kernel.org, smfrench@gmail.com, pc@manguebit.com,
ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com,
bharathsm@microsoft.com, henrique.carvalho@suse.com
Subject: Re: [PATCH v2 15/20] smb: client: remove cached_dirent->fattr
Date: Fri, 24 Oct 2025 02:26:47 -0700 [thread overview]
Message-ID: <CAGypqWyGNiB5zFf2Lo_qhfBp1vdvf_FQnmOJLpaCwNu88sWJ-g@mail.gmail.com> (raw)
In-Reply-To: <20251007174304.1755251-16-ematsumiya@suse.de>
On Tue, Oct 7, 2025 at 10:44 AM Enzo Matsumiya <ematsumiya@suse.de> wrote:
>
> Replace with ->unique_id and ->dtype -- the only fields used from
> cifs_fattr.
>
> Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
> ---
> fs/smb/client/cached_dir.h | 6 ++++--
> fs/smb/client/readdir.c | 9 ++++-----
> 2 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/fs/smb/client/cached_dir.h b/fs/smb/client/cached_dir.h
> index de1231bdb0d9..86a1a927a521 100644
> --- a/fs/smb/client/cached_dir.h
> +++ b/fs/smb/client/cached_dir.h
> @@ -8,13 +8,15 @@
> #ifndef _CACHED_DIR_H
> #define _CACHED_DIR_H
>
> -
> struct cached_dirent {
> struct list_head entry;
> char *name;
> int namelen;
> loff_t pos;
> - struct cifs_fattr fattr;
> +
> + /* filled from cifs_fattr */
> + u64 unique_id;
> + unsigned int dtype;
> };
>
> struct cached_dirents {
> diff --git a/fs/smb/client/readdir.c b/fs/smb/client/readdir.c
> index 32dcbb702b14..96b5074d72a5 100644
> --- a/fs/smb/client/readdir.c
> +++ b/fs/smb/client/readdir.c
> @@ -850,9 +850,7 @@ static bool emit_cached_dirents(struct cached_dirents *cde,
> * initial scan.
> */
> ctx->pos = dirent->pos;
> - rc = dir_emit(ctx, dirent->name, dirent->namelen,
> - dirent->fattr.cf_uniqueid,
> - dirent->fattr.cf_dtype);
> + rc = dir_emit(ctx, dirent->name, dirent->namelen, dirent->unique_id, dirent->dtype);
> if (!rc)
> return rc;
> ctx->pos++;
> @@ -905,9 +903,10 @@ static bool add_cached_dirent(struct cached_dirents *cde,
> cde->is_failed = 1;
> return false;
> }
> - de->pos = ctx->pos;
>
> - memcpy(&de->fattr, fattr, sizeof(struct cifs_fattr));
> + de->pos = ctx->pos;
> + de->unique_id = fattr->cf_uniqueid;
> + de->dtype = fattr->cf_dtype;
>
> list_add_tail(&de->entry, &cde->entries);
> /* update accounting */
> --
> 2.51.0
>
>
Looks good to me.
-Bharath
next prev parent reply other threads:[~2025-10-24 9:26 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 17:42 [PATCH v2 00/20] cached dir fixes and improvements Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 01/20] smb: client: remove cfids_invalidation_worker Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 02/20] smb: client: remove cached_dir_offload_close/close_work Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 03/20] smb: client: remove cached_dir_put_work/put_work Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 04/20] smb: client: remove cached_fids->dying list Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 05/20] smb: client: remove cached_fid->on_list Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 06/20] smb: client: merge {close,invalidate}_all_cached_dirs() Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 07/20] smb: client: merge free_cached_dir in release callback Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 08/20] smb: client: split find_or_create_cached_dir() Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 09/20] smb: client: enhance cached dir lookups Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 10/20] smb: client: refactor dropping cached dirs Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 11/20] smb: client: simplify cached_fid state checking Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 12/20] smb: client: prevent lease breaks of cached parents when opening children Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 13/20] smb: client: actually use cached dirs on readdir Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 14/20] smb: client: wait for concurrent caching of dirents in cifs_readdir() Enzo Matsumiya
2025-10-07 17:42 ` [PATCH v2 15/20] smb: client: remove cached_dirent->fattr Enzo Matsumiya
2025-10-24 9:26 ` Bharath SM [this message]
2025-10-07 17:43 ` [PATCH v2 16/20] smb: client: add is_dir argument to query_path_info Enzo Matsumiya
2025-10-07 17:43 ` [PATCH v2 17/20] smb: client: use cached dir on queryfs/smb2_compound_op Enzo Matsumiya
2025-10-07 17:43 ` [PATCH v2 18/20] smb: client: skip dentry revalidation of cached root Enzo Matsumiya
2025-10-07 17:43 ` [PATCH v2 19/20] smb: client: rework cached dirs synchronization Enzo Matsumiya
2025-10-07 17:43 ` [PATCH v2 20/20] smb: client: cleanup open_cached_dir() Enzo Matsumiya
2025-10-16 12:42 ` [PATCH v2 00/20] cached dir fixes and improvements Enzo Matsumiya
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=CAGypqWyGNiB5zFf2Lo_qhfBp1vdvf_FQnmOJLpaCwNu88sWJ-g@mail.gmail.com \
--to=bharathsm.hsk@gmail.com \
--cc=bharathsm@microsoft.com \
--cc=ematsumiya@suse.de \
--cc=henrique.carvalho@suse.com \
--cc=linux-cifs@vger.kernel.org \
--cc=pc@manguebit.com \
--cc=ronniesahlberg@gmail.com \
--cc=smfrench@gmail.com \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).