summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 343963a589e6..8bd04a0423ad 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);
}