diff options
Diffstat (limited to 'fs/super.c')
-rw-r--r-- | fs/super.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/fs/super.c b/fs/super.c index 3d9f117dd2a3..18d159dc1e40 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -293,6 +293,7 @@ void __fsync_super(struct super_block *sb) | |||
293 | { | 293 | { |
294 | sync_inodes_sb(sb, 0); | 294 | sync_inodes_sb(sb, 0); |
295 | vfs_dq_sync(sb); | 295 | vfs_dq_sync(sb); |
296 | sync_inodes_sb(sb, 1); | ||
296 | lock_super(sb); | 297 | lock_super(sb); |
297 | if (sb->s_dirt && sb->s_op->write_super) | 298 | if (sb->s_dirt && sb->s_op->write_super) |
298 | sb->s_op->write_super(sb); | 299 | sb->s_op->write_super(sb); |
@@ -300,7 +301,6 @@ void __fsync_super(struct super_block *sb) | |||
300 | if (sb->s_op->sync_fs) | 301 | if (sb->s_op->sync_fs) |
301 | sb->s_op->sync_fs(sb, 1); | 302 | sb->s_op->sync_fs(sb, 1); |
302 | sync_blockdev(sb->s_bdev); | 303 | sync_blockdev(sb->s_bdev); |
303 | sync_inodes_sb(sb, 1); | ||
304 | } | 304 | } |
305 | 305 | ||
306 | /* | 306 | /* |
@@ -522,6 +522,33 @@ restart: | |||
522 | mutex_unlock(&mutex); | 522 | mutex_unlock(&mutex); |
523 | } | 523 | } |
524 | 524 | ||
525 | #ifdef CONFIG_BLOCK | ||
526 | /* | ||
527 | * Sync all block devices underlying some superblock | ||
528 | */ | ||
529 | void sync_blockdevs(void) | ||
530 | { | ||
531 | struct super_block *sb; | ||
532 | |||
533 | spin_lock(&sb_lock); | ||
534 | restart: | ||
535 | list_for_each_entry(sb, &super_blocks, s_list) { | ||
536 | if (!sb->s_bdev) | ||
537 | continue; | ||
538 | sb->s_count++; | ||
539 | spin_unlock(&sb_lock); | ||
540 | down_read(&sb->s_umount); | ||
541 | if (sb->s_root) | ||
542 | sync_blockdev(sb->s_bdev); | ||
543 | up_read(&sb->s_umount); | ||
544 | spin_lock(&sb_lock); | ||
545 | if (__put_super_and_need_restart(sb)) | ||
546 | goto restart; | ||
547 | } | ||
548 | spin_unlock(&sb_lock); | ||
549 | } | ||
550 | #endif | ||
551 | |||
525 | /** | 552 | /** |
526 | * get_super - get the superblock of a device | 553 | * get_super - get the superblock of a device |
527 | * @bdev: device to get the superblock for | 554 | * @bdev: device to get the superblock for |