Michael S. Tsirkin
2016-Feb-24 15:11 UTC
[PATCH] virtio_blk: VIRTIO_BLK_F_WCE->VIRTIO_BLK_F_FLUSH
Latest virtio spec says the feature bit name is VIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_WCE is the legacy name. virtio blk header says exactly the reverse - fix that and update driver code to match. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- I'm inclined to merge it for the current kernel - safe and avoids confusion. include/uapi/linux/virtio_blk.h | 6 +++--- drivers/block/virtio_blk.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h index 19c66fc..c3f98df 100644 --- a/include/uapi/linux/virtio_blk.h +++ b/include/uapi/linux/virtio_blk.h @@ -43,11 +43,11 @@ #ifndef VIRTIO_BLK_NO_LEGACY #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ -#define VIRTIO_BLK_F_WCE 9 /* Writeback mode enabled after reset */ +#define VIRTIO_BLK_F_FLUSH 9 /* Writeback mode enabled after reset */ #define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ #ifndef __KERNEL__ -/* Old (deprecated) name for VIRTIO_BLK_F_WCE. */ -#define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE +/* Old (deprecated) name for VIRTIO_BLK_F_FLUSH. */ +#define VIRTIO_BLK_F_WCE VIRTIO_BLK_F_FLUSH #endif #endif /* !VIRTIO_BLK_NO_LEGACY */ diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 6ca3549..dbaebb0 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -478,7 +478,7 @@ static int virtblk_get_cache_mode(struct virtio_device *vdev) struct virtio_blk_config, wce, &writeback); if (err) - writeback = virtio_has_feature(vdev, VIRTIO_BLK_F_WCE); + writeback = virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH); return writeback; } @@ -833,14 +833,14 @@ static const struct virtio_device_id id_table[] = { static unsigned int features_legacy[] = { VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, VIRTIO_BLK_F_GEOMETRY, VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE, VIRTIO_BLK_F_SCSI, - VIRTIO_BLK_F_WCE, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE, + VIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE, VIRTIO_BLK_F_MQ, } ; static unsigned int features[] = { VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, VIRTIO_BLK_F_GEOMETRY, VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE, - VIRTIO_BLK_F_WCE, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE, + VIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE, VIRTIO_BLK_F_MQ, }; -- MST
Paolo Bonzini
2016-Feb-24 15:16 UTC
[PATCH] virtio_blk: VIRTIO_BLK_F_WCE->VIRTIO_BLK_F_FLUSH
On 24/02/2016 16:11, Michael S. Tsirkin wrote:> Latest virtio spec says the feature bit name is VIRTIO_BLK_F_FLUSH, > VIRTIO_BLK_F_WCE is the legacy name. virtio blk header says exactly the > reverse - fix that and update driver code to match. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > --- > I'm inclined to merge it for the current kernel - > safe and avoids confusion.Since you are at it, also change this:> +#define VIRTIO_BLK_F_FLUSH 9 /* Writeback mode enabled after reset */to /* Flush command supported */> #define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ > #ifndef __KERNEL__ > -/* Old (deprecated) name for VIRTIO_BLK_F_WCE. */ > -#define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE > +/* Old (deprecated) name for VIRTIO_BLK_F_FLUSH. */ > +#define VIRTIO_BLK_F_WCE VIRTIO_BLK_F_FLUSH > #endif > #endif /* !VIRTIO_BLK_NO_LEGACY */ > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > index 6ca3549..dbaebb0 100644 > --- a/drivers/block/virtio_blk.c > +++ b/drivers/block/virtio_blk.c > @@ -478,7 +478,7 @@ static int virtblk_get_cache_mode(struct virtio_device *vdev) > struct virtio_blk_config, wce, > &writeback);and add a comment here: /* * If WCE is not configurable and flush is not available, * assume no writeback cache is in use. */> if (err) > - writeback = virtio_has_feature(vdev, VIRTIO_BLK_F_WCE); > + writeback = virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH); > > return writeback; > } > @@ -833,14 +833,14 @@ static const struct virtio_device_id id_table[] = { > static unsigned int features_legacy[] = { > VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, VIRTIO_BLK_F_GEOMETRY, > VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE, VIRTIO_BLK_F_SCSI, > - VIRTIO_BLK_F_WCE, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE, > + VIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE, > VIRTIO_BLK_F_MQ, > } > ; > static unsigned int features[] = { > VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, VIRTIO_BLK_F_GEOMETRY, > VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE, > - VIRTIO_BLK_F_WCE, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE, > + VIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE, > VIRTIO_BLK_F_MQ, > }; > >
Maybe Matching Threads
- [PATCH] virtio_blk: VIRTIO_BLK_F_WCE->VIRTIO_BLK_F_FLUSH
- [PATCH v2] virtio_blk: VIRTIO_BLK_F_WCE->VIRTIO_BLK_F_FLUSH
- [PATCH v2] virtio_blk: VIRTIO_BLK_F_WCE->VIRTIO_BLK_F_FLUSH
- [PATCH] virtio-blk: use VIRTIO_BLK_F_WCE and VIRTIO_BLK_F_CONFIG_WCE in virtio1
- [PATCH] virtio-blk: use VIRTIO_BLK_F_WCE and VIRTIO_BLK_F_CONFIG_WCE in virtio1