summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_transport_fc.c
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2016-11-17 10:31:22 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2016-11-17 20:15:26 -0500
commit06548160dfecd1983ffd9d6795242a5cda095da5 (patch)
treedc7e4c9d49d2c6cbb61a373d992afadc666910f1 /drivers/scsi/scsi_transport_fc.c
parent6aa858cd335a94e2824ed542140ac9704c0a64e2 (diff)
scsi: fc: use bsg_job_done
fc_bsg_jobdone() and bsg_job_done() are 1:1 copies now so use the bsg-lib one instead of the FC private implementation. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Acked-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
-rw-r--r--drivers/scsi/scsi_transport_fc.c41
1 files changed, 3 insertions, 38 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 1d959ae7d0c8..ee1e812bad4c 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -3556,41 +3556,6 @@ fc_vport_sched_delete(struct work_struct *work)
*/
/**
- * fc_bsg_jobdone - completion routine for bsg requests that the LLD has
- * completed
- * @job: fc_bsg_job that is complete
- * @result: job reply result
- * @reply_payload_rcv_len: length of payload received
- */
-void fc_bsg_jobdone(struct bsg_job *job, int result,
- unsigned int reply_payload_rcv_len)
-{
- struct request *req = job->req;
- struct request *rsp = req->next_rq;
- int err;
-
- err = job->req->errors = result;
-
- if (err < 0)
- /* we're only returning the result field in the reply */
- job->req->sense_len = sizeof(uint32_t);
- else
- job->req->sense_len = job->reply_len;
-
- /* we assume all request payload was transferred, residual == 0 */
- req->resid_len = 0;
-
- if (rsp) {
- WARN_ON(reply_payload_rcv_len > rsp->resid_len);
-
- /* set reply (bidi) residual */
- rsp->resid_len -= min(reply_payload_rcv_len, rsp->resid_len);
- }
- blk_complete_request(req);
-}
-EXPORT_SYMBOL_GPL(fc_bsg_jobdone);
-
-/**
* fc_bsg_job_timeout - handler for when a bsg request timesout
* @req: request that timed out
*/
@@ -3797,7 +3762,7 @@ fail_host_msg:
bsg_reply->reply_payload_rcv_len = 0;
bsg_reply->result = ret;
job->reply_len = sizeof(uint32_t);
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return FC_DISPATCH_UNLOCKED;
}
@@ -3875,7 +3840,7 @@ fail_rport_msg:
bsg_reply->reply_payload_rcv_len = 0;
bsg_reply->result = ret;
job->reply_len = sizeof(uint32_t);
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return FC_DISPATCH_UNLOCKED;
}
@@ -3936,7 +3901,7 @@ fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host *shost,
bsg_reply->reply_payload_rcv_len = 0;
bsg_reply->result = -ENOMSG;
job->reply_len = sizeof(uint32_t);
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
spin_lock_irq(q->queue_lock);
continue;