aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsctl.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/nfsctl.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/nfsctl.c')
-rw-r--r--fs/nfsd/nfsctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index f5ab74af6ce2..09d909a42ece 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -909,7 +909,8 @@ static ssize_t nfsd4_write_time(struct file *file, char *buf, size_t size, time_
909 */ 909 */
910static ssize_t write_leasetime(struct file *file, char *buf, size_t size) 910static ssize_t write_leasetime(struct file *file, char *buf, size_t size)
911{ 911{
912 return nfsd4_write_time(file, buf, size, &nfsd4_lease); 912 struct nfsd_net *nn = net_generic(&init_net, nfsd_net_id);
913 return nfsd4_write_time(file, buf, size, &nn->nfsd4_lease);
913} 914}
914 915
915/** 916/**
@@ -1060,6 +1061,7 @@ int nfsd_net_id;
1060static __net_init int nfsd_init_net(struct net *net) 1061static __net_init int nfsd_init_net(struct net *net)
1061{ 1062{
1062 int retval; 1063 int retval;
1064 struct nfsd_net *nn = net_generic(net, nfsd_net_id);
1063 1065
1064 retval = nfsd_export_init(net); 1066 retval = nfsd_export_init(net);
1065 if (retval) 1067 if (retval)
@@ -1067,6 +1069,7 @@ static __net_init int nfsd_init_net(struct net *net)
1067 retval = nfsd_idmap_init(net); 1069 retval = nfsd_idmap_init(net);
1068 if (retval) 1070 if (retval)
1069 goto out_idmap_error; 1071 goto out_idmap_error;
1072 nn->nfsd4_lease = 90; /* default lease time */
1070 return 0; 1073 return 0;
1071 1074
1072out_idmap_error: 1075out_idmap_error: