aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_bsg.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-02-24 18:55:50 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2022-03-01 22:21:50 -0500
commitdbb4c84d87af7416bb7e35f8e6dd8d87d5f221d4 (patch)
tree631497936089e518bac20582f2b7803a88d478ef /drivers/scsi/scsi_bsg.c
parentscsi: core: Move the resid_len field from struct scsi_request to struct scsi_cmnd (diff)
downloadlinux-dev-dbb4c84d87af7416bb7e35f8e6dd8d87d5f221d4.tar.xz
linux-dev-dbb4c84d87af7416bb7e35f8e6dd8d87d5f221d4.zip
scsi: core: Move the result field from struct scsi_request to struct scsi_cmnd
Prepare for removing the scsi_request structure by moving the result field to struct scsi_cmnd. Link: https://lore.kernel.org/r/20220224175552.988286-7-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_bsg.c')
-rw-r--r--drivers/scsi/scsi_bsg.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_bsg.c b/drivers/scsi/scsi_bsg.c
index 4c697d0ddf1d..8039c3c11a6e 100644
--- a/drivers/scsi/scsi_bsg.c
+++ b/drivers/scsi/scsi_bsg.c
@@ -12,7 +12,6 @@
static int scsi_bsg_sg_io_fn(struct request_queue *q, struct sg_io_v4 *hdr,
fmode_t mode, unsigned int timeout)
{
- struct scsi_request *sreq;
struct scsi_cmnd *scmd;
struct request *rq;
struct bio *bio;
@@ -33,7 +32,6 @@ static int scsi_bsg_sg_io_fn(struct request_queue *q, struct sg_io_v4 *hdr,
rq->timeout = timeout;
ret = -ENOMEM;
- sreq = scsi_req(rq);
scmd = blk_mq_rq_to_pdu(rq);
scmd->cmd_len = hdr->request_len;
if (scmd->cmd_len > sizeof(scmd->cmnd)) {
@@ -66,10 +64,10 @@ static int scsi_bsg_sg_io_fn(struct request_queue *q, struct sg_io_v4 *hdr,
/*
* fill in all the output members
*/
- hdr->device_status = sreq->result & 0xff;
- hdr->transport_status = host_byte(sreq->result);
+ hdr->device_status = scmd->result & 0xff;
+ hdr->transport_status = host_byte(scmd->result);
hdr->driver_status = 0;
- if (scsi_status_is_check_condition(sreq->result))
+ if (scsi_status_is_check_condition(scmd->result))
hdr->driver_status = DRIVER_SENSE;
hdr->info = 0;
if (hdr->device_status || hdr->transport_status || hdr->driver_status)