[04/50] sr: Use blk_req() instead of scsi_cmnd.request

Message ID 20210514213356.5264-5-bvanassche@acm.org
State New
Headers show
Series
  • Untitled series #127588
Related show

Commit Message

Bart Van Assche May 14, 2021, 9:32 p.m.
Prepare for removal of the request pointer by using blk_req() instead. This
patch does not change any functionality.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/sr.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch

diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index e4633b84c556..5a23f4ca8698 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -326,7 +326,7 @@  static int sr_done(struct scsi_cmnd *SCpnt)
 	int good_bytes = (result == 0 ? this_count : 0);
 	int block_sectors = 0;
 	long error_sector;
-	struct scsi_cd *cd = scsi_cd(SCpnt->request->rq_disk);
+	struct scsi_cd *cd = scsi_cd(blk_req(SCpnt)->rq_disk);
 
 #ifdef DEBUG
 	scmd_printk(KERN_INFO, SCpnt, "done: %x\n", result);
@@ -348,16 +348,16 @@  static int sr_done(struct scsi_cmnd *SCpnt)
 				break;
 			error_sector =
 				get_unaligned_be32(&SCpnt->sense_buffer[3]);
-			if (SCpnt->request->bio != NULL)
+			if (blk_req(SCpnt)->bio != NULL)
 				block_sectors =
-					bio_sectors(SCpnt->request->bio);
+					bio_sectors(blk_req(SCpnt)->bio);
 			if (block_sectors < 4)
 				block_sectors = 4;
 			if (cd->device->sector_size == 2048)
 				error_sector <<= 2;
 			error_sector &= ~(block_sectors - 1);
 			good_bytes = (error_sector -
-				      blk_rq_pos(SCpnt->request)) << 9;
+				      blk_rq_pos(blk_req(SCpnt))) << 9;
 			if (good_bytes < 0 || good_bytes >= this_count)
 				good_bytes = 0;
 			/*
@@ -389,7 +389,7 @@  static blk_status_t sr_init_command(struct scsi_cmnd *SCpnt)
 {
 	int block = 0, this_count, s_size;
 	struct scsi_cd *cd;
-	struct request *rq = SCpnt->request;
+	struct request *rq = blk_req(SCpnt);
 	blk_status_t ret;
 
 	ret = scsi_alloc_sgtables(SCpnt);