aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/nfs4state.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 6ab677913f9c..213da7b7e7d3 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -49,12 +49,20 @@
49time_t nfsd4_lease = 90; /* default lease time */ 49time_t nfsd4_lease = 90; /* default lease time */
50time_t nfsd4_grace = 90; 50time_t nfsd4_grace = 90;
51static time_t boot_time; 51static time_t boot_time;
52static stateid_t zerostateid; /* bits all 0 */ 52
53static stateid_t onestateid; /* bits all 1 */ 53#define all_ones {{~0,~0},~0}
54static const stateid_t one_stateid = {
55 .si_generation = ~0,
56 .si_opaque = all_ones,
57};
58static const stateid_t zero_stateid = {
59 /* all fields zero */
60};
61
54static u64 current_sessionid = 1; 62static u64 current_sessionid = 1;
55 63
56#define ZERO_STATEID(stateid) (!memcmp((stateid), &zerostateid, sizeof(stateid_t))) 64#define ZERO_STATEID(stateid) (!memcmp((stateid), &zero_stateid, sizeof(stateid_t)))
57#define ONE_STATEID(stateid) (!memcmp((stateid), &onestateid, sizeof(stateid_t))) 65#define ONE_STATEID(stateid) (!memcmp((stateid), &one_stateid, sizeof(stateid_t)))
58 66
59/* forward declarations */ 67/* forward declarations */
60static int check_for_locks(struct nfs4_file *filp, struct nfs4_lockowner *lowner); 68static int check_for_locks(struct nfs4_file *filp, struct nfs4_lockowner *lowner);
@@ -4564,7 +4572,6 @@ nfs4_state_init(void)
4564 } 4572 }
4565 for (i = 0; i < LOCKOWNER_INO_HASH_SIZE; i++) 4573 for (i = 0; i < LOCKOWNER_INO_HASH_SIZE; i++)
4566 INIT_LIST_HEAD(&lockowner_ino_hashtbl[i]); 4574 INIT_LIST_HEAD(&lockowner_ino_hashtbl[i]);
4567 memset(&onestateid, ~0, sizeof(stateid_t));
4568 INIT_LIST_HEAD(&close_lru); 4575 INIT_LIST_HEAD(&close_lru);
4569 INIT_LIST_HEAD(&client_lru); 4576 INIT_LIST_HEAD(&client_lru);
4570 INIT_LIST_HEAD(&del_recall_lru); 4577 INIT_LIST_HEAD(&del_recall_lru);