aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-12-20 16:03:55 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:59 -0500
commitba7392bb37cb12781890f45d7ddee1618e33a036 (patch)
tree4c9a6cb3b22cae407f810c214275ab107ee3fc77 /net/sunrpc/xprt.c
parent2881ae74e68ecfe3b32a90936e5d93a9ba598c3a (diff)
SUNRPC: Add support for per-client timeout values
In order to be able to support setting the timeo and retrans parameters on a per-mountpoint basis, we move the rpc_timeout structure into the rpc_clnt. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 2bc99569c586..cfcade906a56 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -501,9 +501,10 @@ EXPORT_SYMBOL_GPL(xprt_set_retrans_timeout_def);
501void xprt_set_retrans_timeout_rtt(struct rpc_task *task) 501void xprt_set_retrans_timeout_rtt(struct rpc_task *task)
502{ 502{
503 int timer = task->tk_msg.rpc_proc->p_timer; 503 int timer = task->tk_msg.rpc_proc->p_timer;
504 struct rpc_rtt *rtt = task->tk_client->cl_rtt; 504 struct rpc_clnt *clnt = task->tk_client;
505 struct rpc_rtt *rtt = clnt->cl_rtt;
505 struct rpc_rqst *req = task->tk_rqstp; 506 struct rpc_rqst *req = task->tk_rqstp;
506 unsigned long max_timeout = req->rq_xprt->timeout.to_maxval; 507 unsigned long max_timeout = clnt->cl_timeout->to_maxval;
507 508
508 task->tk_timeout = rpc_calc_rto(rtt, timer); 509 task->tk_timeout = rpc_calc_rto(rtt, timer);
509 task->tk_timeout <<= rpc_ntimeo(rtt, timer) + req->rq_retries; 510 task->tk_timeout <<= rpc_ntimeo(rtt, timer) + req->rq_retries;
@@ -514,7 +515,7 @@ EXPORT_SYMBOL_GPL(xprt_set_retrans_timeout_rtt);
514 515
515static void xprt_reset_majortimeo(struct rpc_rqst *req) 516static void xprt_reset_majortimeo(struct rpc_rqst *req)
516{ 517{
517 struct rpc_timeout *to = &req->rq_xprt->timeout; 518 const struct rpc_timeout *to = req->rq_task->tk_client->cl_timeout;
518 519
519 req->rq_majortimeo = req->rq_timeout; 520 req->rq_majortimeo = req->rq_timeout;
520 if (to->to_exponential) 521 if (to->to_exponential)
@@ -534,7 +535,7 @@ static void xprt_reset_majortimeo(struct rpc_rqst *req)
534int xprt_adjust_timeout(struct rpc_rqst *req) 535int xprt_adjust_timeout(struct rpc_rqst *req)
535{ 536{
536 struct rpc_xprt *xprt = req->rq_xprt; 537 struct rpc_xprt *xprt = req->rq_xprt;
537 struct rpc_timeout *to = &xprt->timeout; 538 const struct rpc_timeout *to = req->rq_task->tk_client->cl_timeout;
538 int status = 0; 539 int status = 0;
539 540
540 if (time_before(jiffies, req->rq_majortimeo)) { 541 if (time_before(jiffies, req->rq_majortimeo)) {
@@ -928,7 +929,7 @@ static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
928{ 929{
929 struct rpc_rqst *req = task->tk_rqstp; 930 struct rpc_rqst *req = task->tk_rqstp;
930 931
931 req->rq_timeout = xprt->timeout.to_initval; 932 req->rq_timeout = task->tk_client->cl_timeout->to_initval;
932 req->rq_task = task; 933 req->rq_task = task;
933 req->rq_xprt = xprt; 934 req->rq_xprt = xprt;
934 req->rq_buffer = NULL; 935 req->rq_buffer = NULL;