From 52ae9400049579017e83ac557e37eb167d5e09e8 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Wed, 12 Mar 2008 14:40:14 -0400 Subject: [PATCH] --- yaml --- r: 92875 b: refs/heads/master c: 25337fdc85951dfeac944f16cb565904c619077a h: refs/heads/master i: 92873: 567463d1ad6a0c35026b78ad1802769a75a76415 92871: 1d5f66f261cde2b8c25371ba47348189cabaacba v: v3 --- [refs] | 2 +- trunk/include/linux/sunrpc/auth.h | 4 ++-- trunk/net/sunrpc/auth.c | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 5cc57aa84d07..0b57295c7d0c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9446389ef612096704fdf18fa79bab423d4110f0 +refs/heads/master: 25337fdc85951dfeac944f16cb565904c619077a diff --git a/trunk/include/linux/sunrpc/auth.h b/trunk/include/linux/sunrpc/auth.h index 7a69ca3bebaf..84d5f3a05b16 100644 --- a/trunk/include/linux/sunrpc/auth.h +++ b/trunk/include/linux/sunrpc/auth.h @@ -59,8 +59,8 @@ struct rpc_cred { /* * Client authentication handle */ -#define RPC_CREDCACHE_NR 8 -#define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1) +#define RPC_CREDCACHE_HASHBITS 4 +#define RPC_CREDCACHE_NR (1 << RPC_CREDCACHE_HASHBITS) struct rpc_cred_cache { struct hlist_head hashtable[RPC_CREDCACHE_NR]; spinlock_t lock; diff --git a/trunk/net/sunrpc/auth.c b/trunk/net/sunrpc/auth.c index eca941ce298b..b38f6ee2f5e2 100644 --- a/trunk/net/sunrpc/auth.c +++ b/trunk/net/sunrpc/auth.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -280,7 +281,9 @@ rpcauth_lookup_credcache(struct rpc_auth *auth, struct auth_cred * acred, struct hlist_node *pos; struct rpc_cred *cred = NULL, *entry, *new; - int nr = 0; + unsigned int nr; + + nr = hash_long(acred->uid, RPC_CREDCACHE_HASHBITS); if (!(flags & RPCAUTH_LOOKUP_ROOTCREDS)) nr = acred->uid & RPC_CREDCACHE_MASK;