From: Christoph Hellwig <hch@bombadil.infradead.org> 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, "Christoph Hellwig" <hch@lst.de> Subject: mtip32xx: add a status field to struct mtip_cmd Date: Tue, 18 Apr 2017 08:52:19 -0700 [thread overview] Message-ID: <20170418155229.5977-14-hch@bombadil.infradead.org> (raw) In-Reply-To: <20170418155229.5977-1-hch@bombadil.infradead.org> From: Christoph Hellwig <hch@lst.de> Instead of using req->errors, which will go away. Signed-off-by: Christoph Hellwig <hch@lst.de> --- drivers/block/mtip32xx/mtip32xx.c | 16 +++++++++------- drivers/block/mtip32xx/mtip32xx.h | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 05e3e664ea1b..7406de29db58 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -241,7 +241,8 @@ static void mtip_async_complete(struct mtip_port *port, rq = mtip_rq_from_tag(dd, tag); - blk_mq_complete_request(rq, status); + cmd->status = status; + blk_mq_complete_request(rq, 0); } /* @@ -2910,18 +2911,19 @@ static void mtip_softirq_done_fn(struct request *rq) if (unlikely(cmd->unaligned)) up(&dd->port->cmd_slot_unal); - blk_mq_end_request(rq, rq->errors); + blk_mq_end_request(rq, cmd->status); } static void mtip_abort_cmd(struct request *req, void *data, bool reserved) { + struct mtip_cmd *cmd = blk_mq_rq_to_pdu(req); struct driver_data *dd = data; dbg_printk(MTIP_DRV_NAME " Aborting request, tag = %d\n", req->tag); clear_bit(req->tag, dd->port->cmds_to_issue); - req->errors = -EIO; + cmd->status = -EIO; mtip_softirq_done_fn(req); } @@ -3816,7 +3818,6 @@ static int mtip_queue_rq(struct blk_mq_hw_ctx *hctx, if (likely(!ret)) return BLK_MQ_RQ_QUEUE_OK; - rq->errors = ret; return BLK_MQ_RQ_QUEUE_ERROR; } @@ -4106,9 +4107,10 @@ static void mtip_no_dev_cleanup(struct request *rq, void *data, bool reserv) struct driver_data *dd = (struct driver_data *)data; struct mtip_cmd *cmd; - if (likely(!reserv)) - blk_mq_complete_request(rq, -ENODEV); - else if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &dd->port->flags)) { + if (likely(!reserv)) { + cmd->status = -ENODEV; + blk_mq_complete_request(rq, 0); + } else if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &dd->port->flags)) { cmd = mtip_cmd_from_tag(dd, MTIP_TAG_INTERNAL); if (cmd->comp_func) diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h index 7617888f7944..57b41528a824 100644 --- a/drivers/block/mtip32xx/mtip32xx.h +++ b/drivers/block/mtip32xx/mtip32xx.h @@ -352,6 +352,7 @@ struct mtip_cmd { int retries; /* The number of retries left for this command. */ int direction; /* Data transfer direction */ + int status; }; /* Structure used to describe a port. */ -- 2.11.0
WARNING: multiple messages have this Message-ID (diff)
From: hch@bombadil.infradead.org (Christoph Hellwig) Subject: mtip32xx: add a status field to struct mtip_cmd Date: Tue, 18 Apr 2017 08:52:19 -0700 [thread overview] Message-ID: <20170418155229.5977-14-hch@bombadil.infradead.org> (raw) In-Reply-To: <20170418155229.5977-1-hch@bombadil.infradead.org> From: Christoph Hellwig <hch@lst.de> Instead of using req->errors, which will go away. Signed-off-by: Christoph Hellwig <hch at lst.de> --- drivers/block/mtip32xx/mtip32xx.c | 16 +++++++++------- drivers/block/mtip32xx/mtip32xx.h | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 05e3e664ea1b..7406de29db58 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -241,7 +241,8 @@ static void mtip_async_complete(struct mtip_port *port, rq = mtip_rq_from_tag(dd, tag); - blk_mq_complete_request(rq, status); + cmd->status = status; + blk_mq_complete_request(rq, 0); } /* @@ -2910,18 +2911,19 @@ static void mtip_softirq_done_fn(struct request *rq) if (unlikely(cmd->unaligned)) up(&dd->port->cmd_slot_unal); - blk_mq_end_request(rq, rq->errors); + blk_mq_end_request(rq, cmd->status); } static void mtip_abort_cmd(struct request *req, void *data, bool reserved) { + struct mtip_cmd *cmd = blk_mq_rq_to_pdu(req); struct driver_data *dd = data; dbg_printk(MTIP_DRV_NAME " Aborting request, tag = %d\n", req->tag); clear_bit(req->tag, dd->port->cmds_to_issue); - req->errors = -EIO; + cmd->status = -EIO; mtip_softirq_done_fn(req); } @@ -3816,7 +3818,6 @@ static int mtip_queue_rq(struct blk_mq_hw_ctx *hctx, if (likely(!ret)) return BLK_MQ_RQ_QUEUE_OK; - rq->errors = ret; return BLK_MQ_RQ_QUEUE_ERROR; } @@ -4106,9 +4107,10 @@ static void mtip_no_dev_cleanup(struct request *rq, void *data, bool reserv) struct driver_data *dd = (struct driver_data *)data; struct mtip_cmd *cmd; - if (likely(!reserv)) - blk_mq_complete_request(rq, -ENODEV); - else if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &dd->port->flags)) { + if (likely(!reserv)) { + cmd->status = -ENODEV; + blk_mq_complete_request(rq, 0); + } else if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &dd->port->flags)) { cmd = mtip_cmd_from_tag(dd, MTIP_TAG_INTERNAL); if (cmd->comp_func) diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h index 7617888f7944..57b41528a824 100644 --- a/drivers/block/mtip32xx/mtip32xx.h +++ b/drivers/block/mtip32xx/mtip32xx.h @@ -352,6 +352,7 @@ struct mtip_cmd { int retries; /* The number of retries left for this command. */ int direction; /* Data transfer direction */ + int status; }; /* Structure used to describe a port. */ -- 2.11.0
next prev parent reply other threads:[~2017-04-18 15:52 UTC|newest] Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-04-18 15:52 kill req->errors V2 Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` block: remove the blk_execute_rq return value Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 22:24 ` Bart Van Assche 2017-04-18 22:24 ` Bart Van Assche 2017-04-18 22:24 ` Bart Van Assche 2017-04-19 6:13 ` hch 2017-04-19 6:13 ` hch 2017-04-18 15:52 ` nvme-fc: fix status code handling in nvme_fc_fcpio_done Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 21:08 ` James Smart 2017-04-18 21:08 ` James Smart 2017-04-18 15:52 ` nvme: split nvme status from block req->errors Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` nvme: make nvme_error_status private Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` virtio: fix spelling of virtblk_scsi_request_done Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` virtio_blk: don't use req->errors Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` scsi: introduce a new result field in struct scsi_request Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 22:34 ` Bart Van Assche 2017-04-18 22:34 ` Bart Van Assche 2017-04-18 22:34 ` Bart Van Assche 2017-04-19 6:14 ` hch 2017-04-19 6:14 ` hch 2017-04-18 15:52 ` loop: zero-fill bio on the submitting cpu Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` null_blk: don't pass always-0 req->errors to blk_mq_complete_request Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` dm rq: don't pass irrelevant error code " Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` dm mpath: don't check for req->errors Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` nbd: don't use req->errors Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig [this message] 2017-04-18 15:52 ` mtip32xx: add a status field to struct mtip_cmd Christoph Hellwig 2017-04-18 15:52 ` xen-blkfront: don't use req->errors Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` blk-mq: remove the error argument to blk_mq_complete_request Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 22:50 ` Bart Van Assche 2017-04-18 22:50 ` Bart Van Assche 2017-04-18 22:50 ` Bart Van Assche 2017-04-19 17:54 ` hch 2017-04-19 17:54 ` hch 2017-04-18 15:52 ` blk-mq: simplify __blk_mq_complete_request Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` block: add a error_count field to struct request Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 22:57 ` Bart Van Assche 2017-04-18 22:57 ` Bart Van Assche 2017-04-18 22:57 ` Bart Van Assche 2017-04-19 6:15 ` hch 2017-04-19 6:15 ` hch 2017-04-18 15:52 ` floppy: switch from req->errors to req->error_count Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` ataflop: " Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` swim3: remove (commented out) printing of req->errors Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` pd: remove bogus check for req->errors Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 22:59 ` Bart Van Assche 2017-04-18 22:59 ` Bart Van Assche 2017-04-18 22:59 ` Bart Van Assche 2017-04-18 15:52 ` blktrace: remove the unused block_rq_abort tracepoint Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-18 15:52 ` block: remove the errors field from struct request Christoph Hellwig 2017-04-18 15:52 ` Christoph Hellwig 2017-04-21 14:06 mtip32xx: add a status field to struct mtip_cmd Colin Ian King 2017-04-21 14:14 ` Jens Axboe 2017-04-21 14:37 ` Christoph Hellwig 2017-04-21 14:47 ` Jens Axboe
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=20170418155229.5977-14-hch@bombadil.infradead.org \ --to=hch@bombadil.infradead.org \ --cc=axboe@kernel.dk \ --cc=dm-devel@redhat.com \ --cc=hch@lst.de \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.