cifsfs.c 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. /*
  2. * fs/cifs/cifsfs.c
  3. *
  4. * Copyright (C) International Business Machines Corp., 2002,2008
  5. * Author(s): Steve French (sfrench@us.ibm.com)
  6. *
  7. * Common Internet FileSystem (CIFS) client
  8. *
  9. * This library is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU Lesser General Public License as published
  11. * by the Free Software Foundation; either version 2.1 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  17. * the GNU Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public License
  20. * along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. */
  23. /* Note that BB means BUGBUG (ie something to fix eventually) */
  24. #include <linux/module.h>
  25. #include <linux/fs.h>
  26. #include <linux/mount.h>
  27. #include <linux/slab.h>
  28. #include <linux/init.h>
  29. #include <linux/list.h>
  30. #include <linux/seq_file.h>
  31. #include <linux/vfs.h>
  32. #include <linux/mempool.h>
  33. #include <linux/delay.h>
  34. #include <linux/kthread.h>
  35. #include <linux/freezer.h>
  36. #include <linux/smp_lock.h>
  37. #include "cifsfs.h"
  38. #include "cifspdu.h"
  39. #define DECLARE_GLOBALS_HERE
  40. #include "cifsglob.h"
  41. #include "cifsproto.h"
  42. #include "cifs_debug.h"
  43. #include "cifs_fs_sb.h"
  44. #include <linux/mm.h>
  45. #include <linux/key-type.h>
  46. #include "dns_resolve.h"
  47. #include "cifs_spnego.h"
  48. #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
  49. #ifdef CONFIG_CIFS_QUOTA
  50. static struct quotactl_ops cifs_quotactl_ops;
  51. #endif /* QUOTA */
  52. int cifsFYI = 0;
  53. int cifsERROR = 1;
  54. int traceSMB = 0;
  55. unsigned int oplockEnabled = 1;
  56. unsigned int experimEnabled = 0;
  57. unsigned int linuxExtEnabled = 1;
  58. unsigned int lookupCacheEnabled = 1;
  59. unsigned int multiuser_mount = 0;
  60. unsigned int extended_security = CIFSSEC_DEF;
  61. /* unsigned int ntlmv2_support = 0; */
  62. unsigned int sign_CIFS_PDUs = 1;
  63. extern struct task_struct *oplockThread; /* remove sparse warning */
  64. struct task_struct *oplockThread = NULL;
  65. /* extern struct task_struct * dnotifyThread; remove sparse warning */
  66. static const struct super_operations cifs_super_ops;
  67. unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
  68. module_param(CIFSMaxBufSize, int, 0);
  69. MODULE_PARM_DESC(CIFSMaxBufSize, "Network buffer size (not including header). "
  70. "Default: 16384 Range: 8192 to 130048");
  71. unsigned int cifs_min_rcv = CIFS_MIN_RCV_POOL;
  72. module_param(cifs_min_rcv, int, 0);
  73. MODULE_PARM_DESC(cifs_min_rcv, "Network buffers in pool. Default: 4 Range: "
  74. "1 to 64");
  75. unsigned int cifs_min_small = 30;
  76. module_param(cifs_min_small, int, 0);
  77. MODULE_PARM_DESC(cifs_min_small, "Small network buffers in pool. Default: 30 "
  78. "Range: 2 to 256");
  79. unsigned int cifs_max_pending = CIFS_MAX_REQ;
  80. module_param(cifs_max_pending, int, 0);
  81. MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. "
  82. "Default: 50 Range: 2 to 256");
  83. extern mempool_t *cifs_sm_req_poolp;
  84. extern mempool_t *cifs_req_poolp;
  85. extern mempool_t *cifs_mid_poolp;
  86. extern struct kmem_cache *cifs_oplock_cachep;
  87. static int
  88. cifs_read_super(struct super_block *sb, void *data,
  89. const char *devname, int silent)
  90. {
  91. struct inode *inode;
  92. struct cifs_sb_info *cifs_sb;
  93. int rc = 0;
  94. /* BB should we make this contingent on mount parm? */
  95. sb->s_flags |= MS_NODIRATIME | MS_NOATIME;
  96. sb->s_fs_info = kzalloc(sizeof(struct cifs_sb_info), GFP_KERNEL);
  97. cifs_sb = CIFS_SB(sb);
  98. if (cifs_sb == NULL)
  99. return -ENOMEM;
  100. #ifdef CONFIG_CIFS_DFS_UPCALL
  101. /* copy mount params to sb for use in submounts */
  102. /* BB: should we move this after the mount so we
  103. * do not have to do the copy on failed mounts?
  104. * BB: May be it is better to do simple copy before
  105. * complex operation (mount), and in case of fail
  106. * just exit instead of doing mount and attempting
  107. * undo it if this copy fails?*/
  108. if (data) {
  109. int len = strlen(data);
  110. cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
  111. if (cifs_sb->mountdata == NULL) {
  112. kfree(sb->s_fs_info);
  113. sb->s_fs_info = NULL;
  114. return -ENOMEM;
  115. }
  116. strncpy(cifs_sb->mountdata, data, len + 1);
  117. cifs_sb->mountdata[len] = '\0';
  118. }
  119. #endif
  120. rc = cifs_mount(sb, cifs_sb, data, devname);
  121. if (rc) {
  122. if (!silent)
  123. cERROR(1,
  124. ("cifs_mount failed w/return code = %d", rc));
  125. goto out_mount_failed;
  126. }
  127. sb->s_magic = CIFS_MAGIC_NUMBER;
  128. sb->s_op = &cifs_super_ops;
  129. /* if (cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512)
  130. sb->s_blocksize =
  131. cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */
  132. #ifdef CONFIG_CIFS_QUOTA
  133. sb->s_qcop = &cifs_quotactl_ops;
  134. #endif
  135. sb->s_blocksize = CIFS_MAX_MSGSIZE;
  136. sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */
  137. inode = cifs_root_iget(sb, ROOT_I);
  138. if (IS_ERR(inode)) {
  139. rc = PTR_ERR(inode);
  140. inode = NULL;
  141. goto out_no_root;
  142. }
  143. sb->s_root = d_alloc_root(inode);
  144. if (!sb->s_root) {
  145. rc = -ENOMEM;
  146. goto out_no_root;
  147. }
  148. #ifdef CONFIG_CIFS_EXPERIMENTAL
  149. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
  150. cFYI(1, ("export ops supported"));
  151. sb->s_export_op = &cifs_export_ops;
  152. }
  153. #endif /* EXPERIMENTAL */
  154. return 0;
  155. out_no_root:
  156. cERROR(1, ("cifs_read_super: get root inode failed"));
  157. if (inode)
  158. iput(inode);
  159. cifs_umount(sb, cifs_sb);
  160. out_mount_failed:
  161. if (cifs_sb) {
  162. #ifdef CONFIG_CIFS_DFS_UPCALL
  163. if (cifs_sb->mountdata) {
  164. kfree(cifs_sb->mountdata);
  165. cifs_sb->mountdata = NULL;
  166. }
  167. #endif
  168. if (cifs_sb->local_nls)
  169. unload_nls(cifs_sb->local_nls);
  170. kfree(cifs_sb);
  171. }
  172. return rc;
  173. }
  174. static void
  175. cifs_put_super(struct super_block *sb)
  176. {
  177. int rc = 0;
  178. struct cifs_sb_info *cifs_sb;
  179. cFYI(1, ("In cifs_put_super"));
  180. cifs_sb = CIFS_SB(sb);
  181. if (cifs_sb == NULL) {
  182. cFYI(1, ("Empty cifs superblock info passed to unmount"));
  183. return;
  184. }
  185. lock_kernel();
  186. rc = cifs_umount(sb, cifs_sb);
  187. if (rc)
  188. cERROR(1, ("cifs_umount failed with return code %d", rc));
  189. #ifdef CONFIG_CIFS_DFS_UPCALL
  190. if (cifs_sb->mountdata) {
  191. kfree(cifs_sb->mountdata);
  192. cifs_sb->mountdata = NULL;
  193. }
  194. #endif
  195. unload_nls(cifs_sb->local_nls);
  196. kfree(cifs_sb);
  197. unlock_kernel();
  198. }
  199. static int
  200. cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
  201. {
  202. struct super_block *sb = dentry->d_sb;
  203. struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
  204. struct cifsTconInfo *tcon = cifs_sb->tcon;
  205. int rc = -EOPNOTSUPP;
  206. int xid;
  207. xid = GetXid();
  208. buf->f_type = CIFS_MAGIC_NUMBER;
  209. /*
  210. * PATH_MAX may be too long - it would presumably be total path,
  211. * but note that some servers (includinng Samba 3) have a shorter
  212. * maximum path.
  213. *
  214. * Instead could get the real value via SMB_QUERY_FS_ATTRIBUTE_INFO.
  215. */
  216. buf->f_namelen = PATH_MAX;
  217. buf->f_files = 0; /* undefined */
  218. buf->f_ffree = 0; /* unlimited */
  219. /*
  220. * We could add a second check for a QFS Unix capability bit
  221. */
  222. if ((tcon->ses->capabilities & CAP_UNIX) &&
  223. (CIFS_POSIX_EXTENSIONS & le64_to_cpu(tcon->fsUnixInfo.Capability)))
  224. rc = CIFSSMBQFSPosixInfo(xid, tcon, buf);
  225. /*
  226. * Only need to call the old QFSInfo if failed on newer one,
  227. * e.g. by OS/2.
  228. **/
  229. if (rc && (tcon->ses->capabilities & CAP_NT_SMBS))
  230. rc = CIFSSMBQFSInfo(xid, tcon, buf);
  231. /*
  232. * Some old Windows servers also do not support level 103, retry with
  233. * older level one if old server failed the previous call or we
  234. * bypassed it because we detected that this was an older LANMAN sess
  235. */
  236. if (rc)
  237. rc = SMBOldQFSInfo(xid, tcon, buf);
  238. FreeXid(xid);
  239. return 0;
  240. }
  241. static int cifs_permission(struct inode *inode, int mask)
  242. {
  243. struct cifs_sb_info *cifs_sb;
  244. cifs_sb = CIFS_SB(inode->i_sb);
  245. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) {
  246. if ((mask & MAY_EXEC) && !execute_ok(inode))
  247. return -EACCES;
  248. else
  249. return 0;
  250. } else /* file mode might have been restricted at mount time
  251. on the client (above and beyond ACL on servers) for
  252. servers which do not support setting and viewing mode bits,
  253. so allowing client to check permissions is useful */
  254. return generic_permission(inode, mask, NULL);
  255. }
  256. static struct kmem_cache *cifs_inode_cachep;
  257. static struct kmem_cache *cifs_req_cachep;
  258. static struct kmem_cache *cifs_mid_cachep;
  259. struct kmem_cache *cifs_oplock_cachep;
  260. static struct kmem_cache *cifs_sm_req_cachep;
  261. mempool_t *cifs_sm_req_poolp;
  262. mempool_t *cifs_req_poolp;
  263. mempool_t *cifs_mid_poolp;
  264. static struct inode *
  265. cifs_alloc_inode(struct super_block *sb)
  266. {
  267. struct cifsInodeInfo *cifs_inode;
  268. cifs_inode = kmem_cache_alloc(cifs_inode_cachep, GFP_KERNEL);
  269. if (!cifs_inode)
  270. return NULL;
  271. cifs_inode->cifsAttrs = 0x20; /* default */
  272. atomic_set(&cifs_inode->inUse, 0);
  273. cifs_inode->time = 0;
  274. cifs_inode->write_behind_rc = 0;
  275. /* Until the file is open and we have gotten oplock
  276. info back from the server, can not assume caching of
  277. file data or metadata */
  278. cifs_inode->clientCanCacheRead = false;
  279. cifs_inode->clientCanCacheAll = false;
  280. cifs_inode->delete_pending = false;
  281. cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */
  282. cifs_inode->server_eof = 0;
  283. /* Can not set i_flags here - they get immediately overwritten
  284. to zero by the VFS */
  285. /* cifs_inode->vfs_inode.i_flags = S_NOATIME | S_NOCMTIME;*/
  286. INIT_LIST_HEAD(&cifs_inode->openFileList);
  287. return &cifs_inode->vfs_inode;
  288. }
  289. static void
  290. cifs_destroy_inode(struct inode *inode)
  291. {
  292. kmem_cache_free(cifs_inode_cachep, CIFS_I(inode));
  293. }
  294. /*
  295. * cifs_show_options() is for displaying mount options in /proc/mounts.
  296. * Not all settable options are displayed but most of the important
  297. * ones are.
  298. */
  299. static int
  300. cifs_show_options(struct seq_file *s, struct vfsmount *m)
  301. {
  302. struct cifs_sb_info *cifs_sb;
  303. struct cifsTconInfo *tcon;
  304. struct TCP_Server_Info *server;
  305. cifs_sb = CIFS_SB(m->mnt_sb);
  306. tcon = cifs_sb->tcon;
  307. seq_printf(s, ",unc=%s", cifs_sb->tcon->treeName);
  308. if (tcon->ses->userName)
  309. seq_printf(s, ",username=%s", tcon->ses->userName);
  310. if (tcon->ses->domainName)
  311. seq_printf(s, ",domain=%s", tcon->ses->domainName);
  312. cifs_show_address(s, tcon->ses->server);
  313. seq_printf(s, ",uid=%d", cifs_sb->mnt_uid);
  314. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)
  315. seq_printf(s, ",forceuid");
  316. seq_printf(s, ",gid=%d", cifs_sb->mnt_gid);
  317. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID)
  318. seq_printf(s, ",forcegid");
  319. server = tcon->ses->server;
  320. seq_printf(s, ",addr=");
  321. switch (server->addr.sockAddr6.sin6_family) {
  322. case AF_INET6:
  323. seq_printf(s, "%pI6", &server->addr.sockAddr6.sin6_addr);
  324. break;
  325. case AF_INET:
  326. seq_printf(s, "%pI4", &server->addr.sockAddr.sin_addr.s_addr);
  327. break;
  328. }
  329. if (!tcon->unix_ext)
  330. seq_printf(s, ",file_mode=0%o,dir_mode=0%o",
  331. cifs_sb->mnt_file_mode,
  332. cifs_sb->mnt_dir_mode);
  333. if (tcon->seal)
  334. seq_printf(s, ",seal");
  335. if (tcon->nocase)
  336. seq_printf(s, ",nocase");
  337. if (tcon->retry)
  338. seq_printf(s, ",hard");
  339. if (cifs_sb->prepath)
  340. seq_printf(s, ",prepath=%s", cifs_sb->prepath);
  341. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
  342. seq_printf(s, ",posixpaths");
  343. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID)
  344. seq_printf(s, ",setuids");
  345. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
  346. seq_printf(s, ",serverino");
  347. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO)
  348. seq_printf(s, ",directio");
  349. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
  350. seq_printf(s, ",nouser_xattr");
  351. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR)
  352. seq_printf(s, ",mapchars");
  353. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
  354. seq_printf(s, ",sfu");
  355. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
  356. seq_printf(s, ",nobrl");
  357. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
  358. seq_printf(s, ",cifsacl");
  359. if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
  360. seq_printf(s, ",dynperm");
  361. if (m->mnt_sb->s_flags & MS_POSIXACL)
  362. seq_printf(s, ",acl");
  363. seq_printf(s, ",rsize=%d", cifs_sb->rsize);
  364. seq_printf(s, ",wsize=%d", cifs_sb->wsize);
  365. return 0;
  366. }
  367. #ifdef CONFIG_CIFS_QUOTA
  368. int cifs_xquota_set(struct super_block *sb, int quota_type, qid_t qid,
  369. struct fs_disk_quota *pdquota)
  370. {
  371. int xid;
  372. int rc = 0;
  373. struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
  374. struct cifsTconInfo *pTcon;
  375. if (cifs_sb)
  376. pTcon = cifs_sb->tcon;
  377. else
  378. return -EIO;
  379. xid = GetXid();
  380. if (pTcon) {
  381. cFYI(1, ("set type: 0x%x id: %d", quota_type, qid));
  382. } else
  383. rc = -EIO;
  384. FreeXid(xid);
  385. return rc;
  386. }
  387. int cifs_xquota_get(struct super_block *sb, int quota_type, qid_t qid,
  388. struct fs_disk_quota *pdquota)
  389. {
  390. int xid;
  391. int rc = 0;
  392. struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
  393. struct cifsTconInfo *pTcon;
  394. if (cifs_sb)
  395. pTcon = cifs_sb->tcon;
  396. else
  397. return -EIO;
  398. xid = GetXid();
  399. if (pTcon) {
  400. cFYI(1, ("set type: 0x%x id: %d", quota_type, qid));
  401. } else
  402. rc = -EIO;
  403. FreeXid(xid);
  404. return rc;
  405. }
  406. int cifs_xstate_set(struct super_block *sb, unsigned int flags, int operation)
  407. {
  408. int xid;
  409. int rc = 0;
  410. struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
  411. struct cifsTconInfo *pTcon;
  412. if (cifs_sb)
  413. pTcon = cifs_sb->tcon;
  414. else
  415. return -EIO;
  416. xid = GetXid();
  417. if (pTcon) {
  418. cFYI(1, ("flags: 0x%x operation: 0x%x", flags, operation));
  419. } else
  420. rc = -EIO;
  421. FreeXid(xid);
  422. return rc;
  423. }
  424. int cifs_xstate_get(struct super_block *sb, struct fs_quota_stat *qstats)
  425. {
  426. int xid;
  427. int rc = 0;
  428. struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
  429. struct cifsTconInfo *pTcon;
  430. if (cifs_sb)
  431. pTcon = cifs_sb->tcon;
  432. else
  433. return -EIO;
  434. xid = GetXid();
  435. if (pTcon) {
  436. cFYI(1, ("pqstats %p", qstats));
  437. } else
  438. rc = -EIO;
  439. FreeXid(xid);
  440. return rc;
  441. }
  442. static struct quotactl_ops cifs_quotactl_ops = {
  443. .set_xquota = cifs_xquota_set,
  444. .get_xquota = cifs_xquota_get,
  445. .set_xstate = cifs_xstate_set,
  446. .get_xstate = cifs_xstate_get,
  447. };
  448. #endif
  449. static void cifs_umount_begin(struct super_block *sb)
  450. {
  451. struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
  452. struct cifsTconInfo *tcon;
  453. if (cifs_sb == NULL)
  454. return;
  455. tcon = cifs_sb->tcon;
  456. if (tcon == NULL)
  457. return;
  458. lock_kernel();
  459. read_lock(&cifs_tcp_ses_lock);
  460. if (tcon->tc_count == 1)
  461. tcon->tidStatus = CifsExiting;
  462. read_unlock(&cifs_tcp_ses_lock);
  463. /* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */
  464. /* cancel_notify_requests(tcon); */
  465. if (tcon->ses && tcon->ses->server) {
  466. cFYI(1, ("wake up tasks now - umount begin not complete"));
  467. wake_up_all(&tcon->ses->server->request_q);
  468. wake_up_all(&tcon->ses->server->response_q);
  469. msleep(1); /* yield */
  470. /* we have to kick the requests once more */
  471. wake_up_all(&tcon->ses->server->response_q);
  472. msleep(1);
  473. }
  474. /* BB FIXME - finish add checks for tidStatus BB */
  475. unlock_kernel();
  476. return;
  477. }
  478. #ifdef CONFIG_CIFS_STATS2
  479. static int cifs_show_stats(struct seq_file *s, struct vfsmount *mnt)
  480. {
  481. /* BB FIXME */
  482. return 0;
  483. }
  484. #endif
  485. static int cifs_remount(struct super_block *sb, int *flags, char *data)
  486. {
  487. *flags |= MS_NODIRATIME;
  488. return 0;
  489. }
  490. static const struct super_operations cifs_super_ops = {
  491. .put_super = cifs_put_super,
  492. .statfs = cifs_statfs,
  493. .alloc_inode = cifs_alloc_inode,
  494. .destroy_inode = cifs_destroy_inode,
  495. /* .drop_inode = generic_delete_inode,
  496. .delete_inode = cifs_delete_inode, */ /* Do not need above two
  497. functions unless later we add lazy close of inodes or unless the
  498. kernel forgets to call us with the same number of releases (closes)
  499. as opens */
  500. .show_options = cifs_show_options,
  501. .umount_begin = cifs_umount_begin,
  502. .remount_fs = cifs_remount,
  503. #ifdef CONFIG_CIFS_STATS2
  504. .show_stats = cifs_show_stats,
  505. #endif
  506. };
  507. static int
  508. cifs_get_sb(struct file_system_type *fs_type,
  509. int flags, const char *dev_name, void *data, struct vfsmount *mnt)
  510. {
  511. int rc;
  512. struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL);
  513. cFYI(1, ("Devname: %s flags: %d ", dev_name, flags));
  514. if (IS_ERR(sb))
  515. return PTR_ERR(sb);
  516. sb->s_flags = flags;
  517. rc = cifs_read_super(sb, data, dev_name, flags & MS_SILENT ? 1 : 0);
  518. if (rc) {
  519. deactivate_locked_super(sb);
  520. return rc;
  521. }
  522. sb->s_flags |= MS_ACTIVE;
  523. simple_set_mnt(mnt, sb);
  524. return 0;
  525. }
  526. static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
  527. unsigned long nr_segs, loff_t pos)
  528. {
  529. struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode;
  530. ssize_t written;
  531. written = generic_file_aio_write(iocb, iov, nr_segs, pos);
  532. if (!CIFS_I(inode)->clientCanCacheAll)
  533. filemap_fdatawrite(inode->i_mapping);
  534. return written;
  535. }
  536. static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
  537. {
  538. /* origin == SEEK_END => we must revalidate the cached file length */
  539. if (origin == SEEK_END) {
  540. int retval;
  541. /* some applications poll for the file length in this strange
  542. way so we must seek to end on non-oplocked files by
  543. setting the revalidate time to zero */
  544. CIFS_I(file->f_path.dentry->d_inode)->time = 0;
  545. retval = cifs_revalidate(file->f_path.dentry);
  546. if (retval < 0)
  547. return (loff_t)retval;
  548. }
  549. return generic_file_llseek_unlocked(file, offset, origin);
  550. }
  551. #ifdef CONFIG_CIFS_EXPERIMENTAL
  552. static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
  553. {
  554. /* note that this is called by vfs setlease with the BKL held
  555. although I doubt that BKL is needed here in cifs */
  556. struct inode *inode = file->f_path.dentry->d_inode;
  557. if (!(S_ISREG(inode->i_mode)))
  558. return -EINVAL;
  559. /* check if file is oplocked */
  560. if (((arg == F_RDLCK) &&
  561. (CIFS_I(inode)->clientCanCacheRead)) ||
  562. ((arg == F_WRLCK) &&
  563. (CIFS_I(inode)->clientCanCacheAll)))
  564. return generic_setlease(file, arg, lease);
  565. else if (CIFS_SB(inode->i_sb)->tcon->local_lease &&
  566. !CIFS_I(inode)->clientCanCacheRead)
  567. /* If the server claims to support oplock on this
  568. file, then we still need to check oplock even
  569. if the local_lease mount option is set, but there
  570. are servers which do not support oplock for which
  571. this mount option may be useful if the user
  572. knows that the file won't be changed on the server
  573. by anyone else */
  574. return generic_setlease(file, arg, lease);
  575. else
  576. return -EAGAIN;
  577. }
  578. #endif
  579. struct file_system_type cifs_fs_type = {
  580. .owner = THIS_MODULE,
  581. .name = "cifs",
  582. .get_sb = cifs_get_sb,
  583. .kill_sb = kill_anon_super,
  584. /* .fs_flags */
  585. };
  586. const struct inode_operations cifs_dir_inode_ops = {
  587. .create = cifs_create,
  588. .lookup = cifs_lookup,
  589. .getattr = cifs_getattr,
  590. .unlink = cifs_unlink,
  591. .link = cifs_hardlink,
  592. .mkdir = cifs_mkdir,
  593. .rmdir = cifs_rmdir,
  594. .rename = cifs_rename,
  595. .permission = cifs_permission,
  596. /* revalidate:cifs_revalidate, */
  597. .setattr = cifs_setattr,
  598. .symlink = cifs_symlink,
  599. .mknod = cifs_mknod,
  600. #ifdef CONFIG_CIFS_XATTR
  601. .setxattr = cifs_setxattr,
  602. .getxattr = cifs_getxattr,
  603. .listxattr = cifs_listxattr,
  604. .removexattr = cifs_removexattr,
  605. #endif
  606. };
  607. const struct inode_operations cifs_file_inode_ops = {
  608. /* revalidate:cifs_revalidate, */
  609. .setattr = cifs_setattr,
  610. .getattr = cifs_getattr, /* do we need this anymore? */
  611. .rename = cifs_rename,
  612. .permission = cifs_permission,
  613. #ifdef CONFIG_CIFS_XATTR
  614. .setxattr = cifs_setxattr,
  615. .getxattr = cifs_getxattr,
  616. .listxattr = cifs_listxattr,
  617. .removexattr = cifs_removexattr,
  618. #endif
  619. };
  620. const struct inode_operations cifs_symlink_inode_ops = {
  621. .readlink = generic_readlink,
  622. .follow_link = cifs_follow_link,
  623. .put_link = cifs_put_link,
  624. .permission = cifs_permission,
  625. /* BB add the following two eventually */
  626. /* revalidate: cifs_revalidate,
  627. setattr: cifs_notify_change, *//* BB do we need notify change */
  628. #ifdef CONFIG_CIFS_XATTR
  629. .setxattr = cifs_setxattr,
  630. .getxattr = cifs_getxattr,
  631. .listxattr = cifs_listxattr,
  632. .removexattr = cifs_removexattr,
  633. #endif
  634. };
  635. const struct file_operations cifs_file_ops = {
  636. .read = do_sync_read,
  637. .write = do_sync_write,
  638. .aio_read = generic_file_aio_read,
  639. .aio_write = cifs_file_aio_write,
  640. .open = cifs_open,
  641. .release = cifs_close,
  642. .lock = cifs_lock,
  643. .fsync = cifs_fsync,
  644. .flush = cifs_flush,
  645. .mmap = cifs_file_mmap,
  646. .splice_read = generic_file_splice_read,
  647. .llseek = cifs_llseek,
  648. #ifdef CONFIG_CIFS_POSIX
  649. .unlocked_ioctl = cifs_ioctl,
  650. #endif /* CONFIG_CIFS_POSIX */
  651. #ifdef CONFIG_CIFS_EXPERIMENTAL
  652. .setlease = cifs_setlease,
  653. #endif /* CONFIG_CIFS_EXPERIMENTAL */
  654. };
  655. const struct file_operations cifs_file_direct_ops = {
  656. /* no mmap, no aio, no readv -
  657. BB reevaluate whether they can be done with directio, no cache */
  658. .read = cifs_user_read,
  659. .write = cifs_user_write,
  660. .open = cifs_open,
  661. .release = cifs_close,
  662. .lock = cifs_lock,
  663. .fsync = cifs_fsync,
  664. .flush = cifs_flush,
  665. .splice_read = generic_file_splice_read,
  666. #ifdef CONFIG_CIFS_POSIX
  667. .unlocked_ioctl = cifs_ioctl,
  668. #endif /* CONFIG_CIFS_POSIX */
  669. .llseek = cifs_llseek,
  670. #ifdef CONFIG_CIFS_EXPERIMENTAL
  671. .setlease = cifs_setlease,
  672. #endif /* CONFIG_CIFS_EXPERIMENTAL */
  673. };
  674. const struct file_operations cifs_file_nobrl_ops = {
  675. .read = do_sync_read,
  676. .write = do_sync_write,
  677. .aio_read = generic_file_aio_read,
  678. .aio_write = cifs_file_aio_write,
  679. .open = cifs_open,
  680. .release = cifs_close,
  681. .fsync = cifs_fsync,
  682. .flush = cifs_flush,
  683. .mmap = cifs_file_mmap,
  684. .splice_read = generic_file_splice_read,
  685. .llseek = cifs_llseek,
  686. #ifdef CONFIG_CIFS_POSIX
  687. .unlocked_ioctl = cifs_ioctl,
  688. #endif /* CONFIG_CIFS_POSIX */
  689. #ifdef CONFIG_CIFS_EXPERIMENTAL
  690. .setlease = cifs_setlease,
  691. #endif /* CONFIG_CIFS_EXPERIMENTAL */
  692. };
  693. const struct file_operations cifs_file_direct_nobrl_ops = {
  694. /* no mmap, no aio, no readv -
  695. BB reevaluate whether they can be done with directio, no cache */
  696. .read = cifs_user_read,
  697. .write = cifs_user_write,
  698. .open = cifs_open,
  699. .release = cifs_close,
  700. .fsync = cifs_fsync,
  701. .flush = cifs_flush,
  702. .splice_read = generic_file_splice_read,
  703. #ifdef CONFIG_CIFS_POSIX
  704. .unlocked_ioctl = cifs_ioctl,
  705. #endif /* CONFIG_CIFS_POSIX */
  706. .llseek = cifs_llseek,
  707. #ifdef CONFIG_CIFS_EXPERIMENTAL
  708. .setlease = cifs_setlease,
  709. #endif /* CONFIG_CIFS_EXPERIMENTAL */
  710. };
  711. const struct file_operations cifs_dir_ops = {
  712. .readdir = cifs_readdir,
  713. .release = cifs_closedir,
  714. .read = generic_read_dir,
  715. .unlocked_ioctl = cifs_ioctl,
  716. .llseek = generic_file_llseek,
  717. };
  718. static void
  719. cifs_init_once(void *inode)
  720. {
  721. struct cifsInodeInfo *cifsi = inode;
  722. inode_init_once(&cifsi->vfs_inode);
  723. INIT_LIST_HEAD(&cifsi->lockList);
  724. }
  725. static int
  726. cifs_init_inodecache(void)
  727. {
  728. cifs_inode_cachep = kmem_cache_create("cifs_inode_cache",
  729. sizeof(struct cifsInodeInfo),
  730. 0, (SLAB_RECLAIM_ACCOUNT|
  731. SLAB_MEM_SPREAD),
  732. cifs_init_once);
  733. if (cifs_inode_cachep == NULL)
  734. return -ENOMEM;
  735. return 0;
  736. }
  737. static void
  738. cifs_destroy_inodecache(void)
  739. {
  740. kmem_cache_destroy(cifs_inode_cachep);
  741. }
  742. static int
  743. cifs_init_request_bufs(void)
  744. {
  745. if (CIFSMaxBufSize < 8192) {
  746. /* Buffer size can not be smaller than 2 * PATH_MAX since maximum
  747. Unicode path name has to fit in any SMB/CIFS path based frames */
  748. CIFSMaxBufSize = 8192;
  749. } else if (CIFSMaxBufSize > 1024*127) {
  750. CIFSMaxBufSize = 1024 * 127;
  751. } else {
  752. CIFSMaxBufSize &= 0x1FE00; /* Round size to even 512 byte mult*/
  753. }
  754. /* cERROR(1,("CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize)); */
  755. cifs_req_cachep = kmem_cache_create("cifs_request",
  756. CIFSMaxBufSize +
  757. MAX_CIFS_HDR_SIZE, 0,
  758. SLAB_HWCACHE_ALIGN, NULL);
  759. if (cifs_req_cachep == NULL)
  760. return -ENOMEM;
  761. if (cifs_min_rcv < 1)
  762. cifs_min_rcv = 1;
  763. else if (cifs_min_rcv > 64) {
  764. cifs_min_rcv = 64;
  765. cERROR(1, ("cifs_min_rcv set to maximum (64)"));
  766. }
  767. cifs_req_poolp = mempool_create_slab_pool(cifs_min_rcv,
  768. cifs_req_cachep);
  769. if (cifs_req_poolp == NULL) {
  770. kmem_cache_destroy(cifs_req_cachep);
  771. return -ENOMEM;
  772. }
  773. /* MAX_CIFS_SMALL_BUFFER_SIZE bytes is enough for most SMB responses and
  774. almost all handle based requests (but not write response, nor is it
  775. sufficient for path based requests). A smaller size would have
  776. been more efficient (compacting multiple slab items on one 4k page)
  777. for the case in which debug was on, but this larger size allows
  778. more SMBs to use small buffer alloc and is still much more
  779. efficient to alloc 1 per page off the slab compared to 17K (5page)
  780. alloc of large cifs buffers even when page debugging is on */
  781. cifs_sm_req_cachep = kmem_cache_create("cifs_small_rq",
  782. MAX_CIFS_SMALL_BUFFER_SIZE, 0, SLAB_HWCACHE_ALIGN,
  783. NULL);
  784. if (cifs_sm_req_cachep == NULL) {
  785. mempool_destroy(cifs_req_poolp);
  786. kmem_cache_destroy(cifs_req_cachep);
  787. return -ENOMEM;
  788. }
  789. if (cifs_min_small < 2)
  790. cifs_min_small = 2;
  791. else if (cifs_min_small > 256) {
  792. cifs_min_small = 256;
  793. cFYI(1, ("cifs_min_small set to maximum (256)"));
  794. }
  795. cifs_sm_req_poolp = mempool_create_slab_pool(cifs_min_small,
  796. cifs_sm_req_cachep);
  797. if (cifs_sm_req_poolp == NULL) {
  798. mempool_destroy(cifs_req_poolp);
  799. kmem_cache_destroy(cifs_req_cachep);
  800. kmem_cache_destroy(cifs_sm_req_cachep);
  801. return -ENOMEM;
  802. }
  803. return 0;
  804. }
  805. static void
  806. cifs_destroy_request_bufs(void)
  807. {
  808. mempool_destroy(cifs_req_poolp);
  809. kmem_cache_destroy(cifs_req_cachep);
  810. mempool_destroy(cifs_sm_req_poolp);
  811. kmem_cache_destroy(cifs_sm_req_cachep);
  812. }
  813. static int
  814. cifs_init_mids(void)
  815. {
  816. cifs_mid_cachep = kmem_cache_create("cifs_mpx_ids",
  817. sizeof(struct mid_q_entry), 0,
  818. SLAB_HWCACHE_ALIGN, NULL);
  819. if (cifs_mid_cachep == NULL)
  820. return -ENOMEM;
  821. /* 3 is a reasonable minimum number of simultaneous operations */
  822. cifs_mid_poolp = mempool_create_slab_pool(3, cifs_mid_cachep);
  823. if (cifs_mid_poolp == NULL) {
  824. kmem_cache_destroy(cifs_mid_cachep);
  825. return -ENOMEM;
  826. }
  827. cifs_oplock_cachep = kmem_cache_create("cifs_oplock_structs",
  828. sizeof(struct oplock_q_entry), 0,
  829. SLAB_HWCACHE_ALIGN, NULL);
  830. if (cifs_oplock_cachep == NULL) {
  831. mempool_destroy(cifs_mid_poolp);
  832. kmem_cache_destroy(cifs_mid_cachep);
  833. return -ENOMEM;
  834. }
  835. return 0;
  836. }
  837. static void
  838. cifs_destroy_mids(void)
  839. {
  840. mempool_destroy(cifs_mid_poolp);
  841. kmem_cache_destroy(cifs_mid_cachep);
  842. kmem_cache_destroy(cifs_oplock_cachep);
  843. }
  844. static int cifs_oplock_thread(void *dummyarg)
  845. {
  846. struct oplock_q_entry *oplock_item;
  847. struct cifsTconInfo *pTcon;
  848. struct inode *inode;
  849. __u16 netfid;
  850. int rc, waitrc = 0;
  851. set_freezable();
  852. do {
  853. if (try_to_freeze())
  854. continue;
  855. spin_lock(&GlobalMid_Lock);
  856. if (list_empty(&GlobalOplock_Q)) {
  857. spin_unlock(&GlobalMid_Lock);
  858. set_current_state(TASK_INTERRUPTIBLE);
  859. schedule_timeout(39*HZ);
  860. } else {
  861. oplock_item = list_entry(GlobalOplock_Q.next,
  862. struct oplock_q_entry, qhead);
  863. cFYI(1, ("found oplock item to write out"));
  864. pTcon = oplock_item->tcon;
  865. inode = oplock_item->pinode;
  866. netfid = oplock_item->netfid;
  867. spin_unlock(&GlobalMid_Lock);
  868. DeleteOplockQEntry(oplock_item);
  869. /* can not grab inode sem here since it would
  870. deadlock when oplock received on delete
  871. since vfs_unlink holds the i_mutex across
  872. the call */
  873. /* mutex_lock(&inode->i_mutex);*/
  874. if (S_ISREG(inode->i_mode)) {
  875. #ifdef CONFIG_CIFS_EXPERIMENTAL
  876. if (CIFS_I(inode)->clientCanCacheAll == 0)
  877. break_lease(inode, FMODE_READ);
  878. else if (CIFS_I(inode)->clientCanCacheRead == 0)
  879. break_lease(inode, FMODE_WRITE);
  880. #endif
  881. rc = filemap_fdatawrite(inode->i_mapping);
  882. if (CIFS_I(inode)->clientCanCacheRead == 0) {
  883. waitrc = filemap_fdatawait(
  884. inode->i_mapping);
  885. invalidate_remote_inode(inode);
  886. }
  887. if (rc == 0)
  888. rc = waitrc;
  889. } else
  890. rc = 0;
  891. /* mutex_unlock(&inode->i_mutex);*/
  892. if (rc)
  893. CIFS_I(inode)->write_behind_rc = rc;
  894. cFYI(1, ("Oplock flush inode %p rc %d",
  895. inode, rc));
  896. /* releasing stale oplock after recent reconnect
  897. of smb session using a now incorrect file
  898. handle is not a data integrity issue but do
  899. not bother sending an oplock release if session
  900. to server still is disconnected since oplock
  901. already released by the server in that case */
  902. if (!pTcon->need_reconnect) {
  903. rc = CIFSSMBLock(0, pTcon, netfid,
  904. 0 /* len */ , 0 /* offset */, 0,
  905. 0, LOCKING_ANDX_OPLOCK_RELEASE,
  906. false /* wait flag */);
  907. cFYI(1, ("Oplock release rc = %d", rc));
  908. }
  909. set_current_state(TASK_INTERRUPTIBLE);
  910. schedule_timeout(1); /* yield in case q were corrupt */
  911. }
  912. } while (!kthread_should_stop());
  913. return 0;
  914. }
  915. static int __init
  916. init_cifs(void)
  917. {
  918. int rc = 0;
  919. cifs_proc_init();
  920. INIT_LIST_HEAD(&cifs_tcp_ses_list);
  921. INIT_LIST_HEAD(&GlobalOplock_Q);
  922. #ifdef CONFIG_CIFS_EXPERIMENTAL
  923. INIT_LIST_HEAD(&GlobalDnotifyReqList);
  924. INIT_LIST_HEAD(&GlobalDnotifyRsp_Q);
  925. #endif
  926. /*
  927. * Initialize Global counters
  928. */
  929. atomic_set(&sesInfoAllocCount, 0);
  930. atomic_set(&tconInfoAllocCount, 0);
  931. atomic_set(&tcpSesAllocCount, 0);
  932. atomic_set(&tcpSesReconnectCount, 0);
  933. atomic_set(&tconInfoReconnectCount, 0);
  934. atomic_set(&bufAllocCount, 0);
  935. atomic_set(&smBufAllocCount, 0);
  936. #ifdef CONFIG_CIFS_STATS2
  937. atomic_set(&totBufAllocCount, 0);
  938. atomic_set(&totSmBufAllocCount, 0);
  939. #endif /* CONFIG_CIFS_STATS2 */
  940. atomic_set(&midCount, 0);
  941. GlobalCurrentXid = 0;
  942. GlobalTotalActiveXid = 0;
  943. GlobalMaxActiveXid = 0;
  944. memset(Local_System_Name, 0, 15);
  945. rwlock_init(&GlobalSMBSeslock);
  946. rwlock_init(&cifs_tcp_ses_lock);
  947. spin_lock_init(&GlobalMid_Lock);
  948. if (cifs_max_pending < 2) {
  949. cifs_max_pending = 2;
  950. cFYI(1, ("cifs_max_pending set to min of 2"));
  951. } else if (cifs_max_pending > 256) {
  952. cifs_max_pending = 256;
  953. cFYI(1, ("cifs_max_pending set to max of 256"));
  954. }
  955. rc = cifs_init_inodecache();
  956. if (rc)
  957. goto out_clean_proc;
  958. rc = cifs_init_mids();
  959. if (rc)
  960. goto out_destroy_inodecache;
  961. rc = cifs_init_request_bufs();
  962. if (rc)
  963. goto out_destroy_mids;
  964. rc = register_filesystem(&cifs_fs_type);
  965. if (rc)
  966. goto out_destroy_request_bufs;
  967. #ifdef CONFIG_CIFS_UPCALL
  968. rc = register_key_type(&cifs_spnego_key_type);
  969. if (rc)
  970. goto out_unregister_filesystem;
  971. #endif
  972. #ifdef CONFIG_CIFS_DFS_UPCALL
  973. rc = register_key_type(&key_type_dns_resolver);
  974. if (rc)
  975. goto out_unregister_key_type;
  976. #endif
  977. oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd");
  978. if (IS_ERR(oplockThread)) {
  979. rc = PTR_ERR(oplockThread);
  980. cERROR(1, ("error %d create oplock thread", rc));
  981. goto out_unregister_dfs_key_type;
  982. }
  983. return 0;
  984. out_unregister_dfs_key_type:
  985. #ifdef CONFIG_CIFS_DFS_UPCALL
  986. unregister_key_type(&key_type_dns_resolver);
  987. out_unregister_key_type:
  988. #endif
  989. #ifdef CONFIG_CIFS_UPCALL
  990. unregister_key_type(&cifs_spnego_key_type);
  991. out_unregister_filesystem:
  992. #endif
  993. unregister_filesystem(&cifs_fs_type);
  994. out_destroy_request_bufs:
  995. cifs_destroy_request_bufs();
  996. out_destroy_mids:
  997. cifs_destroy_mids();
  998. out_destroy_inodecache:
  999. cifs_destroy_inodecache();
  1000. out_clean_proc:
  1001. cifs_proc_clean();
  1002. return rc;
  1003. }
  1004. static void __exit
  1005. exit_cifs(void)
  1006. {
  1007. cFYI(DBG2, ("exit_cifs"));
  1008. cifs_proc_clean();
  1009. #ifdef CONFIG_CIFS_DFS_UPCALL
  1010. cifs_dfs_release_automount_timer();
  1011. unregister_key_type(&key_type_dns_resolver);
  1012. #endif
  1013. #ifdef CONFIG_CIFS_UPCALL
  1014. unregister_key_type(&cifs_spnego_key_type);
  1015. #endif
  1016. unregister_filesystem(&cifs_fs_type);
  1017. cifs_destroy_inodecache();
  1018. cifs_destroy_mids();
  1019. cifs_destroy_request_bufs();
  1020. kthread_stop(oplockThread);
  1021. }
  1022. MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>");
  1023. MODULE_LICENSE("GPL"); /* combination of LGPL + GPL source behaves as GPL */
  1024. MODULE_DESCRIPTION
  1025. ("VFS to access servers complying with the SNIA CIFS Specification "
  1026. "e.g. Samba and Windows");
  1027. MODULE_VERSION(CIFS_VERSION);
  1028. module_init(init_cifs)
  1029. module_exit(exit_cifs)