mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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 <tgraf@suug.ch> Cc: netfilter-devel@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
dd95539888
commit
8d24c0b431
4 changed files with 66 additions and 91 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue