aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-12-30 10:26:04 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-12-29 17:56:05 -0500
commit4b7f7e2049956f6e946ad56c1ee093e7bab74da9 (patch)
tree23e307f720b8fd42465d5ec92da6b4205b6534a0 /drivers/block
parent1b4aa2faeca1b9922033daf2475b6fc13b0ffea6 (diff)
virtio: set max_segment_size and max_sectors to infinite.
Setting max_segment_size allows more than 64k per sg element, unless the host specified a limit. Setting max_sectors indicates that our max_hw_segments is the only limit. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/virtio_blk.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 85d79a02d487..0e2ade648aff 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -277,6 +277,9 @@ static int virtblk_probe(struct virtio_device *vdev)
277 } 277 }
278 set_capacity(vblk->disk, cap); 278 set_capacity(vblk->disk, cap);
279 279
280 /* No real sector limit. */
281 blk_queue_max_sectors(vblk->disk->queue, -1U);
282
280 /* Host can optionally specify maximum segment size and number of 283 /* Host can optionally specify maximum segment size and number of
281 * segments. */ 284 * segments. */
282 err = virtio_config_val(vdev, VIRTIO_BLK_F_SIZE_MAX, 285 err = virtio_config_val(vdev, VIRTIO_BLK_F_SIZE_MAX,
@@ -284,6 +287,8 @@ static int virtblk_probe(struct virtio_device *vdev)
284 &v); 287 &v);
285 if (!err) 288 if (!err)
286 blk_queue_max_segment_size(vblk->disk->queue, v); 289 blk_queue_max_segment_size(vblk->disk->queue, v);
290 else
291 blk_queue_max_segment_size(vblk->disk->queue, -1UL);
287 292
288 err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX, 293 err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX,
289 offsetof(struct virtio_blk_config, seg_max), 294 offsetof(struct virtio_blk_config, seg_max),