summaryrefslogtreecommitdiff
path: root/include/scsi
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2021-06-08 23:39:24 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2021-07-20 22:10:42 -0400
commitf0f214fe8cd32224267ebea93817b8c32074623d (patch)
treee44f110a4ba963ba015f416a08416abb2085801e /include/scsi
parentf7be677227a5375cefd084df2c88864fc673e24a (diff)
downloadlinux-rt-f0f214fe8cd32224267ebea93817b8c32074623d.tar.gz
scsi: core: Introduce scsi_get_sector()
Since scsi_get_lba() returns a sector_t value instead of the LBA, the name of that function is confusing. Introduce an identical function scsi_get_sector(). Link: https://lore.kernel.org/r/20210513223757.3938-2-bvanassche@acm.org Link: https://lore.kernel.org/r/20210609033929.3815-11-martin.petersen@oracle.com Cc: Christoph Hellwig <hch@lst.de> Cc: Ming Lei <ming.lei@redhat.com> Cc: Hannes Reinecke <hare@suse.de> Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Message-Id: <20210609033929.3815-11-martin.petersen@oracle.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/scsi_cmnd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 301b9cd4ddd0..cba63377d46a 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -220,6 +220,11 @@ static inline int scsi_sg_copy_to_buffer(struct scsi_cmnd *cmd,
buf, buflen);
}
+static inline sector_t scsi_get_sector(struct scsi_cmnd *scmd)
+{
+ return blk_rq_pos(scmd->request);
+}
+
/*
* The operations below are hints that tell the controller driver how
* to handle I/Os with DIF or similar types of protection information.