diff options
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 16b21522e8fe..aa4ea965b329 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -465,12 +465,20 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name | |||
465 | direntry->d_op = &cifs_dentry_ops; | 465 | direntry->d_op = &cifs_dentry_ops; |
466 | d_add(direntry, newInode); | 466 | d_add(direntry, newInode); |
467 | 467 | ||
468 | /* since paths are not looked up by component - the parent directories are presumed to be good here */ | 468 | /* since paths are not looked up by component - the parent |
469 | directories are presumed to be good here */ | ||
469 | renew_parental_timestamps(direntry); | 470 | renew_parental_timestamps(direntry); |
470 | 471 | ||
471 | } else if (rc == -ENOENT) { | 472 | } else if (rc == -ENOENT) { |
472 | rc = 0; | 473 | rc = 0; |
474 | direntry->d_time = jiffies; | ||
475 | if (pTcon->nocase) | ||
476 | direntry->d_op = &cifs_ci_dentry_ops; | ||
477 | else | ||
478 | direntry->d_op = &cifs_dentry_ops; | ||
473 | d_add(direntry, NULL); | 479 | d_add(direntry, NULL); |
480 | /* if it was once a directory (but how can we tell?) we could do | ||
481 | shrink_dcache_parent(direntry); */ | ||
474 | } else { | 482 | } else { |
475 | cERROR(1,("Error 0x%x on cifs_get_inode_info in lookup of %s", | 483 | cERROR(1,("Error 0x%x on cifs_get_inode_info in lookup of %s", |
476 | rc,full_path)); | 484 | rc,full_path)); |
@@ -489,21 +497,20 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) | |||
489 | { | 497 | { |
490 | int isValid = 1; | 498 | int isValid = 1; |
491 | 499 | ||
492 | /* lock_kernel(); *//* surely we do not want to lock the kernel for a whole network round trip which could take seconds */ | ||
493 | |||
494 | if (direntry->d_inode) { | 500 | if (direntry->d_inode) { |
495 | if (cifs_revalidate(direntry)) { | 501 | if (cifs_revalidate(direntry)) { |
496 | /* unlock_kernel(); */ | ||
497 | return 0; | 502 | return 0; |
498 | } | 503 | } |
499 | } else { | 504 | } else { |
500 | cFYI(1, | 505 | cFYI(1, ("neg dentry 0x%p name = %s", |
501 | ("In cifs_d_revalidate with no inode but name = %s and dentry 0x%p", | 506 | direntry, direntry->d_name.name)); |
502 | direntry->d_name.name, direntry)); | 507 | if(time_after(jiffies, direntry->d_time + HZ) || |
508 | !lookupCacheEnabled) { | ||
509 | d_drop(direntry); | ||
510 | isValid = 0; | ||
511 | } | ||
503 | } | 512 | } |
504 | 513 | ||
505 | /* unlock_kernel(); */ | ||
506 | |||
507 | return isValid; | 514 | return isValid; |
508 | } | 515 | } |
509 | 516 | ||