aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2022-05-10 09:42:07 +1000
committerSteve French <stfrench@microsoft.com>2022-05-24 14:33:11 -0500
commitd87c48ce4d8951f46d21f17ea86bba8853049862 (patch)
tree9d5b70fa32e36691fecab1cf6e45657c78eb92e4 /fs/cifs/cifsglob.h
parentcifs: avoid parallel session setups on same channel (diff)
downloadlinux-dev-d87c48ce4d8951f46d21f17ea86bba8853049862.tar.xz
linux-dev-d87c48ce4d8951f46d21f17ea86bba8853049862.zip
cifs: cache the dirents for entries in a cached directory
This adds caching of the directory entries for a cached directory while we keep a lease on the directory. Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 8880a26f234f..b6c2a787be06 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -1052,6 +1052,27 @@ struct cifs_fattr {
u32 cf_cifstag;
};
+struct cached_dirent {
+ struct list_head entry;
+ char *name;
+ int namelen;
+ loff_t pos;
+
+ struct cifs_fattr fattr;
+};
+
+struct cached_dirents {
+ bool is_valid:1;
+ bool is_failed:1;
+ struct dir_context *ctx; /*
+ * Only used to make sure we only take entries
+ * from a single context. Never dereferenced.
+ */
+ struct mutex de_mutex;
+ int pos; /* Expected ctx->pos */
+ struct list_head entries;
+};
+
struct cached_fid {
bool is_valid:1; /* Do we have a useable root fid */
bool file_all_info_is_valid:1;
@@ -1064,6 +1085,7 @@ struct cached_fid {
struct dentry *dentry;
struct work_struct lease_break;
struct smb2_file_all_info file_all_info;
+ struct cached_dirents dirents;
};
/*