aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4callback.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-11-27 06:11:44 -0500
committerJ. Bruce Fields <bfields@redhat.com>2012-11-28 10:39:46 -0500
commit3d7337115d06f21970e23684f4d2e62e3a44c572 (patch)
tree08701fd0025986ff1b0ec6d70022189c000876c3 /fs/nfsd/nfs4callback.c
parent864aee5c6f90533984c356494e6b0a8070e5d5f2 (diff)
nfsd: make NFSv4 lease time per net
Lease time is a part of NFSv4 state engine, which is constructed per network namespace. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r--fs/nfsd/nfs4callback.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 826cc269c445..99bc85ff0217 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -36,6 +36,7 @@
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include "nfsd.h" 37#include "nfsd.h"
38#include "state.h" 38#include "state.h"
39#include "netns.h"
39 40
40#define NFSDDBG_FACILITY NFSDDBG_PROC 41#define NFSDDBG_FACILITY NFSDDBG_PROC
41 42
@@ -625,9 +626,10 @@ static const struct rpc_program cb_program = {
625 .pipe_dir_name = "nfsd4_cb", 626 .pipe_dir_name = "nfsd4_cb",
626}; 627};
627 628
628static int max_cb_time(void) 629static int max_cb_time(struct net *net)
629{ 630{
630 return max(nfsd4_lease/10, (time_t)1) * HZ; 631 struct nfsd_net *nn = net_generic(net, nfsd_net_id);
632 return max(nn->nfsd4_lease/10, (time_t)1) * HZ;
631} 633}
632 634
633static struct rpc_cred *callback_cred; 635static struct rpc_cred *callback_cred;
@@ -659,7 +661,7 @@ static struct rpc_cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc
659static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn, struct nfsd4_session *ses) 661static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn, struct nfsd4_session *ses)
660{ 662{
661 struct rpc_timeout timeparms = { 663 struct rpc_timeout timeparms = {
662 .to_initval = max_cb_time(), 664 .to_initval = max_cb_time(clp->net),
663 .to_retries = 0, 665 .to_retries = 0,
664 }; 666 };
665 struct rpc_create_args args = { 667 struct rpc_create_args args = {