]> 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)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 30 Jul 2012 04:00:52 +0000 (13:30 +0930)
commitcd5d503862b0d0d927c56ef2e34d3ededac88039
tree73d31dddd2d63ab2fce0880ee77e9525065a4027
parent2c95a3290919541b846bee3e0fbaa75860929f53
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