summaryrefslogtreecommitdiff
path: root/drivers/block/virtio_blk.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2016-03-30 10:12:58 -0600
committerJens Axboe <axboe@fb.com>2016-04-12 16:00:39 -0600
commitad9126ac723f9e8ed900194d226a0608ffeae45e (patch)
tree7b211dde6dcf01d19e244e68e3880f4c1e57768b /drivers/block/virtio_blk.c
parent12c95f137d09450b2c2e86fb12da5c7cf585b322 (diff)
downloadlwn-ad9126ac723f9e8ed900194d226a0608ffeae45e.tar.gz
lwn-ad9126ac723f9e8ed900194d226a0608ffeae45e.zip
virtio_blk: switch to using blk_queue_write_cache()
Signed-off-by: Jens Axboe <axboe@fb.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/block/virtio_blk.c')
-rw-r--r--drivers/block/virtio_blk.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 28cff0d23d82..42758b52768c 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -493,11 +493,7 @@ static void virtblk_update_cache_mode(struct virtio_device *vdev)
u8 writeback = virtblk_get_cache_mode(vdev);
struct virtio_blk *vblk = vdev->priv;
- if (writeback)
- blk_queue_flush(vblk->disk->queue, REQ_FLUSH);
- else
- blk_queue_flush(vblk->disk->queue, 0);
-
+ blk_queue_write_cache(vblk->disk->queue, writeback, false);
revalidate_disk(vblk->disk);
}