cifsglob.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. /*
  2. * fs/cifs/cifsglob.h
  3. *
  4. * Copyright (C) International Business Machines Corp., 2002,2006
  5. * Author(s): Steve French (sfrench@us.ibm.com)
  6. * Jeremy Allison (jra@samba.org)
  7. *
  8. * This library is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published
  10. * by the Free Software Foundation; either version 2.1 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  16. * the GNU Lesser General Public License for more details.
  17. *
  18. */
  19. #include <linux/in.h>
  20. #include <linux/in6.h>
  21. #include "cifs_fs_sb.h"
  22. /*
  23. * The sizes of various internal tables and strings
  24. */
  25. #define MAX_UID_INFO 16
  26. #define MAX_SES_INFO 2
  27. #define MAX_TCON_INFO 4
  28. #define MAX_TREE_SIZE 2 + MAX_SERVER_SIZE + 1 + MAX_SHARE_SIZE + 1
  29. #define MAX_SERVER_SIZE 15
  30. #define MAX_SHARE_SIZE 64 /* used to be 20 - this should still be enough */
  31. #define MAX_USERNAME_SIZE 32 /* 32 is to allow for 15 char names + null
  32. termination then *2 for unicode versions */
  33. #define MAX_PASSWORD_SIZE 16
  34. #define CIFS_MIN_RCV_POOL 4
  35. /*
  36. * MAX_REQ is the maximum number of requests that WE will send
  37. * on one socket concurently. It also matches the most common
  38. * value of max multiplex returned by servers. We may
  39. * eventually want to use the negotiated value (in case
  40. * future servers can handle more) when we are more confident that
  41. * we will not have problems oveloading the socket with pending
  42. * write data.
  43. */
  44. #define CIFS_MAX_REQ 50
  45. #define SERVER_NAME_LENGTH 15
  46. #define SERVER_NAME_LEN_WITH_NULL (SERVER_NAME_LENGTH + 1)
  47. /* used to define string lengths for reversing unicode strings */
  48. /* (256+1)*2 = 514 */
  49. /* (max path length + 1 for null) * 2 for unicode */
  50. #define MAX_NAME 514
  51. #include "cifspdu.h"
  52. #ifndef FALSE
  53. #define FALSE 0
  54. #endif
  55. #ifndef TRUE
  56. #define TRUE 1
  57. #endif
  58. #ifndef XATTR_DOS_ATTRIB
  59. #define XATTR_DOS_ATTRIB "user.DOSATTRIB"
  60. #endif
  61. /*
  62. * This information is kept on every Server we know about.
  63. *
  64. * Some things to note:
  65. *
  66. */
  67. #define SERVER_NAME_LEN_WITH_NULL (SERVER_NAME_LENGTH + 1)
  68. /*
  69. * CIFS vfs client Status information (based on what we know.)
  70. */
  71. /* associated with each tcp and smb session */
  72. enum statusEnum {
  73. CifsNew = 0,
  74. CifsGood,
  75. CifsExiting,
  76. CifsNeedReconnect
  77. };
  78. enum securityEnum {
  79. LANMAN = 0, /* Legacy LANMAN auth */
  80. NTLM, /* Legacy NTLM012 auth with NTLM hash */
  81. NTLMv2, /* Legacy NTLM auth with NTLMv2 hash */
  82. RawNTLMSSP, /* NTLMSSP without SPNEGO */
  83. NTLMSSP, /* NTLMSSP via SPNEGO */
  84. Kerberos /* Kerberos via SPNEGO */
  85. };
  86. enum protocolEnum {
  87. IPV4 = 0,
  88. IPV6,
  89. SCTP
  90. /* Netbios frames protocol not supported at this time */
  91. };
  92. /*
  93. *****************************************************************
  94. * Except the CIFS PDUs themselves all the
  95. * globally interesting structs should go here
  96. *****************************************************************
  97. */
  98. struct TCP_Server_Info {
  99. /* 15 character server name + 0x20 16th byte indicating type = srv */
  100. char server_RFC1001_name[SERVER_NAME_LEN_WITH_NULL];
  101. char unicode_server_Name[SERVER_NAME_LEN_WITH_NULL * 2];
  102. struct socket *ssocket;
  103. union {
  104. struct sockaddr_in sockAddr;
  105. struct sockaddr_in6 sockAddr6;
  106. } addr;
  107. wait_queue_head_t response_q;
  108. wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/
  109. struct list_head pending_mid_q;
  110. void *Server_NlsInfo; /* BB - placeholder for future NLS info */
  111. unsigned short server_codepage; /* codepage for the server */
  112. unsigned long ip_address; /* IP addr for the server if known */
  113. enum protocolEnum protocolType;
  114. char versionMajor;
  115. char versionMinor;
  116. unsigned svlocal:1; /* local server or remote */
  117. atomic_t socketUseCount; /* number of open cifs sessions on socket */
  118. atomic_t inFlight; /* number of requests on the wire to server */
  119. #ifdef CONFIG_CIFS_STATS2
  120. atomic_t inSend; /* requests trying to send */
  121. atomic_t num_waiters; /* blocked waiting to get in sendrecv */
  122. #endif
  123. enum statusEnum tcpStatus; /* what we think the status is */
  124. struct semaphore tcpSem;
  125. struct task_struct *tsk;
  126. char server_GUID[16];
  127. char secMode;
  128. enum securityEnum secType;
  129. unsigned int maxReq; /* Clients should submit no more */
  130. /* than maxReq distinct unanswered SMBs to the server when using */
  131. /* multiplexed reads or writes */
  132. unsigned int maxBuf; /* maxBuf specifies the maximum */
  133. /* message size the server can send or receive for non-raw SMBs */
  134. unsigned int maxRw; /* maxRw specifies the maximum */
  135. /* message size the server can send or receive for */
  136. /* SMB_COM_WRITE_RAW or SMB_COM_READ_RAW. */
  137. char sessid[4]; /* unique token id for this session */
  138. /* (returned on Negotiate */
  139. int capabilities; /* allow selective disabling of caps by smb sess */
  140. int timeAdj; /* Adjust for difference in server time zone in sec */
  141. __u16 CurrentMid; /* multiplex id - rotating counter */
  142. char cryptKey[CIFS_CRYPTO_KEY_SIZE];
  143. /* 16th byte of RFC1001 workstation name is always null */
  144. char workstation_RFC1001_name[SERVER_NAME_LEN_WITH_NULL];
  145. __u32 sequence_number; /* needed for CIFS PDU signature */
  146. char mac_signing_key[CIFS_SESS_KEY_SIZE + 16];
  147. unsigned long lstrp; /* when we got last response from this server */
  148. };
  149. /*
  150. * The following is our shortcut to user information. We surface the uid,
  151. * and name. We always get the password on the fly in case it
  152. * has changed. We also hang a list of sessions owned by this user off here.
  153. */
  154. struct cifsUidInfo {
  155. struct list_head userList;
  156. struct list_head sessionList; /* SMB sessions for this user */
  157. uid_t linux_uid;
  158. char user[MAX_USERNAME_SIZE + 1]; /* ascii name of user */
  159. /* BB may need ptr or callback for PAM or WinBind info */
  160. };
  161. /*
  162. * Session structure. One of these for each uid session with a particular host
  163. */
  164. struct cifsSesInfo {
  165. struct list_head cifsSessionList;
  166. struct semaphore sesSem;
  167. #if 0
  168. struct cifsUidInfo *uidInfo; /* pointer to user info */
  169. #endif
  170. struct TCP_Server_Info *server; /* pointer to server info */
  171. atomic_t inUse; /* # of mounts (tree connections) on this ses */
  172. enum statusEnum status;
  173. unsigned overrideSecFlg; /* if non-zero override global sec flags */
  174. __u16 ipc_tid; /* special tid for connection to IPC share */
  175. __u16 flags;
  176. char *serverOS; /* name of operating system underlying server */
  177. char *serverNOS; /* name of network operating system of server */
  178. char *serverDomain; /* security realm of server */
  179. int Suid; /* remote smb uid */
  180. uid_t linux_uid; /* local Linux uid */
  181. int capabilities;
  182. char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for
  183. TCP names - will ipv6 and sctp addresses fit? */
  184. char userName[MAX_USERNAME_SIZE + 1];
  185. char * domainName;
  186. char * password;
  187. };
  188. /* no more than one of the following three session flags may be set */
  189. #define CIFS_SES_NT4 1
  190. #define CIFS_SES_OS2 2
  191. #define CIFS_SES_W9X 4
  192. /* following flag is set for old servers such as OS2 (and Win95?)
  193. which do not negotiate NTLM or POSIX dialects, but instead
  194. negotiate one of the older LANMAN dialects */
  195. #define CIFS_SES_LANMAN 8
  196. /*
  197. * there is one of these for each connection to a resource on a particular
  198. * session
  199. */
  200. struct cifsTconInfo {
  201. struct list_head cifsConnectionList;
  202. struct list_head openFileList;
  203. struct semaphore tconSem;
  204. struct cifsSesInfo *ses; /* pointer to session associated with */
  205. char treeName[MAX_TREE_SIZE + 1]; /* UNC name of resource in ASCII */
  206. char *nativeFileSystem;
  207. __u16 tid; /* The 2 byte tree id */
  208. __u16 Flags; /* optional support bits */
  209. enum statusEnum tidStatus;
  210. atomic_t useCount; /* how many explicit/implicit mounts to share */
  211. #ifdef CONFIG_CIFS_STATS
  212. atomic_t num_smbs_sent;
  213. atomic_t num_writes;
  214. atomic_t num_reads;
  215. atomic_t num_oplock_brks;
  216. atomic_t num_opens;
  217. atomic_t num_closes;
  218. atomic_t num_deletes;
  219. atomic_t num_mkdirs;
  220. atomic_t num_rmdirs;
  221. atomic_t num_renames;
  222. atomic_t num_t2renames;
  223. atomic_t num_ffirst;
  224. atomic_t num_fnext;
  225. atomic_t num_fclose;
  226. atomic_t num_hardlinks;
  227. atomic_t num_symlinks;
  228. atomic_t num_locks;
  229. atomic_t num_acl_get;
  230. atomic_t num_acl_set;
  231. #ifdef CONFIG_CIFS_STATS2
  232. unsigned long long time_writes;
  233. unsigned long long time_reads;
  234. unsigned long long time_opens;
  235. unsigned long long time_deletes;
  236. unsigned long long time_closes;
  237. unsigned long long time_mkdirs;
  238. unsigned long long time_rmdirs;
  239. unsigned long long time_renames;
  240. unsigned long long time_t2renames;
  241. unsigned long long time_ffirst;
  242. unsigned long long time_fnext;
  243. unsigned long long time_fclose;
  244. #endif /* CONFIG_CIFS_STATS2 */
  245. __u64 bytes_read;
  246. __u64 bytes_written;
  247. spinlock_t stat_lock;
  248. #endif /* CONFIG_CIFS_STATS */
  249. FILE_SYSTEM_DEVICE_INFO fsDevInfo;
  250. FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if fs name truncated */
  251. FILE_SYSTEM_UNIX_INFO fsUnixInfo;
  252. unsigned retry:1;
  253. unsigned nocase:1;
  254. /* BB add field for back pointer to sb struct? */
  255. };
  256. /*
  257. * This info hangs off the cifsFileInfo structure, pointed to by llist.
  258. * This is used to track byte stream locks on the file
  259. */
  260. struct cifsLockInfo {
  261. struct list_head llist; /* pointer to next cifsLockInfo */
  262. __u64 offset;
  263. __u64 length;
  264. __u8 type;
  265. };
  266. /*
  267. * One of these for each open instance of a file
  268. */
  269. struct cifs_search_info {
  270. loff_t index_of_last_entry;
  271. __u16 entries_in_buffer;
  272. __u16 info_level;
  273. __u32 resume_key;
  274. char * ntwrk_buf_start;
  275. char * srch_entries_start;
  276. char * presume_name;
  277. unsigned int resume_name_len;
  278. unsigned endOfSearch:1;
  279. unsigned emptyDir:1;
  280. unsigned unicode:1;
  281. unsigned smallBuf:1; /* so we know which buf_release function to call */
  282. };
  283. struct cifsFileInfo {
  284. struct list_head tlist; /* pointer to next fid owned by tcon */
  285. struct list_head flist; /* next fid (file instance) for this inode */
  286. unsigned int uid; /* allows finding which FileInfo structure */
  287. __u32 pid; /* process id who opened file */
  288. __u16 netfid; /* file id from remote */
  289. /* BB add lock scope info here if needed */ ;
  290. /* lock scope id (0 if none) */
  291. struct file * pfile; /* needed for writepage */
  292. struct inode * pInode; /* needed for oplock break */
  293. struct semaphore lock_sem;
  294. struct list_head llist; /* list of byte range locks we have. */
  295. unsigned closePend:1; /* file is marked to close */
  296. unsigned invalidHandle:1; /* file closed via session abend */
  297. atomic_t wrtPending; /* handle in use - defer close */
  298. struct semaphore fh_sem; /* prevents reopen race after dead ses*/
  299. char * search_resume_name; /* BB removeme BB */
  300. struct cifs_search_info srch_inf;
  301. };
  302. /*
  303. * One of these for each file inode
  304. */
  305. struct cifsInodeInfo {
  306. struct list_head lockList;
  307. /* BB add in lists for dirty pages - i.e. write caching info for oplock */
  308. struct list_head openFileList;
  309. int write_behind_rc;
  310. __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */
  311. atomic_t inUse; /* num concurrent users (local openers cifs) of file*/
  312. unsigned long time; /* jiffies of last update/check of inode */
  313. unsigned clientCanCacheRead:1; /* read oplock */
  314. unsigned clientCanCacheAll:1; /* read and writebehind oplock */
  315. unsigned oplockPending:1;
  316. struct inode vfs_inode;
  317. };
  318. static inline struct cifsInodeInfo *
  319. CIFS_I(struct inode *inode)
  320. {
  321. return container_of(inode, struct cifsInodeInfo, vfs_inode);
  322. }
  323. static inline struct cifs_sb_info *
  324. CIFS_SB(struct super_block *sb)
  325. {
  326. return sb->s_fs_info;
  327. }
  328. static inline char CIFS_DIR_SEP(const struct cifs_sb_info *cifs_sb)
  329. {
  330. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
  331. return '/';
  332. else
  333. return '\\';
  334. }
  335. #ifdef CONFIG_CIFS_STATS
  336. #define cifs_stats_inc atomic_inc
  337. static inline void cifs_stats_bytes_written(struct cifsTconInfo *tcon,
  338. unsigned int bytes)
  339. {
  340. if (bytes) {
  341. spin_lock(&tcon->stat_lock);
  342. tcon->bytes_written += bytes;
  343. spin_unlock(&tcon->stat_lock);
  344. }
  345. }
  346. static inline void cifs_stats_bytes_read(struct cifsTconInfo *tcon,
  347. unsigned int bytes)
  348. {
  349. spin_lock(&tcon->stat_lock);
  350. tcon->bytes_read += bytes;
  351. spin_unlock(&tcon->stat_lock);
  352. }
  353. #else
  354. #define cifs_stats_inc(field) do {} while(0)
  355. #define cifs_stats_bytes_written(tcon, bytes) do {} while(0)
  356. #define cifs_stats_bytes_read(tcon, bytes) do {} while(0)
  357. #endif
  358. /* one of these for every pending CIFS request to the server */
  359. struct mid_q_entry {
  360. struct list_head qhead; /* mids waiting on reply from this server */
  361. __u16 mid; /* multiplex id */
  362. __u16 pid; /* process id */
  363. __u32 sequence_number; /* for CIFS signing */
  364. unsigned long when_alloc; /* when mid was created */
  365. #ifdef CONFIG_CIFS_STATS2
  366. unsigned long when_sent; /* time when smb send finished */
  367. unsigned long when_received; /* when demux complete (taken off wire) */
  368. #endif
  369. struct cifsSesInfo *ses; /* smb was sent to this server */
  370. struct task_struct *tsk; /* task waiting for response */
  371. struct smb_hdr *resp_buf; /* response buffer */
  372. int midState; /* wish this were enum but can not pass to wait_event */
  373. __u8 command; /* smb command code */
  374. unsigned largeBuf:1; /* if valid response, is pointer to large buf */
  375. unsigned multiRsp:1; /* multiple trans2 responses for one request */
  376. unsigned multiEnd:1; /* both received */
  377. };
  378. struct oplock_q_entry {
  379. struct list_head qhead;
  380. struct inode * pinode;
  381. struct cifsTconInfo * tcon;
  382. __u16 netfid;
  383. };
  384. /* for pending dnotify requests */
  385. struct dir_notify_req {
  386. struct list_head lhead;
  387. __le16 Pid;
  388. __le16 PidHigh;
  389. __u16 Mid;
  390. __u16 Tid;
  391. __u16 Uid;
  392. __u16 netfid;
  393. __u32 filter; /* CompletionFilter (for multishot) */
  394. int multishot;
  395. struct file * pfile;
  396. };
  397. #define MID_FREE 0
  398. #define MID_REQUEST_ALLOCATED 1
  399. #define MID_REQUEST_SUBMITTED 2
  400. #define MID_RESPONSE_RECEIVED 4
  401. #define MID_RETRY_NEEDED 8 /* session closed while this request out */
  402. #define MID_NO_RESP_NEEDED 0x10
  403. /* Types of response buffer returned from SendReceive2 */
  404. #define CIFS_NO_BUFFER 0 /* Response buffer not returned */
  405. #define CIFS_SMALL_BUFFER 1
  406. #define CIFS_LARGE_BUFFER 2
  407. #define CIFS_IOVEC 4 /* array of response buffers */
  408. /* Security Flags: indicate type of session setup needed */
  409. #define CIFSSEC_MAY_SIGN 0x00001
  410. #define CIFSSEC_MAY_NTLM 0x00002
  411. #define CIFSSEC_MAY_NTLMV2 0x00004
  412. #define CIFSSEC_MAY_KRB5 0x00008
  413. #ifdef CONFIG_CIFS_WEAK_PW_HASH
  414. #define CIFSSEC_MAY_LANMAN 0x00010
  415. #define CIFSSEC_MAY_PLNTXT 0x00020
  416. #endif /* weak passwords */
  417. #define CIFSSEC_MAY_SEAL 0x00040 /* not supported yet */
  418. #define CIFSSEC_MUST_SIGN 0x01001
  419. /* note that only one of the following can be set so the
  420. result of setting MUST flags more than once will be to
  421. require use of the stronger protocol */
  422. #define CIFSSEC_MUST_NTLM 0x02002
  423. #define CIFSSEC_MUST_NTLMV2 0x04004
  424. #define CIFSSEC_MUST_KRB5 0x08008
  425. #ifdef CONFIG_CIFS_WEAK_PW_HASH
  426. #define CIFSSEC_MUST_LANMAN 0x10010
  427. #define CIFSSEC_MUST_PLNTXT 0x20020
  428. #define CIFSSEC_MASK 0x37037 /* current flags supported if weak */
  429. #else
  430. #define CIFSSEC_MASK 0x07007 /* flags supported if no weak config */
  431. #endif /* WEAK_PW_HASH */
  432. #define CIFSSEC_MUST_SEAL 0x40040 /* not supported yet */
  433. #define CIFSSEC_DEF CIFSSEC_MAY_SIGN | CIFSSEC_MAY_NTLM | CIFSSEC_MAY_NTLMV2
  434. #define CIFSSEC_MAX CIFSSEC_MUST_SIGN | CIFSSEC_MUST_NTLMV2
  435. /*
  436. *****************************************************************
  437. * All constants go here
  438. *****************************************************************
  439. */
  440. #define UID_HASH (16)
  441. /*
  442. * Note that ONE module should define _DECLARE_GLOBALS_HERE to cause the
  443. * following to be declared.
  444. */
  445. /****************************************************************************
  446. * Locking notes. All updates to global variables and lists should be
  447. * protected by spinlocks or semaphores.
  448. *
  449. * Spinlocks
  450. * ---------
  451. * GlobalMid_Lock protects:
  452. * list operations on pending_mid_q and oplockQ
  453. * updates to XID counters, multiplex id and SMB sequence numbers
  454. * GlobalSMBSesLock protects:
  455. * list operations on tcp and SMB session lists and tCon lists
  456. * f_owner.lock protects certain per file struct operations
  457. * mapping->page_lock protects certain per page operations
  458. *
  459. * Semaphores
  460. * ----------
  461. * sesSem operations on smb session
  462. * tconSem operations on tree connection
  463. * fh_sem file handle reconnection operations
  464. *
  465. ****************************************************************************/
  466. #ifdef DECLARE_GLOBALS_HERE
  467. #define GLOBAL_EXTERN
  468. #else
  469. #define GLOBAL_EXTERN extern
  470. #endif
  471. /*
  472. * The list of servers that did not respond with NT LM 0.12.
  473. * This list helps improve performance and eliminate the messages indicating
  474. * that we had a communications error talking to the server in this list.
  475. */
  476. /* Feature not supported */
  477. /* GLOBAL_EXTERN struct servers_not_supported *NotSuppList; */
  478. /*
  479. * The following is a hash table of all the users we know about.
  480. */
  481. GLOBAL_EXTERN struct smbUidInfo *GlobalUidList[UID_HASH];
  482. /* GLOBAL_EXTERN struct list_head GlobalServerList; BB not implemented yet */
  483. GLOBAL_EXTERN struct list_head GlobalSMBSessionList;
  484. GLOBAL_EXTERN struct list_head GlobalTreeConnectionList;
  485. GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */
  486. GLOBAL_EXTERN struct list_head GlobalOplock_Q;
  487. /* Outstanding dir notify requests */
  488. GLOBAL_EXTERN struct list_head GlobalDnotifyReqList;
  489. /* DirNotify response queue */
  490. GLOBAL_EXTERN struct list_head GlobalDnotifyRsp_Q;
  491. /*
  492. * Global transaction id (XID) information
  493. */
  494. GLOBAL_EXTERN unsigned int GlobalCurrentXid; /* protected by GlobalMid_Sem */
  495. GLOBAL_EXTERN unsigned int GlobalTotalActiveXid; /* prot by GlobalMid_Sem */
  496. GLOBAL_EXTERN unsigned int GlobalMaxActiveXid; /* prot by GlobalMid_Sem */
  497. GLOBAL_EXTERN spinlock_t GlobalMid_Lock; /* protects above & list operations */
  498. /* on midQ entries */
  499. GLOBAL_EXTERN char Local_System_Name[15];
  500. /*
  501. * Global counters, updated atomically
  502. */
  503. GLOBAL_EXTERN atomic_t sesInfoAllocCount;
  504. GLOBAL_EXTERN atomic_t tconInfoAllocCount;
  505. GLOBAL_EXTERN atomic_t tcpSesAllocCount;
  506. GLOBAL_EXTERN atomic_t tcpSesReconnectCount;
  507. GLOBAL_EXTERN atomic_t tconInfoReconnectCount;
  508. /* Various Debug counters to remove someday (BB) */
  509. GLOBAL_EXTERN atomic_t bufAllocCount; /* current number allocated */
  510. #ifdef CONFIG_CIFS_STATS2
  511. GLOBAL_EXTERN atomic_t totBufAllocCount; /* total allocated over all time */
  512. GLOBAL_EXTERN atomic_t totSmBufAllocCount;
  513. #endif
  514. GLOBAL_EXTERN atomic_t smBufAllocCount;
  515. GLOBAL_EXTERN atomic_t midCount;
  516. /* Misc globals */
  517. GLOBAL_EXTERN unsigned int multiuser_mount; /* if enabled allows new sessions
  518. to be established on existing mount if we
  519. have the uid/password or Kerberos credential
  520. or equivalent for current user */
  521. GLOBAL_EXTERN unsigned int oplockEnabled;
  522. GLOBAL_EXTERN unsigned int experimEnabled;
  523. GLOBAL_EXTERN unsigned int lookupCacheEnabled;
  524. GLOBAL_EXTERN unsigned int extended_security; /* if on, session setup sent
  525. with more secure ntlmssp2 challenge/resp */
  526. GLOBAL_EXTERN unsigned int sign_CIFS_PDUs; /* enable smb packet signing */
  527. GLOBAL_EXTERN unsigned int linuxExtEnabled;/*enable Linux/Unix CIFS extensions*/
  528. GLOBAL_EXTERN unsigned int CIFSMaxBufSize; /* max size not including hdr */
  529. GLOBAL_EXTERN unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */
  530. GLOBAL_EXTERN unsigned int cifs_min_small; /* min size of small buf pool */
  531. GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/