aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h39
1 files changed, 30 insertions, 9 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 339ebe3ebc0d..4ff6313f0a91 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -230,6 +230,12 @@ struct cifs_mnt_data {
230 int flags; 230 int flags;
231}; 231};
232 232
233static inline unsigned int
234get_rfc1002_length(void *buf)
235{
236 return be32_to_cpu(*((__be32 *)buf));
237}
238
233struct TCP_Server_Info { 239struct TCP_Server_Info {
234 struct list_head tcp_ses_list; 240 struct list_head tcp_ses_list;
235 struct list_head smb_ses_list; 241 struct list_head smb_ses_list;
@@ -276,7 +282,7 @@ struct TCP_Server_Info {
276 vcnumbers */ 282 vcnumbers */
277 int capabilities; /* allow selective disabling of caps by smb sess */ 283 int capabilities; /* allow selective disabling of caps by smb sess */
278 int timeAdj; /* Adjust for difference in server time zone in sec */ 284 int timeAdj; /* Adjust for difference in server time zone in sec */
279 __u16 CurrentMid; /* multiplex id - rotating counter */ 285 __u64 CurrentMid; /* multiplex id - rotating counter */
280 char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */ 286 char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */
281 /* 16th byte of RFC1001 workstation name is always null */ 287 /* 16th byte of RFC1001 workstation name is always null */
282 char workstation_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL]; 288 char workstation_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL];
@@ -335,6 +341,18 @@ has_credits(struct TCP_Server_Info *server, int *credits)
335 return num > 0; 341 return num > 0;
336} 342}
337 343
344static inline size_t
345header_size(void)
346{
347 return sizeof(struct smb_hdr);
348}
349
350static inline size_t
351max_header_size(void)
352{
353 return MAX_CIFS_HDR_SIZE;
354}
355
338/* 356/*
339 * Macros to allow the TCP_Server_Info->net field and related code to drop out 357 * Macros to allow the TCP_Server_Info->net field and related code to drop out
340 * when CONFIG_NET_NS isn't set. 358 * when CONFIG_NET_NS isn't set.
@@ -583,9 +601,11 @@ struct cifs_io_parms {
583 * Take a reference on the file private data. Must be called with 601 * Take a reference on the file private data. Must be called with
584 * cifs_file_list_lock held. 602 * cifs_file_list_lock held.
585 */ 603 */
586static inline void cifsFileInfo_get(struct cifsFileInfo *cifs_file) 604static inline
605struct cifsFileInfo *cifsFileInfo_get(struct cifsFileInfo *cifs_file)
587{ 606{
588 ++cifs_file->count; 607 ++cifs_file->count;
608 return cifs_file;
589} 609}
590 610
591void cifsFileInfo_put(struct cifsFileInfo *cifs_file); 611void cifsFileInfo_put(struct cifsFileInfo *cifs_file);
@@ -606,7 +626,7 @@ struct cifsInodeInfo {
606 bool delete_pending; /* DELETE_ON_CLOSE is set */ 626 bool delete_pending; /* DELETE_ON_CLOSE is set */
607 bool invalid_mapping; /* pagecache is invalid */ 627 bool invalid_mapping; /* pagecache is invalid */
608 unsigned long time; /* jiffies of last update of inode */ 628 unsigned long time; /* jiffies of last update of inode */
609 u64 server_eof; /* current file size on server */ 629 u64 server_eof; /* current file size on server -- protected by i_lock */
610 u64 uniqueid; /* server inode number */ 630 u64 uniqueid; /* server inode number */
611 u64 createtime; /* creation time on server */ 631 u64 createtime; /* creation time on server */
612#ifdef CONFIG_CIFS_FSCACHE 632#ifdef CONFIG_CIFS_FSCACHE
@@ -713,8 +733,8 @@ typedef void (mid_callback_t)(struct mid_q_entry *mid);
713/* one of these for every pending CIFS request to the server */ 733/* one of these for every pending CIFS request to the server */
714struct mid_q_entry { 734struct mid_q_entry {
715 struct list_head qhead; /* mids waiting on reply from this server */ 735 struct list_head qhead; /* mids waiting on reply from this server */
716 __u16 mid; /* multiplex id */ 736 __u64 mid; /* multiplex id */
717 __u16 pid; /* process id */ 737 __u32 pid; /* process id */
718 __u32 sequence_number; /* for CIFS signing */ 738 __u32 sequence_number; /* for CIFS signing */
719 unsigned long when_alloc; /* when mid was created */ 739 unsigned long when_alloc; /* when mid was created */
720#ifdef CONFIG_CIFS_STATS2 740#ifdef CONFIG_CIFS_STATS2
@@ -724,10 +744,10 @@ struct mid_q_entry {
724 mid_receive_t *receive; /* call receive callback */ 744 mid_receive_t *receive; /* call receive callback */
725 mid_callback_t *callback; /* call completion callback */ 745 mid_callback_t *callback; /* call completion callback */
726 void *callback_data; /* general purpose pointer for callback */ 746 void *callback_data; /* general purpose pointer for callback */
727 struct smb_hdr *resp_buf; /* pointer to received SMB header */ 747 void *resp_buf; /* pointer to received SMB header */
728 int midState; /* wish this were enum but can not pass to wait_event */ 748 int mid_state; /* wish this were enum but can not pass to wait_event */
729 __u8 command; /* smb command code */ 749 __le16 command; /* smb command code */
730 bool largeBuf:1; /* if valid response, is pointer to large buf */ 750 bool large_buf:1; /* if valid response, is pointer to large buf */
731 bool multiRsp:1; /* multiple trans2 responses for one request */ 751 bool multiRsp:1; /* multiple trans2 responses for one request */
732 bool multiEnd:1; /* both received */ 752 bool multiEnd:1; /* both received */
733}; 753};
@@ -1052,5 +1072,6 @@ GLOBAL_EXTERN spinlock_t gidsidlock;
1052void cifs_oplock_break(struct work_struct *work); 1072void cifs_oplock_break(struct work_struct *work);
1053 1073
1054extern const struct slow_work_ops cifs_oplock_break_ops; 1074extern const struct slow_work_ops cifs_oplock_break_ops;
1075extern struct workqueue_struct *cifsiod_wq;
1055 1076
1056#endif /* _CIFS_GLOB_H */ 1077#endif /* _CIFS_GLOB_H */