nfsd41: sessionid hashing
authorMarc Eshel <eshel@almaden.ibm.com>
Fri, 3 Apr 2009 05:27:52 +0000 (08:27 +0300)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Sat, 4 Apr 2009 00:41:14 +0000 (17:41 -0700)
commit5282fd724b667b7d65f2e41e405a825e58a78813
tree6603d2895c789db0e2244e9966f3a2246a6addb9
parentc4bf7868064ce8b9c75d8049d077e593c20602b3
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>
fs/nfsd/nfs4state.c
include/linux/nfsd/state.h