Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283218
b: refs/heads/master
c: eaf5f90
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi authored and Al Viro committed Jan 10, 2012
1 parent 32ccc9b commit 8fb8507
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 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: f4947fbce208990266920d51837e4e7ba9779db1
refs/heads/master: eaf5f9073533cde21c7121c136f1c3f072d9cf59
15 changes: 11 additions & 4 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ static void dentry_lru_add(struct dentry *dentry)
static void __dentry_lru_del(struct dentry *dentry)
{
list_del_init(&dentry->d_lru);
dentry->d_flags &= ~DCACHE_SHRINK_LIST;
dentry->d_sb->s_nr_dentry_unused--;
dentry_stat.nr_unused--;
}
Expand Down Expand Up @@ -806,6 +807,7 @@ void prune_dcache_sb(struct super_block *sb, int count)
spin_unlock(&dentry->d_lock);
} else {
list_move_tail(&dentry->d_lru, &tmp);
dentry->d_flags |= DCACHE_SHRINK_LIST;
spin_unlock(&dentry->d_lock);
if (!--count)
break;
Expand Down Expand Up @@ -1097,14 +1099,19 @@ static int select_parent(struct dentry *parent, struct list_head *dispose)

/*
* move only zero ref count dentries to the dispose list.
*
* Those which are presently on the shrink list, being processed
* by shrink_dentry_list(), shouldn't be moved. Otherwise the
* loop in shrink_dcache_parent() might not make any progress
* and loop forever.
*/
if (!dentry->d_count) {
if (dentry->d_count) {
dentry_lru_del(dentry);
} else if (!(dentry->d_flags & DCACHE_SHRINK_LIST)) {
dentry_lru_move_list(dentry, dispose);
dentry->d_flags |= DCACHE_SHRINK_LIST;
found++;
} else {
dentry_lru_del(dentry);
}

/*
* We can return to the caller if we have found some (this
* ensures forward progress). We'll be coming back to find
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/dcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ struct dentry_operations {

#define DCACHE_CANT_MOUNT 0x0100
#define DCACHE_GENOCIDE 0x0200
#define DCACHE_SHRINK_LIST 0x0400

#define DCACHE_NFSFS_RENAMED 0x1000
/* this dentry has been "silly renamed" and has to be deleted on the last
Expand Down

0 comments on commit 8fb8507

Please sign in to comment.