diff options
author | Andreea-Cristina Bernat <bernat.ada@gmail.com> | 2015-01-16 18:19:53 +0300 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2015-02-17 21:26:19 +0300 |
commit | 03c885913f914d17124432dd50caf2923a80847c (patch) | |
tree | 3db8e8bb201844385275b6a4e58acc9458a29552 /fs/notify/inode_mark.c | |
parent | 0e6bbba56c54f6305f24f0ad8991f5b5d03ae2b5 (diff) | |
download | linux-03c885913f914d17124432dd50caf2923a80847c.tar.xz |
IB/qib: Replace rcu_assign_pointer() with RCU_INIT_POINTER() in qib_qp.c
According to RCU_INIT_POINTER()'s block comment 3.a, it can be used if
"1. This use of RCU_INIT_POINTER() is NULLing out the pointer"
it is better to use it instead of rcu_assign_pointer() because it has a
smaller overhead.
"3. The referenced data structure has already been exposed to readers either
at compile time or via rcu_assign_pointer() -and-
a. You have not made -any- reader-visible changes to this structure since
then".
These cases fulfill the conditions above because between the
rcu_dereference_protected() call and the rcu_assign_pointer() call
there is no update of that value. Therefore, this patch makes the
replacement.
The following Coccinelle semantic patch was used:
@@
@@
- rcu_assign_pointer
+ RCU_INIT_POINTER
(...,
(
rtnl_dereference(...)
|
rcu_dereference_protected(...)
) )
[consolidated from http://marc.info/?l=linux-rdma&m=140836578119485&w=2 and
http://marc.info/?l=linux-rdma&m=140906361403047&w=2]
Tested-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'fs/notify/inode_mark.c')
0 files changed, 0 insertions, 0 deletions