xen-blkback: use sync_blockdev
authorChristoph Hellwig <hch@lst.de>
Tue, 19 Oct 2021 06:25:26 +0000 (08:25 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 22 Oct 2021 14:36:55 +0000 (08:36 -0600)
Use sync_blockdev instead of opencoding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20211019062530.2174626-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/xen-blkback/xenbus.c

index 33eba3df4dd9af6f545856326a46378178c0db27..914587aabca0cd210eca2856d69a5204aa0005b3 100644 (file)
@@ -98,7 +98,7 @@ static void xen_update_blkif_status(struct xen_blkif *blkif)
                return;
        }
 
-       err = filemap_write_and_wait(blkif->vbd.bdev->bd_inode->i_mapping);
+       err = sync_blockdev(blkif->vbd.bdev);
        if (err) {
                xenbus_dev_error(blkif->be->dev, err, "block flush");
                return;