aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/state.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-11-12 15:00:56 -0500
committerJ. Bruce Fields <bfields@redhat.com>2012-11-12 18:55:11 -0500
commitac55fdc408039b425a2fa3cbcaed7444e5339f9a (patch)
tree6fb1420263d6f06ddb27b9b7943ffed50f7d638d /fs/nfsd/state.h
parent0ce0c2b5d23080eec39ccc52354be1eea326ed5f (diff)
nfsd: move the confirmed and unconfirmed hlists to a rbtree
The current code requires that we md5 hash the name in order to store the client in the confirmed and unconfirmed trees. Change it instead to store the clients in a pair of rbtrees, and simply compare the cl_names directly instead of hashing them. This also necessitates that we add a new flag to the clp->cl_flags field to indicate which tree the client is currently in. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/state.h')
-rw-r--r--fs/nfsd/state.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index cf9f7ba4df8d..6c342bd806e5 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -232,7 +232,7 @@ struct nfsd4_sessionid {
232 */ 232 */
233struct nfs4_client { 233struct nfs4_client {
234 struct list_head cl_idhash; /* hash by cl_clientid.id */ 234 struct list_head cl_idhash; /* hash by cl_clientid.id */
235 struct list_head cl_strhash; /* hash by cl_name */ 235 struct rb_node cl_namenode; /* link into by-name trees */
236 struct list_head cl_openowners; 236 struct list_head cl_openowners;
237 struct idr cl_stateids; /* stateid lookup */ 237 struct idr cl_stateids; /* stateid lookup */
238 struct list_head cl_delegations; 238 struct list_head cl_delegations;
@@ -253,6 +253,7 @@ struct nfs4_client {
253#define NFSD4_CLIENT_CB_KILL (1) 253#define NFSD4_CLIENT_CB_KILL (1)
254#define NFSD4_CLIENT_STABLE (2) /* client on stable storage */ 254#define NFSD4_CLIENT_STABLE (2) /* client on stable storage */
255#define NFSD4_CLIENT_RECLAIM_COMPLETE (3) /* reclaim_complete done */ 255#define NFSD4_CLIENT_RECLAIM_COMPLETE (3) /* reclaim_complete done */
256#define NFSD4_CLIENT_CONFIRMED (4) /* client is confirmed */
256#define NFSD4_CLIENT_CB_FLAG_MASK (1 << NFSD4_CLIENT_CB_UPDATE | \ 257#define NFSD4_CLIENT_CB_FLAG_MASK (1 << NFSD4_CLIENT_CB_UPDATE | \
257 1 << NFSD4_CLIENT_CB_KILL) 258 1 << NFSD4_CLIENT_CB_KILL)
258 unsigned long cl_flags; 259 unsigned long cl_flags;