rhashtable: involve rhashtable_lookup_insert routine
Involve a new function called rhashtable_lookup_insert() which makes lookup and insertion atomic under bucket lock protection, helping us avoid to introduce an extra lock when we search and insert an object into hash table. Signed-off-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Thomas Graf <tgraf@suug.ch> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
54c5b7d311
commit
db30485408
@@ -168,6 +168,7 @@ int rhashtable_shrink(struct rhashtable *ht);
|
||||
void *rhashtable_lookup(struct rhashtable *ht, const void *key);
|
||||
void *rhashtable_lookup_compare(struct rhashtable *ht, const void *key,
|
||||
bool (*compare)(void *, void *), void *arg);
|
||||
bool rhashtable_lookup_insert(struct rhashtable *ht, struct rhash_head *obj);
|
||||
|
||||
void rhashtable_destroy(struct rhashtable *ht);
|
||||
|
||||
|
Reference in New Issue
Block a user