Skip to content

Commit 31156ec

Browse files
Christoph Hellwigaxboe
authored andcommitted
bsg-lib: introduce a timeout field in struct bsg_job
The zfcp driver wants to know the timeout for a bsg job, so add a field to struct bsg_job for it in preparation of not exposing the request to the bsg-lib users. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Benjamin Block <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent ce3077e commit 31156ec

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

block/bsg-lib.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ static int bsg_prepare_job(struct device *dev, struct request *req)
132132
struct bsg_job *job = blk_mq_rq_to_pdu(req);
133133
int ret;
134134

135+
job->timeout = req->timeout;
135136
job->request = rq->cmd;
136137
job->request_len = rq->cmd_len;
137138

drivers/s390/scsi/zfcp_fc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ static int zfcp_fc_exec_els_job(struct bsg_job *job,
961961
d_id = ntoh24(bsg_request->rqst_data.h_els.port_id);
962962

963963
els->handler = zfcp_fc_ct_els_job_handler;
964-
return zfcp_fsf_send_els(adapter, d_id, els, job->req->timeout / HZ);
964+
return zfcp_fsf_send_els(adapter, d_id, els, job->timeout / HZ);
965965
}
966966

967967
static int zfcp_fc_exec_ct_job(struct bsg_job *job,
@@ -980,7 +980,7 @@ static int zfcp_fc_exec_ct_job(struct bsg_job *job,
980980
return ret;
981981

982982
ct->handler = zfcp_fc_ct_job_handler;
983-
ret = zfcp_fsf_send_ct(wka_port, ct, NULL, job->req->timeout / HZ);
983+
ret = zfcp_fsf_send_ct(wka_port, ct, NULL, job->timeout / HZ);
984984
if (ret)
985985
zfcp_fc_wka_port_put(wka_port);
986986

include/linux/bsg-lib.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ struct bsg_job {
4444

4545
struct kref kref;
4646

47+
unsigned int timeout;
48+
4749
/* Transport/driver specific request/reply structs */
4850
void *request;
4951
void *reply;

0 commit comments

Comments
 (0)