~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/smb/client/cached_dir.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /fs/smb/client/cached_dir.h (Architecture sparc64) and /fs/smb/client/cached_dir.h (Architecture sparc)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*                                                  2 /*
  3  *  Functions to handle the cached directory e      3  *  Functions to handle the cached directory entries
  4  *                                                  4  *
  5  *  Copyright (c) 2022, Ronnie Sahlberg <lsahl      5  *  Copyright (c) 2022, Ronnie Sahlberg <lsahlber@redhat.com>
  6  */                                                 6  */
  7                                                     7 
  8 #ifndef _CACHED_DIR_H                               8 #ifndef _CACHED_DIR_H
  9 #define _CACHED_DIR_H                               9 #define _CACHED_DIR_H
 10                                                    10 
 11                                                    11 
 12 struct cached_dirent {                             12 struct cached_dirent {
 13         struct list_head entry;                    13         struct list_head entry;
 14         char *name;                                14         char *name;
 15         int namelen;                               15         int namelen;
 16         loff_t pos;                                16         loff_t pos;
 17                                                    17 
 18         struct cifs_fattr fattr;                   18         struct cifs_fattr fattr;
 19 };                                                 19 };
 20                                                    20 
 21 struct cached_dirents {                            21 struct cached_dirents {
 22         bool is_valid:1;                           22         bool is_valid:1;
 23         bool is_failed:1;                          23         bool is_failed:1;
 24         struct dir_context *ctx; /*                24         struct dir_context *ctx; /*
 25                                   * Only used      25                                   * Only used to make sure we only take entries
 26                                   * from a sin     26                                   * from a single context. Never dereferenced.
 27                                   */               27                                   */
 28         struct mutex de_mutex;                     28         struct mutex de_mutex;
 29         int pos;                 /* Expected c     29         int pos;                 /* Expected ctx->pos */
 30         struct list_head entries;                  30         struct list_head entries;
 31 };                                                 31 };
 32                                                    32 
 33 struct cached_fid {                                33 struct cached_fid {
 34         struct list_head entry;                    34         struct list_head entry;
 35         struct cached_fids *cfids;                 35         struct cached_fids *cfids;
 36         const char *path;                          36         const char *path;
 37         bool has_lease:1;                          37         bool has_lease:1;
 38         bool is_open:1;                            38         bool is_open:1;
 39         bool on_list:1;                            39         bool on_list:1;
 40         bool file_all_info_is_valid:1;             40         bool file_all_info_is_valid:1;
 41         unsigned long time; /* jiffies of when     41         unsigned long time; /* jiffies of when lease was taken */
 42         struct kref refcount;                      42         struct kref refcount;
 43         struct cifs_fid fid;                       43         struct cifs_fid fid;
 44         spinlock_t fid_lock;                       44         spinlock_t fid_lock;
 45         struct cifs_tcon *tcon;                    45         struct cifs_tcon *tcon;
 46         struct dentry *dentry;                     46         struct dentry *dentry;
 47         struct work_struct lease_break;            47         struct work_struct lease_break;
 48         struct smb2_file_all_info file_all_inf     48         struct smb2_file_all_info file_all_info;
 49         struct cached_dirents dirents;             49         struct cached_dirents dirents;
 50 };                                                 50 };
 51                                                    51 
 52 /* default MAX_CACHED_FIDS is 16 */                52 /* default MAX_CACHED_FIDS is 16 */
 53 struct cached_fids {                               53 struct cached_fids {
 54         /* Must be held when:                      54         /* Must be held when:
 55          * - accessing the cfids->entries list     55          * - accessing the cfids->entries list
 56          */                                        56          */
 57         spinlock_t cfid_list_lock;                 57         spinlock_t cfid_list_lock;
 58         int num_entries;                           58         int num_entries;
 59         struct list_head entries;                  59         struct list_head entries;
 60         struct delayed_work laundromat_work;       60         struct delayed_work laundromat_work;
 61 };                                                 61 };
 62                                                    62 
 63 extern struct cached_fids *init_cached_dirs(vo     63 extern struct cached_fids *init_cached_dirs(void);
 64 extern void free_cached_dirs(struct cached_fid     64 extern void free_cached_dirs(struct cached_fids *cfids);
 65 extern int open_cached_dir(unsigned int xid, s     65 extern int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
 66                            const char *path,       66                            const char *path,
 67                            struct cifs_sb_info     67                            struct cifs_sb_info *cifs_sb,
 68                            bool lookup_only, s     68                            bool lookup_only, struct cached_fid **cfid);
 69 extern int open_cached_dir_by_dentry(struct ci     69 extern int open_cached_dir_by_dentry(struct cifs_tcon *tcon,
 70                                      struct de     70                                      struct dentry *dentry,
 71                                      struct ca     71                                      struct cached_fid **cfid);
 72 extern void close_cached_dir(struct cached_fid     72 extern void close_cached_dir(struct cached_fid *cfid);
 73 extern void drop_cached_dir_by_name(const unsi     73 extern void drop_cached_dir_by_name(const unsigned int xid,
 74                                     struct cif     74                                     struct cifs_tcon *tcon,
 75                                     const char     75                                     const char *name,
 76                                     struct cif     76                                     struct cifs_sb_info *cifs_sb);
 77 extern void close_all_cached_dirs(struct cifs_     77 extern void close_all_cached_dirs(struct cifs_sb_info *cifs_sb);
 78 extern void invalidate_all_cached_dirs(struct      78 extern void invalidate_all_cached_dirs(struct cifs_tcon *tcon);
 79 extern int cached_dir_lease_break(struct cifs_     79 extern int cached_dir_lease_break(struct cifs_tcon *tcon, __u8 lease_key[16]);
 80                                                    80 
 81 #endif                  /* _CACHED_DIR_H */        81 #endif                  /* _CACHED_DIR_H */
 82                                                    82 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php