virtio_blk: correct tags for config space fields
authorMichael S. Tsirkin <mst@redhat.com>
Fri, 10 Jul 2020 11:17:13 +0000 (07:17 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 5 Aug 2020 15:08:39 +0000 (11:08 -0400)
Tag config space fields as having virtio endian-ness.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
include/uapi/linux/virtio_blk.h

index 0f99d7b..d888f01 100644 (file)
 
 struct virtio_blk_config {
        /* The capacity (in 512-byte sectors). */
-       __u64 capacity;
+       __virtio64 capacity;
        /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
-       __u32 size_max;
+       __virtio32 size_max;
        /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
-       __u32 seg_max;
+       __virtio32 seg_max;
        /* geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */
        struct virtio_blk_geometry {
-               __u16 cylinders;
+               __virtio16 cylinders;
                __u8 heads;
                __u8 sectors;
        } geometry;
 
        /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
-       __u32 blk_size;
+       __virtio32 blk_size;
 
        /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY  */
        /* exponent for physical block per logical block. */
@@ -78,42 +78,42 @@ struct virtio_blk_config {
        /* alignment offset in logical blocks. */
        __u8 alignment_offset;
        /* minimum I/O size without performance penalty in logical blocks. */
-       __u16 min_io_size;
+       __virtio16 min_io_size;
        /* optimal sustained I/O size in logical blocks. */
-       __u32 opt_io_size;
+       __virtio32 opt_io_size;
 
        /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
        __u8 wce;
        __u8 unused;
 
        /* number of vqs, only available when VIRTIO_BLK_F_MQ is set */
-       __u16 num_queues;
+       __virtio16 num_queues;
 
        /* the next 3 entries are guarded by VIRTIO_BLK_F_DISCARD */
        /*
         * The maximum discard sectors (in 512-byte sectors) for
         * one segment.
         */
-       __u32 max_discard_sectors;
+       __virtio32 max_discard_sectors;
        /*
         * The maximum number of discard segments in a
         * discard command.
         */
-       __u32 max_discard_seg;
+       __virtio32 max_discard_seg;
        /* Discard commands must be aligned to this number of sectors. */
-       __u32 discard_sector_alignment;
+       __virtio32 discard_sector_alignment;
 
        /* the next 3 entries are guarded by VIRTIO_BLK_F_WRITE_ZEROES */
        /*
         * The maximum number of write zeroes sectors (in 512-byte sectors) in
         * one segment.
         */
-       __u32 max_write_zeroes_sectors;
+       __virtio32 max_write_zeroes_sectors;
        /*
         * The maximum number of segments in a write zeroes
         * command.
         */
-       __u32 max_write_zeroes_seg;
+       __virtio32 max_write_zeroes_seg;
        /*
         * Set if a VIRTIO_BLK_T_WRITE_ZEROES request may result in the
         * deallocation of one or more of the sectors.