summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-03-13 17:28:40 +0100
committerJens Axboe <axboe@kernel.dk>2018-03-13 18:40:23 +0100
commitef6fa64f9b8e1611854077ea9213f2eef2428cd2 (patch)
tree08020d01515b4b92de377a0f2914ccda85d51a1a /block
parentbsg-lib: introduce a timeout field in struct bsg_job (diff)
downloadlinux-ef6fa64f9b8e1611854077ea9213f2eef2428cd2.tar.xz
linux-ef6fa64f9b8e1611854077ea9213f2eef2428cd2.zip
bsg-lib: remove bsg_job.req
Users of the bsg-lib interface should only use the bsg_job data structure and not know about implementation details of it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Benjamin Block <bblock@linux.vnet.ibm.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/bsg-lib.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/block/bsg-lib.c b/block/bsg-lib.c
index fb509779a090..f2c2d54a61b4 100644
--- a/block/bsg-lib.c
+++ b/block/bsg-lib.c
@@ -35,7 +35,7 @@
static void bsg_teardown_job(struct kref *kref)
{
struct bsg_job *job = container_of(kref, struct bsg_job, kref);
- struct request *rq = job->req;
+ struct request *rq = blk_mq_rq_from_pdu(job);
put_device(job->dev); /* release reference for the request */
@@ -68,19 +68,18 @@ EXPORT_SYMBOL_GPL(bsg_job_get);
void bsg_job_done(struct bsg_job *job, int result,
unsigned int reply_payload_rcv_len)
{
- struct request *req = job->req;
+ struct request *req = blk_mq_rq_from_pdu(job);
struct request *rsp = req->next_rq;
- struct scsi_request *rq = scsi_req(req);
int err;
- err = scsi_req(job->req)->result = result;
+ err = job->sreq.result = result;
if (err < 0)
/* we're only returning the result field in the reply */
- rq->sense_len = sizeof(u32);
+ job->sreq.sense_len = sizeof(u32);
else
- rq->sense_len = job->reply_len;
+ job->sreq.sense_len = job->reply_len;
/* we assume all request payload was transferred, residual == 0 */
- rq->resid_len = 0;
+ job->sreq.resid_len = 0;
if (rsp) {
WARN_ON(reply_payload_rcv_len > scsi_req(rsp)->resid_len);
@@ -232,7 +231,6 @@ static void bsg_initialize_rq(struct request *req)
sreq->sense = sense;
sreq->sense_len = SCSI_SENSE_BUFFERSIZE;
- job->req = req;
job->reply = sense;
job->reply_len = sreq->sense_len;
job->dd_data = job + 1;