aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfsd
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-06-24 01:03:52 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:06:33 -0400
commita55370a3c0106106a975c5a09cee800611d0cf50 (patch)
tree408d5dc0ecf970c103ef091388e66da267adb2e2 /include/linux/nfsd
parent7dea9d280c96f90382ec5d5709433e66a0993ec9 (diff)
[PATCH] knfsd: nfsd4: reboot hash
For the purposes of reboot recovery we keep a directory with subdirectories each having a name that is the ascii hex representation of the md5 sum of a client identifier for an active client. This adds the code to calculate that name. We also use it for the purposes of comparing clients, so if someone ever manages to find two client names that are md5 collisions, then we'll return clid_inuse to the second. Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/nfsd')
-rw-r--r--include/linux/nfsd/state.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 296e6429fc3b..fdaa84addadb 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -109,6 +109,8 @@ struct nfs4_callback {
109 struct rpc_clnt * cb_client; 109 struct rpc_clnt * cb_client;
110}; 110};
111 111
112#define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */
113
112/* 114/*
113 * struct nfs4_client - one per client. Clientids live here. 115 * struct nfs4_client - one per client. Clientids live here.
114 * o Each nfs4_client is hashed by clientid. 116 * o Each nfs4_client is hashed by clientid.
@@ -126,6 +128,7 @@ struct nfs4_client {
126 struct list_head cl_del_perclnt; /* list: delegations */ 128 struct list_head cl_del_perclnt; /* list: delegations */
127 struct list_head cl_lru; /* tail queue */ 129 struct list_head cl_lru; /* tail queue */
128 struct xdr_netobj cl_name; /* id generated by client */ 130 struct xdr_netobj cl_name; /* id generated by client */
131 char cl_recdir[HEXDIR_LEN]; /* recovery dir */
129 nfs4_verifier cl_verifier; /* generated by client */ 132 nfs4_verifier cl_verifier; /* generated by client */
130 time_t cl_time; /* time of last lease renewal */ 133 time_t cl_time; /* time of last lease renewal */
131 u32 cl_addr; /* client ipaddress */ 134 u32 cl_addr; /* client ipaddress */
@@ -143,7 +146,7 @@ struct nfs4_client {
143 */ 146 */
144struct nfs4_client_reclaim { 147struct nfs4_client_reclaim {
145 struct list_head cr_strhash; /* hash by cr_name */ 148 struct list_head cr_strhash; /* hash by cr_name */
146 struct xdr_netobj cr_name; /* id generated by client */ 149 char cr_recdir[HEXDIR_LEN]; /* recover dir */
147}; 150};
148 151
149static inline void 152static inline void
@@ -283,6 +286,7 @@ extern void nfs4_free_stateowner(struct kref *kref);
283extern void nfsd4_probe_callback(struct nfs4_client *clp); 286extern void nfsd4_probe_callback(struct nfs4_client *clp);
284extern void nfsd4_cb_recall(struct nfs4_delegation *dp); 287extern void nfsd4_cb_recall(struct nfs4_delegation *dp);
285extern void nfs4_put_delegation(struct nfs4_delegation *dp); 288extern void nfs4_put_delegation(struct nfs4_delegation *dp);
289extern int nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname);
286 290
287static inline void 291static inline void
288nfs4_put_stateowner(struct nfs4_stateowner *so) 292nfs4_put_stateowner(struct nfs4_stateowner *so)