diff options
author | Christoph Hellwig <hch@lst.de> | 2022-04-15 07:52:43 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-18 04:49:59 +0300 |
commit | 08e688fdb8f7e862092ae64cee20bc8b463d1046 (patch) | |
tree | 8c85516d2478db6988a5d73b1032622a2897a705 /drivers/block/xen-blkback | |
parent | 10f0d2a517796b8f6dc04fb0cc3e49003ae6b0bc (diff) | |
download | linux-08e688fdb8f7e862092ae64cee20bc8b463d1046.tar.xz |
block: add a bdev_write_cache helper
Add a helper to check the write cache flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: David Sterba <dsterba@suse.com> [btrfs]
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220415045258.199825-13-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/xen-blkback')
-rw-r--r-- | drivers/block/xen-blkback/xenbus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index f09040435e2e..8b691fe50475 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -517,7 +517,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle, vbd->type |= VDISK_REMOVABLE; q = bdev_get_queue(bdev); - if (q && test_bit(QUEUE_FLAG_WC, &q->queue_flags)) + if (bdev_write_cache(bdev)) vbd->flush_support = true; if (q && blk_queue_secure_erase(q)) |