]> git.karo-electronics.de Git - karo-tx-linux.git/commit
virtio-blk: allow toggling host cache between writeback and writethrough
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 3 Jul 2012 13:19:37 +0000 (15:19 +0200)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sat, 21 Jul 2012 22:28:15 +0000 (08:28 +1000)
commit3740323690914333f1a1361e59a4715d89d16b11
tree9692e10d91a528a57496add717967d90694ecf1d
parent0da7b08d4c46b3b3b7f922df076a4f329a19eb01
virtio-blk: allow toggling host cache between writeback and writethrough

This patch adds support for the new VIRTIO_BLK_F_CONFIG_WCE feature,
which exposes the cache mode in the configuration space and lets the
driver modify it.  The cache mode is exposed via sysfs.

Even if the host does not support the new feature, the cache mode is
visible (thanks to the existing VIRTIO_BLK_F_WCE), but not modifiable.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/block/virtio_blk.c
include/linux/virtio_blk.h