summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_ioctl.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-02-24 18:55:51 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2022-03-01 22:21:50 -0500
commit6aded12b10e0c9536ee2c8ee33a1f7ed52f9cb34 (patch)
tree1174a1b6a77638b424e579ad16b3c75d2a500e75 /drivers/scsi/scsi_ioctl.c
parentdbb4c84d87af7416bb7e35f8e6dd8d87d5f221d4 (diff)
downloadlinux-6aded12b10e0c9536ee2c8ee33a1f7ed52f9cb34.tar.gz
linux-6aded12b10e0c9536ee2c8ee33a1f7ed52f9cb34.tar.bz2
linux-6aded12b10e0c9536ee2c8ee33a1f7ed52f9cb34.zip
scsi: core: Remove struct scsi_request
Let submitters initialize the scmd->allowed field directly instead of indirecting through struct scsi_request and remove the now superfluous structure. Link: https://lore.kernel.org/r/20220224175552.988286-8-hch@lst.de Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: John Garry <john.garry@huawei.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_ioctl.c')
-rw-r--r--drivers/scsi/scsi_ioctl.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 04b7c70d1dba..0613015cae39 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -411,7 +411,6 @@ static int sg_io(struct scsi_device *sdev, struct sg_io_hdr *hdr, fmode_t mode)
int writing = 0;
int at_head = 0;
struct request *rq;
- struct scsi_request *req;
struct scsi_cmnd *scmd;
struct bio *bio;
@@ -440,7 +439,6 @@ static int sg_io(struct scsi_device *sdev, struct sg_io_hdr *hdr, fmode_t mode)
REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0);
if (IS_ERR(rq))
return PTR_ERR(rq);
- req = scsi_req(rq);
scmd = blk_mq_rq_to_pdu(rq);
if (hdr->cmd_len > sizeof(scmd->cmnd)) {
@@ -475,7 +473,7 @@ static int sg_io(struct scsi_device *sdev, struct sg_io_hdr *hdr, fmode_t mode)
goto out_put_request;
bio = rq->bio;
- req->retries = 0;
+ scmd->allowed = 0;
start_time = jiffies;
@@ -521,7 +519,6 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode,
struct scsi_ioctl_command __user *sic)
{
struct request *rq;
- struct scsi_request *req;
int err;
unsigned int in_len, out_len, bytes, opcode, cmdlen;
struct scsi_cmnd *scmd;
@@ -555,7 +552,6 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode,
err = PTR_ERR(rq);
goto error_free_buffer;
}
- req = scsi_req(rq);
scmd = blk_mq_rq_to_pdu(rq);
cmdlen = COMMAND_SIZE(opcode);
@@ -576,13 +572,13 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode,
goto error;
/* default. possible overridden later */
- req->retries = 5;
+ scmd->allowed = 5;
switch (opcode) {
case SEND_DIAGNOSTIC:
case FORMAT_UNIT:
rq->timeout = FORMAT_UNIT_TIMEOUT;
- req->retries = 1;
+ scmd->allowed = 1;
break;
case START_STOP:
rq->timeout = START_STOP_TIMEOUT;
@@ -595,7 +591,7 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode,
break;
case READ_DEFECT_DATA:
rq->timeout = READ_DEFECT_DATA_TIMEOUT;
- req->retries = 1;
+ scmd->allowed = 1;
break;
default:
rq->timeout = BLK_DEFAULT_SG_TIMEOUT;