diff mbox series

[4/4] btrfs: Don't opencode sync_blockdev

Message ID 20200722080925.6802-5-nborisov@suse.com (mailing list archive)
State New, archived
Headers show
Series Misc cleanups around device addition | expand

Commit Message

Nikolay Borisov July 22, 2020, 8:09 a.m. UTC
Instead of opencoding filemap_write_and_wait simply call syncblockdev as
it makes it abundandtly clear what's going on and why this is used. No
semantics changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Johannes Thumshirn July 22, 2020, 9:20 a.m. UTC | #1
On 22/07/2020 10:09, Nikolay Borisov wrote:
> Instead of opencoding filemap_write_and_wait simply call syncblockdev as
                                             sync_blockdev() ~^
> it makes it abundandtly clear what's going on and why this is used. No
  abundantly ~^

Otherwise:
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Anand Jain July 30, 2020, 5:05 a.m. UTC | #2
On 22/7/20 4:09 pm, Nikolay Borisov wrote:
> Instead of opencoding filemap_write_and_wait simply call syncblockdev as
> it makes it abundandtly clear what's going on and why this is used. No
> semantics changes.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>   fs/btrfs/volumes.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 17047c118969..d42571f36fcf 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -2499,7 +2499,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);

  Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand

>   
>   	rcu_read_lock();
>   	list_for_each_entry_rcu(device, &fs_devices->devices, dev_list) {
>
diff mbox series

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 17047c118969..d42571f36fcf 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2499,7 +2499,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) {