aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsproto.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifsproto.h')
-rw-r--r--fs/cifs/cifsproto.h56
1 files changed, 44 insertions, 12 deletions
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 8df28e925e5b..6f4e243e0f62 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -69,8 +69,9 @@ extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer,
69 struct TCP_Server_Info *server); 69 struct TCP_Server_Info *server);
70extern void DeleteMidQEntry(struct mid_q_entry *midEntry); 70extern void DeleteMidQEntry(struct mid_q_entry *midEntry);
71extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, 71extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
72 unsigned int nvec, mid_callback_t *callback, 72 unsigned int nvec, mid_receive_t *receive,
73 void *cbdata, bool ignore_pend); 73 mid_callback_t *callback, void *cbdata,
74 bool ignore_pend);
74extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *, 75extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *,
75 struct smb_hdr * /* input */ , 76 struct smb_hdr * /* input */ ,
76 struct smb_hdr * /* out */ , 77 struct smb_hdr * /* out */ ,
@@ -90,6 +91,7 @@ extern int SendReceiveBlockingLock(const unsigned int xid,
90extern int checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length); 91extern int checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length);
91extern bool is_valid_oplock_break(struct smb_hdr *smb, 92extern bool is_valid_oplock_break(struct smb_hdr *smb,
92 struct TCP_Server_Info *); 93 struct TCP_Server_Info *);
94extern bool backup_cred(struct cifs_sb_info *);
93extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof); 95extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
94extern void cifs_update_eof(struct cifsInodeInfo *cifsi, loff_t offset, 96extern void cifs_update_eof(struct cifsInodeInfo *cifsi, loff_t offset,
95 unsigned int bytes_written); 97 unsigned int bytes_written);
@@ -145,12 +147,19 @@ extern int cifs_get_inode_info_unix(struct inode **pinode,
145extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, 147extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb,
146 struct cifs_fattr *fattr, struct inode *inode, 148 struct cifs_fattr *fattr, struct inode *inode,
147 const char *path, const __u16 *pfid); 149 const char *path, const __u16 *pfid);
148extern int mode_to_cifs_acl(struct inode *inode, const char *path, __u64); 150extern int id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64,
151 uid_t, gid_t);
149extern struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *, struct inode *, 152extern struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *, struct inode *,
150 const char *, u32 *); 153 const char *, u32 *);
151extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *, 154extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *,
152 const char *); 155 const char *, int);
153 156
157extern void dequeue_mid(struct mid_q_entry *mid, bool malformed);
158extern int cifs_read_from_socket(struct TCP_Server_Info *server, char *buf,
159 unsigned int to_read);
160extern int cifs_readv_from_socket(struct TCP_Server_Info *server,
161 struct kvec *iov_orig, unsigned int nr_segs,
162 unsigned int to_read);
154extern void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, 163extern void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
155 struct cifs_sb_info *cifs_sb); 164 struct cifs_sb_info *cifs_sb);
156extern int cifs_match_super(struct super_block *, void *); 165extern int cifs_match_super(struct super_block *, void *);
@@ -359,14 +368,17 @@ extern int CIFSGetSrvInodeNumber(const int xid, struct cifs_tcon *tcon,
359 const struct nls_table *nls_codepage, 368 const struct nls_table *nls_codepage,
360 int remap_special_chars); 369 int remap_special_chars);
361 370
371extern int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid,
372 const __u8 lock_type, const __u32 num_unlock,
373 const __u32 num_lock, LOCKING_ANDX_RANGE *buf);
362extern int CIFSSMBLock(const int xid, struct cifs_tcon *tcon, 374extern int CIFSSMBLock(const int xid, struct cifs_tcon *tcon,
363 const __u16 netfid, const __u64 len, 375 const __u16 netfid, const __u32 netpid, const __u64 len,
364 const __u64 offset, const __u32 numUnlock, 376 const __u64 offset, const __u32 numUnlock,
365 const __u32 numLock, const __u8 lockType, 377 const __u32 numLock, const __u8 lockType,
366 const bool waitFlag, const __u8 oplock_level); 378 const bool waitFlag, const __u8 oplock_level);
367extern int CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon, 379extern int CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon,
368 const __u16 smb_file_id, const int get_flag, 380 const __u16 smb_file_id, const __u32 netpid,
369 const __u64 len, struct file_lock *, 381 const int get_flag, const __u64 len, struct file_lock *,
370 const __u16 lock_type, const bool waitFlag); 382 const __u16 lock_type, const bool waitFlag);
371extern int CIFSSMBTDis(const int xid, struct cifs_tcon *tcon); 383extern int CIFSSMBTDis(const int xid, struct cifs_tcon *tcon);
372extern int CIFSSMBEcho(struct TCP_Server_Info *server); 384extern int CIFSSMBEcho(struct TCP_Server_Info *server);
@@ -380,11 +392,12 @@ extern void tconInfoFree(struct cifs_tcon *);
380extern int cifs_sign_smb(struct smb_hdr *, struct TCP_Server_Info *, __u32 *); 392extern int cifs_sign_smb(struct smb_hdr *, struct TCP_Server_Info *, __u32 *);
381extern int cifs_sign_smb2(struct kvec *iov, int n_vec, struct TCP_Server_Info *, 393extern int cifs_sign_smb2(struct kvec *iov, int n_vec, struct TCP_Server_Info *,
382 __u32 *); 394 __u32 *);
383extern int cifs_verify_signature(struct smb_hdr *, 395extern int cifs_verify_signature(struct kvec *iov, unsigned int nr_iov,
384 struct TCP_Server_Info *server, 396 struct TCP_Server_Info *server,
385 __u32 expected_sequence_number); 397 __u32 expected_sequence_number);
386extern int SMBNTencrypt(unsigned char *, unsigned char *, unsigned char *); 398extern int SMBNTencrypt(unsigned char *, unsigned char *, unsigned char *,
387extern int setup_ntlm_response(struct cifs_ses *); 399 const struct nls_table *);
400extern int setup_ntlm_response(struct cifs_ses *, const struct nls_table *);
388extern int setup_ntlmv2_rsp(struct cifs_ses *, const struct nls_table *); 401extern int setup_ntlmv2_rsp(struct cifs_ses *, const struct nls_table *);
389extern int cifs_crypto_shash_allocate(struct TCP_Server_Info *); 402extern int cifs_crypto_shash_allocate(struct TCP_Server_Info *);
390extern void cifs_crypto_shash_release(struct TCP_Server_Info *); 403extern void cifs_crypto_shash_release(struct TCP_Server_Info *);
@@ -419,7 +432,7 @@ extern int CIFSSMBSetEA(const int xid, struct cifs_tcon *tcon,
419extern int CIFSSMBGetCIFSACL(const int xid, struct cifs_tcon *tcon, 432extern int CIFSSMBGetCIFSACL(const int xid, struct cifs_tcon *tcon,
420 __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen); 433 __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen);
421extern int CIFSSMBSetCIFSACL(const int, struct cifs_tcon *, __u16, 434extern int CIFSSMBSetCIFSACL(const int, struct cifs_tcon *, __u16,
422 struct cifs_ntsd *, __u32); 435 struct cifs_ntsd *, __u32, int);
423extern int CIFSSMBGetPosixACL(const int xid, struct cifs_tcon *tcon, 436extern int CIFSSMBGetPosixACL(const int xid, struct cifs_tcon *tcon,
424 const unsigned char *searchName, 437 const unsigned char *searchName,
425 char *acl_inf, const int buflen, const int acl_type, 438 char *acl_inf, const int buflen, const int acl_type,
@@ -436,10 +449,29 @@ extern int CIFSCheckMFSymlink(struct cifs_fattr *fattr,
436 const unsigned char *path, 449 const unsigned char *path,
437 struct cifs_sb_info *cifs_sb, int xid); 450 struct cifs_sb_info *cifs_sb, int xid);
438extern int mdfour(unsigned char *, unsigned char *, int); 451extern int mdfour(unsigned char *, unsigned char *, int);
439extern int E_md4hash(const unsigned char *passwd, unsigned char *p16); 452extern int E_md4hash(const unsigned char *passwd, unsigned char *p16,
453 const struct nls_table *codepage);
440extern int SMBencrypt(unsigned char *passwd, const unsigned char *c8, 454extern int SMBencrypt(unsigned char *passwd, const unsigned char *c8,
441 unsigned char *p24); 455 unsigned char *p24);
442 456
457/* asynchronous read support */
458struct cifs_readdata {
459 struct cifsFileInfo *cfile;
460 struct address_space *mapping;
461 __u64 offset;
462 unsigned int bytes;
463 pid_t pid;
464 int result;
465 struct list_head pages;
466 struct work_struct work;
467 unsigned int nr_iov;
468 struct kvec iov[1];
469};
470
471struct cifs_readdata *cifs_readdata_alloc(unsigned int nr_pages);
472void cifs_readdata_free(struct cifs_readdata *rdata);
473int cifs_async_readv(struct cifs_readdata *rdata);
474
443/* asynchronous write support */ 475/* asynchronous write support */
444struct cifs_writedata { 476struct cifs_writedata {
445 struct kref refcount; 477 struct kref refcount;