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
|
@ -96,9 +96,6 @@ static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht)
|
|||
|
||||
int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params);
|
||||
|
||||
u32 rhashtable_hashfn(const struct rhashtable *ht, const void *key, u32 len);
|
||||
u32 rhashtable_obj_hashfn(const struct rhashtable *ht, void *ptr);
|
||||
|
||||
void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node);
|
||||
bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node);
|
||||
void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj,
|
||||
|
@ -111,7 +108,7 @@ int rhashtable_expand(struct rhashtable *ht);
|
|||
int rhashtable_shrink(struct rhashtable *ht);
|
||||
|
||||
void *rhashtable_lookup(const struct rhashtable *ht, const void *key);
|
||||
void *rhashtable_lookup_compare(const struct rhashtable *ht, u32 hash,
|
||||
void *rhashtable_lookup_compare(const struct rhashtable *ht, const void *key,
|
||||
bool (*compare)(void *, void *), void *arg);
|
||||
|
||||
void rhashtable_destroy(const struct rhashtable *ht);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue