blk-mq: remove the error argument to blk_mq_complete_request
authorChristoph Hellwig <hch@lst.de>
Thu, 20 Apr 2017 14:03:09 +0000 (16:03 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 20 Apr 2017 18:16:10 +0000 (12:16 -0600)
Now that all drivers that call blk_mq_complete_requests have a
->complete callback we can remove the direct call to blk_mq_end_request,
as well as the error argument to blk_mq_complete_request.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
12 files changed:
block/blk-mq.c
drivers/block/loop.c
drivers/block/mtip32xx/mtip32xx.c
drivers/block/nbd.c
drivers/block/null_blk.c
drivers/block/virtio_blk.c
drivers/block/xen-blkfront.c
drivers/md/dm-rq.c
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
drivers/scsi/scsi_lib.c
include/linux/blk-mq.h

index c496692ecc5b8e2b717d40bad71aebdb398ea17f..3a2d179d49d67c2be15ab89ec699f088b3b91447 100644 (file)
@@ -442,17 +442,10 @@ static void blk_mq_stat_add(struct request *rq)
 
 static void __blk_mq_complete_request(struct request *rq)
 {
-       struct request_queue *q = rq->q;
-
        if (rq->internal_tag != -1)
                blk_mq_sched_completed_request(rq);
-
        blk_mq_stat_add(rq);
-
-       if (!q->softirq_done_fn)
-               blk_mq_end_request(rq, rq->errors);
-       else
-               blk_mq_ipi_complete_request(rq);
+       blk_mq_ipi_complete_request(rq);
 }
 
 /**
@@ -463,16 +456,14 @@ static void __blk_mq_complete_request(struct request *rq)
  *     Ends all I/O on a request. It does not handle partial completions.
  *     The actual completion happens out-of-order, through a IPI handler.
  **/
-void blk_mq_complete_request(struct request *rq, int error)
+void blk_mq_complete_request(struct request *rq)
 {
        struct request_queue *q = rq->q;
 
        if (unlikely(blk_should_fake_timeout(q)))
                return;
-       if (!blk_mark_rq_complete(rq)) {
-               rq->errors = error;
+       if (!blk_mark_rq_complete(rq))
                __blk_mq_complete_request(rq);
-       }
 }
 EXPORT_SYMBOL(blk_mq_complete_request);
 
index 86351b3f7350482a5bd136745a709fae4e2f5f2e..994403efee19de163238b62e722fb6a478b5f7d5 100644 (file)
@@ -465,7 +465,7 @@ static void lo_rw_aio_complete(struct kiocb *iocb, long ret, long ret2)
        struct loop_cmd *cmd = container_of(iocb, struct loop_cmd, iocb);
 
        cmd->ret = ret;
-       blk_mq_complete_request(cmd->rq, 0);
+       blk_mq_complete_request(cmd->rq);
 }
 
 static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd,
@@ -1685,7 +1685,7 @@ static void loop_handle_cmd(struct loop_cmd *cmd)
        /* complete non-aio request */
        if (!cmd->use_aio || ret) {
                cmd->ret = ret ? -EIO : 0;
-               blk_mq_complete_request(cmd->rq, 0);
+               blk_mq_complete_request(cmd->rq);
        }
 }
 
index 7406de29db5839cf55a8e2d76897f82df1970c66..66a6bd83faae8c74296f6a52e5feaab255894d77 100644 (file)
@@ -242,7 +242,7 @@ static void mtip_async_complete(struct mtip_port *port,
        rq = mtip_rq_from_tag(dd, tag);
 
        cmd->status = status;
-       blk_mq_complete_request(rq, 0);
+       blk_mq_complete_request(rq);
 }
 
 /*
@@ -4109,7 +4109,7 @@ static void mtip_no_dev_cleanup(struct request *rq, void *data, bool reserv)
 
        if (likely(!reserv)) {
                cmd->status = -ENODEV;
-               blk_mq_complete_request(rq, 0);
+               blk_mq_complete_request(rq);
        } else if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &dd->port->flags)) {
 
                cmd = mtip_cmd_from_tag(dd, MTIP_TAG_INTERNAL);
index 09a74a66beb1829d4eded127113b6c36e9041e1a..d387bef07fcce7bb529ff7d8e56ce7e3f62d7fcb 100644 (file)
@@ -635,7 +635,7 @@ static void recv_work(struct work_struct *work)
                        break;
                }
 
-               blk_mq_complete_request(blk_mq_rq_from_pdu(cmd), 0);
+               blk_mq_complete_request(blk_mq_rq_from_pdu(cmd));
        }
        atomic_dec(&config->recv_threads);
        wake_up(&config->recv_wq);
@@ -651,7 +651,7 @@ static void nbd_clear_req(struct request *req, void *data, bool reserved)
                return;
        cmd = blk_mq_rq_to_pdu(req);
        cmd->status = -EIO;
-       blk_mq_complete_request(req, 0);
+       blk_mq_complete_request(req);
 }
 
 static void nbd_clear_que(struct nbd_device *nbd)
index 0ca4aa34edb9cf6450eb83ab4ed3a511ccadae36..d946e1eeac8ef0dafbf3510f3aaa57925ea5f07c 100644 (file)
@@ -281,7 +281,7 @@ static inline void null_handle_cmd(struct nullb_cmd *cmd)
        case NULL_IRQ_SOFTIRQ:
                switch (queue_mode)  {
                case NULL_Q_MQ:
-                       blk_mq_complete_request(cmd->rq, 0);
+                       blk_mq_complete_request(cmd->rq);
                        break;
                case NULL_Q_RQ:
                        blk_complete_request(cmd->rq);
index dea2a58d67342864a7c34642f84d3de5b5fb811a..f94614257462c33d058bcadd22347c69060fdd40 100644 (file)
@@ -201,7 +201,7 @@ static void virtblk_done(struct virtqueue *vq)
                while ((vbr = virtqueue_get_buf(vblk->vqs[qid].vq, &len)) != NULL) {
                        struct request *req = blk_mq_rq_from_pdu(vbr);
 
-                       blk_mq_complete_request(req, 0);
+                       blk_mq_complete_request(req);
                        req_done = true;
                }
                if (unlikely(virtqueue_is_broken(vq)))
index 57866355c060d05997c7e94cb09f7f83456b5a6f..39459631667cc248a8d569bf13ed6e67273848ae 100644 (file)
@@ -1647,7 +1647,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
                        BUG();
                }
 
-               blk_mq_complete_request(req, 0);
+               blk_mq_complete_request(req);
        }
 
        rinfo->ring.rsp_cons = i;
index 1173be21f6f6faa1bd73fbe35bdd1900b05f51d2..bff7e3bdb4ed1d6bf8ff367e11fa13749dfd6776 100644 (file)
@@ -363,7 +363,7 @@ static void dm_complete_request(struct request *rq, int error)
        if (!rq->q->mq_ops)
                blk_complete_request(rq);
        else
-               blk_mq_complete_request(rq, 0);
+               blk_mq_complete_request(rq);
 }
 
 /*
index 805f250315ecda0af2a62a425a5e85f578540d41..8dc6647982936ee071d0a28f5e5c2fb69f5980fb 100644 (file)
@@ -117,7 +117,7 @@ void nvme_cancel_request(struct request *req, void *data, bool reserved)
        if (blk_queue_dying(req->q))
                status |= NVME_SC_DNR;
        nvme_req(req)->status = status;
-       blk_mq_complete_request(req, 0);
+       blk_mq_complete_request(req);
 
 }
 EXPORT_SYMBOL_GPL(nvme_cancel_request);
index 550037f5efea5bd1757b654f977c24bac7e3044a..c6ef6c30e2f0cd7953858de8525af27d1300a263 100644 (file)
@@ -251,7 +251,7 @@ static inline void nvme_end_request(struct request *req, __le16 status,
 
        rq->status = le16_to_cpu(status) >> 1;
        rq->result = result;
-       blk_mq_complete_request(req, 0);
+       blk_mq_complete_request(req);
 }
 
 void nvme_complete_rq(struct request *req);
index b9298a499e19aa995a85975f36f20c12d810e4ca..4a20e6098f7ca94dd7fc5ee4f1d5ce874fa2dafb 100644 (file)
@@ -1904,7 +1904,7 @@ static int scsi_mq_prep_fn(struct request *req)
 static void scsi_mq_done(struct scsi_cmnd *cmd)
 {
        trace_scsi_dispatch_cmd_done(cmd);
-       blk_mq_complete_request(cmd->request, 0);
+       blk_mq_complete_request(cmd->request);
 }
 
 static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
index d75de612845d5235c5859deb5f36d450b24671d6..0c4dadb85f62a5e3605be6b37845779d8bcfd73c 100644 (file)
@@ -228,7 +228,7 @@ void blk_mq_add_to_requeue_list(struct request *rq, bool at_head,
 void blk_mq_kick_requeue_list(struct request_queue *q);
 void blk_mq_delay_kick_requeue_list(struct request_queue *q, unsigned long msecs);
 void blk_mq_abort_requeue_list(struct request_queue *q);
-void blk_mq_complete_request(struct request *rq, int error);
+void blk_mq_complete_request(struct request *rq);
 
 bool blk_mq_queue_stopped(struct request_queue *q);
 void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx);