···536536 */537537static void prune_dcache(int count)538538{539539- struct super_block *sb;539539+ struct super_block *sb, *n;540540 int w_count;541541 int unused = dentry_stat.nr_unused;542542 int prune_ratio;···545545 if (unused == 0 || count == 0)546546 return;547547 spin_lock(&dcache_lock);548548-restart:549548 if (count >= unused)550549 prune_ratio = 1;551550 else552551 prune_ratio = unused / count;553552 spin_lock(&sb_lock);554554- list_for_each_entry(sb, &super_blocks, s_list) {553553+ list_for_each_entry_safe(sb, n, &super_blocks, s_list) {555554 if (list_empty(&sb->s_instances))556555 continue;557556 if (sb->s_nr_dentry_unused == 0)···591592 }592593 spin_lock(&sb_lock);593594 count -= pruned;594594- /*595595- * restart only when sb is no longer on the list and596596- * we have more work to do.597597- */598598- if (__put_super_and_need_restart(sb) && count > 0) {599599- spin_unlock(&sb_lock);600600- goto restart;601601- }595595+ __put_super(sb);596596+ /* more work left to do? */597597+ if (count <= 0)598598+ break;602599 }603600 spin_unlock(&sb_lock);604601 spin_unlock(&dcache_lock);