summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnzo Matsumiya <ematsumiya@suse.de>2025-09-09 09:57:20 -0300
committerEnzo Matsumiya <ematsumiya@suse.de>2025-09-26 19:08:09 -0300
commit116380c666e04fc3fa75cdcec279d8f16512682d (patch)
tree2368b748750831a9482cb8cbcefbcf359bf4e02b
parent61fb8c8817bcd2def0b656db85e09985f34925fb (diff)
downloadlinux-116380c666e04fc3fa75cdcec279d8f16512682d.tar.gz
linux-116380c666e04fc3fa75cdcec279d8f16512682d.tar.bz2
linux-116380c666e04fc3fa75cdcec279d8f16512682d.zip
smb: client: remove cached_dirent->fattr
Replace with ->unique_id and ->dtype -- the only fields used from cifs_fattr. Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
-rw-r--r--fs/smb/client/cached_dir.h6
-rw-r--r--fs/smb/client/readdir.c9
2 files changed, 8 insertions, 7 deletions
diff --git a/fs/smb/client/cached_dir.h b/fs/smb/client/cached_dir.h
index c45151446049..d5ad10a35ed7 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 903919345df1..4b6e2632e8ed 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);
}