Re: [PATCH 1/4] scsi: Introduct scsi_cmd_to_tag()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19/08/2021 09:40, Hannes Reinecke wrote:
Introduce a wrapper to get the tag from a SCSI command.

Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
---
  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)

I'd call it scsi_cmd_to_rq_tag(), especially since scsi_cmnd.tag is hanging for dear life and I assume you want this helper regardless of what happens there, but it's just a name...

+{
+	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,


Reviewed-by: John Garry <john.garry@xxxxxxxxxx>




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux