diff options
author | NeilBrown <neilb@suse.com> | 2019-04-12 03:52:08 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-13 02:34:45 +0200 |
commit | adc6a3ab192eb40fb9d8b093c87d9aa785af4513 (patch) | |
tree | 6aae93c08ed6295e47300fbe11dc010ee1b32a1d /drivers/block/skd_main.c | |
parent | rhashtable: reorder some inline functions and macros. (diff) | |
download | linux-adc6a3ab192eb40fb9d8b093c87d9aa785af4513.tar.xz linux-adc6a3ab192eb40fb9d8b093c87d9aa785af4513.zip |
rhashtable: move dereference inside rht_ptr()
Rather than dereferencing a pointer to a bucket and then passing the
result to rht_ptr(), we now pass in the pointer and do the dereference
in rht_ptr().
This requires that we pass in the tbl and hash as well to support RCU
checks, and means that the various rht_for_each functions can expect a
pointer that can be dereferenced without further care.
There are two places where we dereference a bucket pointer
where there is no testable protection - in each case we know
that we much have exclusive access without having taken a lock.
The previous code used rht_dereference() to pretend that holding
the mutex provided protects, but holding the mutex never provides
protection for accessing buckets.
So instead introduce rht_ptr_exclusive() that can be used when
there is known to be exclusive access without holding any locks.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/block/skd_main.c')
0 files changed, 0 insertions, 0 deletions