Commit 4dda4735 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

mtip32xx: add a status field to struct mtip_cmd

Instead of using req->errors, which will go away.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 1e388ae0
...@@ -241,7 +241,8 @@ static void mtip_async_complete(struct mtip_port *port, ...@@ -241,7 +241,8 @@ static void mtip_async_complete(struct mtip_port *port,
rq = mtip_rq_from_tag(dd, tag); 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) ...@@ -2910,18 +2911,19 @@ static void mtip_softirq_done_fn(struct request *rq)
if (unlikely(cmd->unaligned)) if (unlikely(cmd->unaligned))
up(&dd->port->cmd_slot_unal); 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, static void mtip_abort_cmd(struct request *req, void *data,
bool reserved) bool reserved)
{ {
struct mtip_cmd *cmd = blk_mq_rq_to_pdu(req);
struct driver_data *dd = data; struct driver_data *dd = data;
dbg_printk(MTIP_DRV_NAME " Aborting request, tag = %d\n", req->tag); dbg_printk(MTIP_DRV_NAME " Aborting request, tag = %d\n", req->tag);
clear_bit(req->tag, dd->port->cmds_to_issue); clear_bit(req->tag, dd->port->cmds_to_issue);
req->errors = -EIO; cmd->status = -EIO;
mtip_softirq_done_fn(req); mtip_softirq_done_fn(req);
} }
...@@ -3816,7 +3818,6 @@ static int mtip_queue_rq(struct blk_mq_hw_ctx *hctx, ...@@ -3816,7 +3818,6 @@ static int mtip_queue_rq(struct blk_mq_hw_ctx *hctx,
if (likely(!ret)) if (likely(!ret))
return BLK_MQ_RQ_QUEUE_OK; return BLK_MQ_RQ_QUEUE_OK;
rq->errors = ret;
return BLK_MQ_RQ_QUEUE_ERROR; return BLK_MQ_RQ_QUEUE_ERROR;
} }
...@@ -4106,9 +4107,10 @@ static void mtip_no_dev_cleanup(struct request *rq, void *data, bool reserv) ...@@ -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 driver_data *dd = (struct driver_data *)data;
struct mtip_cmd *cmd; struct mtip_cmd *cmd;
if (likely(!reserv)) if (likely(!reserv)) {
blk_mq_complete_request(rq, -ENODEV); cmd->status = -ENODEV;
else if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &dd->port->flags)) { 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); cmd = mtip_cmd_from_tag(dd, MTIP_TAG_INTERNAL);
if (cmd->comp_func) if (cmd->comp_func)
......
...@@ -352,6 +352,7 @@ struct mtip_cmd { ...@@ -352,6 +352,7 @@ struct mtip_cmd {
int retries; /* The number of retries left for this command. */ int retries; /* The number of retries left for this command. */
int direction; /* Data transfer direction */ int direction; /* Data transfer direction */
int status;
}; };
/* Structure used to describe a port. */ /* Structure used to describe a port. */
......
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