From da0242dd604d645a0622dcfab75573e29c986d68 Mon Sep 17 00:00:00 2001 From: Enzo Matsumiya Date: Tue, 9 Sep 2025 09:57:20 -0300 Subject: smb: client: remove cached_dirent->fattr Replace with ->unique_id and ->dtype -- the only fields used from cifs_fattr. Signed-off-by: Enzo Matsumiya --- 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 537730a74867..419b1d88e5f3 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 a50ba3458bf3..fbcf8d82476e 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++; @@ -901,9 +899,10 @@ static void add_cached_dirent(struct cached_dirents *cde, struct dir_context *ct cde->is_failed = 1; return; } - 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); } -- cgit v1.2.3