btrfs: Don't opencode sync_blockdev in btrfs_init_dev_replace_tgtdev
authorNikolay Borisov <nborisov@suse.com>
Tue, 14 May 2019 10:54:38 +0000 (13:54 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 1 Jul 2019 11:34:53 +0000 (13:34 +0200)
Using sync_blockdev makes it plain obvious what's happening. No
functional changes.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
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/dev-replace.c

index ee0989c7e3a9ca3a78465be5ec6780a046c6e322..1b83787176f9a5e4e8250e767dfdcf44e9d40a63 100644 (file)
@@ -201,7 +201,7 @@ static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
                return PTR_ERR(bdev);
        }
 
-       filemap_write_and_wait(bdev->bd_inode->i_mapping);
+       sync_blockdev(bdev);
 
        devices = &fs_info->fs_devices->devices;
        list_for_each_entry(device, devices, dev_list) {