diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-03-22 20:09:33 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-05-21 18:31:15 -0400 |
commit | 6754af64641e8224c281ee5714e012e3ed41f701 (patch) | |
tree | 248a8c01aae46f98505d8c196393fae629f9691a /fs/drop_caches.c | |
parent | 8edd64bd6089e21f47dcdebb14b598b713213ddc (diff) |
Convert simple loops over superblocks to list_for_each_entry_safe
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/drop_caches.c')
-rw-r--r-- | fs/drop_caches.c | 8 |
1 files changed, 3 insertions, 5 deletions
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) | |||
35 | 35 | ||
36 | static void drop_pagecache(void) | 36 | static void drop_pagecache(void) |
37 | { | 37 | { |
38 | struct super_block *sb; | 38 | struct super_block *sb, *n; |
39 | 39 | ||
40 | spin_lock(&sb_lock); | 40 | spin_lock(&sb_lock); |
41 | restart: | 41 | list_for_each_entry_safe(sb, n, &super_blocks, s_list) { |
42 | list_for_each_entry(sb, &super_blocks, s_list) { | ||
43 | if (list_empty(&sb->s_instances)) | 42 | if (list_empty(&sb->s_instances)) |
44 | continue; | 43 | continue; |
45 | sb->s_count++; | 44 | sb->s_count++; |
@@ -49,8 +48,7 @@ restart: | |||
49 | drop_pagecache_sb(sb); | 48 | drop_pagecache_sb(sb); |
50 | up_read(&sb->s_umount); | 49 | up_read(&sb->s_umount); |
51 | spin_lock(&sb_lock); | 50 | spin_lock(&sb_lock); |
52 | if (__put_super_and_need_restart(sb)) | 51 | __put_super(sb); |
53 | goto restart; | ||
54 | } | 52 | } |
55 | spin_unlock(&sb_lock); | 53 | spin_unlock(&sb_lock); |
56 | } | 54 | } |