summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.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/sg.c
parentdbb4c84d87af7416bb7e35f8e6dd8d87d5f221d4 (diff)
downloadlinux-stable-6aded12b10e0c9536ee2c8ee33a1f7ed52f9cb34.tar.gz
linux-stable-6aded12b10e0c9536ee2c8ee33a1f7ed52f9cb34.tar.bz2
linux-stable-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/sg.c')
-rw-r--r--drivers/scsi/sg.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 26a753521cb2..6a1c3ffaf32a 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1725,7 +1725,6 @@ sg_start_req(Sg_request *srp, unsigned char *cmd)
{
int res;
struct request *rq;
- struct scsi_request *req;
Sg_fd *sfp = srp->parentfp;
sg_io_hdr_t *hp = &srp->header;
int dxfer_len = (int) hp->dxfer_len;
@@ -1758,7 +1757,6 @@ sg_start_req(Sg_request *srp, unsigned char *cmd)
if (IS_ERR(rq))
return PTR_ERR(rq);
scmd = blk_mq_rq_to_pdu(rq);
- req = scsi_req(rq);
if (hp->cmd_len > sizeof(scmd->cmnd)) {
blk_mq_free_request(rq);
@@ -1770,7 +1768,7 @@ sg_start_req(Sg_request *srp, unsigned char *cmd)
srp->rq = rq;
rq->end_io_data = srp;
- req->retries = SG_DEFAULT_RETRIES;
+ scmd->allowed = SG_DEFAULT_RETRIES;
if ((dxfer_len <= 0) || (dxfer_dir == SG_DXFER_NONE))
return 0;