Commit a6e76e6f authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: scsi_debug: Use scsi_cmd_to_rq() instead of scsi_cmnd.request

Prepare for removal of the request pointer by using scsi_cmd_to_rq()
instead. This patch does not change any functionality.

Link: https://lore.kernel.org/r/20210809230355.8186-42-bvanassche@acm.orgAcked-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ba4baf09
...@@ -4722,7 +4722,7 @@ static int resp_rwp_zone(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) ...@@ -4722,7 +4722,7 @@ static int resp_rwp_zone(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
static struct sdebug_queue *get_queue(struct scsi_cmnd *cmnd) static struct sdebug_queue *get_queue(struct scsi_cmnd *cmnd)
{ {
u16 hwq; u16 hwq;
u32 tag = blk_mq_unique_tag(cmnd->request); u32 tag = blk_mq_unique_tag(scsi_cmd_to_rq(cmnd));
hwq = blk_mq_unique_tag_to_hwq(tag); hwq = blk_mq_unique_tag_to_hwq(tag);
...@@ -4735,7 +4735,7 @@ static struct sdebug_queue *get_queue(struct scsi_cmnd *cmnd) ...@@ -4735,7 +4735,7 @@ static struct sdebug_queue *get_queue(struct scsi_cmnd *cmnd)
static u32 get_tag(struct scsi_cmnd *cmnd) static u32 get_tag(struct scsi_cmnd *cmnd)
{ {
return blk_mq_unique_tag(cmnd->request); return blk_mq_unique_tag(scsi_cmd_to_rq(cmnd));
} }
/* Queued (deferred) command completions converge here. */ /* Queued (deferred) command completions converge here. */
...@@ -5384,7 +5384,7 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, ...@@ -5384,7 +5384,7 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
{ {
bool new_sd_dp; bool new_sd_dp;
bool inject = false; bool inject = false;
bool hipri = (cmnd->request->cmd_flags & REQ_HIPRI); bool hipri = scsi_cmd_to_rq(cmnd)->cmd_flags & REQ_HIPRI;
int k, num_in_q, qdepth; int k, num_in_q, qdepth;
unsigned long iflags; unsigned long iflags;
u64 ns_from_boot = 0; u64 ns_from_boot = 0;
...@@ -5587,8 +5587,9 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, ...@@ -5587,8 +5587,9 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
if (sdebug_statistics) if (sdebug_statistics)
sd_dp->issuing_cpu = raw_smp_processor_id(); sd_dp->issuing_cpu = raw_smp_processor_id();
if (unlikely(sd_dp->aborted)) { if (unlikely(sd_dp->aborted)) {
sdev_printk(KERN_INFO, sdp, "abort request tag %d\n", cmnd->request->tag); sdev_printk(KERN_INFO, sdp, "abort request tag %d\n",
blk_abort_request(cmnd->request); scsi_cmd_to_rq(cmnd)->tag);
blk_abort_request(scsi_cmd_to_rq(cmnd));
atomic_set(&sdeb_inject_pending, 0); atomic_set(&sdeb_inject_pending, 0);
sd_dp->aborted = false; sd_dp->aborted = false;
} }
...@@ -7414,7 +7415,7 @@ static int scsi_debug_queuecommand(struct Scsi_Host *shost, ...@@ -7414,7 +7415,7 @@ static int scsi_debug_queuecommand(struct Scsi_Host *shost,
(u32)cmd[k]); (u32)cmd[k]);
} }
sdev_printk(KERN_INFO, sdp, "%s: tag=%#x, cmd %s\n", my_name, sdev_printk(KERN_INFO, sdp, "%s: tag=%#x, cmd %s\n", my_name,
blk_mq_unique_tag(scp->request), b); blk_mq_unique_tag(scsi_cmd_to_rq(scp)), b);
} }
if (unlikely(inject_now && (sdebug_opts & SDEBUG_OPT_HOST_BUSY))) if (unlikely(inject_now && (sdebug_opts & SDEBUG_OPT_HOST_BUSY)))
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
......
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