aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/netns.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/netns.h')
-rw-r--r--fs/nfsd/netns.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
index 65c2431ea32f..1051bebff1b0 100644
--- a/fs/nfsd/netns.h
+++ b/fs/nfsd/netns.h
@@ -24,7 +24,18 @@
24#include <net/net_namespace.h> 24#include <net/net_namespace.h>
25#include <net/netns/generic.h> 25#include <net/netns/generic.h>
26 26
27/* Hash tables for nfs4_clientid state */
28#define CLIENT_HASH_BITS 4
29#define CLIENT_HASH_SIZE (1 << CLIENT_HASH_BITS)
30#define CLIENT_HASH_MASK (CLIENT_HASH_SIZE - 1)
31
32#define LOCKOWNER_INO_HASH_BITS 8
33#define LOCKOWNER_INO_HASH_SIZE (1 << LOCKOWNER_INO_HASH_BITS)
34
35#define SESSION_HASH_SIZE 512
36
27struct cld_net; 37struct cld_net;
38struct nfsd4_client_tracking_ops;
28 39
29struct nfsd_net { 40struct nfsd_net {
30 struct cld_net *cld_net; 41 struct cld_net *cld_net;
@@ -38,7 +49,62 @@ struct nfsd_net {
38 struct lock_manager nfsd4_manager; 49 struct lock_manager nfsd4_manager;
39 bool grace_ended; 50 bool grace_ended;
40 time_t boot_time; 51 time_t boot_time;
52
53 /*
54 * reclaim_str_hashtbl[] holds known client info from previous reset/reboot
55 * used in reboot/reset lease grace period processing
56 *
57 * conf_id_hashtbl[], and conf_name_tree hold confirmed
58 * setclientid_confirmed info.
59 *
60 * unconf_str_hastbl[] and unconf_name_tree hold unconfirmed
61 * setclientid info.
62 */
63 struct list_head *reclaim_str_hashtbl;
64 int reclaim_str_hashtbl_size;
65 struct list_head *conf_id_hashtbl;
66 struct rb_root conf_name_tree;
67 struct list_head *unconf_id_hashtbl;
68 struct rb_root unconf_name_tree;
69 struct list_head *ownerstr_hashtbl;
70 struct list_head *lockowner_ino_hashtbl;
71 struct list_head *sessionid_hashtbl;
72 /*
73 * client_lru holds client queue ordered by nfs4_client.cl_time
74 * for lease renewal.
75 *
76 * close_lru holds (open) stateowner queue ordered by nfs4_stateowner.so_time
77 * for last close replay.
78 *
79 * All of the above fields are protected by the client_mutex.
80 */
81 struct list_head client_lru;
82 struct list_head close_lru;
83
84 struct delayed_work laundromat_work;
85
86 /* client_lock protects the client lru list and session hash table */
87 spinlock_t client_lock;
88
89 struct file *rec_file;
90 bool in_grace;
91 struct nfsd4_client_tracking_ops *client_tracking_ops;
92
93 time_t nfsd4_lease;
94 time_t nfsd4_grace;
95
96 bool nfsd_net_up;
97
98 /*
99 * Time of server startup
100 */
101 struct timeval nfssvc_boot;
102
103 struct svc_serv *nfsd_serv;
41}; 104};
42 105
106/* Simple check to find out if a given net was properly initialized */
107#define nfsd_netns_ready(nn) ((nn)->sessionid_hashtbl)
108
43extern int nfsd_net_id; 109extern int nfsd_net_id;
44#endif /* __NFSD_NETNS_H__ */ 110#endif /* __NFSD_NETNS_H__ */