diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-11 10:35:01 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-12 20:56:38 +0100 |
commit | a5edb407029321066c0ebbc2fd3d91acdd644d1e (patch) | |
tree | 22793a9330500e0cc66ca4360dec621cb60858aa | |
parent | 2129297760278dc48649b9d50b4b646b36b5ff6d (diff) |
Revert "scsi: core: Make scsi_get_lba() return the LBA"
This reverts commit d054858a9c9e4406099e61fe00c93516f9b4c169 which is
commit d2c945f01d233085fedc9e3cf7ec180eaa2b7a85 upstream.
As reported, a lot of scsi changes were made just to resolve a 2 line
patch, so let's revert them all and then manually fix up the 2 line
fixup so that things are simpler and potential abi changes are not an
issue.
Link: https://lore.kernel.org/r/ZZ042FejzwMM5vDW@duo.ucw.cz
Reported-by: Pavel Machek <pavel@ucw.cz>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Benjamin Block <bblock@linux.ibm.com>
Cc: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | include/scsi/scsi_cmnd.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 162a53a39ac0..ddab0c580382 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -229,13 +229,6 @@ static inline sector_t scsi_get_sector(struct scsi_cmnd *scmd) return blk_rq_pos(scmd->request); } -static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd) -{ - unsigned int shift = ilog2(scmd->device->sector_size) - SECTOR_SHIFT; - - return blk_rq_pos(scmd->request) >> shift; -} - /* * The operations below are hints that tell the controller driver how * to handle I/Os with DIF or similar types of protection information. @@ -298,6 +291,11 @@ static inline unsigned char scsi_get_prot_type(struct scsi_cmnd *scmd) return scmd->prot_type; } +static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd) +{ + return blk_rq_pos(scmd->request); +} + static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd) { struct request *rq = blk_mq_rq_from_pdu(scmd); |