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

Unified · Split

include/uapi/linux/virtio_blk.h+13−13
@@ -57,20 +57,20 @@ · 56 unmodified lines
57 57
58struct virtio_blk_config {58struct virtio_blk_config {
59 /* The capacity (in 512-byte sectors). */59 /* The capacity (in 512-byte sectors). */
60 __u64 capacity;60 __virtio64 capacity;
61 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */61 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
62 __u32 size_max;62 __virtio32 size_max;
63 /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */63 /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
64 __u32 seg_max;64 __virtio32 seg_max;
65 /* geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */65 /* geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */
66 struct virtio_blk_geometry {66 struct virtio_blk_geometry {
67 __u16 cylinders;67 __virtio16 cylinders;
68 __u8 heads;68 __u8 heads;
69 __u8 sectors;69 __u8 sectors;
70 } geometry;70 } geometry;
71 71
72 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */72 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
73 __u32 blk_size;73 __virtio32 blk_size;
74 74
75 /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */75 /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */
76 /* exponent for physical block per logical block. */76 /* exponent for physical block per logical block. */
@@ -78,42 +78,42 @@ struct virtio_blk_config { · 1 unmodified line
78 /* alignment offset in logical blocks. */78 /* alignment offset in logical blocks. */
79 __u8 alignment_offset;79 __u8 alignment_offset;
80 /* minimum I/O size without performance penalty in logical blocks. */80 /* minimum I/O size without performance penalty in logical blocks. */
81 __u16 min_io_size;81 __virtio16 min_io_size;
82 /* optimal sustained I/O size in logical blocks. */82 /* optimal sustained I/O size in logical blocks. */
83 __u32 opt_io_size;83 __virtio32 opt_io_size;
84 84
85 /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */85 /* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
86 __u8 wce;86 __u8 wce;
87 __u8 unused;87 __u8 unused;
88 88
89 /* number of vqs, only available when VIRTIO_BLK_F_MQ is set */89 /* number of vqs, only available when VIRTIO_BLK_F_MQ is set */
90 __u16 num_queues;90 __virtio16 num_queues;
91 91
92 /* the next 3 entries are guarded by VIRTIO_BLK_F_DISCARD */92 /* the next 3 entries are guarded by VIRTIO_BLK_F_DISCARD */
93 /*93 /*
94 * The maximum discard sectors (in 512-byte sectors) for94 * The maximum discard sectors (in 512-byte sectors) for
95 * one segment.95 * one segment.
96 */96 */
97 __u32 max_discard_sectors;97 __virtio32 max_discard_sectors;
98 /*98 /*
99 * The maximum number of discard segments in a99 * The maximum number of discard segments in a
100 * discard command.100 * discard command.
101 */101 */
102 __u32 max_discard_seg;102 __virtio32 max_discard_seg;
103 /* Discard commands must be aligned to this number of sectors. */103 /* Discard commands must be aligned to this number of sectors. */
104 __u32 discard_sector_alignment;104 __virtio32 discard_sector_alignment;
105 105
106 /* the next 3 entries are guarded by VIRTIO_BLK_F_WRITE_ZEROES */106 /* the next 3 entries are guarded by VIRTIO_BLK_F_WRITE_ZEROES */
107 /*107 /*
108 * The maximum number of write zeroes sectors (in 512-byte sectors) in108 * The maximum number of write zeroes sectors (in 512-byte sectors) in
109 * one segment.109 * one segment.
110 */110 */
111 __u32 max_write_zeroes_sectors;111 __virtio32 max_write_zeroes_sectors;
112 /*112 /*
113 * The maximum number of segments in a write zeroes113 * The maximum number of segments in a write zeroes
114 * command.114 * command.
115 */115 */
116 __u32 max_write_zeroes_seg;116 __virtio32 max_write_zeroes_seg;
117 /*117 /*
118 * Set if a VIRTIO_BLK_T_WRITE_ZEROES request may result in the118 * Set if a VIRTIO_BLK_T_WRITE_ZEROES request may result in the
119 * deallocation of one or more of the sectors.119 * deallocation of one or more of the sectors.