aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2010-02-28 23:20:19 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-03-06 15:02:01 -0500
commitcf07d2ea43e5c22149435ee9002cb737eac20eca (patch)
treebe8af254331398b2be20090b2b61da432229f109 /fs/nfsd/nfs4state.c
parent4ea41e2de5bba756858bb40f964e3490b6d1a25c (diff)
nfsd4: simplify references to nfsd4 lease time
Instead of accessing the lease time directly, some users call nfs4_lease_time(), and some a macro, NFSD_LEASE_TIME, defined as nfs4_lease_time(). Neither layer of indirection serves any purpose. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 3a20c09353e..cc9164a34be 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -44,7 +44,7 @@
44#define NFSDDBG_FACILITY NFSDDBG_PROC 44#define NFSDDBG_FACILITY NFSDDBG_PROC
45 45
46/* Globals */ 46/* Globals */
47static time_t lease_time = 90; /* default lease time */ 47time_t nfsd4_lease = 90; /* default lease time */
48static time_t user_lease_time = 90; 48static time_t user_lease_time = 90;
49static time_t boot_time; 49static time_t boot_time;
50static u32 current_ownerid = 1; 50static u32 current_ownerid = 1;
@@ -2560,9 +2560,9 @@ nfs4_laundromat(void)
2560 struct nfs4_stateowner *sop; 2560 struct nfs4_stateowner *sop;
2561 struct nfs4_delegation *dp; 2561 struct nfs4_delegation *dp;
2562 struct list_head *pos, *next, reaplist; 2562 struct list_head *pos, *next, reaplist;
2563 time_t cutoff = get_seconds() - NFSD_LEASE_TIME; 2563 time_t cutoff = get_seconds() - nfsd4_lease;
2564 time_t t, clientid_val = NFSD_LEASE_TIME; 2564 time_t t, clientid_val = nfsd4_lease;
2565 time_t u, test_val = NFSD_LEASE_TIME; 2565 time_t u, test_val = nfsd4_lease;
2566 2566
2567 nfs4_lock_state(); 2567 nfs4_lock_state();
2568 2568
@@ -2602,7 +2602,7 @@ nfs4_laundromat(void)
2602 list_del_init(&dp->dl_recall_lru); 2602 list_del_init(&dp->dl_recall_lru);
2603 unhash_delegation(dp); 2603 unhash_delegation(dp);
2604 } 2604 }
2605 test_val = NFSD_LEASE_TIME; 2605 test_val = nfsd4_lease;
2606 list_for_each_safe(pos, next, &close_lru) { 2606 list_for_each_safe(pos, next, &close_lru) {
2607 sop = list_entry(pos, struct nfs4_stateowner, so_close_lru); 2607 sop = list_entry(pos, struct nfs4_stateowner, so_close_lru);
2608 if (time_after((unsigned long)sop->so_time, (unsigned long)cutoff)) { 2608 if (time_after((unsigned long)sop->so_time, (unsigned long)cutoff)) {
@@ -2672,7 +2672,7 @@ EXPIRED_STATEID(stateid_t *stateid)
2672{ 2672{
2673 if (time_before((unsigned long)boot_time, 2673 if (time_before((unsigned long)boot_time,
2674 ((unsigned long)stateid->si_boot)) && 2674 ((unsigned long)stateid->si_boot)) &&
2675 time_before((unsigned long)(stateid->si_boot + lease_time), get_seconds())) { 2675 time_before((unsigned long)(stateid->si_boot + nfsd4_lease), get_seconds())) {
2676 dprintk("NFSD: expired stateid " STATEID_FMT "!\n", 2676 dprintk("NFSD: expired stateid " STATEID_FMT "!\n",
2677 STATEID_VAL(stateid)); 2677 STATEID_VAL(stateid));
2678 return 1; 2678 return 1;
@@ -3976,7 +3976,7 @@ nfsd4_load_reboot_recovery_data(void)
3976unsigned long 3976unsigned long
3977get_nfs4_grace_period(void) 3977get_nfs4_grace_period(void)
3978{ 3978{
3979 return max(user_lease_time, lease_time) * HZ; 3979 return max(user_lease_time, nfsd4_lease) * HZ;
3980} 3980}
3981 3981
3982/* 3982/*
@@ -4009,7 +4009,7 @@ __nfs4_state_start(void)
4009 4009
4010 boot_time = get_seconds(); 4010 boot_time = get_seconds();
4011 grace_time = get_nfs4_grace_period(); 4011 grace_time = get_nfs4_grace_period();
4012 lease_time = user_lease_time; 4012 nfsd4_lease = user_lease_time;
4013 locks_start_grace(&nfsd4_manager); 4013 locks_start_grace(&nfsd4_manager);
4014 printk(KERN_INFO "NFSD: starting %ld-second grace period\n", 4014 printk(KERN_INFO "NFSD: starting %ld-second grace period\n",
4015 grace_time/HZ); 4015 grace_time/HZ);
@@ -4036,12 +4036,6 @@ nfs4_state_start(void)
4036 return 0; 4036 return 0;
4037} 4037}
4038 4038
4039time_t
4040nfs4_lease_time(void)
4041{
4042 return lease_time;
4043}
4044
4045static void 4039static void
4046__nfs4_state_shutdown(void) 4040__nfs4_state_shutdown(void)
4047{ 4041{