diff options
author | Marc Eshel <eshel@almaden.ibm.com> | 2009-04-03 01:27:52 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-04-03 20:41:14 -0400 |
commit | 5282fd724b667b7d65f2e41e405a825e58a78813 (patch) | |
tree | 6603d2895c789db0e2244e9966f3a2246a6addb9 /include | |
parent | c4bf7868064ce8b9c75d8049d077e593c20602b3 (diff) |
nfsd41: sessionid hashing
Simple sessionid hashing using its monotonically increasing sequence number.
Locking considerations:
sessionid_hashtbl access is controlled by the sessionid_lock spin lock.
It must be taken for insert, delete, and lookup.
nfsd4_sequence looks up the session id and if the session is found,
it calls nfsd4_get_session (still under the sessionid_lock).
nfsd4_destroy_session calls nfsd4_put_session after unhashing
it, so when the session's kref reaches zero it's going to get freed.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[we don't use a prime for sessionid hash table size]
[use sessionid_lock spin lock]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nfsd/state.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index 7faefc7c9d9a..5b3a6660f3af 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
@@ -132,6 +132,13 @@ nfsd4_get_session(struct nfsd4_session *ses) | |||
132 | kref_get(&ses->se_ref); | 132 | kref_get(&ses->se_ref); |
133 | } | 133 | } |
134 | 134 | ||
135 | /* formatted contents of nfs4_sessionid */ | ||
136 | struct nfsd4_sessionid { | ||
137 | clientid_t clientid; | ||
138 | u32 sequence; | ||
139 | u32 reserved; | ||
140 | }; | ||
141 | |||
135 | #define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */ | 142 | #define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */ |
136 | 143 | ||
137 | /* | 144 | /* |