]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: involve rhashtable_lookup_compare_insert routine
authorYing Xue <ying.xue@windriver.com>
Mon, 12 Jan 2015 06:52:22 +0000 (14:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Jan 2015 19:01:00 +0000 (14:01 -0500)
commitb03c27c2033117c95342313e7073b3bcf865aae2
tree9b490c8b37180ba0ce56ffd9ff521b43218fd8c5
parent49da54ea9e83e94eefd6deb529a06d3347d9d5b3
rhashtable: involve rhashtable_lookup_compare_insert routine

Introduce a new function called rhashtable_lookup_compare_insert()
which is very similar to rhashtable_lookup_insert(). But the former
makes use of users' given compare function to look for an object,
and then inserts it into hash table if found. As the entire process
of search and insertion is under protection of per bucket lock, this
can help users to avoid the involvement of extra lock.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Cc: Thomas Graf <tgraf@suug.ch>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rhashtable.h
lib/rhashtable.c