aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRyan Harper <ryanh@us.ibm.com>2008-04-16 14:56:37 -0400
committerRusty Russell <rusty@rustcorp.com.au>2008-05-02 07:50:51 -0400
commit48e4043d4529523cbc7fa8dd745bd8e2c45ce1d3 (patch)
tree15c2784498237de48c222c50b540123d5eeff464 /include/linux
parentc45a6816c19dee67b8f725e6646d428901a6dc24 (diff)
virtio: add virtio disk geometry feature
Rather than faking up some geometry, allow the backend to push the disk geometry via virtio pci config option. Keep the old geo code around for compatibility. Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified to single struct)
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/virtio_blk.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index c75a9e82b924..d4695a3356d0 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -9,6 +9,7 @@
9#define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ 9#define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */
10#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ 10#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */
11#define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ 11#define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */
12#define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */
12 13
13struct virtio_blk_config 14struct virtio_blk_config
14{ 15{
@@ -18,6 +19,12 @@ struct virtio_blk_config
18 __le32 size_max; 19 __le32 size_max;
19 /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */ 20 /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
20 __le32 seg_max; 21 __le32 seg_max;
22 /* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */
23 struct virtio_blk_geometry {
24 __le16 cylinders;
25 __u8 heads;
26 __u8 sectors;
27 } geometry;
21} __attribute__((packed)); 28} __attribute__((packed));
22 29
23/* These two define direction. */ 30/* These two define direction. */