.. | .. |
---|
46 | 46 | extern int smb2_check_receive(struct mid_q_entry *mid, |
---|
47 | 47 | struct TCP_Server_Info *server, bool log_error); |
---|
48 | 48 | extern struct mid_q_entry *smb2_setup_request(struct cifs_ses *ses, |
---|
49 | | - struct smb_rqst *rqst); |
---|
| 49 | + struct TCP_Server_Info *, |
---|
| 50 | + struct smb_rqst *rqst); |
---|
50 | 51 | extern struct mid_q_entry *smb2_setup_async_request( |
---|
51 | 52 | struct TCP_Server_Info *server, struct smb_rqst *rqst); |
---|
52 | 53 | extern struct cifs_ses *smb2_find_smb_ses(struct TCP_Server_Info *server, |
---|
.. | .. |
---|
54 | 55 | extern struct cifs_tcon *smb2_find_smb_tcon(struct TCP_Server_Info *server, |
---|
55 | 56 | __u64 ses_id, __u32 tid); |
---|
56 | 57 | extern int smb2_calc_signature(struct smb_rqst *rqst, |
---|
57 | | - struct TCP_Server_Info *server); |
---|
| 58 | + struct TCP_Server_Info *server, |
---|
| 59 | + bool allocate_crypto); |
---|
58 | 60 | extern int smb3_calc_signature(struct smb_rqst *rqst, |
---|
59 | | - struct TCP_Server_Info *server); |
---|
| 61 | + struct TCP_Server_Info *server, |
---|
| 62 | + bool allocate_crypto); |
---|
60 | 63 | extern void smb2_echo_request(struct work_struct *work); |
---|
61 | 64 | extern __le32 smb2_get_lease_state(struct cifsInodeInfo *cinode); |
---|
62 | 65 | extern bool smb2_is_valid_oplock_break(char *buffer, |
---|
.. | .. |
---|
67 | 70 | struct mid_q_entry *mid); |
---|
68 | 71 | |
---|
69 | 72 | extern int open_shroot(unsigned int xid, struct cifs_tcon *tcon, |
---|
70 | | - struct cifs_fid *pfid); |
---|
| 73 | + struct cifs_sb_info *cifs_sb, |
---|
| 74 | + struct cached_fid **cfid); |
---|
71 | 75 | extern void close_shroot(struct cached_fid *cfid); |
---|
| 76 | +extern void close_shroot_lease(struct cached_fid *cfid); |
---|
| 77 | +extern void close_shroot_lease_locked(struct cached_fid *cfid); |
---|
72 | 78 | extern void move_smb2_info_to_cifs(FILE_ALL_INFO *dst, |
---|
73 | 79 | struct smb2_file_all_info *src); |
---|
| 80 | +extern int smb2_query_reparse_tag(const unsigned int xid, struct cifs_tcon *tcon, |
---|
| 81 | + struct cifs_sb_info *cifs_sb, const char *path, |
---|
| 82 | + __u32 *reparse_tag); |
---|
74 | 83 | extern int smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, |
---|
75 | 84 | struct cifs_sb_info *cifs_sb, |
---|
76 | 85 | const char *full_path, FILE_ALL_INFO *data, |
---|
.. | .. |
---|
84 | 93 | umode_t mode, struct cifs_tcon *tcon, |
---|
85 | 94 | const char *full_path, |
---|
86 | 95 | struct cifs_sb_info *cifs_sb); |
---|
87 | | -extern int smb2_mkdir(const unsigned int xid, struct cifs_tcon *tcon, |
---|
| 96 | +extern int smb2_mkdir(const unsigned int xid, struct inode *inode, |
---|
| 97 | + umode_t mode, struct cifs_tcon *tcon, |
---|
88 | 98 | const char *name, struct cifs_sb_info *cifs_sb); |
---|
89 | 99 | extern void smb2_mkdir_setinfo(struct inode *inode, const char *full_path, |
---|
90 | 100 | struct cifs_sb_info *cifs_sb, |
---|
.. | .. |
---|
116 | 126 | extern int smb3_crypto_aead_allocate(struct TCP_Server_Info *server); |
---|
117 | 127 | extern unsigned long smb_rqst_len(struct TCP_Server_Info *server, |
---|
118 | 128 | struct smb_rqst *rqst); |
---|
| 129 | +extern void smb2_set_next_command(struct cifs_tcon *tcon, |
---|
| 130 | + struct smb_rqst *rqst); |
---|
| 131 | +extern void smb2_set_related(struct smb_rqst *rqst); |
---|
119 | 132 | |
---|
120 | 133 | /* |
---|
121 | 134 | * SMB2 Worker functions - most of protocol specific implementation details |
---|
.. | .. |
---|
132 | 145 | extern int SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, |
---|
133 | 146 | __le16 *path, __u8 *oplock, |
---|
134 | 147 | struct smb2_file_all_info *buf, |
---|
| 148 | + struct create_posix_rsp *posix, |
---|
135 | 149 | struct kvec *err_iov, int *resp_buftype); |
---|
136 | | -extern int SMB2_open_init(struct cifs_tcon *tcon, struct smb_rqst *rqst, |
---|
| 150 | +extern int SMB2_open_init(struct cifs_tcon *tcon, |
---|
| 151 | + struct TCP_Server_Info *server, |
---|
| 152 | + struct smb_rqst *rqst, |
---|
137 | 153 | __u8 *oplock, struct cifs_open_parms *oparms, |
---|
138 | 154 | __le16 *path); |
---|
139 | 155 | extern void SMB2_open_free(struct smb_rqst *rqst); |
---|
140 | 156 | extern int SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, |
---|
141 | 157 | u64 persistent_fid, u64 volatile_fid, u32 opcode, |
---|
142 | | - bool is_fsctl, char *in_data, u32 indatalen, |
---|
| 158 | + char *in_data, u32 indatalen, u32 maxoutlen, |
---|
143 | 159 | char **out_data, u32 *plen /* returned data len */); |
---|
| 160 | +extern int SMB2_ioctl_init(struct cifs_tcon *tcon, |
---|
| 161 | + struct TCP_Server_Info *server, |
---|
| 162 | + struct smb_rqst *rqst, |
---|
| 163 | + u64 persistent_fid, u64 volatile_fid, u32 opcode, |
---|
| 164 | + char *in_data, u32 indatalen, |
---|
| 165 | + __u32 max_response_size); |
---|
| 166 | +extern void SMB2_ioctl_free(struct smb_rqst *rqst); |
---|
| 167 | +extern int SMB2_change_notify(const unsigned int xid, struct cifs_tcon *tcon, |
---|
| 168 | + u64 persistent_fid, u64 volatile_fid, bool watch_tree, |
---|
| 169 | + u32 completion_filter); |
---|
| 170 | + |
---|
| 171 | +extern int __SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, |
---|
| 172 | + u64 persistent_fid, u64 volatile_fid, |
---|
| 173 | + struct smb2_file_network_open_info *pbuf); |
---|
144 | 174 | extern int SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, |
---|
145 | 175 | u64 persistent_file_id, u64 volatile_file_id); |
---|
146 | | -extern int SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon, |
---|
147 | | - u64 persistent_fid, u64 volatile_fid, int flags); |
---|
148 | | -extern int SMB2_close_init(struct cifs_tcon *tcon, struct smb_rqst *rqst, |
---|
149 | | - u64 persistent_file_id, u64 volatile_file_id); |
---|
| 176 | +extern int SMB2_close_init(struct cifs_tcon *tcon, |
---|
| 177 | + struct TCP_Server_Info *server, |
---|
| 178 | + struct smb_rqst *rqst, |
---|
| 179 | + u64 persistent_fid, u64 volatile_fid, |
---|
| 180 | + bool query_attrs); |
---|
150 | 181 | extern void SMB2_close_free(struct smb_rqst *rqst); |
---|
151 | 182 | extern int SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, |
---|
152 | 183 | u64 persistent_file_id, u64 volatile_file_id); |
---|
153 | | -extern int SMB2_query_eas(const unsigned int xid, struct cifs_tcon *tcon, |
---|
154 | | - u64 persistent_file_id, u64 volatile_file_id, |
---|
155 | | - int ea_buf_size, |
---|
156 | | - struct smb2_file_full_ea_info *data); |
---|
| 184 | +extern int SMB2_flush_init(const unsigned int xid, struct smb_rqst *rqst, |
---|
| 185 | + struct cifs_tcon *tcon, |
---|
| 186 | + struct TCP_Server_Info *server, |
---|
| 187 | + u64 persistent_file_id, u64 volatile_file_id); |
---|
| 188 | +extern void SMB2_flush_free(struct smb_rqst *rqst); |
---|
| 189 | +extern int SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon, |
---|
| 190 | + u64 persistent_fid, u64 volatile_fid, struct smb311_posix_qinfo *data, u32 *plen); |
---|
157 | 191 | extern int SMB2_query_info(const unsigned int xid, struct cifs_tcon *tcon, |
---|
158 | 192 | u64 persistent_file_id, u64 volatile_file_id, |
---|
159 | 193 | struct smb2_file_all_info *data); |
---|
160 | | -extern int SMB2_query_info_init(struct cifs_tcon *tcon, struct smb_rqst *rqst, |
---|
| 194 | +extern int SMB2_query_info_init(struct cifs_tcon *tcon, |
---|
| 195 | + struct TCP_Server_Info *server, |
---|
| 196 | + struct smb_rqst *rqst, |
---|
161 | 197 | u64 persistent_fid, u64 volatile_fid, |
---|
162 | 198 | u8 info_class, u8 info_type, |
---|
163 | | - u32 additional_info, size_t output_len); |
---|
| 199 | + u32 additional_info, size_t output_len, |
---|
| 200 | + size_t input_len, void *input); |
---|
164 | 201 | extern void SMB2_query_info_free(struct smb_rqst *rqst); |
---|
165 | 202 | extern int SMB2_query_acl(const unsigned int xid, struct cifs_tcon *tcon, |
---|
166 | 203 | u64 persistent_file_id, u64 volatile_file_id, |
---|
.. | .. |
---|
179 | 216 | extern int SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, |
---|
180 | 217 | u64 persistent_fid, u64 volatile_fid, int index, |
---|
181 | 218 | struct cifs_search_info *srch_inf); |
---|
182 | | -extern int SMB2_rename(const unsigned int xid, struct cifs_tcon *tcon, |
---|
183 | | - u64 persistent_fid, u64 volatile_fid, |
---|
184 | | - __le16 *target_file); |
---|
185 | | -extern int SMB2_rmdir(const unsigned int xid, struct cifs_tcon *tcon, |
---|
186 | | - u64 persistent_fid, u64 volatile_fid); |
---|
187 | | -extern int SMB2_set_hardlink(const unsigned int xid, struct cifs_tcon *tcon, |
---|
188 | | - u64 persistent_fid, u64 volatile_fid, |
---|
189 | | - __le16 *target_file); |
---|
| 219 | +extern int SMB2_query_directory_init(unsigned int xid, struct cifs_tcon *tcon, |
---|
| 220 | + struct TCP_Server_Info *server, |
---|
| 221 | + struct smb_rqst *rqst, |
---|
| 222 | + u64 persistent_fid, u64 volatile_fid, |
---|
| 223 | + int index, int info_level); |
---|
| 224 | +extern void SMB2_query_directory_free(struct smb_rqst *rqst); |
---|
190 | 225 | extern int SMB2_set_eof(const unsigned int xid, struct cifs_tcon *tcon, |
---|
191 | 226 | u64 persistent_fid, u64 volatile_fid, u32 pid, |
---|
192 | | - __le64 *eof, bool is_fallocate); |
---|
193 | | -extern int SMB2_set_info(const unsigned int xid, struct cifs_tcon *tcon, |
---|
194 | | - u64 persistent_fid, u64 volatile_fid, |
---|
195 | | - FILE_BASIC_INFO *buf); |
---|
| 227 | + __le64 *eof); |
---|
| 228 | +extern int SMB2_set_info_init(struct cifs_tcon *tcon, |
---|
| 229 | + struct TCP_Server_Info *server, |
---|
| 230 | + struct smb_rqst *rqst, |
---|
| 231 | + u64 persistent_fid, u64 volatile_fid, u32 pid, |
---|
| 232 | + u8 info_class, u8 info_type, u32 additional_info, |
---|
| 233 | + void **data, unsigned int *size); |
---|
| 234 | +extern void SMB2_set_info_free(struct smb_rqst *rqst); |
---|
196 | 235 | extern int SMB2_set_acl(const unsigned int xid, struct cifs_tcon *tcon, |
---|
197 | 236 | u64 persistent_fid, u64 volatile_fid, |
---|
198 | 237 | struct cifs_ntsd *pnntsd, int pacllen, int aclflag); |
---|
.. | .. |
---|
207 | 246 | extern int smb2_handle_cancelled_close(struct cifs_tcon *tcon, |
---|
208 | 247 | __u64 persistent_fid, |
---|
209 | 248 | __u64 volatile_fid); |
---|
210 | | -extern int smb2_handle_cancelled_mid(char *buffer, |
---|
211 | | - struct TCP_Server_Info *server); |
---|
| 249 | +extern int smb2_handle_cancelled_mid(struct mid_q_entry *mid, struct TCP_Server_Info *server); |
---|
212 | 250 | void smb2_cancelled_close_fid(struct work_struct *work); |
---|
213 | 251 | extern int SMB2_QFS_info(const unsigned int xid, struct cifs_tcon *tcon, |
---|
214 | 252 | u64 persistent_file_id, u64 volatile_file_id, |
---|
.. | .. |
---|
232 | 270 | |
---|
233 | 271 | extern enum securityEnum smb2_select_sectype(struct TCP_Server_Info *, |
---|
234 | 272 | enum securityEnum); |
---|
| 273 | +extern void smb2_parse_contexts(struct TCP_Server_Info *server, |
---|
| 274 | + struct smb2_create_rsp *rsp, |
---|
| 275 | + unsigned int *epoch, char *lease_key, |
---|
| 276 | + __u8 *oplock, struct smb2_file_all_info *buf, |
---|
| 277 | + struct create_posix_rsp *posix); |
---|
235 | 278 | extern int smb3_encryption_required(const struct cifs_tcon *tcon); |
---|
236 | 279 | extern int smb2_validate_iov(unsigned int offset, unsigned int buffer_length, |
---|
237 | 280 | struct kvec *iov, unsigned int min_buf_size); |
---|
| 281 | +extern int smb2_validate_and_copy_iov(unsigned int offset, |
---|
| 282 | + unsigned int buffer_length, |
---|
| 283 | + struct kvec *iov, |
---|
| 284 | + unsigned int minbufsize, char *data); |
---|
238 | 285 | extern void smb2_copy_fs_info_to_kstatfs( |
---|
239 | 286 | struct smb2_fs_full_size_info *pfs_inf, |
---|
240 | 287 | struct kstatfs *kst); |
---|
241 | 288 | extern int smb311_crypto_shash_allocate(struct TCP_Server_Info *server); |
---|
242 | 289 | extern int smb311_update_preauth_hash(struct cifs_ses *ses, |
---|
243 | 290 | struct kvec *iov, int nvec); |
---|
| 291 | +extern int smb2_query_info_compound(const unsigned int xid, |
---|
| 292 | + struct cifs_tcon *tcon, |
---|
| 293 | + __le16 *utf16_path, u32 desired_access, |
---|
| 294 | + u32 class, u32 type, u32 output_len, |
---|
| 295 | + struct kvec *rsp, int *buftype, |
---|
| 296 | + struct cifs_sb_info *cifs_sb); |
---|
| 297 | +/* query path info from the server using SMB311 POSIX extensions*/ |
---|
| 298 | +extern int smb311_posix_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, |
---|
| 299 | + struct cifs_sb_info *sb, const char *path, struct smb311_posix_qinfo *qinf, |
---|
| 300 | + bool *adjust_tx, bool *symlink); |
---|
| 301 | +int posix_info_parse(const void *beg, const void *end, |
---|
| 302 | + struct smb2_posix_info_parsed *out); |
---|
| 303 | +int posix_info_sid_size(const void *beg, const void *end); |
---|
244 | 304 | #endif /* _SMB2PROTO_H */ |
---|