summaryrefslogtreecommitdiffstats
path: root/lib/debug_info.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-06-18 04:52:50 +0200
committerDavid S. Miller <davem@davemloft.net>2018-06-22 06:43:28 +0200
commitc0690016a73fe6bd456887bbbe6e10c7f0096554 (patch)
tree7b835ab9e83decb0f9be1f616daa5374dd47559d /lib/debug_info.c
parentrhashtable: use cmpxchg() to protect ->future_tbl. (diff)
downloadlinux-c0690016a73fe6bd456887bbbe6e10c7f0096554.tar.xz
linux-c0690016a73fe6bd456887bbbe6e10c7f0096554.zip
rhashtable: clean up dereference of ->future_tbl.
Using rht_dereference_bucket() to dereference ->future_tbl looks like a type error, and could be confusing. Using rht_dereference_rcu() to test a pointer for NULL adds an unnecessary barrier - rcu_access_pointer() is preferred for NULL tests when no lock is held. This uses 3 different ways to access ->future_tbl. - if we know the mutex is held, use rht_dereference() - if we don't hold the mutex, and are only testing for NULL, use rcu_access_pointer() - otherwise (using RCU protection for true dereference), use rht_dereference_rcu(). Note that this includes a simplification of the call to rhashtable_last_table() - we don't do an extra dereference before the call any more. Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/debug_info.c')
0 files changed, 0 insertions, 0 deletions