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

TOMOYO Linux Cross Reference
Linux/fs/smb/server/oplock.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /fs/smb/server/oplock.h (Version linux-6.11-rc3) and /fs/smb/server/oplock.h (Version linux-6.1.104)


  1 /* SPDX-License-Identifier: GPL-2.0-or-later *      1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*                                                  2 /*
  3  *   Copyright (C) 2016 Namjae Jeon <linkinjeo      3  *   Copyright (C) 2016 Namjae Jeon <linkinjeon@kernel.org>
  4  *   Copyright (C) 2018 Samsung Electronics Co      4  *   Copyright (C) 2018 Samsung Electronics Co., Ltd.
  5  */                                                 5  */
  6                                                     6 
  7 #ifndef __KSMBD_OPLOCK_H                            7 #ifndef __KSMBD_OPLOCK_H
  8 #define __KSMBD_OPLOCK_H                            8 #define __KSMBD_OPLOCK_H
  9                                                     9 
 10 #include "smb_common.h"                            10 #include "smb_common.h"
 11                                                    11 
 12 #define OPLOCK_WAIT_TIME        (35 * HZ)          12 #define OPLOCK_WAIT_TIME        (35 * HZ)
 13                                                    13 
                                                   >>  14 /* SMB2 Oplock levels */
                                                   >>  15 #define SMB2_OPLOCK_LEVEL_NONE          0x00
                                                   >>  16 #define SMB2_OPLOCK_LEVEL_II            0x01
                                                   >>  17 #define SMB2_OPLOCK_LEVEL_EXCLUSIVE     0x08
                                                   >>  18 #define SMB2_OPLOCK_LEVEL_BATCH         0x09
                                                   >>  19 #define SMB2_OPLOCK_LEVEL_LEASE         0xFF
                                                   >>  20 
 14 /* Oplock states */                                21 /* Oplock states */
 15 #define OPLOCK_STATE_NONE       0x00               22 #define OPLOCK_STATE_NONE       0x00
 16 #define OPLOCK_ACK_WAIT         0x01               23 #define OPLOCK_ACK_WAIT         0x01
 17 #define OPLOCK_CLOSING          0x02               24 #define OPLOCK_CLOSING          0x02
 18                                                    25 
 19 #define OPLOCK_WRITE_TO_READ            0x01       26 #define OPLOCK_WRITE_TO_READ            0x01
 20 #define OPLOCK_READ_HANDLE_TO_READ      0x02       27 #define OPLOCK_READ_HANDLE_TO_READ      0x02
 21 #define OPLOCK_WRITE_TO_NONE            0x04       28 #define OPLOCK_WRITE_TO_NONE            0x04
 22 #define OPLOCK_READ_TO_NONE             0x08       29 #define OPLOCK_READ_TO_NONE             0x08
 23                                                    30 
 24 struct lease_ctx_info {                            31 struct lease_ctx_info {
 25         __u8                    lease_key[SMB2     32         __u8                    lease_key[SMB2_LEASE_KEY_SIZE];
 26         __le32                  req_state;         33         __le32                  req_state;
 27         __le32                  flags;             34         __le32                  flags;
 28         __le64                  duration;          35         __le64                  duration;
 29         __u8                    parent_lease_k     36         __u8                    parent_lease_key[SMB2_LEASE_KEY_SIZE];
 30         __le16                  epoch;             37         __le16                  epoch;
 31         int                     version;           38         int                     version;
 32         bool                    is_dir;            39         bool                    is_dir;
 33 };                                                 40 };
 34                                                    41 
 35 struct lease_table {                               42 struct lease_table {
 36         char                    client_guid[SM     43         char                    client_guid[SMB2_CLIENT_GUID_SIZE];
 37         struct list_head        lease_list;        44         struct list_head        lease_list;
 38         struct list_head        l_entry;           45         struct list_head        l_entry;
 39         spinlock_t              lb_lock;           46         spinlock_t              lb_lock;
 40 };                                                 47 };
 41                                                    48 
 42 struct lease {                                     49 struct lease {
 43         __u8                    lease_key[SMB2     50         __u8                    lease_key[SMB2_LEASE_KEY_SIZE];
 44         __le32                  state;             51         __le32                  state;
 45         __le32                  new_state;         52         __le32                  new_state;
 46         __le32                  flags;             53         __le32                  flags;
 47         __le64                  duration;          54         __le64                  duration;
 48         __u8                    parent_lease_k     55         __u8                    parent_lease_key[SMB2_LEASE_KEY_SIZE];
 49         int                     version;           56         int                     version;
 50         unsigned short          epoch;             57         unsigned short          epoch;
 51         bool                    is_dir;            58         bool                    is_dir;
 52         struct lease_table      *l_lb;             59         struct lease_table      *l_lb;
 53 };                                                 60 };
 54                                                    61 
 55 struct oplock_info {                               62 struct oplock_info {
 56         struct ksmbd_conn       *conn;             63         struct ksmbd_conn       *conn;
 57         struct ksmbd_session    *sess;             64         struct ksmbd_session    *sess;
 58         struct ksmbd_work       *work;             65         struct ksmbd_work       *work;
 59         struct ksmbd_file       *o_fp;             66         struct ksmbd_file       *o_fp;
 60         int                     level;             67         int                     level;
 61         int                     op_state;          68         int                     op_state;
 62         unsigned long           pending_break;     69         unsigned long           pending_break;
 63         u64                     fid;               70         u64                     fid;
 64         atomic_t                breaking_cnt;      71         atomic_t                breaking_cnt;
 65         atomic_t                refcount;          72         atomic_t                refcount;
 66         __u16                   Tid;               73         __u16                   Tid;
 67         bool                    is_lease;          74         bool                    is_lease;
 68         bool                    open_trunc;        75         bool                    open_trunc;     /* truncate on open */
 69         struct lease            *o_lease;          76         struct lease            *o_lease;
 70         struct list_head        interim_list;      77         struct list_head        interim_list;
 71         struct list_head        op_entry;          78         struct list_head        op_entry;
 72         struct list_head        lease_entry;       79         struct list_head        lease_entry;
 73         wait_queue_head_t oplock_q; /* Other s     80         wait_queue_head_t oplock_q; /* Other server threads */
 74         wait_queue_head_t oplock_brk; /* oploc     81         wait_queue_head_t oplock_brk; /* oplock breaking wait */
 75         struct rcu_head         rcu_head;          82         struct rcu_head         rcu_head;
 76 };                                                 83 };
 77                                                    84 
 78 struct lease_break_info {                          85 struct lease_break_info {
 79         __le32                  curr_state;        86         __le32                  curr_state;
 80         __le32                  new_state;         87         __le32                  new_state;
 81         __le16                  epoch;             88         __le16                  epoch;
 82         char                    lease_key[SMB2     89         char                    lease_key[SMB2_LEASE_KEY_SIZE];
 83 };                                                 90 };
 84                                                    91 
 85 struct oplock_break_info {                         92 struct oplock_break_info {
 86         int level;                                 93         int level;
 87         int open_trunc;                            94         int open_trunc;
 88         int fid;                                   95         int fid;
 89 };                                                 96 };
 90                                                    97 
 91 int smb_grant_oplock(struct ksmbd_work *work,      98 int smb_grant_oplock(struct ksmbd_work *work, int req_op_level,
 92                      u64 pid, struct ksmbd_fil     99                      u64 pid, struct ksmbd_file *fp, __u16 tid,
 93                      struct lease_ctx_info *lc    100                      struct lease_ctx_info *lctx, int share_ret);
 94 void smb_break_all_levII_oplock(struct ksmbd_w    101 void smb_break_all_levII_oplock(struct ksmbd_work *work,
 95                                 struct ksmbd_f    102                                 struct ksmbd_file *fp, int is_trunc);
 96 int opinfo_write_to_read(struct oplock_info *o    103 int opinfo_write_to_read(struct oplock_info *opinfo);
 97 int opinfo_read_handle_to_read(struct oplock_i    104 int opinfo_read_handle_to_read(struct oplock_info *opinfo);
 98 int opinfo_write_to_none(struct oplock_info *o    105 int opinfo_write_to_none(struct oplock_info *opinfo);
 99 int opinfo_read_to_none(struct oplock_info *op    106 int opinfo_read_to_none(struct oplock_info *opinfo);
100 void close_id_del_oplock(struct ksmbd_file *fp    107 void close_id_del_oplock(struct ksmbd_file *fp);
101 void smb_break_all_oplock(struct ksmbd_work *w    108 void smb_break_all_oplock(struct ksmbd_work *work, struct ksmbd_file *fp);
102 struct oplock_info *opinfo_get(struct ksmbd_fi    109 struct oplock_info *opinfo_get(struct ksmbd_file *fp);
103 void opinfo_put(struct oplock_info *opinfo);      110 void opinfo_put(struct oplock_info *opinfo);
104                                                   111 
105 /* Lease related functions */                     112 /* Lease related functions */
106 void create_lease_buf(u8 *rbuf, struct lease *    113 void create_lease_buf(u8 *rbuf, struct lease *lease);
107 struct lease_ctx_info *parse_lease_state(void  !! 114 struct lease_ctx_info *parse_lease_state(void *open_req, bool is_dir);
108 __u8 smb2_map_lease_to_oplock(__le32 lease_sta    115 __u8 smb2_map_lease_to_oplock(__le32 lease_state);
109 int lease_read_to_write(struct oplock_info *op    116 int lease_read_to_write(struct oplock_info *opinfo);
110                                                   117 
111 /* Durable related functions */                   118 /* Durable related functions */
112 void create_durable_rsp_buf(char *cc);            119 void create_durable_rsp_buf(char *cc);
113 void create_durable_v2_rsp_buf(char *cc, struc    120 void create_durable_v2_rsp_buf(char *cc, struct ksmbd_file *fp);
114 void create_mxac_rsp_buf(char *cc, int maximal    121 void create_mxac_rsp_buf(char *cc, int maximal_access);
115 void create_disk_id_rsp_buf(char *cc, __u64 fi    122 void create_disk_id_rsp_buf(char *cc, __u64 file_id, __u64 vol_id);
116 void create_posix_rsp_buf(char *cc, struct ksm    123 void create_posix_rsp_buf(char *cc, struct ksmbd_file *fp);
117 struct create_context *smb2_find_context_vals(    124 struct create_context *smb2_find_context_vals(void *open_req, const char *tag, int tag_len);
118 struct oplock_info *lookup_lease_in_table(stru    125 struct oplock_info *lookup_lease_in_table(struct ksmbd_conn *conn,
119                                           char    126                                           char *lease_key);
120 int find_same_lease_key(struct ksmbd_session *    127 int find_same_lease_key(struct ksmbd_session *sess, struct ksmbd_inode *ci,
121                         struct lease_ctx_info     128                         struct lease_ctx_info *lctx);
122 void destroy_lease_table(struct ksmbd_conn *co    129 void destroy_lease_table(struct ksmbd_conn *conn);
123 void smb_send_parent_lease_break_noti(struct k    130 void smb_send_parent_lease_break_noti(struct ksmbd_file *fp,
124                                       struct l    131                                       struct lease_ctx_info *lctx);
125 void smb_lazy_parent_lease_break_close(struct     132 void smb_lazy_parent_lease_break_close(struct ksmbd_file *fp);
126 int smb2_check_durable_oplock(struct ksmbd_con << 
127                               struct ksmbd_sha << 
128                               struct ksmbd_fil << 
129                               struct lease_ctx << 
130                               char *name);     << 
131 #endif /* __KSMBD_OPLOCK_H */                     133 #endif /* __KSMBD_OPLOCK_H */
132                                                   134 

~ [ 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