virtio_blk: support barriers without FLUSH feature
commit10bc310c27af1ed358e62351e7ac1d0110c3da27
authorChristoph Hellwig <hch@lst.de>
Tue, 15 Jun 2010 12:43:48 +0000 (15 14:43 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 5 Aug 2010 03:35:29 +0000 (5 13:05 +0930)
tree6277061961bff7cce8a40ac661374f575e57173f
parent3cfc2c42c1cbc8e238bb9c0612c0df4565e3a8b4
virtio_blk: support barriers without FLUSH feature

If we want to support barriers with the cache=writethrough mode in qemu
we need to tell the block layer that we only need queue drains to
implement a barrier.  Follow the model set by SCSI and IDE and assume
that there is no volatile write cache if the host doesn't advertize it.
While this might imply working barriers on old qemu versions or other
hypervisors that actually have a volatile write cache this is only a
cosmetic issue - these hypervisors don't guarantee any data integrity
with or without this patch, but with the patch we at least provide
data ordering.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/block/virtio_blk.c