summaryrefslogtreecommitdiffstats
path: root/include/linux/nfsd
diff options
context:
space:
mode:
authorMarc Eshel <eshel@almaden.ibm.com>2009-04-03 08:27:52 +0300
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-04-03 17:41:14 -0700
commit5282fd724b667b7d65f2e41e405a825e58a78813 (patch)
tree6603d2895c789db0e2244e9966f3a2246a6addb9 /include/linux/nfsd
parentc4bf7868064ce8b9c75d8049d077e593c20602b3 (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/linux/nfsd')
-rw-r--r--include/linux/nfsd/state.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 7faefc7c9d9..5b3a6660f3a 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -132,6 +132,13 @@ nfsd4_get_session(struct nfsd4_session *ses)
kref_get(&ses->se_ref);
}
+/* formatted contents of nfs4_sessionid */
+struct nfsd4_sessionid {
+ clientid_t clientid;
+ u32 sequence;
+ u32 reserved;
+};
+
#define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */
/*