From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: "Josef Bacik" <jbacik@fb.com>,
"James Smart" <james.smart@broadcom.com>,
"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org,
linux-block@vger.kernel.org, dm-devel@redhat.com
Subject: [PATCH 16/23] blk-mq: remove the error argument to blk_mq_complete_request
Date: Thu, 20 Apr 2017 16:03:09 +0200 [thread overview]
Message-ID: <20170420140316.6546-17-hch@lst.de> (raw)
In-Reply-To: <20170420140316.6546-1-hch@lst.de>
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>
---
block/blk-mq.c | 15 +++------------
drivers/block/loop.c | 4 ++--
drivers/block/mtip32xx/mtip32xx.c | 4 ++--
drivers/block/nbd.c | 4 ++--
drivers/block/null_blk.c | 2 +-
drivers/block/virtio_blk.c | 2 +-
drivers/block/xen-blkfront.c | 2 +-
drivers/md/dm-rq.c | 2 +-
drivers/nvme/host/core.c | 2 +-
drivers/nvme/host/nvme.h | 2 +-
drivers/scsi/scsi_lib.c | 2 +-
include/linux/blk-mq.h | 2 +-
12 files changed, 17 insertions(+), 26 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index c496692ecc5b..3a2d179d49d6 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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);
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 86351b3f7350..994403efee19 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -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);
}
}
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 7406de29db58..66a6bd83faae 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -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);
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 09a74a66beb1..d387bef07fcc 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -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)
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index 0ca4aa34edb9..d946e1eeac8e 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -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);
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index dea2a58d6734..f94614257462 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -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)))
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 57866355c060..39459631667c 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -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;
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index 1173be21f6f6..bff7e3bdb4ed 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -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);
}
/*
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 805f250315ec..8dc664798293 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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);
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 550037f5efea..c6ef6c30e2f0 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -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);
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index b9298a499e19..4a20e6098f7c 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -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,
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index d75de612845d..0c4dadb85f62 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -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);
--
2.11.0
next prev parent reply other threads:[~2017-04-20 14:04 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-20 14:02 kill req->errors V4 Christoph Hellwig
2017-04-20 14:02 ` [PATCH 01/23] pd: don't check blk_execute_rq return value Christoph Hellwig
2017-04-20 14:59 ` Johannes Thumshirn
2017-04-20 14:02 ` [PATCH 02/23] block: remove the " Christoph Hellwig
2017-04-20 15:19 ` Bart Van Assche
2017-04-20 14:02 ` [PATCH 03/23] nvme-fc: fix status code handling in nvme_fc_fcpio_done Christoph Hellwig
2017-04-20 14:02 ` [PATCH 04/23] nvme: split nvme status from block req->errors Christoph Hellwig
2017-04-20 14:02 ` [PATCH 05/23] nvme: make nvme_error_status private Christoph Hellwig
2017-04-20 14:02 ` [PATCH 06/23] virtio: fix spelling of virtblk_scsi_request_done Christoph Hellwig
2017-04-20 14:03 ` [PATCH 07/23] virtio_blk: don't use req->errors Christoph Hellwig
2017-04-20 14:03 ` [PATCH 08/23] scsi: introduce a result field in struct scsi_request Christoph Hellwig
2017-04-20 15:25 ` Bart Van Assche
2017-04-20 14:03 ` [PATCH 09/23] loop: zero-fill bio on the submitting cpu Christoph Hellwig
2017-04-20 14:03 ` [PATCH 10/23] null_blk: don't pass always-0 req->errors to blk_mq_complete_request Christoph Hellwig
2017-04-20 15:02 ` Johannes Thumshirn
2017-04-20 14:03 ` [PATCH 11/23] dm rq: don't pass irrelevant error code " Christoph Hellwig
2017-04-20 15:04 ` Johannes Thumshirn
2017-04-20 15:25 ` Bart Van Assche
2017-04-20 14:03 ` [PATCH 12/23] dm mpath: don't check for req->errors Christoph Hellwig
2017-04-20 15:04 ` Johannes Thumshirn
2017-04-20 15:25 ` Bart Van Assche
2017-04-20 14:03 ` [PATCH 13/23] nbd: don't use req->errors Christoph Hellwig
2017-04-20 14:03 ` [PATCH 14/23] mtip32xx: add a status field to struct mtip_cmd Christoph Hellwig
2017-04-20 15:13 ` Johannes Thumshirn
2017-04-20 14:03 ` [PATCH 15/23] xen-blkfront: don't use req->errors Christoph Hellwig
2017-04-20 14:03 ` Christoph Hellwig [this message]
2017-04-20 15:14 ` [PATCH 16/23] blk-mq: remove the error argument to blk_mq_complete_request Johannes Thumshirn
2017-04-20 15:28 ` Bart Van Assche
2017-04-20 14:03 ` [PATCH 17/23] blk-mq: simplify __blk_mq_complete_request Christoph Hellwig
2017-04-20 14:03 ` [PATCH 18/23] block: add a error_count field to struct request Christoph Hellwig
2017-04-20 14:03 ` [PATCH 19/23] floppy: switch from req->errors to req->error_count Christoph Hellwig
2017-04-20 14:03 ` [PATCH 20/23] ataflop: " Christoph Hellwig
2017-04-20 14:03 ` [PATCH 21/23] swim3: remove (commented out) printing of req->errors Christoph Hellwig
2017-04-20 15:19 ` Johannes Thumshirn
2017-04-20 14:03 ` [PATCH 22/23] blktrace: remove the unused block_rq_abort tracepoint Christoph Hellwig
2017-04-20 15:20 ` Johannes Thumshirn
2017-04-20 15:25 ` Christoph Hellwig
2017-04-20 15:38 ` Johannes Thumshirn
2017-04-20 18:13 ` Jens Axboe
2017-04-20 14:03 ` [PATCH 23/23] block: remove the errors field from struct request Christoph Hellwig
2017-04-20 15:21 ` Johannes Thumshirn
2017-04-20 18:16 ` kill req->errors V4 Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2017-04-19 19:26 kill req->errors V3 Christoph Hellwig
2017-04-19 19:27 ` [PATCH 16/23] blk-mq: remove the error argument to blk_mq_complete_request Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170420140316.6546-17-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=james.smart@broadcom.com \
--cc=jbacik@fb.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=roger.pau@citrix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox