aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/virtio_blk.c
diff options
context:
space:
mode:
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 29a9daf48621..dfe9ee5f1696 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -124,12 +124,11 @@ static bool do_req(struct request_queue *q, struct virtio_blk *vblk,
124 124
125static void do_virtblk_request(struct request_queue *q) 125static void do_virtblk_request(struct request_queue *q)
126{ 126{
127 struct virtio_blk *vblk = NULL; 127 struct virtio_blk *vblk = q->queuedata;
128 struct request *req; 128 struct request *req;
129 unsigned int issued = 0; 129 unsigned int issued = 0;
130 130
131 while ((req = blk_peek_request(q)) != NULL) { 131 while ((req = blk_peek_request(q)) != NULL) {
132 vblk = req->rq_disk->private_data;
133 BUG_ON(req->nr_phys_segments + 2 > vblk->sg_elems); 132 BUG_ON(req->nr_phys_segments + 2 > vblk->sg_elems);
134 133
135 /* If this request fails, stop queue and wait for something to 134 /* If this request fails, stop queue and wait for something to
@@ -249,6 +248,7 @@ static int virtblk_probe(struct virtio_device *vdev)
249 goto out_put_disk; 248 goto out_put_disk;
250 } 249 }
251 250
251 vblk->disk->queue->queuedata = vblk;
252 queue_flag_set_unlocked(QUEUE_FLAG_VIRT, vblk->disk->queue); 252 queue_flag_set_unlocked(QUEUE_FLAG_VIRT, vblk->disk->queue);
253 253
254 if (index < 26) { 254 if (index < 26) {