aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 6a6b96e8dcb2..a3c00da9ce21 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -188,8 +188,15 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru
188 if (!xprt_bound(clnt->cl_xprt)) 188 if (!xprt_bound(clnt->cl_xprt))
189 clnt->cl_autobind = 1; 189 clnt->cl_autobind = 1;
190 190
191 clnt->cl_timeout = xprt->timeout;
192 if (args->timeout != NULL) {
193 memcpy(&clnt->cl_timeout_default, args->timeout,
194 sizeof(clnt->cl_timeout_default));
195 clnt->cl_timeout = &clnt->cl_timeout_default;
196 }
197
191 clnt->cl_rtt = &clnt->cl_rtt_default; 198 clnt->cl_rtt = &clnt->cl_rtt_default;
192 rpc_init_rtt(&clnt->cl_rtt_default, xprt->timeout.to_initval); 199 rpc_init_rtt(&clnt->cl_rtt_default, clnt->cl_timeout->to_initval);
193 200
194 kref_init(&clnt->cl_kref); 201 kref_init(&clnt->cl_kref);
195 202
@@ -251,7 +258,6 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
251 .srcaddr = args->saddress, 258 .srcaddr = args->saddress,
252 .dstaddr = args->address, 259 .dstaddr = args->address,
253 .addrlen = args->addrsize, 260 .addrlen = args->addrsize,
254 .timeout = args->timeout
255 }; 261 };
256 char servername[48]; 262 char servername[48];
257 263
@@ -348,7 +354,7 @@ rpc_clone_client(struct rpc_clnt *clnt)
348 new->cl_autobind = 0; 354 new->cl_autobind = 0;
349 INIT_LIST_HEAD(&new->cl_tasks); 355 INIT_LIST_HEAD(&new->cl_tasks);
350 spin_lock_init(&new->cl_lock); 356 spin_lock_init(&new->cl_lock);
351 rpc_init_rtt(&new->cl_rtt_default, clnt->cl_xprt->timeout.to_initval); 357 rpc_init_rtt(&new->cl_rtt_default, clnt->cl_timeout->to_initval);
352 new->cl_metrics = rpc_alloc_iostats(clnt); 358 new->cl_metrics = rpc_alloc_iostats(clnt);
353 if (new->cl_metrics == NULL) 359 if (new->cl_metrics == NULL)
354 goto out_no_stats; 360 goto out_no_stats;