]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
virtio: set max_segment_size and max_sectors to infinite.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 30 Dec 2008 15:26:04 +0000 (09:26 -0600)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 29 Dec 2008 22:56:05 +0000 (09:26 +1030)
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>
drivers/block/virtio_blk.c

index 85d79a02d48726c150e6f8f1b17889f84bc8cc8d..0e2ade648aff24837b8ca098f68c1c5d3d7b338a 100644 (file)
@@ -277,6 +277,9 @@ static int virtblk_probe(struct virtio_device *vdev)
        }
        set_capacity(vblk->disk, cap);
 
+       /* No real sector limit. */
+       blk_queue_max_sectors(vblk->disk->queue, -1U);
+
        /* Host can optionally specify maximum segment size and number of
         * segments. */
        err = virtio_config_val(vdev, VIRTIO_BLK_F_SIZE_MAX,
@@ -284,6 +287,8 @@ static int virtblk_probe(struct virtio_device *vdev)
                                &v);
        if (!err)
                blk_queue_max_segment_size(vblk->disk->queue, v);
+       else
+               blk_queue_max_segment_size(vblk->disk->queue, -1UL);
 
        err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX,
                                offsetof(struct virtio_blk_config, seg_max),