Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197947
b: refs/heads/master
c: 79893c1
h: refs/heads/master
i:
  197945: b3e4668
  197943: 45eddbf
v: v3
  • Loading branch information
Al Viro committed May 21, 2010
1 parent 0e93067 commit ebdbdfb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 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: df40c01a9249873e4ad0625ae5d9fb831962b75c
refs/heads/master: 79893c17b45dec0d3c25bc22d28d9f319b14f573
17 changes: 6 additions & 11 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ static void __shrink_dcache_sb(struct super_block *sb, int *count, int flags)
*/
static void prune_dcache(int count)
{
struct super_block *sb;
struct super_block *sb, *n;
int w_count;
int unused = dentry_stat.nr_unused;
int prune_ratio;
Expand All @@ -545,13 +545,12 @@ static void prune_dcache(int count)
if (unused == 0 || count == 0)
return;
spin_lock(&dcache_lock);
restart:
if (count >= unused)
prune_ratio = 1;
else
prune_ratio = unused / count;
spin_lock(&sb_lock);
list_for_each_entry(sb, &super_blocks, s_list) {
list_for_each_entry_safe(sb, n, &super_blocks, s_list) {
if (list_empty(&sb->s_instances))
continue;
if (sb->s_nr_dentry_unused == 0)
Expand Down Expand Up @@ -592,14 +591,10 @@ static void prune_dcache(int count)
}
spin_lock(&sb_lock);
count -= pruned;
/*
* restart only when sb is no longer on the list and
* we have more work to do.
*/
if (__put_super_and_need_restart(sb) && count > 0) {
spin_unlock(&sb_lock);
goto restart;
}
__put_super(sb);
/* more work left to do? */
if (count <= 0)
break;
}
spin_unlock(&sb_lock);
spin_unlock(&dcache_lock);
Expand Down

0 comments on commit ebdbdfb

Please sign in to comment.