Commit ed7fb2d0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: core: Only start the request just before dispatching

This has no change in behavior, but improves the accounting a bit.

Link: https://lore.kernel.org/r/20201005084130.143273-11-hch@lst.deReviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 74e5e6c1
...@@ -1557,8 +1557,6 @@ static blk_status_t scsi_prepare_cmd(struct request *req) ...@@ -1557,8 +1557,6 @@ static blk_status_t scsi_prepare_cmd(struct request *req)
(struct scatterlist *)(cmd->prot_sdb + 1); (struct scatterlist *)(cmd->prot_sdb + 1);
} }
blk_mq_start_request(req);
/* /*
* Special handling for passthrough commands, which don't go to the ULP * Special handling for passthrough commands, which don't go to the ULP
* at all: * at all:
...@@ -1659,7 +1657,6 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, ...@@ -1659,7 +1657,6 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
req->rq_flags |= RQF_DONTPREP; req->rq_flags |= RQF_DONTPREP;
} else { } else {
clear_bit(SCMD_STATE_COMPLETE, &cmd->state); clear_bit(SCMD_STATE_COMPLETE, &cmd->state);
blk_mq_start_request(req);
} }
cmd->flags &= SCMD_PRESERVED_FLAGS; cmd->flags &= SCMD_PRESERVED_FLAGS;
...@@ -1672,6 +1669,7 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, ...@@ -1672,6 +1669,7 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
cmd->scsi_done = scsi_mq_done; cmd->scsi_done = scsi_mq_done;
blk_mq_start_request(req);
reason = scsi_dispatch_cmd(cmd); reason = scsi_dispatch_cmd(cmd);
if (reason) { if (reason) {
scsi_set_blocked(cmd, reason); scsi_set_blocked(cmd, reason);
......
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