dir.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /*
  2. * fs/cifs/dir.c
  3. *
  4. * vfs operations that deal with dentries
  5. *
  6. * Copyright (C) International Business Machines Corp., 2002,2005
  7. * Author(s): Steve French (sfrench@us.ibm.com)
  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. #include <linux/fs.h>
  24. #include <linux/stat.h>
  25. #include <linux/slab.h>
  26. #include <linux/namei.h>
  27. #include "cifsfs.h"
  28. #include "cifspdu.h"
  29. #include "cifsglob.h"
  30. #include "cifsproto.h"
  31. #include "cifs_debug.h"
  32. #include "cifs_fs_sb.h"
  33. static void
  34. renew_parental_timestamps(struct dentry *direntry)
  35. {
  36. /* BB check if there is a way to get the kernel to do this or if we really need this */
  37. do {
  38. direntry->d_time = jiffies;
  39. direntry = direntry->d_parent;
  40. } while (!IS_ROOT(direntry));
  41. }
  42. /* Note: caller must free return buffer */
  43. char *
  44. build_path_from_dentry(struct dentry *direntry)
  45. {
  46. struct dentry *temp;
  47. int namelen;
  48. int pplen;
  49. char *full_path;
  50. char dirsep;
  51. if(direntry == NULL)
  52. return NULL; /* not much we can do if dentry is freed and
  53. we need to reopen the file after it was closed implicitly
  54. when the server crashed */
  55. dirsep = CIFS_DIR_SEP(CIFS_SB(direntry->d_sb));
  56. pplen = CIFS_SB(direntry->d_sb)->prepathlen;
  57. cifs_bp_rename_retry:
  58. namelen = pplen;
  59. for (temp = direntry; !IS_ROOT(temp);) {
  60. namelen += (1 + temp->d_name.len);
  61. temp = temp->d_parent;
  62. if(temp == NULL) {
  63. cERROR(1,("corrupt dentry"));
  64. return NULL;
  65. }
  66. }
  67. full_path = kmalloc(namelen+1, GFP_KERNEL);
  68. if(full_path == NULL)
  69. return full_path;
  70. full_path[namelen] = 0; /* trailing null */
  71. for (temp = direntry; !IS_ROOT(temp);) {
  72. namelen -= 1 + temp->d_name.len;
  73. if (namelen < 0) {
  74. break;
  75. } else {
  76. full_path[namelen] = dirsep;
  77. strncpy(full_path + namelen + 1, temp->d_name.name,
  78. temp->d_name.len);
  79. cFYI(0, ("name: %s", full_path + namelen));
  80. }
  81. temp = temp->d_parent;
  82. if(temp == NULL) {
  83. cERROR(1,("corrupt dentry"));
  84. kfree(full_path);
  85. return NULL;
  86. }
  87. }
  88. if (namelen != pplen) {
  89. cERROR(1,
  90. ("did not end path lookup where expected namelen is %d",
  91. namelen));
  92. /* presumably this is only possible if racing with a rename
  93. of one of the parent directories (we can not lock the dentries
  94. above us to prevent this, but retrying should be harmless) */
  95. kfree(full_path);
  96. goto cifs_bp_rename_retry;
  97. }
  98. /* DIR_SEP already set for byte 0 / vs \ but not for
  99. subsequent slashes in prepath which currently must
  100. be entered the right way - not sure if there is an alternative
  101. since the '\' is a valid posix character so we can not switch
  102. those safely to '/' if any are found in the middle of the prepath */
  103. /* BB test paths to Windows with '/' in the midst of prepath */
  104. strncpy(full_path,CIFS_SB(direntry->d_sb)->prepath,pplen);
  105. return full_path;
  106. }
  107. /* char * build_wildcard_path_from_dentry(struct dentry *direntry)
  108. {
  109. if(full_path == NULL)
  110. return full_path;
  111. full_path[namelen] = '\\';
  112. full_path[namelen+1] = '*';
  113. full_path[namelen+2] = 0;
  114. BB remove above eight lines BB */
  115. /* Inode operations in similar order to how they appear in Linux file fs.h */
  116. int
  117. cifs_create(struct inode *inode, struct dentry *direntry, int mode,
  118. struct nameidata *nd)
  119. {
  120. int rc = -ENOENT;
  121. int xid;
  122. int oplock = 0;
  123. int desiredAccess = GENERIC_READ | GENERIC_WRITE;
  124. __u16 fileHandle;
  125. struct cifs_sb_info *cifs_sb;
  126. struct cifsTconInfo *pTcon;
  127. char *full_path = NULL;
  128. FILE_ALL_INFO * buf = NULL;
  129. struct inode *newinode = NULL;
  130. struct cifsFileInfo * pCifsFile = NULL;
  131. struct cifsInodeInfo * pCifsInode;
  132. int disposition = FILE_OVERWRITE_IF;
  133. int write_only = FALSE;
  134. xid = GetXid();
  135. cifs_sb = CIFS_SB(inode->i_sb);
  136. pTcon = cifs_sb->tcon;
  137. full_path = build_path_from_dentry(direntry);
  138. if(full_path == NULL) {
  139. FreeXid(xid);
  140. return -ENOMEM;
  141. }
  142. if(nd && (nd->flags & LOOKUP_OPEN)) {
  143. int oflags = nd->intent.open.flags;
  144. desiredAccess = 0;
  145. if (oflags & FMODE_READ)
  146. desiredAccess |= GENERIC_READ;
  147. if (oflags & FMODE_WRITE) {
  148. desiredAccess |= GENERIC_WRITE;
  149. if (!(oflags & FMODE_READ))
  150. write_only = TRUE;
  151. }
  152. if((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
  153. disposition = FILE_CREATE;
  154. else if((oflags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
  155. disposition = FILE_OVERWRITE_IF;
  156. else if((oflags & O_CREAT) == O_CREAT)
  157. disposition = FILE_OPEN_IF;
  158. else {
  159. cFYI(1,("Create flag not set in create function"));
  160. }
  161. }
  162. /* BB add processing to set equivalent of mode - e.g. via CreateX with ACLs */
  163. if (oplockEnabled)
  164. oplock = REQ_OPLOCK;
  165. buf = kmalloc(sizeof(FILE_ALL_INFO),GFP_KERNEL);
  166. if(buf == NULL) {
  167. kfree(full_path);
  168. FreeXid(xid);
  169. return -ENOMEM;
  170. }
  171. if (cifs_sb->tcon->ses->capabilities & CAP_NT_SMBS)
  172. rc = CIFSSMBOpen(xid, pTcon, full_path, disposition,
  173. desiredAccess, CREATE_NOT_DIR,
  174. &fileHandle, &oplock, buf, cifs_sb->local_nls,
  175. cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
  176. else
  177. rc = -EIO; /* no NT SMB support fall into legacy open below */
  178. if(rc == -EIO) {
  179. /* old server, retry the open legacy style */
  180. rc = SMBLegacyOpen(xid, pTcon, full_path, disposition,
  181. desiredAccess, CREATE_NOT_DIR,
  182. &fileHandle, &oplock, buf, cifs_sb->local_nls,
  183. cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
  184. }
  185. if (rc) {
  186. cFYI(1, ("cifs_create returned 0x%x", rc));
  187. } else {
  188. /* If Open reported that we actually created a file
  189. then we now have to set the mode if possible */
  190. if ((cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
  191. (oplock & CIFS_CREATE_ACTION))
  192. if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
  193. CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
  194. (__u64)current->fsuid,
  195. (__u64)current->fsgid,
  196. 0 /* dev */,
  197. cifs_sb->local_nls,
  198. cifs_sb->mnt_cifs_flags &
  199. CIFS_MOUNT_MAP_SPECIAL_CHR);
  200. } else {
  201. CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
  202. (__u64)-1,
  203. (__u64)-1,
  204. 0 /* dev */,
  205. cifs_sb->local_nls,
  206. cifs_sb->mnt_cifs_flags &
  207. CIFS_MOUNT_MAP_SPECIAL_CHR);
  208. }
  209. else {
  210. /* BB implement mode setting via Windows security descriptors */
  211. /* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/
  212. /* could set r/o dos attribute if mode & 0222 == 0 */
  213. }
  214. /* BB server might mask mode so we have to query for Unix case*/
  215. if (pTcon->ses->capabilities & CAP_UNIX)
  216. rc = cifs_get_inode_info_unix(&newinode, full_path,
  217. inode->i_sb,xid);
  218. else {
  219. rc = cifs_get_inode_info(&newinode, full_path,
  220. buf, inode->i_sb,xid);
  221. if(newinode) {
  222. newinode->i_mode = mode;
  223. if((oplock & CIFS_CREATE_ACTION) &&
  224. (cifs_sb->mnt_cifs_flags &
  225. CIFS_MOUNT_SET_UID)) {
  226. newinode->i_uid = current->fsuid;
  227. newinode->i_gid = current->fsgid;
  228. }
  229. }
  230. }
  231. if (rc != 0) {
  232. cFYI(1,
  233. ("Create worked but get_inode_info failed rc = %d",
  234. rc));
  235. } else {
  236. if (pTcon->nocase)
  237. direntry->d_op = &cifs_ci_dentry_ops;
  238. else
  239. direntry->d_op = &cifs_dentry_ops;
  240. d_instantiate(direntry, newinode);
  241. }
  242. if((nd->flags & LOOKUP_OPEN) == FALSE) {
  243. /* mknod case - do not leave file open */
  244. CIFSSMBClose(xid, pTcon, fileHandle);
  245. } else if(newinode) {
  246. pCifsFile =
  247. kzalloc(sizeof (struct cifsFileInfo), GFP_KERNEL);
  248. if(pCifsFile == NULL)
  249. goto cifs_create_out;
  250. pCifsFile->netfid = fileHandle;
  251. pCifsFile->pid = current->tgid;
  252. pCifsFile->pInode = newinode;
  253. pCifsFile->invalidHandle = FALSE;
  254. pCifsFile->closePend = FALSE;
  255. init_MUTEX(&pCifsFile->fh_sem);
  256. init_MUTEX(&pCifsFile->lock_sem);
  257. INIT_LIST_HEAD(&pCifsFile->llist);
  258. atomic_set(&pCifsFile->wrtPending,0);
  259. /* set the following in open now
  260. pCifsFile->pfile = file; */
  261. write_lock(&GlobalSMBSeslock);
  262. list_add(&pCifsFile->tlist,&pTcon->openFileList);
  263. pCifsInode = CIFS_I(newinode);
  264. if(pCifsInode) {
  265. /* if readable file instance put first in list*/
  266. if (write_only == TRUE) {
  267. list_add_tail(&pCifsFile->flist,
  268. &pCifsInode->openFileList);
  269. } else {
  270. list_add(&pCifsFile->flist,
  271. &pCifsInode->openFileList);
  272. }
  273. if((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
  274. pCifsInode->clientCanCacheAll = TRUE;
  275. pCifsInode->clientCanCacheRead = TRUE;
  276. cFYI(1,("Exclusive Oplock for inode %p",
  277. newinode));
  278. } else if((oplock & 0xF) == OPLOCK_READ)
  279. pCifsInode->clientCanCacheRead = TRUE;
  280. }
  281. write_unlock(&GlobalSMBSeslock);
  282. }
  283. }
  284. cifs_create_out:
  285. kfree(buf);
  286. kfree(full_path);
  287. FreeXid(xid);
  288. return rc;
  289. }
  290. int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
  291. dev_t device_number)
  292. {
  293. int rc = -EPERM;
  294. int xid;
  295. struct cifs_sb_info *cifs_sb;
  296. struct cifsTconInfo *pTcon;
  297. char *full_path = NULL;
  298. struct inode * newinode = NULL;
  299. if (!old_valid_dev(device_number))
  300. return -EINVAL;
  301. xid = GetXid();
  302. cifs_sb = CIFS_SB(inode->i_sb);
  303. pTcon = cifs_sb->tcon;
  304. full_path = build_path_from_dentry(direntry);
  305. if(full_path == NULL)
  306. rc = -ENOMEM;
  307. else if (pTcon->ses->capabilities & CAP_UNIX) {
  308. if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
  309. rc = CIFSSMBUnixSetPerms(xid, pTcon, full_path,
  310. mode,(__u64)current->fsuid,(__u64)current->fsgid,
  311. device_number, cifs_sb->local_nls,
  312. cifs_sb->mnt_cifs_flags &
  313. CIFS_MOUNT_MAP_SPECIAL_CHR);
  314. } else {
  315. rc = CIFSSMBUnixSetPerms(xid, pTcon,
  316. full_path, mode, (__u64)-1, (__u64)-1,
  317. device_number, cifs_sb->local_nls,
  318. cifs_sb->mnt_cifs_flags &
  319. CIFS_MOUNT_MAP_SPECIAL_CHR);
  320. }
  321. if(!rc) {
  322. rc = cifs_get_inode_info_unix(&newinode, full_path,
  323. inode->i_sb,xid);
  324. if (pTcon->nocase)
  325. direntry->d_op = &cifs_ci_dentry_ops;
  326. else
  327. direntry->d_op = &cifs_dentry_ops;
  328. if(rc == 0)
  329. d_instantiate(direntry, newinode);
  330. }
  331. } else {
  332. if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
  333. int oplock = 0;
  334. u16 fileHandle;
  335. FILE_ALL_INFO * buf;
  336. cFYI(1,("sfu compat create special file"));
  337. buf = kmalloc(sizeof(FILE_ALL_INFO),GFP_KERNEL);
  338. if(buf == NULL) {
  339. kfree(full_path);
  340. FreeXid(xid);
  341. return -ENOMEM;
  342. }
  343. rc = CIFSSMBOpen(xid, pTcon, full_path,
  344. FILE_CREATE, /* fail if exists */
  345. GENERIC_WRITE /* BB would
  346. WRITE_OWNER | WRITE_DAC be better? */,
  347. /* Create a file and set the
  348. file attribute to SYSTEM */
  349. CREATE_NOT_DIR | CREATE_OPTION_SPECIAL,
  350. &fileHandle, &oplock, buf,
  351. cifs_sb->local_nls,
  352. cifs_sb->mnt_cifs_flags &
  353. CIFS_MOUNT_MAP_SPECIAL_CHR);
  354. /* BB FIXME - add handling for backlevel servers
  355. which need legacy open and check for all
  356. calls to SMBOpen for fallback to
  357. SMBLeagcyOpen */
  358. if(!rc) {
  359. /* BB Do not bother to decode buf since no
  360. local inode yet to put timestamps in,
  361. but we can reuse it safely */
  362. int bytes_written;
  363. struct win_dev *pdev;
  364. pdev = (struct win_dev *)buf;
  365. if(S_ISCHR(mode)) {
  366. memcpy(pdev->type, "IntxCHR", 8);
  367. pdev->major =
  368. cpu_to_le64(MAJOR(device_number));
  369. pdev->minor =
  370. cpu_to_le64(MINOR(device_number));
  371. rc = CIFSSMBWrite(xid, pTcon,
  372. fileHandle,
  373. sizeof(struct win_dev),
  374. 0, &bytes_written, (char *)pdev,
  375. NULL, 0);
  376. } else if(S_ISBLK(mode)) {
  377. memcpy(pdev->type, "IntxBLK", 8);
  378. pdev->major =
  379. cpu_to_le64(MAJOR(device_number));
  380. pdev->minor =
  381. cpu_to_le64(MINOR(device_number));
  382. rc = CIFSSMBWrite(xid, pTcon,
  383. fileHandle,
  384. sizeof(struct win_dev),
  385. 0, &bytes_written, (char *)pdev,
  386. NULL, 0);
  387. } /* else if(S_ISFIFO */
  388. CIFSSMBClose(xid, pTcon, fileHandle);
  389. d_drop(direntry);
  390. }
  391. kfree(buf);
  392. /* add code here to set EAs */
  393. }
  394. }
  395. kfree(full_path);
  396. FreeXid(xid);
  397. return rc;
  398. }
  399. struct dentry *
  400. cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct nameidata *nd)
  401. {
  402. int xid;
  403. int rc = 0; /* to get around spurious gcc warning, set to zero here */
  404. struct cifs_sb_info *cifs_sb;
  405. struct cifsTconInfo *pTcon;
  406. struct inode *newInode = NULL;
  407. char *full_path = NULL;
  408. xid = GetXid();
  409. cFYI(1,
  410. (" parent inode = 0x%p name is: %s and dentry = 0x%p",
  411. parent_dir_inode, direntry->d_name.name, direntry));
  412. /* BB Add check of incoming data - e.g. frame not longer than maximum SMB - let server check the namelen BB */
  413. /* check whether path exists */
  414. cifs_sb = CIFS_SB(parent_dir_inode->i_sb);
  415. pTcon = cifs_sb->tcon;
  416. /*
  417. * Don't allow the separator character in a path component.
  418. * The VFS will not allow "/", but "\" is allowed by posix.
  419. */
  420. if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
  421. int i;
  422. for (i = 0; i < direntry->d_name.len; i++)
  423. if (direntry->d_name.name[i] == '\\') {
  424. cFYI(1, ("Invalid file name"));
  425. FreeXid(xid);
  426. return ERR_PTR(-EINVAL);
  427. }
  428. }
  429. /* can not grab the rename sem here since it would
  430. deadlock in the cases (beginning of sys_rename itself)
  431. in which we already have the sb rename sem */
  432. full_path = build_path_from_dentry(direntry);
  433. if(full_path == NULL) {
  434. FreeXid(xid);
  435. return ERR_PTR(-ENOMEM);
  436. }
  437. if (direntry->d_inode != NULL) {
  438. cFYI(1, (" non-NULL inode in lookup"));
  439. } else {
  440. cFYI(1, (" NULL inode in lookup"));
  441. }
  442. cFYI(1,
  443. (" Full path: %s inode = 0x%p", full_path, direntry->d_inode));
  444. if (pTcon->ses->capabilities & CAP_UNIX)
  445. rc = cifs_get_inode_info_unix(&newInode, full_path,
  446. parent_dir_inode->i_sb,xid);
  447. else
  448. rc = cifs_get_inode_info(&newInode, full_path, NULL,
  449. parent_dir_inode->i_sb,xid);
  450. if ((rc == 0) && (newInode != NULL)) {
  451. if (pTcon->nocase)
  452. direntry->d_op = &cifs_ci_dentry_ops;
  453. else
  454. direntry->d_op = &cifs_dentry_ops;
  455. d_add(direntry, newInode);
  456. /* since paths are not looked up by component - the parent
  457. directories are presumed to be good here */
  458. renew_parental_timestamps(direntry);
  459. } else if (rc == -ENOENT) {
  460. rc = 0;
  461. direntry->d_time = jiffies;
  462. if (pTcon->nocase)
  463. direntry->d_op = &cifs_ci_dentry_ops;
  464. else
  465. direntry->d_op = &cifs_dentry_ops;
  466. d_add(direntry, NULL);
  467. /* if it was once a directory (but how can we tell?) we could do
  468. shrink_dcache_parent(direntry); */
  469. } else {
  470. cERROR(1,("Error 0x%x on cifs_get_inode_info in lookup of %s",
  471. rc,full_path));
  472. /* BB special case check for Access Denied - watch security
  473. exposure of returning dir info implicitly via different rc
  474. if file exists or not but no access BB */
  475. }
  476. kfree(full_path);
  477. FreeXid(xid);
  478. return ERR_PTR(rc);
  479. }
  480. static int
  481. cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
  482. {
  483. int isValid = 1;
  484. if (direntry->d_inode) {
  485. if (cifs_revalidate(direntry)) {
  486. return 0;
  487. }
  488. } else {
  489. cFYI(1, ("neg dentry 0x%p name = %s",
  490. direntry, direntry->d_name.name));
  491. if(time_after(jiffies, direntry->d_time + HZ) ||
  492. !lookupCacheEnabled) {
  493. d_drop(direntry);
  494. isValid = 0;
  495. }
  496. }
  497. return isValid;
  498. }
  499. /* static int cifs_d_delete(struct dentry *direntry)
  500. {
  501. int rc = 0;
  502. cFYI(1, ("In cifs d_delete, name = %s", direntry->d_name.name));
  503. return rc;
  504. } */
  505. struct dentry_operations cifs_dentry_ops = {
  506. .d_revalidate = cifs_d_revalidate,
  507. /* d_delete: cifs_d_delete, *//* not needed except for debugging */
  508. /* no need for d_hash, d_compare, d_release, d_iput ... yet. BB confirm this BB */
  509. };
  510. static int cifs_ci_hash(struct dentry *dentry, struct qstr *q)
  511. {
  512. struct nls_table *codepage = CIFS_SB(dentry->d_inode->i_sb)->local_nls;
  513. unsigned long hash;
  514. int i;
  515. hash = init_name_hash();
  516. for (i = 0; i < q->len; i++)
  517. hash = partial_name_hash(nls_tolower(codepage, q->name[i]),
  518. hash);
  519. q->hash = end_name_hash(hash);
  520. return 0;
  521. }
  522. static int cifs_ci_compare(struct dentry *dentry, struct qstr *a,
  523. struct qstr *b)
  524. {
  525. struct nls_table *codepage = CIFS_SB(dentry->d_inode->i_sb)->local_nls;
  526. if ((a->len == b->len) &&
  527. (nls_strnicmp(codepage, a->name, b->name, a->len) == 0)) {
  528. /*
  529. * To preserve case, don't let an existing negative dentry's
  530. * case take precedence. If a is not a negative dentry, this
  531. * should have no side effects
  532. */
  533. memcpy((unsigned char *)a->name, b->name, a->len);
  534. return 0;
  535. }
  536. return 1;
  537. }
  538. struct dentry_operations cifs_ci_dentry_ops = {
  539. .d_revalidate = cifs_d_revalidate,
  540. .d_hash = cifs_ci_hash,
  541. .d_compare = cifs_ci_compare,
  542. };