btrfs: don't opencode sync_blockdev in btrfs_init_new_device
authorNikolay Borisov <nborisov@suse.com>
Wed, 22 Jul 2020 08:09:25 +0000 (11:09 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:12:15 +0000 (12:12 +0200)
Instead of opencoding filemap_write_and_wait simply call syncblockdev as
it makes it abundantly clear what's going on and why this is used. No
semantics changes.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c

index 9355f5c78c155711d70356e047e19f10cf8f71bf..9d169cba8514574147052b1a44fb4c78bbfc0d91 100644 (file)
@@ -2512,7 +2512,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
                locked = true;
        }
 
-       filemap_write_and_wait(bdev->bd_inode->i_mapping);
+       sync_blockdev(bdev);
 
        rcu_read_lock();
        list_for_each_entry_rcu(device, &fs_devices->devices, dev_list) {