From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Hannes Reinecke <hare@suse.de>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, Matthew Wilcox <willy@infradead.org>,
Hannes Reinecke <hare@suse.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>
Subject: Re: [PATCH v5 14/52] advansys: Use scsi_cmd_to_rq() instead of scsi_cmnd.request
Date: Wed, 11 Aug 2021 22:58:10 -0400 [thread overview]
Message-ID: <yq135rftlva.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <95223f29-1ced-a7a7-7fc7-90a3578f0447@acm.org> (Bart Van Assche's message of "Tue, 10 Aug 2021 09:16:25 -0700")
Bart,
>> Cf the previous patch; we really should introduce a helper to get
>> the tag from a SCSI command.
>
> Is this something that you plan to work on or do you perhaps expect me
> to introduce such a helper?
I agree that getting the tag is a common operation and I had the same
thought as Hannes when I reviewed the patches.
Adding a dedicated wrapper would result in the diff below. However,
after having gone through this exercise, I'm not sure it's worth the
additional churn...
Thoughts?
--
Martin K. Petersen Oracle Linux Engineering
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index f7f630485465..ef2c3a3c9f7c 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -631,7 +631,7 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev,
{
struct ata_queued_cmd *qc;
- qc = ata_qc_new_init(dev, scsi_cmd_to_rq(cmd)->tag);
+ qc = ata_qc_new_init(dev, scsi_cmd_to_tag(cmd));
if (qc) {
qc->scsicmd = cmd;
qc->scsidone = cmd->scsi_done;
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index a12e3525977d..6595b394bbf4 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -1823,7 +1823,7 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)
if ((hostdata->tag_negotiated & (1<<scmd_id(SCp))) &&
SCp->device->simple_tags) {
- slot->tag = scsi_cmd_to_rq(SCp)->tag;
+ slot->tag = scsi_cmd_to_tag(SCp);
CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n",
slot->tag, slot);
} else {
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index deb32c9f4b3e..563e93cc3b9a 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -224,7 +224,7 @@ struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd)
{
struct fib *fibptr;
- fibptr = &dev->fibs[scsi_cmd_to_rq(scmd)->tag];
+ fibptr = &dev->fibs[scsi_cmd_to_tag(scmd)];
/*
* Null out fields that depend on being zero at the start of
* each I/O
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index ffb391967573..c536ea9c9e6f 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -7423,7 +7423,7 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
* Set the srb_tag to the command tag + 1, as
* srb_tag '0' is used internally by the chip.
*/
- srb_tag = scsi_cmd_to_rq(scp)->tag + 1;
+ srb_tag = scsi_cmd_to_tag(scp) + 1;
asc_scsi_q->q2.srb_tag = srb_tag;
/*
@@ -7637,7 +7637,7 @@ static int
adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
adv_req_t **adv_reqpp)
{
- u32 srb_tag = scsi_cmd_to_rq(scp)->tag;
+ u32 srb_tag = scsi_cmd_to_tag(scp);
adv_req_t *reqp;
ADV_SCSI_REQ_Q *scsiqp;
int ret;
diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c
index 3b2eb6ce1fcf..f4019fdf39f4 100644
--- a/drivers/scsi/csiostor/csio_scsi.c
+++ b/drivers/scsi/csiostor/csio_scsi.c
@@ -1989,13 +1989,13 @@ csio_eh_abort_handler(struct scsi_cmnd *cmnd)
csio_info(hw,
"Aborted SCSI command to (%d:%llu) tag %u\n",
cmnd->device->id, cmnd->device->lun,
- scsi_cmd_to_rq(cmnd)->tag);
+ scsi_cmd_to_tag(cmnd));
return SUCCESS;
} else {
csio_info(hw,
"Failed to abort SCSI command, (%d:%llu) tag %u\n",
cmnd->device->id, cmnd->device->lun,
- scsi_cmd_to_rq(cmnd)->tag);
+ scsi_cmd_to_tag(cmnd));
return FAILED;
}
}
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 7af96d14c9bc..855113bc028f 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -652,7 +652,7 @@ static int adpt_abort(struct scsi_cmnd * cmd)
msg[2] = 0;
msg[3]= 0;
/* Add 1 to avoid firmware treating it as invalid command */
- msg[4] = scsi_cmd_to_rq(cmd)->tag + 1;
+ msg[4] = scsi_cmd_to_tag(cmd) + 1;
if (pHba->host)
spin_lock_irq(pHba->host->host_lock);
rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER);
@@ -2236,7 +2236,7 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d
msg[1] = ((0xff<<24)|(HOST_TID<<12)|d->tid);
msg[2] = 0;
/* Add 1 to avoid firmware treating it as invalid command */
- msg[3] = scsi_cmd_to_rq(cmd)->tag + 1;
+ msg[3] = scsi_cmd_to_tag(cmd) + 1;
// Our cards use the transaction context as the tag for queueing
// Adaptec/DPT Private stuff
msg[4] = I2O_CMD_SCSI_EXEC|(DPT_ORGANIZATION_ID<<16);
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 0f9cedf78872..aa8ed0f9fd32 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -107,7 +107,7 @@ static void fnic_cleanup_io(struct fnic *fnic);
static inline spinlock_t *fnic_io_lock_hash(struct fnic *fnic,
struct scsi_cmnd *sc)
{
- u32 hash = scsi_cmd_to_rq(sc)->tag & (FNIC_IO_LOCKS - 1);
+ u32 hash = scsi_cmd_to_tag(sc) & (FNIC_IO_LOCKS - 1);
return &fnic->io_req_lock[hash];
}
@@ -390,7 +390,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
(rp->flags & FC_RP_FLAGS_RETRY))
exch_flags |= FCPIO_ICMND_SRFLAG_RETRY;
- fnic_queue_wq_copy_desc_icmnd_16(wq, scsi_cmd_to_rq(sc)->tag,
+ fnic_queue_wq_copy_desc_icmnd_16(wq, scsi_cmd_to_tag(sc),
0, exch_flags, io_req->sgl_cnt,
SCSI_SENSE_BUFFERSIZE,
io_req->sgl_list_pa,
@@ -422,7 +422,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
*/
static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
{
- const int tag = scsi_cmd_to_rq(sc)->tag;
+ const int tag = scsi_cmd_to_tag(sc);
struct fc_lport *lp = shost_priv(sc->device->host);
struct fc_rport *rport;
struct fnic_io_req *io_req = NULL;
@@ -1363,7 +1363,7 @@ int fnic_wq_copy_cmpl_handler(struct fnic *fnic, int copy_work_to_do)
static bool fnic_cleanup_io_iter(struct scsi_cmnd *sc, void *data,
bool reserved)
{
- const int tag = scsi_cmd_to_rq(sc)->tag;
+ const int tag = scsi_cmd_to_tag(sc);
struct fnic *fnic = data;
struct fnic_io_req *io_req;
unsigned long flags = 0;
@@ -1566,7 +1566,7 @@ static bool fnic_rport_abort_io_iter(struct scsi_cmnd *sc, void *data,
{
struct fnic_rport_abort_io_iter_data *iter_data = data;
struct fnic *fnic = iter_data->fnic;
- int abt_tag = scsi_cmd_to_rq(sc)->tag;
+ int abt_tag = scsi_cmd_to_tag(sc);
struct fnic_io_req *io_req;
spinlock_t *io_lock;
unsigned long flags;
@@ -1993,7 +1993,7 @@ static inline int fnic_queue_dr_io_req(struct fnic *fnic,
/* fill in the lun info */
int_to_scsilun(sc->device->lun, &fc_lun);
- fnic_queue_wq_copy_desc_itmf(wq, scsi_cmd_to_rq(sc)->tag | FNIC_TAG_DEV_RST,
+ fnic_queue_wq_copy_desc_itmf(wq, scsi_cmd_to_tag(sc) | FNIC_TAG_DEV_RST,
0, FCPIO_ITMF_LUN_RESET, SCSI_NO_TAG,
fc_lun.scsi_lun, io_req->port_id,
fnic->config.ra_tov, fnic->config.ed_tov);
@@ -2024,7 +2024,7 @@ static bool fnic_pending_aborts_iter(struct scsi_cmnd *sc,
struct fnic_pending_aborts_iter_data *iter_data = data;
struct fnic *fnic = iter_data->fnic;
struct scsi_device *lun_dev = iter_data->lun_dev;
- int abt_tag = scsi_cmd_to_rq(sc)->tag;
+ int abt_tag = scsi_cmd_to_tag(sc);
struct fnic_io_req *io_req;
spinlock_t *io_lock;
unsigned long flags;
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 9515c45affa5..45397c422727 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -185,7 +185,7 @@ static int hisi_sas_slot_index_alloc(struct hisi_hba *hisi_hba,
void *bitmap = hisi_hba->slot_index_tags;
if (scsi_cmnd)
- return scsi_cmd_to_rq(scsi_cmnd)->tag;
+ return scsi_cmd_to_tag(scsi_cmnd);
spin_lock(&hisi_hba->lock);
index = find_next_zero_bit(bitmap, hisi_hba->slot_index_count,
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 3faa87fa296a..e330d3ac19a8 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -5686,7 +5686,7 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
/* Get the ptr to our adapter structure out of cmd->host. */
h = sdev_to_hba(cmd->device);
- BUG_ON(scsi_cmd_to_rq(cmd)->tag < 0);
+ BUG_ON(scsi_cmd_to_tag(cmd) < 0);
dev = cmd->device->hostdata;
if (!dev) {
@@ -5894,7 +5894,7 @@ static int hpsa_scsi_add_host(struct ctlr_info *h)
*/
static int hpsa_get_cmd_index(struct scsi_cmnd *scmd)
{
- int idx = scsi_cmd_to_rq(scmd)->tag;
+ int idx = scsi_cmd_to_tag(scmd);
if (idx < 0)
return idx;
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 26d0cf9353dd..77401a61ba5b 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3381,7 +3381,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance,
return SCSI_MLQUEUE_HOST_BUSY;
}
- cmd = megasas_get_cmd_fusion(instance, scsi_cmd_to_rq(scmd)->tag);
+ cmd = megasas_get_cmd_fusion(instance, scsi_cmd_to_tag(scmd));
if (!cmd) {
atomic_dec(&instance->fw_outstanding);
@@ -3422,7 +3422,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance,
*/
if (cmd->r1_alt_dev_handle != MR_DEVHANDLE_INVALID) {
r1_cmd = megasas_get_cmd_fusion(instance,
- scsi_cmd_to_rq(scmd)->tag + instance->max_fw_cmds);
+ scsi_cmd_to_tag(scmd) + instance->max_fw_cmds);
megasas_prepare_secondRaid1_IO(instance, cmd, r1_cmd);
}
diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index 4d251bf630a3..38d6e4b61e81 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -702,7 +702,7 @@ static int mvumi_host_reset(struct scsi_cmnd *scmd)
mhba = (struct mvumi_hba *) scmd->device->host->hostdata;
scmd_printk(KERN_NOTICE, scmd, "RESET -%u cmd=%x retries=%x\n",
- scsi_cmd_to_rq(scmd)->tag, scmd->cmnd[0], scmd->retries);
+ scsi_cmd_to_tag(scmd), scmd->cmnd[0], scmd->retries);
return mhba->instancet->reset_host(mhba);
}
diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
index a4a88323e020..fe280b349b2f 100644
--- a/drivers/scsi/myrb.c
+++ b/drivers/scsi/myrb.c
@@ -1551,7 +1551,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost,
}
myrb_reset_cmd(cmd_blk);
- mbox->type5.id = scsi_cmd_to_rq(scmd)->tag + 3;
+ mbox->type5.id = scsi_cmd_to_tag(scmd) + 3;
if (scmd->sc_data_direction == DMA_NONE)
goto submit;
nsge = scsi_dma_map(scmd);
diff --git a/drivers/scsi/qla4xxx/ql4_iocb.c b/drivers/scsi/qla4xxx/ql4_iocb.c
index 28eab07935ba..93eaed02a60d 100644
--- a/drivers/scsi/qla4xxx/ql4_iocb.c
+++ b/drivers/scsi/qla4xxx/ql4_iocb.c
@@ -288,7 +288,7 @@ int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb * srb)
/* Acquire hardware specific lock */
spin_lock_irqsave(&ha->hardware_lock, flags);
- index = scsi_cmd_to_rq(cmd)->tag;
+ index = scsi_cmd_to_tag(cmd);
/*
* Check to see if adapter is online before placing request on
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 31529d8add0d..5b892b043716 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -5588,7 +5588,7 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
sd_dp->issuing_cpu = raw_smp_processor_id();
if (unlikely(sd_dp->aborted)) {
sdev_printk(KERN_INFO, sdp, "abort request tag %d\n",
- scsi_cmd_to_rq(cmnd)->tag);
+ scsi_cmd_to_tag(cmnd));
blk_abort_request(scsi_cmd_to_rq(cmnd));
atomic_set(&sdeb_inject_pending, 0);
sd_dp->aborted = false;
diff --git a/drivers/scsi/scsi_logging.c b/drivers/scsi/scsi_logging.c
index ed9572252a42..7a5fa30f1ad7 100644
--- a/drivers/scsi/scsi_logging.c
+++ b/drivers/scsi/scsi_logging.c
@@ -92,7 +92,7 @@ void scmd_printk(const char *level, const struct scsi_cmnd *scmd,
if (!logbuf)
return;
off = sdev_format_header(logbuf, logbuf_len, scmd_name(scmd),
- scsi_cmd_to_rq((struct scsi_cmnd *)scmd)->tag);
+ scsi_cmd_to_tag((struct scsi_cmnd *)scmd));
if (off < logbuf_len) {
va_start(args, fmt);
off += vscnprintf(logbuf + off, logbuf_len - off, fmt, args);
@@ -189,7 +189,7 @@ void scsi_print_command(struct scsi_cmnd *cmd)
return;
off = sdev_format_header(logbuf, logbuf_len,
- scmd_name(cmd), scsi_cmd_to_rq(cmd)->tag);
+ scmd_name(cmd), scsi_cmd_to_tag(cmd));
if (off >= logbuf_len)
goto out_printk;
off += scnprintf(logbuf + off, logbuf_len - off, "CDB: ");
@@ -211,7 +211,7 @@ void scsi_print_command(struct scsi_cmnd *cmd)
off = sdev_format_header(logbuf, logbuf_len,
scmd_name(cmd),
- scsi_cmd_to_rq(cmd)->tag);
+ scsi_cmd_to_tag(cmd));
if (!WARN_ON(off > logbuf_len - 58)) {
off += scnprintf(logbuf + off, logbuf_len - off,
"CDB[%02x]: ", k);
@@ -375,7 +375,7 @@ EXPORT_SYMBOL(__scsi_print_sense);
void scsi_print_sense(const struct scsi_cmnd *cmd)
{
scsi_log_print_sense(cmd->device, scmd_name(cmd),
- scsi_cmd_to_rq((struct scsi_cmnd *)cmd)->tag,
+ scsi_cmd_to_tag((struct scsi_cmnd *)cmd),
cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE);
}
EXPORT_SYMBOL(scsi_print_sense);
@@ -394,7 +394,7 @@ void scsi_print_result(const struct scsi_cmnd *cmd, const char *msg,
return;
off = sdev_format_header(logbuf, logbuf_len, scmd_name(cmd),
- scsi_cmd_to_rq((struct scsi_cmnd *)cmd)->tag);
+ scsi_cmd_to_tag((struct scsi_cmnd *)cmd));
if (off >= logbuf_len)
goto out_printk;
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index bd72c38d7bfc..c878d692eec3 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -1230,7 +1230,7 @@ int spi_populate_tag_msg(unsigned char *msg, struct scsi_cmnd *cmd)
{
if (cmd->flags & SCMD_TAGGED) {
*msg++ = SIMPLE_QUEUE_TAG;
- *msg++ = scsi_cmd_to_rq(cmd)->tag;
+ *msg++ = scsi_cmd_to_tag(cmd);
return 2;
}
diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c
index 95740caa1eb0..6bdabb60f58f 100644
--- a/drivers/scsi/snic/snic_scsi.c
+++ b/drivers/scsi/snic/snic_scsi.c
@@ -33,7 +33,7 @@
#include "snic_io.h"
#include "snic.h"
-#define snic_cmd_tag(sc) (scsi_cmd_to_rq(sc)->tag)
+#define snic_cmd_tag(sc) (scsi_cmd_to_tag(sc))
const char *snic_state_str[] = {
[SNIC_INIT] = "SNIC_INIT",
@@ -2494,7 +2494,7 @@ snic_scsi_cleanup(struct snic *snic, int ex_tag)
sc->result = DID_TRANSPORT_DISRUPTED << 16;
SNIC_HOST_INFO(snic->shost,
"sc_clean: DID_TRANSPORT_DISRUPTED for sc %p, Tag %d flags 0x%llx rqi %p duration %u msecs\n",
- sc, scsi_cmd_to_rq(sc)->tag, CMD_FLAGS(sc), rqi,
+ sc, snic_cmd_tag(sc), CMD_FLAGS(sc), rqi,
jiffies_to_msecs(jiffies - st_time));
/* Update IO stats */
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index f1ba7f5b52a8..3b8d788c6eda 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -690,7 +690,7 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
cmd->scsi_done = done;
- tag = scsi_cmd_to_rq(cmd)->tag;
+ tag = scsi_cmd_to_tag(cmd);
if (unlikely(tag >= host->can_queue))
return SCSI_MLQUEUE_HOST_BUSY;
@@ -1246,7 +1246,7 @@ static int stex_abort(struct scsi_cmnd *cmd)
{
struct Scsi_Host *host = cmd->device->host;
struct st_hba *hba = (struct st_hba *)host->hostdata;
- u16 tag = scsi_cmd_to_rq(cmd)->tag;
+ u16 tag = scsi_cmd_to_tag(cmd);
void __iomem *base;
u32 data;
int result = SUCCESS;
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index e2278b0125e7..c3217ca78428 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1202,7 +1202,7 @@ static void storvsc_on_io_completion(struct storvsc_device *stor_device,
vstor_packet->vm_srb.srb_status != SRB_STATUS_SUCCESS)
storvsc_log(device, STORVSC_LOGGING_ERROR,
"tag#%d cmd 0x%x status: scsi 0x%x srb 0x%x hv 0x%x\n",
- scsi_cmd_to_rq(request->cmd)->tag,
+ scsi_cmd_to_tag(request->cmd),
stor_pkt->vm_srb.cdb[0],
vstor_packet->vm_srb.scsi_status,
vstor_packet->vm_srb.srb_status,
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index a3b419848f0a..a83981cc8b1b 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2676,7 +2676,7 @@ static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i)
static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
{
struct ufs_hba *hba = shost_priv(host);
- int tag = scsi_cmd_to_rq(cmd)->tag;
+ int tag = scsi_cmd_to_tag(cmd);
struct ufshcd_lrb *lrbp;
int err = 0;
@@ -6994,7 +6994,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
{
struct Scsi_Host *host = cmd->device->host;
struct ufs_hba *hba = shost_priv(host);
- int tag = scsi_cmd_to_rq(cmd)->tag;
+ int tag = scsi_cmd_to_tag(cmd);
struct ufshcd_lrb *lrbp = &hba->lrb[tag];
unsigned long flags;
int err = FAILED;
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 3dfc7ed79ba4..684a48a1cdb8 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -183,7 +183,7 @@ static int tcm_loop_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc)
memset(tl_cmd, 0, sizeof(*tl_cmd));
tl_cmd->sc = sc;
- tl_cmd->sc_cmd_tag = scsi_cmd_to_rq(sc)->tag;
+ tl_cmd->sc_cmd_tag = scsi_cmd_to_tag(sc);
tcm_loop_target_queue_cmd(tl_cmd);
return 0;
@@ -249,7 +249,7 @@ static int tcm_loop_abort_task(struct scsi_cmnd *sc)
tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun,
- scsi_cmd_to_rq(sc)->tag, TMR_ABORT_TASK);
+ scsi_cmd_to_tag(sc), TMR_ABORT_TASK);
return (ret == TMR_FUNCTION_COMPLETE) ? SUCCESS : FAILED;
}
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 6c5a1c1c6b1e..99a1c61cda46 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -149,6 +149,11 @@ static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
return blk_mq_rq_from_pdu(scmd);
}
+static inline int scsi_cmd_to_tag(struct scsi_cmnd *scmd)
+{
+ return blk_mq_rq_from_pdu(scmd)->tag;
+}
+
/*
* Return the driver private allocation behind the command.
* Only works if cmd_size is set in the host template.
next prev parent reply other threads:[~2021-08-12 2:58 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-09 23:03 [PATCH v5 00/52] Remove the request pointer from struct scsi_cmnd Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 01/52] core: Introduce the scsi_cmd_to_rq() function Bart Van Assche
2021-08-10 6:15 ` Hannes Reinecke
2021-08-12 12:28 ` Christoph Hellwig
2021-08-12 18:19 ` Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 02/52] core: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Bart Van Assche
2021-08-10 6:17 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 03/52] sd: " Bart Van Assche
2021-08-10 6:18 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 04/52] sr: " Bart Van Assche
2021-08-10 6:18 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 05/52] scsi_transport_fc: " Bart Van Assche
2021-08-10 6:19 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 06/52] scsi_transport_spi: " Bart Van Assche
2021-08-10 6:19 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 07/52] ata: " Bart Van Assche
2021-08-10 6:20 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 08/52] RDMA/iser: " Bart Van Assche
2021-08-10 6:20 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 09/52] RDMA/srp: " Bart Van Assche
2021-08-10 6:21 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 10/52] zfcp: " Bart Van Assche
2021-08-10 6:21 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 11/52] 53c700: " Bart Van Assche
2021-08-10 6:21 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 12/52] NCR5380: Use sc_data_direction instead of rq_data_dir() Bart Van Assche
2021-08-10 6:22 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 13/52] aacraid: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Bart Van Assche
2021-08-10 6:23 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 14/52] advansys: " Bart Van Assche
2021-08-10 6:25 ` Hannes Reinecke
2021-08-10 16:16 ` Bart Van Assche
2021-08-12 2:58 ` Martin K. Petersen [this message]
2021-08-12 4:03 ` Bart Van Assche
2021-08-12 6:03 ` Hannes Reinecke
2021-08-12 9:05 ` John Garry
2021-08-13 1:42 ` Bart Van Assche
2021-08-13 2:19 ` Matthew Wilcox
2021-08-10 17:25 ` Matthew Wilcox
2021-08-09 23:03 ` [PATCH v5 15/52] aha1542: " Bart Van Assche
2021-08-10 6:25 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 16/52] bnx2i: " Bart Van Assche
2021-08-10 6:26 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 17/52] csiostor: " Bart Van Assche
2021-08-10 6:26 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 18/52] cxlflash: " Bart Van Assche
2021-08-10 6:27 ` Hannes Reinecke
2021-08-09 23:03 ` [PATCH v5 19/52] dpt_i2o: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 20/52] fnic: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 21/52] hisi_sas: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 22/52] hpsa: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 23/52] ibmvfc: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 24/52] ibmvscsi: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 25/52] ips: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 26/52] libsas: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 27/52] lpfc: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 28/52] megaraid: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 29/52] mpi3mr: " Bart Van Assche
2021-08-16 8:32 ` Kashyap Desai
2021-08-16 17:13 ` Martin K. Petersen
2021-08-09 23:03 ` [PATCH v5 30/52] mpt3sas: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 31/52] mvumi: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 32/52] myrb: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 33/52] myrs: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 34/52] ncr53c8xx: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 35/52] qedf: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 36/52] qedi: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 37/52] qla1280: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 38/52] qla2xxx: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 39/52] qla4xxx: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 40/52] qlogicpti: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 41/52] scsi_debug: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 42/52] smartpqi: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 43/52] snic: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 44/52] stex: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 45/52] sun3_scsi: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 46/52] sym53c8xx: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 47/52] ufs: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 48/52] virtio_scsi: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 49/52] xen-scsifront: " Bart Van Assche
2021-08-17 12:42 ` Juergen Gross
2021-08-09 23:03 ` [PATCH v5 50/52] tcm_loop: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 51/52] usb-storage: " Bart Van Assche
2021-08-09 23:03 ` [PATCH v5 52/52] core: Remove the request member from struct scsi_cmnd Bart Van Assche
2021-08-10 5:28 ` [PATCH v5 00/52] Remove the request pointer " Martin K. Petersen
2021-08-10 16:19 ` Bart Van Assche
2021-08-17 3:17 ` Martin K. Petersen
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=yq135rftlva.fsf@ca-mkp.ca.oracle.com \
--to=martin.petersen@oracle.com \
--cc=bvanassche@acm.org \
--cc=hare@suse.com \
--cc=hare@suse.de \
--cc=jejb@linux.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=willy@infradead.org \
/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 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.