]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: Add rhashtable_free_and_destroy()
authorThomas Graf <tgraf@suug.ch>
Tue, 24 Mar 2015 13:18:20 +0000 (14:18 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2015 21:48:40 +0000 (17:48 -0400)
commitac7343bb6ae7037d5ecad7eb41717586e8f86b60
tree8464850fd94dba0dfa34c75c46dfb3fcf4c3c381
parentcde1400602cb9019efa9ae3d63a0a4e66a1b1fb6
rhashtable: Add rhashtable_free_and_destroy()

rhashtable_destroy() variant which stops rehashes, iterates over
the table and calls a callback to release resources.

Avoids need for nft_hash to embed rhashtable internals and allows to
get rid of the being_destroyed flag. It also saves a 2nd mutex
lock upon destruction.

Also fixes an RCU lockdep splash on nft set destruction due to
calling rht_for_each_entry_safe() without holding bucket locks.
Open code this loop as we need know that no mutations may occur in
parallel.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rhashtable.h
lib/rhashtable.c
net/netfilter/nft_hash.c