diff mbox series

[4/7] btrfs: use sync_blockdev

Message ID 20211019062530.2174626-5-hch@lst.de (mailing list archive)
State Accepted
Commit 1226dfff572f8878fdfc4ac2fd84a59c7a75f489
Headers show
Series [1/7] fs: remove __sync_filesystem | expand

Commit Message

Christoph Hellwig Oct. 19, 2021, 6:25 a.m. UTC
Use sync_blockdev instead of opencoding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chaitanya Kulkarni Oct. 19, 2021, 6:34 a.m. UTC | #1
On 10/18/2021 11:25 PM, Christoph Hellwig wrote:
> Use sync_blockdev instead of opencoding it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>


Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
David Sterba Oct. 19, 2021, 1:54 p.m. UTC | #2
On Tue, Oct 19, 2021 at 08:25:27AM +0200, Christoph Hellwig wrote:
> Use sync_blockdev instead of opencoding it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Acked-by: David Sterba <dsterba@suse.com>
diff mbox series

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 2ec3b8ac8fa35..b51e4b464103e 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -508,7 +508,7 @@  btrfs_get_bdev_and_sb(const char *device_path, fmode_t flags, void *holder,
 	}
 
 	if (flush)
-		filemap_write_and_wait((*bdev)->bd_inode->i_mapping);
+		sync_blockdev(*bdev);
 	ret = set_blocksize(*bdev, BTRFS_BDEV_BLOCKSIZE);
 	if (ret) {
 		blkdev_put(*bdev, flags);