History

virtio_blk: correct tags for config space fields

Tag config space fields as having virtio endian-ness.

Michael S. Tsirkin committed 6 years ago

Commit 40e04c41 parent c73cb101 file · +13 −13Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/virtio_blk.h+13−13
@@ -57,20 +57,20 @@ · 56 unmodified lines
5757
5858 struct virtio_blk_config {
5959 /* The capacity (in 512-byte sectors). */
60− __u64 capacity;
60+ __virtio64 capacity;
6161 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
62− __u32 size_max;
62+ __virtio32 size_max;
6363 /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
64− __u32 seg_max;
64+ __virtio32 seg_max;
6565 /* geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */
6666 struct virtio_blk_geometry {
67− __u16 cylinders;
67+ __virtio16 cylinders;
6868 __u8 heads;
6969 __u8 sectors;
7070 } geometry;
7171
7272 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
73− __u32 blk_size;
73+ __virtio32 blk_size;
7474
7575 /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */
7676 /* exponent for physical block per logical block. */
@@ -78,42 +78,42 @@ struct virtio_blk_config { · 1 unmodified line
7878 /* alignment offset in logical blocks. */
7979 __u8 alignment_offset;
8080 /* minimum I/O size without performance penalty in logical blocks. */
81− __u16 min_io_size;
81+ __virtio16 min_io_size;
8282 /* optimal sustained I/O size in logical blocks. */
83− __u32 opt_io_size;
83+ __virtio32 opt_io_size;
8484
8585 /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
8686 __u8 wce;
8787 __u8 unused;
8888
8989 /* number of vqs, only available when VIRTIO_BLK_F_MQ is set */
90− __u16 num_queues;
90+ __virtio16 num_queues;
9191
9292 /* the next 3 entries are guarded by VIRTIO_BLK_F_DISCARD */
9393 /*
9494 * The maximum discard sectors (in 512-byte sectors) for
9595 * one segment.
9696 */
97− __u32 max_discard_sectors;
97+ __virtio32 max_discard_sectors;
9898 /*
9999 * The maximum number of discard segments in a
100100 * discard command.
101101 */
102− __u32 max_discard_seg;
102+ __virtio32 max_discard_seg;
103103 /* Discard commands must be aligned to this number of sectors. */
104− __u32 discard_sector_alignment;
104+ __virtio32 discard_sector_alignment;
105105
106106 /* the next 3 entries are guarded by VIRTIO_BLK_F_WRITE_ZEROES */
107107 /*
108108 * The maximum number of write zeroes sectors (in 512-byte sectors) in
109109 * one segment.
110110 */
111− __u32 max_write_zeroes_sectors;
111+ __virtio32 max_write_zeroes_sectors;
112112 /*
113113 * The maximum number of segments in a write zeroes
114114 * command.
115115 */
116− __u32 max_write_zeroes_seg;
116+ __virtio32 max_write_zeroes_seg;
117117 /*
118118 * Set if a VIRTIO_BLK_T_WRITE_ZEROES request may result in the
119119 * deallocation of one or more of the sectors.