aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/dcache.c38
1 files changed, 4 insertions, 34 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 1f8e6acb0ea4..8150e4e9e88b 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -650,9 +650,8 @@ EXPORT_SYMBOL(dput);
650 * @dentry: dentry to invalidate 650 * @dentry: dentry to invalidate
651 * 651 *
652 * Try to invalidate the dentry if it turns out to be 652 * Try to invalidate the dentry if it turns out to be
653 * possible. If there are other dentries that can be 653 * possible. If there are reasons not to delete it
654 * reached through this one we can't delete it and we 654 * return -EBUSY. On success return 0.
655 * return -EBUSY. On success we return 0.
656 * 655 *
657 * no dcache lock. 656 * no dcache lock.
658 */ 657 */
@@ -667,38 +666,9 @@ int d_invalidate(struct dentry * dentry)
667 spin_unlock(&dentry->d_lock); 666 spin_unlock(&dentry->d_lock);
668 return 0; 667 return 0;
669 } 668 }
670 /*
671 * Check whether to do a partial shrink_dcache
672 * to get rid of unused child entries.
673 */
674 if (!list_empty(&dentry->d_subdirs)) {
675 spin_unlock(&dentry->d_lock);
676 shrink_dcache_parent(dentry);
677 spin_lock(&dentry->d_lock);
678 }
679
680 /*
681 * Somebody else still using it?
682 *
683 * If it's a directory, we can't drop it
684 * for fear of somebody re-populating it
685 * with children (even though dropping it
686 * would make it unreachable from the root,
687 * we might still populate it if it was a
688 * working directory or similar).
689 * We also need to leave mountpoints alone,
690 * directory or not.
691 */
692 if (dentry->d_lockref.count > 1 && dentry->d_inode) {
693 if (S_ISDIR(dentry->d_inode->i_mode) || d_mountpoint(dentry)) {
694 spin_unlock(&dentry->d_lock);
695 return -EBUSY;
696 }
697 }
698
699 __d_drop(dentry);
700 spin_unlock(&dentry->d_lock); 669 spin_unlock(&dentry->d_lock);
701 return 0; 670
671 return check_submounts_and_drop(dentry);
702} 672}
703EXPORT_SYMBOL(d_invalidate); 673EXPORT_SYMBOL(d_invalidate);
704 674