diff mbox series

[1/4] scsi: Introduct scsi_cmd_to_tag()

Message ID 20210819084007.79233-2-hare@suse.de
State New
Headers show
Series scsi: remove last references to scsi_cmnd.tag | expand

Commit Message

Hannes Reinecke Aug. 19, 2021, 8:40 a.m. UTC
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 mbox series

Patch

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,