aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/virtio_blk.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-05-02 22:50:49 -0400
committerRusty Russell <rusty@rustcorp.com.au>2008-05-02 07:50:50 -0400
commit72e61eb40b55dd57031ec5971e810649f82b0259 (patch)
tree66a836c7799b21156d4fc87f42e5817d7d95535b /drivers/block/virtio_blk.c
parent5539ae9613587e4a4eec42d420b8bdd9ff552a65 (diff)
virtio: change config to guest endian.
A recent proposed feature addition to the virtio block driver revealed some flaws in the API, in particular how easy it is to break big endian machines. The virtio config space was originally chosen to be little-endian, because we thought the config might be part of the PCI config space for virtio_pci. It's actually a separate mmio region, so that argument holds little water; as only x86 is currently using the virtio mechanism, we can change this (but must do so now, before the impending s390 merge). API changes: - __virtio_config_val() just becomes a striaght vdev->config_get() call. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/block/virtio_blk.c')
-rw-r--r--drivers/block/virtio_blk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 7e83b6c6e3d6..cc6d39383a3f 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -246,8 +246,8 @@ static int virtblk_probe(struct virtio_device *vdev)
246 blk_queue_ordered(vblk->disk->queue, QUEUE_ORDERED_TAG, NULL); 246 blk_queue_ordered(vblk->disk->queue, QUEUE_ORDERED_TAG, NULL);
247 247
248 /* Host must always specify the capacity. */ 248 /* Host must always specify the capacity. */
249 __virtio_config_val(vdev, offsetof(struct virtio_blk_config, capacity), 249 vdev->config->get(vdev, offsetof(struct virtio_blk_config, capacity),
250 &cap); 250 &cap, sizeof(cap));
251 251
252 /* If capacity is too big, truncate with warning. */ 252 /* If capacity is too big, truncate with warning. */
253 if ((sector_t)cap != cap) { 253 if ((sector_t)cap != cap) {