diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-03-23 06:06:58 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-05-21 18:31:16 -0400 |
commit | 01a05b337a5b647909e1d6670f57e7202318a5fb (patch) | |
tree | 7877f08db14877d06346c8e1ef52aa17f2483e93 /fs/buffer.c | |
parent | 35cf7ba0b46dc3582a01c3860b14bff122662aa3 (diff) |
new helper: iterate_supers()
... and switch the simple "loop over superblocks and do something"
loops to it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index ded29b0fdac3..2914d9adfb50 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -560,25 +560,17 @@ repeat: | |||
560 | return err; | 560 | return err; |
561 | } | 561 | } |
562 | 562 | ||
563 | static void do_thaw_all(struct work_struct *work) | 563 | static void do_thaw_one(struct super_block *sb, void *unused) |
564 | { | 564 | { |
565 | struct super_block *sb, *n; | ||
566 | char b[BDEVNAME_SIZE]; | 565 | char b[BDEVNAME_SIZE]; |
566 | while (sb->s_bdev && !thaw_bdev(sb->s_bdev, sb)) | ||
567 | printk(KERN_WARNING "Emergency Thaw on %s\n", | ||
568 | bdevname(sb->s_bdev, b)); | ||
569 | } | ||
567 | 570 | ||
568 | spin_lock(&sb_lock); | 571 | static void do_thaw_all(struct work_struct *work) |
569 | list_for_each_entry_safe(sb, n, &super_blocks, s_list) { | 572 | { |
570 | if (list_empty(&sb->s_instances)) | 573 | iterate_supers(do_thaw_one, NULL); |
571 | continue; | ||
572 | sb->s_count++; | ||
573 | spin_unlock(&sb_lock); | ||
574 | down_read(&sb->s_umount); | ||
575 | while (sb->s_bdev && !thaw_bdev(sb->s_bdev, sb)) | ||
576 | printk(KERN_WARNING "Emergency Thaw on %s\n", | ||
577 | bdevname(sb->s_bdev, b)); | ||
578 | up_read(&sb->s_umount); | ||
579 | spin_lock(&sb_lock); | ||
580 | } | ||
581 | spin_unlock(&sb_lock); | ||
582 | kfree(work); | 574 | kfree(work); |
583 | printk(KERN_WARNING "Emergency Thaw complete\n"); | 575 | printk(KERN_WARNING "Emergency Thaw complete\n"); |
584 | } | 576 | } |