diff options
-rw-r--r-- | drivers/block/virtio_blk.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 879506a2c234..6ec5fc052786 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c | |||
@@ -47,20 +47,20 @@ static void blk_done(struct virtqueue *vq) | |||
47 | 47 | ||
48 | spin_lock_irqsave(&vblk->lock, flags); | 48 | spin_lock_irqsave(&vblk->lock, flags); |
49 | while ((vbr = vblk->vq->vq_ops->get_buf(vblk->vq, &len)) != NULL) { | 49 | while ((vbr = vblk->vq->vq_ops->get_buf(vblk->vq, &len)) != NULL) { |
50 | int uptodate; | 50 | int error; |
51 | switch (vbr->status) { | 51 | switch (vbr->status) { |
52 | case VIRTIO_BLK_S_OK: | 52 | case VIRTIO_BLK_S_OK: |
53 | uptodate = 1; | 53 | error = 0; |
54 | break; | 54 | break; |
55 | case VIRTIO_BLK_S_UNSUPP: | 55 | case VIRTIO_BLK_S_UNSUPP: |
56 | uptodate = -ENOTTY; | 56 | error = -ENOTTY; |
57 | break; | 57 | break; |
58 | default: | 58 | default: |
59 | uptodate = 0; | 59 | error = -EIO; |
60 | break; | 60 | break; |
61 | } | 61 | } |
62 | 62 | ||
63 | end_dequeued_request(vbr->req, uptodate); | 63 | __blk_end_request(vbr->req, error, blk_rq_bytes(vbr->req)); |
64 | list_del(&vbr->list); | 64 | list_del(&vbr->list); |
65 | mempool_free(vbr, vblk->pool); | 65 | mempool_free(vbr, vblk->pool); |
66 | } | 66 | } |