diff options
Diffstat (limited to 'fs/cifs/cifsproto.h')
-rw-r--r-- | fs/cifs/cifsproto.h | 136 |
1 files changed, 61 insertions, 75 deletions
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index f1bbf8305d3a..5144e9fbeb8c 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | struct statfs; | 25 | struct statfs; |
26 | struct smb_vol; | 26 | struct smb_vol; |
27 | struct smb_rqst; | ||
27 | 28 | ||
28 | /* | 29 | /* |
29 | ***************************************************************** | 30 | ***************************************************************** |
@@ -35,6 +36,8 @@ extern struct smb_hdr *cifs_buf_get(void); | |||
35 | extern void cifs_buf_release(void *); | 36 | extern void cifs_buf_release(void *); |
36 | extern struct smb_hdr *cifs_small_buf_get(void); | 37 | extern struct smb_hdr *cifs_small_buf_get(void); |
37 | extern void cifs_small_buf_release(void *); | 38 | extern void cifs_small_buf_release(void *); |
39 | extern void cifs_rqst_page_to_kvec(struct smb_rqst *rqst, unsigned int idx, | ||
40 | struct kvec *iov); | ||
38 | extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *, | 41 | extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *, |
39 | unsigned int /* length */); | 42 | unsigned int /* length */); |
40 | extern unsigned int _get_xid(void); | 43 | extern unsigned int _get_xid(void); |
@@ -65,21 +68,22 @@ extern char *cifs_compose_mount_options(const char *sb_mountdata, | |||
65 | extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer, | 68 | extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer, |
66 | struct TCP_Server_Info *server); | 69 | struct TCP_Server_Info *server); |
67 | extern void DeleteMidQEntry(struct mid_q_entry *midEntry); | 70 | extern void DeleteMidQEntry(struct mid_q_entry *midEntry); |
71 | extern void cifs_delete_mid(struct mid_q_entry *mid); | ||
68 | extern void cifs_wake_up_task(struct mid_q_entry *mid); | 72 | extern void cifs_wake_up_task(struct mid_q_entry *mid); |
69 | extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, | 73 | extern int cifs_call_async(struct TCP_Server_Info *server, |
70 | unsigned int nvec, mid_receive_t *receive, | 74 | struct smb_rqst *rqst, |
71 | mid_callback_t *callback, void *cbdata, | 75 | mid_receive_t *receive, mid_callback_t *callback, |
72 | const int flags); | 76 | void *cbdata, const int flags); |
73 | extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *, | 77 | extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *, |
74 | struct smb_hdr * /* input */ , | 78 | struct smb_hdr * /* input */ , |
75 | struct smb_hdr * /* out */ , | 79 | struct smb_hdr * /* out */ , |
76 | int * /* bytes returned */ , const int); | 80 | int * /* bytes returned */ , const int); |
77 | extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses, | 81 | extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses, |
78 | char *in_buf, int flags); | 82 | char *in_buf, int flags); |
79 | extern int cifs_setup_request(struct cifs_ses *, struct kvec *, unsigned int, | 83 | extern struct mid_q_entry *cifs_setup_request(struct cifs_ses *, |
80 | struct mid_q_entry **); | 84 | struct smb_rqst *); |
81 | extern int cifs_setup_async_request(struct TCP_Server_Info *, struct kvec *, | 85 | extern struct mid_q_entry *cifs_setup_async_request(struct TCP_Server_Info *, |
82 | unsigned int, struct mid_q_entry **); | 86 | struct smb_rqst *); |
83 | extern int cifs_check_receive(struct mid_q_entry *mid, | 87 | extern int cifs_check_receive(struct mid_q_entry *mid, |
84 | struct TCP_Server_Info *server, bool log_error); | 88 | struct TCP_Server_Info *server, bool log_error); |
85 | extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *, | 89 | extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *, |
@@ -99,7 +103,7 @@ extern void cifs_update_eof(struct cifsInodeInfo *cifsi, loff_t offset, | |||
99 | unsigned int bytes_written); | 103 | unsigned int bytes_written); |
100 | extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool); | 104 | extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool); |
101 | extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool); | 105 | extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool); |
102 | extern unsigned int smbCalcSize(struct smb_hdr *ptr); | 106 | extern unsigned int smbCalcSize(void *buf); |
103 | extern int decode_negTokenInit(unsigned char *security_blob, int length, | 107 | extern int decode_negTokenInit(unsigned char *security_blob, int length, |
104 | struct TCP_Server_Info *server); | 108 | struct TCP_Server_Info *server); |
105 | extern int cifs_convert_address(struct sockaddr *dst, const char *src, int len); | 109 | extern int cifs_convert_address(struct sockaddr *dst, const char *src, int len); |
@@ -120,10 +124,14 @@ extern u64 cifs_UnixTimeToNT(struct timespec); | |||
120 | extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, | 124 | extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, |
121 | int offset); | 125 | int offset); |
122 | extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock); | 126 | extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock); |
123 | 127 | extern int cifs_unlock_range(struct cifsFileInfo *cfile, | |
124 | extern struct cifsFileInfo *cifs_new_fileinfo(__u16 fileHandle, | 128 | struct file_lock *flock, const unsigned int xid); |
125 | struct file *file, struct tcon_link *tlink, | 129 | extern int cifs_push_mandatory_locks(struct cifsFileInfo *cfile); |
126 | __u32 oplock); | 130 | |
131 | extern struct cifsFileInfo *cifs_new_fileinfo(struct cifs_fid *fid, | ||
132 | struct file *file, | ||
133 | struct tcon_link *tlink, | ||
134 | __u32 oplock); | ||
127 | extern int cifs_posix_open(char *full_path, struct inode **inode, | 135 | extern int cifs_posix_open(char *full_path, struct inode **inode, |
128 | struct super_block *sb, int mode, | 136 | struct super_block *sb, int mode, |
129 | unsigned int f_flags, __u32 *oplock, __u16 *netfid, | 137 | unsigned int f_flags, __u32 *oplock, __u16 *netfid, |
@@ -132,18 +140,23 @@ void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr); | |||
132 | extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, | 140 | extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, |
133 | FILE_UNIX_BASIC_INFO *info, | 141 | FILE_UNIX_BASIC_INFO *info, |
134 | struct cifs_sb_info *cifs_sb); | 142 | struct cifs_sb_info *cifs_sb); |
143 | extern void cifs_dir_info_to_fattr(struct cifs_fattr *, FILE_DIRECTORY_INFO *, | ||
144 | struct cifs_sb_info *); | ||
135 | extern void cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr); | 145 | extern void cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr); |
136 | extern struct inode *cifs_iget(struct super_block *sb, | 146 | extern struct inode *cifs_iget(struct super_block *sb, |
137 | struct cifs_fattr *fattr); | 147 | struct cifs_fattr *fattr); |
138 | 148 | ||
139 | extern int cifs_get_file_info(struct file *filp); | ||
140 | extern int cifs_get_inode_info(struct inode **inode, const char *full_path, | 149 | extern int cifs_get_inode_info(struct inode **inode, const char *full_path, |
141 | FILE_ALL_INFO *data, struct super_block *sb, | 150 | FILE_ALL_INFO *data, struct super_block *sb, |
142 | int xid, const __u16 *fid); | 151 | int xid, const __u16 *fid); |
143 | extern int cifs_get_file_info_unix(struct file *filp); | ||
144 | extern int cifs_get_inode_info_unix(struct inode **pinode, | 152 | extern int cifs_get_inode_info_unix(struct inode **pinode, |
145 | const unsigned char *search_path, | 153 | const unsigned char *search_path, |
146 | struct super_block *sb, unsigned int xid); | 154 | struct super_block *sb, unsigned int xid); |
155 | extern int cifs_set_file_info(struct inode *inode, struct iattr *attrs, | ||
156 | unsigned int xid, char *full_path, __u32 dosattr); | ||
157 | extern int cifs_rename_pending_delete(const char *full_path, | ||
158 | struct dentry *dentry, | ||
159 | const unsigned int xid); | ||
147 | extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, | 160 | extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, |
148 | struct cifs_fattr *fattr, struct inode *inode, | 161 | struct cifs_fattr *fattr, struct inode *inode, |
149 | const char *path, const __u16 *pfid); | 162 | const char *path, const __u16 *pfid); |
@@ -169,6 +182,17 @@ extern struct smb_vol *cifs_get_volume_info(char *mount_data, | |||
169 | extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *); | 182 | extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *); |
170 | extern void cifs_umount(struct cifs_sb_info *); | 183 | extern void cifs_umount(struct cifs_sb_info *); |
171 | extern void cifs_mark_open_files_invalid(struct cifs_tcon *tcon); | 184 | extern void cifs_mark_open_files_invalid(struct cifs_tcon *tcon); |
185 | extern bool cifs_find_lock_conflict(struct cifsFileInfo *cfile, __u64 offset, | ||
186 | __u64 length, __u8 type, | ||
187 | struct cifsLockInfo **conf_lock, | ||
188 | bool rw_check); | ||
189 | extern void cifs_add_pending_open(struct cifs_fid *fid, | ||
190 | struct tcon_link *tlink, | ||
191 | struct cifs_pending_open *open); | ||
192 | extern void cifs_add_pending_open_locked(struct cifs_fid *fid, | ||
193 | struct tcon_link *tlink, | ||
194 | struct cifs_pending_open *open); | ||
195 | extern void cifs_del_pending_open(struct cifs_pending_open *open); | ||
172 | 196 | ||
173 | #if IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) | 197 | #if IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) |
174 | extern void cifs_dfs_release_automount_timer(void); | 198 | extern void cifs_dfs_release_automount_timer(void); |
@@ -179,6 +203,10 @@ extern void cifs_dfs_release_automount_timer(void); | |||
179 | void cifs_proc_init(void); | 203 | void cifs_proc_init(void); |
180 | void cifs_proc_clean(void); | 204 | void cifs_proc_clean(void); |
181 | 205 | ||
206 | extern void cifs_move_llist(struct list_head *source, struct list_head *dest); | ||
207 | extern void cifs_free_llist(struct list_head *llist); | ||
208 | extern void cifs_del_lock_waiters(struct cifsLockInfo *lock); | ||
209 | |||
182 | extern int cifs_negotiate_protocol(const unsigned int xid, | 210 | extern int cifs_negotiate_protocol(const unsigned int xid, |
183 | struct cifs_ses *ses); | 211 | struct cifs_ses *ses); |
184 | extern int cifs_setup_session(const unsigned int xid, struct cifs_ses *ses, | 212 | extern int cifs_setup_session(const unsigned int xid, struct cifs_ses *ses, |
@@ -190,10 +218,10 @@ extern int CIFSTCon(const unsigned int xid, struct cifs_ses *ses, | |||
190 | const struct nls_table *); | 218 | const struct nls_table *); |
191 | 219 | ||
192 | extern int CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon, | 220 | extern int CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon, |
193 | const char *searchName, const struct nls_table *nls_codepage, | 221 | const char *searchName, struct cifs_sb_info *cifs_sb, |
194 | __u16 *searchHandle, __u16 search_flags, | 222 | __u16 *searchHandle, __u16 search_flags, |
195 | struct cifs_search_info *psrch_inf, | 223 | struct cifs_search_info *psrch_inf, |
196 | int map, const char dirsep); | 224 | bool msearch); |
197 | 225 | ||
198 | extern int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon, | 226 | extern int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon, |
199 | __u16 searchHandle, __u16 search_flags, | 227 | __u16 searchHandle, __u16 search_flags, |
@@ -265,13 +293,11 @@ extern int CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon, | |||
265 | const struct nls_table *nls_codepage); | 293 | const struct nls_table *nls_codepage); |
266 | #endif /* possibly unneeded function */ | 294 | #endif /* possibly unneeded function */ |
267 | extern int CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon, | 295 | extern int CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon, |
268 | const char *fileName, __u64 size, | 296 | const char *file_name, __u64 size, |
269 | bool setAllocationSizeFlag, | 297 | struct cifs_sb_info *cifs_sb, bool set_allocation); |
270 | const struct nls_table *nls_codepage, | ||
271 | int remap_special_chars); | ||
272 | extern int CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon, | 298 | extern int CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon, |
273 | __u64 size, __u16 fileHandle, __u32 opener_pid, | 299 | struct cifsFileInfo *cfile, __u64 size, |
274 | bool AllocSizeFlag); | 300 | bool set_allocation); |
275 | 301 | ||
276 | struct cifs_unix_set_info_args { | 302 | struct cifs_unix_set_info_args { |
277 | __u64 ctime; | 303 | __u64 ctime; |
@@ -303,22 +329,17 @@ extern int CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon, | |||
303 | const struct nls_table *nls_codepage, | 329 | const struct nls_table *nls_codepage, |
304 | int remap_special_chars); | 330 | int remap_special_chars); |
305 | extern int CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon, | 331 | extern int CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon, |
306 | const char *name, | 332 | const char *name, struct cifs_sb_info *cifs_sb); |
307 | const struct nls_table *nls_codepage, | ||
308 | int remap_special_chars); | ||
309 | extern int CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon, | 333 | extern int CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon, |
310 | const char *fromName, const char *toName, | 334 | const char *from_name, const char *to_name, |
311 | const struct nls_table *nls_codepage, | 335 | struct cifs_sb_info *cifs_sb); |
312 | int remap_special_chars); | ||
313 | extern int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *tcon, | 336 | extern int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *tcon, |
314 | int netfid, const char *target_name, | 337 | int netfid, const char *target_name, |
315 | const struct nls_table *nls_codepage, | 338 | const struct nls_table *nls_codepage, |
316 | int remap_special_chars); | 339 | int remap_special_chars); |
317 | extern int CIFSCreateHardLink(const unsigned int xid, | 340 | extern int CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon, |
318 | struct cifs_tcon *tcon, | 341 | const char *from_name, const char *to_name, |
319 | const char *fromName, const char *toName, | 342 | struct cifs_sb_info *cifs_sb); |
320 | const struct nls_table *nls_codepage, | ||
321 | int remap_special_chars); | ||
322 | extern int CIFSUnixCreateHardLink(const unsigned int xid, | 343 | extern int CIFSUnixCreateHardLink(const unsigned int xid, |
323 | struct cifs_tcon *tcon, | 344 | struct cifs_tcon *tcon, |
324 | const char *fromName, const char *toName, | 345 | const char *fromName, const char *toName, |
@@ -367,8 +388,7 @@ extern int CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms, | |||
367 | unsigned int *nbytes, const char *buf, | 388 | unsigned int *nbytes, const char *buf, |
368 | const char __user *ubuf, const int long_op); | 389 | const char __user *ubuf, const int long_op); |
369 | extern int CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms, | 390 | extern int CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms, |
370 | unsigned int *nbytes, struct kvec *iov, const int nvec, | 391 | unsigned int *nbytes, struct kvec *iov, const int nvec); |
371 | const int long_op); | ||
372 | extern int CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon, | 392 | extern int CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon, |
373 | const char *search_name, __u64 *inode_number, | 393 | const char *search_name, __u64 *inode_number, |
374 | const struct nls_table *nls_codepage, | 394 | const struct nls_table *nls_codepage, |
@@ -397,10 +417,12 @@ extern void sesInfoFree(struct cifs_ses *); | |||
397 | extern struct cifs_tcon *tconInfoAlloc(void); | 417 | extern struct cifs_tcon *tconInfoAlloc(void); |
398 | extern void tconInfoFree(struct cifs_tcon *); | 418 | extern void tconInfoFree(struct cifs_tcon *); |
399 | 419 | ||
400 | extern int cifs_sign_smb(struct smb_hdr *, struct TCP_Server_Info *, __u32 *); | 420 | extern int cifs_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server, |
421 | __u32 *pexpected_response_sequence_number); | ||
401 | extern int cifs_sign_smbv(struct kvec *iov, int n_vec, struct TCP_Server_Info *, | 422 | extern int cifs_sign_smbv(struct kvec *iov, int n_vec, struct TCP_Server_Info *, |
402 | __u32 *); | 423 | __u32 *); |
403 | extern int cifs_verify_signature(struct kvec *iov, unsigned int nr_iov, | 424 | extern int cifs_sign_smb(struct smb_hdr *, struct TCP_Server_Info *, __u32 *); |
425 | extern int cifs_verify_signature(struct smb_rqst *rqst, | ||
404 | struct TCP_Server_Info *server, | 426 | struct TCP_Server_Info *server, |
405 | __u32 expected_sequence_number); | 427 | __u32 expected_sequence_number); |
406 | extern int SMBNTencrypt(unsigned char *, unsigned char *, unsigned char *, | 428 | extern int SMBNTencrypt(unsigned char *, unsigned char *, unsigned char *, |
@@ -462,45 +484,9 @@ extern int E_md4hash(const unsigned char *passwd, unsigned char *p16, | |||
462 | extern int SMBencrypt(unsigned char *passwd, const unsigned char *c8, | 484 | extern int SMBencrypt(unsigned char *passwd, const unsigned char *c8, |
463 | unsigned char *p24); | 485 | unsigned char *p24); |
464 | 486 | ||
465 | /* asynchronous read support */ | ||
466 | struct cifs_readdata { | ||
467 | struct kref refcount; | ||
468 | struct list_head list; | ||
469 | struct completion done; | ||
470 | struct cifsFileInfo *cfile; | ||
471 | struct address_space *mapping; | ||
472 | __u64 offset; | ||
473 | unsigned int bytes; | ||
474 | pid_t pid; | ||
475 | int result; | ||
476 | struct list_head pages; | ||
477 | struct work_struct work; | ||
478 | int (*marshal_iov) (struct cifs_readdata *rdata, | ||
479 | unsigned int remaining); | ||
480 | unsigned int nr_iov; | ||
481 | struct kvec iov[1]; | ||
482 | }; | ||
483 | |||
484 | void cifs_readdata_release(struct kref *refcount); | 487 | void cifs_readdata_release(struct kref *refcount); |
485 | int cifs_async_readv(struct cifs_readdata *rdata); | 488 | int cifs_async_readv(struct cifs_readdata *rdata); |
486 | 489 | int cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid); | |
487 | /* asynchronous write support */ | ||
488 | struct cifs_writedata { | ||
489 | struct kref refcount; | ||
490 | struct list_head list; | ||
491 | struct completion done; | ||
492 | enum writeback_sync_modes sync_mode; | ||
493 | struct work_struct work; | ||
494 | struct cifsFileInfo *cfile; | ||
495 | __u64 offset; | ||
496 | pid_t pid; | ||
497 | unsigned int bytes; | ||
498 | int result; | ||
499 | void (*marshal_iov) (struct kvec *iov, | ||
500 | struct cifs_writedata *wdata); | ||
501 | unsigned int nr_pages; | ||
502 | struct page *pages[1]; | ||
503 | }; | ||
504 | 490 | ||
505 | int cifs_async_writev(struct cifs_writedata *wdata); | 491 | int cifs_async_writev(struct cifs_writedata *wdata); |
506 | void cifs_writev_complete(struct work_struct *work); | 492 | void cifs_writev_complete(struct work_struct *work); |