aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/virtio_blk.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-02-24 15:22:25 -0500
committerRusty Russell <rusty@rustcorp.com.au>2010-02-23 22:52:26 -0500
commit69740c8ba878f58bc3c71f74618fc2cd1da990da (patch)
tree95a86d35fe234db2fd08b10cab0400ad1b2e56dd /include/linux/virtio_blk.h
parentd57ed95da483418e8b0433da693c9168dd0a2df6 (diff)
virtio_blk: add block topology support
Allow reading various alignment values from the config page. This allows the guest to much better align I/O requests depending on the storage topology. Note that the formats for the config values appear a bit messed up, but we follow the formats used by ATA and SCSI so they are expected in the storage world. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/virtio_blk.h')
-rw-r--r--include/linux/virtio_blk.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index fd294c56d571..e52029e98919 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -15,6 +15,7 @@
15#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ 15#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
16#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ 16#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */
17#define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ 17#define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */
18#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */
18 19
19struct virtio_blk_config { 20struct virtio_blk_config {
20 /* The capacity (in 512-byte sectors). */ 21 /* The capacity (in 512-byte sectors). */
@@ -29,8 +30,20 @@ struct virtio_blk_config {
29 __u8 heads; 30 __u8 heads;
30 __u8 sectors; 31 __u8 sectors;
31 } geometry; 32 } geometry;
33
32 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ 34 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
33 __u32 blk_size; 35 __u32 blk_size;
36
37 /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */
38 /* exponent for physical block per logical block. */
39 __u8 physical_block_exp;
40 /* alignment offset in logical blocks. */
41 __u8 alignment_offset;
42 /* minimum I/O size without performance penalty in logical blocks. */
43 __u16 min_io_size;
44 /* optimal sustained I/O size in logical blocks. */
45 __u32 opt_io_size;
46
34} __attribute__((packed)); 47} __attribute__((packed));
35 48
36/* 49/*