summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-03-12 14:49:38 +1100
committerDavid S. Miller <davem@davemloft.net>2015-03-12 14:35:30 -0400
commit8d2b18793d16e4186f00b07d031a25537c4cefb9 (patch)
treee55c3a7180d4b898d2a3b7bc719c54234d8ee70f /lib
parent6b9f53bc102d4e61b73c13f661de4a1c358768c1 (diff)
rhashtable: Move masking back into key_hashfn
This patch reverts commit c88455ce50ae4224d84960ce2baa53e61580df27 ("rhashtable: key_hashfn() must return full hash value") because the only user of it always masks the hash value. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/rhashtable.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index d7f3db57b5d0..ff9cc3386fc9 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -83,7 +83,8 @@ static u32 obj_raw_hashfn(struct rhashtable *ht,
static u32 key_hashfn(struct rhashtable *ht, const struct bucket_table *tbl,
const void *key, u32 len)
{
- return ht->p.hashfn(key, len, tbl->hash_rnd) >> HASH_RESERVED_SPACE;
+ return rht_bucket_index(tbl, ht->p.hashfn(key, len, tbl->hash_rnd) >>
+ HASH_RESERVED_SPACE);
}
static u32 head_hashfn(struct rhashtable *ht,
@@ -622,7 +623,7 @@ void *rhashtable_lookup_compare(struct rhashtable *ht, const void *key,
tbl = rht_dereference_rcu(ht->tbl, ht);
hash = key_hashfn(ht, tbl, key, ht->p.key_len);
restart:
- rht_for_each_rcu(he, tbl, rht_bucket_index(tbl, hash)) {
+ rht_for_each_rcu(he, tbl, hash) {
if (!compare(rht_obj(ht, he), arg))
continue;
rcu_read_unlock();