rhashtable: Add rht_ptr_rcu and improve rht_ptr
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 28 May 2019 07:02:31 +0000 (15:02 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 May 2019 20:27:08 +0000 (13:27 -0700)
commit279758f8001f0014b15656a4ef130a20852f6df6
tree0a3fe4267433d9b51940e04ad68ea2f7b85d03a1
parentaf64935213c42245e7937af0e4a359e1be7946b2
rhashtable: Add rht_ptr_rcu and improve rht_ptr

This patch moves common code between rht_ptr and rht_ptr_exclusive
into __rht_ptr.  It also adds a new helper rht_ptr_rcu exclusively
for the RCU case.  This way rht_ptr becomes a lock-only construct
so we can use the lighter rcu_dereference_protected primitive.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rhashtable.h