diff options
author | Christoph Hellwig <hch@lst.de> | 2022-02-24 18:55:48 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-03-01 22:21:49 -0500 |
commit | 5b794f98074a8b7e8eb77dd43746062940b51160 (patch) | |
tree | 0d9fb15f5afe36a628a7770de661d5355ea50af2 /drivers/scsi/sg.c | |
parent | ce70fd9a551af7424a7dace2a1ba05a7de8eae27 (diff) | |
download | lwn-5b794f98074a8b7e8eb77dd43746062940b51160.tar.gz lwn-5b794f98074a8b7e8eb77dd43746062940b51160.zip |
scsi: core: Remove the sense and sense_len fields from struct scsi_request
Just use the sense_buffer field in struct scsi_cmnd for the sense data and
move the sense_len field over to struct scsi_cmnd.
Link: https://lore.kernel.org/r/20220224175552.988286-5-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.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index cc3f11270dc2..0f96c7cde9e5 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1323,6 +1323,7 @@ sg_rq_end_io_usercontext(struct work_struct *work) static void sg_rq_end_io(struct request *rq, blk_status_t status) { + struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(rq); struct sg_request *srp = rq->end_io_data; struct scsi_request *req = scsi_req(rq); Sg_device *sdp; @@ -1343,7 +1344,7 @@ sg_rq_end_io(struct request *rq, blk_status_t status) if (unlikely(atomic_read(&sdp->detaching))) pr_info("%s: device detaching\n", __func__); - sense = req->sense; + sense = scmd->sense_buffer; result = req->result; resid = req->resid_len; @@ -1380,8 +1381,8 @@ sg_rq_end_io(struct request *rq, blk_status_t status) } } - if (req->sense_len) - memcpy(srp->sense_b, req->sense, SCSI_SENSE_BUFFERSIZE); + if (scmd->sense_len) + memcpy(srp->sense_b, scmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); /* Rely on write phase to clean out srp status values, so no "else" */ |