diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/clnt.c | 15 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 6 |
2 files changed, 20 insertions, 1 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index d7a369e61085..dcc446e7fbf6 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -1197,6 +1197,21 @@ size_t rpc_max_payload(struct rpc_clnt *clnt) | |||
1197 | EXPORT_SYMBOL_GPL(rpc_max_payload); | 1197 | EXPORT_SYMBOL_GPL(rpc_max_payload); |
1198 | 1198 | ||
1199 | /** | 1199 | /** |
1200 | * rpc_get_timeout - Get timeout for transport in units of HZ | ||
1201 | * @clnt: RPC client to query | ||
1202 | */ | ||
1203 | unsigned long rpc_get_timeout(struct rpc_clnt *clnt) | ||
1204 | { | ||
1205 | unsigned long ret; | ||
1206 | |||
1207 | rcu_read_lock(); | ||
1208 | ret = rcu_dereference(clnt->cl_xprt)->timeout->to_initval; | ||
1209 | rcu_read_unlock(); | ||
1210 | return ret; | ||
1211 | } | ||
1212 | EXPORT_SYMBOL_GPL(rpc_get_timeout); | ||
1213 | |||
1214 | /** | ||
1200 | * rpc_force_rebind - force transport to check that remote port is unchanged | 1215 | * rpc_force_rebind - force transport to check that remote port is unchanged |
1201 | * @clnt: client to rebind | 1216 | * @clnt: client to rebind |
1202 | * | 1217 | * |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 846c34fdee9f..b7478d5e7ffd 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -487,13 +487,17 @@ EXPORT_SYMBOL_GPL(xprt_wake_pending_tasks); | |||
487 | * xprt_wait_for_buffer_space - wait for transport output buffer to clear | 487 | * xprt_wait_for_buffer_space - wait for transport output buffer to clear |
488 | * @task: task to be put to sleep | 488 | * @task: task to be put to sleep |
489 | * @action: function pointer to be executed after wait | 489 | * @action: function pointer to be executed after wait |
490 | * | ||
491 | * Note that we only set the timer for the case of RPC_IS_SOFT(), since | ||
492 | * we don't in general want to force a socket disconnection due to | ||
493 | * an incomplete RPC call transmission. | ||
490 | */ | 494 | */ |
491 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action) | 495 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action) |
492 | { | 496 | { |
493 | struct rpc_rqst *req = task->tk_rqstp; | 497 | struct rpc_rqst *req = task->tk_rqstp; |
494 | struct rpc_xprt *xprt = req->rq_xprt; | 498 | struct rpc_xprt *xprt = req->rq_xprt; |
495 | 499 | ||
496 | task->tk_timeout = req->rq_timeout; | 500 | task->tk_timeout = RPC_IS_SOFT(task) ? req->rq_timeout : 0; |
497 | rpc_sleep_on(&xprt->pending, task, action); | 501 | rpc_sleep_on(&xprt->pending, task, action); |
498 | } | 502 | } |
499 | EXPORT_SYMBOL_GPL(xprt_wait_for_buffer_space); | 503 | EXPORT_SYMBOL_GPL(xprt_wait_for_buffer_space); |