rhashtable: Do hashing inside of rhashtable_lookup_compare()

Hash the key inside of rhashtable_lookup_compare() like
rhashtable_lookup() does. This allows to simplify the hashing
functions and keep them private.

Signed-off-by: Thomas Graf <[email protected]>
Cc: [email protected]
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Thomas Graf 2015-01-02 23:00:14 +01:00 • committed by David S. Miller
commit 8d24c0b431
4 changed files with 61 additions and 86 deletions

View file

@ -1002,11 +1002,8 @@ static struct sock *__netlink_lookup(struct netlink_table *table, u32 portid,
.net = net,
.portid = portid,
};
u32 hash;
hash = rhashtable_hashfn(&table->hash, &portid, sizeof(portid));
return rhashtable_lookup_compare(&table->hash, hash,
return rhashtable_lookup_compare(&table->hash, &portid,
&netlink_compare, &arg);
}