dir.c 16 KB

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