Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40406
b: refs/heads/master
c: f871357
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Oct 28, 2006
1 parent 5a20869 commit 4a6a53d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6eac3f93f5e6b7256fb20b7608d62ec192da12be
refs/heads/master: f87135762de4328c6f17897e803e6909bc056feb
10 changes: 8 additions & 2 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ void shrink_dcache_sb(struct super_block * sb)
static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
{
struct dentry *parent;
unsigned detached = 0;

BUG_ON(!IS_ROOT(dentry));

Expand Down Expand Up @@ -621,7 +622,7 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
atomic_dec(&parent->d_count);

list_del(&dentry->d_u.d_child);
dentry_stat.nr_dentry--; /* For d_free, below */
detached++;

inode = dentry->d_inode;
if (inode) {
Expand All @@ -639,7 +640,7 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
* otherwise we ascend to the parent and move to the
* next sibling if there is one */
if (!parent)
return;
goto out;

dentry = parent;

Expand All @@ -648,6 +649,11 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
dentry = list_entry(dentry->d_subdirs.next,
struct dentry, d_u.d_child);
}
out:
/* several dentries were freed, need to correct nr_dentry */
spin_lock(&dcache_lock);
dentry_stat.nr_dentry -= detached;
spin_unlock(&dcache_lock);
}

/*
Expand Down

0 comments on commit 4a6a53d

Please sign in to comment.