Skip to content

Commit

Permalink
Revert "scsi: core: Make scsi_get_lba() return the LBA"
Browse files Browse the repository at this point in the history
This reverts commit d054858 which is
commit d2c945f 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>
  • Loading branch information
Greg Kroah-Hartman committed Jan 12, 2024
1 parent 2129297 commit a5edb40
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions include/scsi/scsi_cmnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a5edb40

Please sign in to comment.