diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2022-08-12 03:04:29 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-08-12 04:08:32 +0300 |
commit | a63ec83c462b5b1439f71ace751e8985dfb3fcab (patch) | |
tree | 4901e893689cff4b5c8c42eba063f27fc3df7139 /fs/cifs/cached_dir.h | |
parent | 9e31678fb403eae0f4fe37c6374be098835c73cd (diff) | |
download | linux-a63ec83c462b5b1439f71ace751e8985dfb3fcab.tar.xz |
cifs: Add constructor/destructors for tcon->cfid
and move the structure definitions into cached_dir.h
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cached_dir.h')
-rw-r--r-- | fs/cifs/cached_dir.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/fs/cifs/cached_dir.h b/fs/cifs/cached_dir.h index 51c6b968f8b6..89c0343d7e26 100644 --- a/fs/cifs/cached_dir.h +++ b/fs/cifs/cached_dir.h @@ -9,6 +9,44 @@ #define _CACHED_DIR_H +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; + bool has_lease:1; + unsigned long time; /* jiffies of when lease was taken */ + struct kref refcount; + struct cifs_fid fid; + struct mutex fid_mutex; + struct cifs_tcon *tcon; + struct dentry *dentry; + struct work_struct lease_break; + struct smb2_file_all_info file_all_info; + struct cached_dirents dirents; +}; + +extern struct cached_fid *init_cached_dir(void); +extern void free_cached_dir(struct cifs_tcon *tcon); extern int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, const char *path, struct cifs_sb_info *cifs_sb, |