Commit 5124c285 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

virtio_blk: use blk_mq_complete_request

Make sure to complete requests on the submitting CPU.  Previously this
was done in blk_mq_end_io, but the responsibility shifted to the drivers.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 30a91cb4
...@@ -110,9 +110,9 @@ static int __virtblk_add_req(struct virtqueue *vq, ...@@ -110,9 +110,9 @@ static int __virtblk_add_req(struct virtqueue *vq,
return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC);
} }
static inline void virtblk_request_done(struct virtblk_req *vbr) static inline void virtblk_request_done(struct request *req)
{ {
struct request *req = vbr->req; struct virtblk_req *vbr = req->special;
int error = virtblk_result(vbr); int error = virtblk_result(vbr);
if (req->cmd_type == REQ_TYPE_BLOCK_PC) { if (req->cmd_type == REQ_TYPE_BLOCK_PC) {
...@@ -138,7 +138,7 @@ static void virtblk_done(struct virtqueue *vq) ...@@ -138,7 +138,7 @@ static void virtblk_done(struct virtqueue *vq)
do { do {
virtqueue_disable_cb(vq); virtqueue_disable_cb(vq);
while ((vbr = virtqueue_get_buf(vblk->vq, &len)) != NULL) { while ((vbr = virtqueue_get_buf(vblk->vq, &len)) != NULL) {
virtblk_request_done(vbr); blk_mq_complete_request(vbr->req);
req_done = true; req_done = true;
} }
if (unlikely(virtqueue_is_broken(vq))) if (unlikely(virtqueue_is_broken(vq)))
...@@ -479,6 +479,7 @@ static struct blk_mq_ops virtio_mq_ops = { ...@@ -479,6 +479,7 @@ static struct blk_mq_ops virtio_mq_ops = {
.map_queue = blk_mq_map_queue, .map_queue = blk_mq_map_queue,
.alloc_hctx = blk_mq_alloc_single_hw_queue, .alloc_hctx = blk_mq_alloc_single_hw_queue,
.free_hctx = blk_mq_free_single_hw_queue, .free_hctx = blk_mq_free_single_hw_queue,
.complete = virtblk_request_done,
}; };
static struct blk_mq_reg virtio_mq_reg = { static struct blk_mq_reg virtio_mq_reg = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment