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.h73
1 files changed, 39 insertions, 34 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 7136c0c3e2f9..5bfb75346cb0 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -161,35 +161,24 @@ struct TCP_Server_Info {
161 int srv_count; /* reference counter */ 161 int srv_count; /* reference counter */
162 /* 15 character server name + 0x20 16th byte indicating type = srv */ 162 /* 15 character server name + 0x20 16th byte indicating type = srv */
163 char server_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL]; 163 char server_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL];
164 enum statusEnum tcpStatus; /* what we think the status is */
164 char *hostname; /* hostname portion of UNC string */ 165 char *hostname; /* hostname portion of UNC string */
165 struct socket *ssocket; 166 struct socket *ssocket;
166 union { 167 struct sockaddr_storage dstaddr;
167 struct sockaddr_in sockAddr;
168 struct sockaddr_in6 sockAddr6;
169 } addr;
170 struct sockaddr_storage srcaddr; /* locally bind to this IP */ 168 struct sockaddr_storage srcaddr; /* locally bind to this IP */
171 wait_queue_head_t response_q; 169 wait_queue_head_t response_q;
172 wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/ 170 wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/
173 struct list_head pending_mid_q; 171 struct list_head pending_mid_q;
174 void *Server_NlsInfo; /* BB - placeholder for future NLS info */
175 unsigned short server_codepage; /* codepage for the server */
176 enum protocolEnum protocolType;
177 char versionMajor;
178 char versionMinor;
179 bool svlocal:1; /* local server or remote */
180 bool noblocksnd; /* use blocking sendmsg */ 172 bool noblocksnd; /* use blocking sendmsg */
181 bool noautotune; /* do not autotune send buf sizes */ 173 bool noautotune; /* do not autotune send buf sizes */
182 bool tcp_nodelay; 174 bool tcp_nodelay;
183 atomic_t inFlight; /* number of requests on the wire to server */ 175 atomic_t inFlight; /* number of requests on the wire to server */
184#ifdef CONFIG_CIFS_STATS2
185 atomic_t inSend; /* requests trying to send */
186 atomic_t num_waiters; /* blocked waiting to get in sendrecv */
187#endif
188 enum statusEnum tcpStatus; /* what we think the status is */
189 struct mutex srv_mutex; 176 struct mutex srv_mutex;
190 struct task_struct *tsk; 177 struct task_struct *tsk;
191 char server_GUID[16]; 178 char server_GUID[16];
192 char secMode; 179 char secMode;
180 bool session_estab; /* mark when very first sess is established */
181 u16 dialect; /* dialect index that server chose */
193 enum securityEnum secType; 182 enum securityEnum secType;
194 unsigned int maxReq; /* Clients should submit no more */ 183 unsigned int maxReq; /* Clients should submit no more */
195 /* than maxReq distinct unanswered SMBs to the server when using */ 184 /* than maxReq distinct unanswered SMBs to the server when using */
@@ -202,28 +191,29 @@ struct TCP_Server_Info {
202 unsigned int max_vcs; /* maximum number of smb sessions, at least 191 unsigned int max_vcs; /* maximum number of smb sessions, at least
203 those that can be specified uniquely with 192 those that can be specified uniquely with
204 vcnumbers */ 193 vcnumbers */
205 char sessid[4]; /* unique token id for this session */
206 /* (returned on Negotiate */
207 int capabilities; /* allow selective disabling of caps by smb sess */ 194 int capabilities; /* allow selective disabling of caps by smb sess */
208 int timeAdj; /* Adjust for difference in server time zone in sec */ 195 int timeAdj; /* Adjust for difference in server time zone in sec */
209 __u16 CurrentMid; /* multiplex id - rotating counter */ 196 __u16 CurrentMid; /* multiplex id - rotating counter */
210 char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */ 197 char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */
211 /* 16th byte of RFC1001 workstation name is always null */ 198 /* 16th byte of RFC1001 workstation name is always null */
212 char workstation_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL]; 199 char workstation_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL];
213 __u32 sequence_number; /* needed for CIFS PDU signature */ 200 __u32 sequence_number; /* for signing, protected by srv_mutex */
214 struct session_key session_key; 201 struct session_key session_key;
215 unsigned long lstrp; /* when we got last response from this server */ 202 unsigned long lstrp; /* when we got last response from this server */
216 u16 dialect; /* dialect index that server chose */
217 struct cifs_secmech secmech; /* crypto sec mech functs, descriptors */ 203 struct cifs_secmech secmech; /* crypto sec mech functs, descriptors */
218 /* extended security flavors that server supports */ 204 /* extended security flavors that server supports */
205 bool sec_ntlmssp; /* supports NTLMSSP */
206 bool sec_kerberosu2u; /* supports U2U Kerberos */
219 bool sec_kerberos; /* supports plain Kerberos */ 207 bool sec_kerberos; /* supports plain Kerberos */
220 bool sec_mskerberos; /* supports legacy MS Kerberos */ 208 bool sec_mskerberos; /* supports legacy MS Kerberos */
221 bool sec_kerberosu2u; /* supports U2U Kerberos */ 209 struct delayed_work echo; /* echo ping workqueue job */
222 bool sec_ntlmssp; /* supports NTLMSSP */
223 bool session_estab; /* mark when very first sess is established */
224#ifdef CONFIG_CIFS_FSCACHE 210#ifdef CONFIG_CIFS_FSCACHE
225 struct fscache_cookie *fscache; /* client index cache cookie */ 211 struct fscache_cookie *fscache; /* client index cache cookie */
226#endif 212#endif
213#ifdef CONFIG_CIFS_STATS2
214 atomic_t inSend; /* requests trying to send */
215 atomic_t num_waiters; /* blocked waiting to get in sendrecv */
216#endif
227}; 217};
228 218
229/* 219/*
@@ -449,13 +439,14 @@ struct cifsInodeInfo {
449 /* BB add in lists for dirty pages i.e. write caching info for oplock */ 439 /* BB add in lists for dirty pages i.e. write caching info for oplock */
450 struct list_head openFileList; 440 struct list_head openFileList;
451 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */ 441 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */
452 unsigned long time; /* jiffies of last update/check of inode */ 442 bool clientCanCacheRead; /* read oplock */
453 bool clientCanCacheRead:1; /* read oplock */ 443 bool clientCanCacheAll; /* read and writebehind oplock */
454 bool clientCanCacheAll:1; /* read and writebehind oplock */ 444 bool delete_pending; /* DELETE_ON_CLOSE is set */
455 bool delete_pending:1; /* DELETE_ON_CLOSE is set */ 445 bool invalid_mapping; /* pagecache is invalid */
456 bool invalid_mapping:1; /* pagecache is invalid */ 446 unsigned long time; /* jiffies of last update of inode */
457 u64 server_eof; /* current file size on server */ 447 u64 server_eof; /* current file size on server */
458 u64 uniqueid; /* server inode number */ 448 u64 uniqueid; /* server inode number */
449 u64 createtime; /* creation time on server */
459#ifdef CONFIG_CIFS_FSCACHE 450#ifdef CONFIG_CIFS_FSCACHE
460 struct fscache_cookie *fscache; 451 struct fscache_cookie *fscache;
461#endif 452#endif
@@ -510,6 +501,18 @@ static inline void cifs_stats_bytes_read(struct cifsTconInfo *tcon,
510 501
511#endif 502#endif
512 503
504struct mid_q_entry;
505
506/*
507 * This is the prototype for the mid callback function. When creating one,
508 * take special care to avoid deadlocks. Things to bear in mind:
509 *
510 * - it will be called by cifsd
511 * - the GlobalMid_Lock will be held
512 * - the mid will be removed from the pending_mid_q list
513 */
514typedef void (mid_callback_t)(struct mid_q_entry *mid);
515
513/* one of these for every pending CIFS request to the server */ 516/* one of these for every pending CIFS request to the server */
514struct mid_q_entry { 517struct mid_q_entry {
515 struct list_head qhead; /* mids waiting on reply from this server */ 518 struct list_head qhead; /* mids waiting on reply from this server */
@@ -521,7 +524,8 @@ struct mid_q_entry {
521 unsigned long when_sent; /* time when smb send finished */ 524 unsigned long when_sent; /* time when smb send finished */
522 unsigned long when_received; /* when demux complete (taken off wire) */ 525 unsigned long when_received; /* when demux complete (taken off wire) */
523#endif 526#endif
524 struct task_struct *tsk; /* task waiting for response */ 527 mid_callback_t *callback; /* call completion callback */
528 void *callback_data; /* general purpose pointer for callback */
525 struct smb_hdr *resp_buf; /* response buffer */ 529 struct smb_hdr *resp_buf; /* response buffer */
526 int midState; /* wish this were enum but can not pass to wait_event */ 530 int midState; /* wish this were enum but can not pass to wait_event */
527 __u8 command; /* smb command code */ 531 __u8 command; /* smb command code */
@@ -576,6 +580,7 @@ struct cifs_fattr {
576 u64 cf_uniqueid; 580 u64 cf_uniqueid;
577 u64 cf_eof; 581 u64 cf_eof;
578 u64 cf_bytes; 582 u64 cf_bytes;
583 u64 cf_createtime;
579 uid_t cf_uid; 584 uid_t cf_uid;
580 gid_t cf_gid; 585 gid_t cf_gid;
581 umode_t cf_mode; 586 umode_t cf_mode;
@@ -623,12 +628,9 @@ static inline void free_dfs_info_array(struct dfs_info3_param *param,
623#define CIFS_IOVEC 4 /* array of response buffers */ 628#define CIFS_IOVEC 4 /* array of response buffers */
624 629
625/* Type of Request to SendReceive2 */ 630/* Type of Request to SendReceive2 */
626#define CIFS_STD_OP 0 /* normal request timeout */ 631#define CIFS_BLOCKING_OP 1 /* operation can block */
627#define CIFS_LONG_OP 1 /* long op (up to 45 sec, oplock time) */ 632#define CIFS_ASYNC_OP 2 /* do not wait for response */
628#define CIFS_VLONG_OP 2 /* sloow op - can take up to 180 seconds */ 633#define CIFS_TIMEOUT_MASK 0x003 /* only one of above set in req */
629#define CIFS_BLOCKING_OP 4 /* operation can block */
630#define CIFS_ASYNC_OP 8 /* do not wait for response */
631#define CIFS_TIMEOUT_MASK 0x00F /* only one of 5 above set in req */
632#define CIFS_LOG_ERROR 0x010 /* log NT STATUS if non-zero */ 634#define CIFS_LOG_ERROR 0x010 /* log NT STATUS if non-zero */
633#define CIFS_LARGE_BUF_OP 0x020 /* large request buffer */ 635#define CIFS_LARGE_BUF_OP 0x020 /* large request buffer */
634#define CIFS_NO_RESP 0x040 /* no response buffer required */ 636#define CIFS_NO_RESP 0x040 /* no response buffer required */
@@ -791,6 +793,9 @@ GLOBAL_EXTERN unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */
791GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */ 793GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */
792GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/ 794GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/
793 795
796/* reconnect after this many failed echo attempts */
797GLOBAL_EXTERN unsigned short echo_retries;
798
794void cifs_oplock_break(struct work_struct *work); 799void cifs_oplock_break(struct work_struct *work);
795void cifs_oplock_break_get(struct cifsFileInfo *cfile); 800void cifs_oplock_break_get(struct cifsFileInfo *cfile);
796void cifs_oplock_break_put(struct cifsFileInfo *cfile); 801void cifs_oplock_break_put(struct cifsFileInfo *cfile);