aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislav Kinsbursky2012-11-27 05:11:44 -0600
committerJ. Bruce Fields2012-11-28 09:39:46 -0600
commit3d7337115d06f21970e23684f4d2e62e3a44c572 (patch)
tree08701fd0025986ff1b0ec6d70022189c000876c3 /fs/nfsd/nfs4state.c
parent864aee5c6f90533984c356494e6b0a8070e5d5f2 (diff)
downloadkernel-omap-3d7337115d06f21970e23684f4d2e62e3a44c572.tar.gz
kernel-omap-3d7337115d06f21970e23684f4d2e62e3a44c572.tar.xz
kernel-omap-3d7337115d06f21970e23684f4d2e62e3a44c572.zip
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/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index fb98f291aac2..932b2ca6f203 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -51,7 +51,6 @@
51#define NFSDDBG_FACILITY NFSDDBG_PROC 51#define NFSDDBG_FACILITY NFSDDBG_PROC
52 52
53/* Globals */ 53/* Globals */
54time_t nfsd4_lease = 90; /* default lease time */
55time_t nfsd4_grace = 90; 54time_t nfsd4_grace = 90;
56 55
57#define all_ones {{~0,~0},~0} 56#define all_ones {{~0,~0},~0}
@@ -3184,7 +3183,7 @@ nfsd4_end_grace(struct nfsd_net *nn)
3184 * to see the (possibly new, possibly shorter) lease time, we 3183 * to see the (possibly new, possibly shorter) lease time, we
3185 * can safely set the next grace time to the current lease time: 3184 * can safely set the next grace time to the current lease time:
3186 */ 3185 */
3187 nfsd4_grace = nfsd4_lease; 3186 nfsd4_grace = nn->nfsd4_lease;
3188} 3187}
3189 3188
3190static time_t 3189static time_t
@@ -3194,9 +3193,9 @@ nfs4_laundromat(struct nfsd_net *nn)
3194 struct nfs4_openowner *oo; 3193 struct nfs4_openowner *oo;
3195 struct nfs4_delegation *dp; 3194 struct nfs4_delegation *dp;
3196 struct list_head *pos, *next, reaplist; 3195 struct list_head *pos, *next, reaplist;
3197 time_t cutoff = get_seconds() - nfsd4_lease; 3196 time_t cutoff = get_seconds() - nn->nfsd4_lease;
3198 time_t t, clientid_val = nfsd4_lease; 3197 time_t t, clientid_val = nn->nfsd4_lease;
3199 time_t u, test_val = nfsd4_lease; 3198 time_t u, test_val = nn->nfsd4_lease;
3200 3199
3201 nfs4_lock_state(); 3200 nfs4_lock_state();
3202 3201
@@ -3245,7 +3244,7 @@ nfs4_laundromat(struct nfsd_net *nn)
3245 dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru); 3244 dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru);
3246 unhash_delegation(dp); 3245 unhash_delegation(dp);
3247 } 3246 }
3248 test_val = nfsd4_lease; 3247 test_val = nn->nfsd4_lease;
3249 list_for_each_safe(pos, next, &nn->close_lru) { 3248 list_for_each_safe(pos, next, &nn->close_lru) {
3250 oo = container_of(pos, struct nfs4_openowner, oo_close_lru); 3249 oo = container_of(pos, struct nfs4_openowner, oo_close_lru);
3251 if (time_after((unsigned long)oo->oo_time, (unsigned long)cutoff)) { 3250 if (time_after((unsigned long)oo->oo_time, (unsigned long)cutoff)) {