From 6754af64641e8224c281ee5714e012e3ed41f701 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 22 Mar 2010 20:09:33 -0400 Subject: Convert simple loops over superblocks to list_for_each_entry_safe Signed-off-by: Al Viro --- fs/drop_caches.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'fs/drop_caches.c') diff --git a/fs/drop_caches.c b/fs/drop_caches.c index 9cd4e4a70f56..42728a1f795f 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c @@ -35,11 +35,10 @@ static void drop_pagecache_sb(struct super_block *sb) static void drop_pagecache(void) { - struct super_block *sb; + struct super_block *sb, *n; spin_lock(&sb_lock); -restart: - 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; sb->s_count++; @@ -49,8 +48,7 @@ restart: drop_pagecache_sb(sb); up_read(&sb->s_umount); spin_lock(&sb_lock); - if (__put_super_and_need_restart(sb)) - goto restart; + __put_super(sb); } spin_unlock(&sb_lock); } -- cgit v1.2.3