linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	John Garry <john.garry@huawei.com>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 1/4] scsi: Introduct scsi_cmd_to_tag()
Date: Thu, 19 Aug 2021 10:40:04 +0200	[thread overview]
Message-ID: <20210819084007.79233-2-hare@suse.de> (raw)
In-Reply-To: <20210819084007.79233-1-hare@suse.de>

Introduce a wrapper to get the tag from a SCSI command.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 include/scsi/scsi_cmnd.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index eaf04c9a1dfc..f3cc3aa0eb04 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -165,6 +165,13 @@ static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd)
 	return *(struct scsi_driver **)rq->rq_disk->private_data;
 }
 
+static inline u32 scsi_cmd_to_tag(struct scsi_cmnd *cmd)
+{
+	struct request *rq = scsi_cmd_to_rq(cmd);
+
+	return rq->tag;
+}
+
 extern void scsi_finish_command(struct scsi_cmnd *cmd);
 
 extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
-- 
2.29.2


  reply	other threads:[~2021-08-19  8:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  8:40 [PATCH 0/4] scsi: remove last references to scsi_cmnd.tag Hannes Reinecke
2021-08-19  8:40 ` Hannes Reinecke [this message]
2021-08-19 10:57   ` [PATCH 1/4] scsi: Introduct scsi_cmd_to_tag() John Garry
2021-08-19 16:59   ` Bart Van Assche
2021-08-19  8:40 ` [PATCH 2/4] fas216: kill scmd->tag Hannes Reinecke
2021-08-19  8:40 ` [PATCH 3/4] acornscsi: remove tagged queuing vestiges Hannes Reinecke
2021-08-19  8:40 ` [PATCH 4/4] scsi: remove 'current_tag' Hannes Reinecke
2021-09-13  9:25 ` [PATCH 0/4] scsi: remove last references to scsi_cmnd.tag John Garry
2021-09-15  3:21   ` Martin K. Petersen
2021-09-15  7:34     ` John Garry

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=20210819084007.79233-2-hare@suse.de \
    --to=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=john.garry@huawei.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).