You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER
When assigning a NULL value to an RCU protected pointer, no barrier is needed. The rcu_assign_pointer, used to handle that but will soon change to not handle the special case. Convert all rcu_assign_pointer of NULL value. //smpl @@ expression P; @@ - rcu_assign_pointer(P, NULL) + RCU_INIT_POINTER(P, NULL) // </smpl> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
76f793e3a4
commit
a9b3cd7f32
+2
-2
@@ -2463,7 +2463,7 @@ int sock_register(const struct net_proto_family *ops)
|
||||
lockdep_is_held(&net_family_lock)))
|
||||
err = -EEXIST;
|
||||
else {
|
||||
rcu_assign_pointer(net_families[ops->family], ops);
|
||||
RCU_INIT_POINTER(net_families[ops->family], ops);
|
||||
err = 0;
|
||||
}
|
||||
spin_unlock(&net_family_lock);
|
||||
@@ -2491,7 +2491,7 @@ void sock_unregister(int family)
|
||||
BUG_ON(family < 0 || family >= NPROTO);
|
||||
|
||||
spin_lock(&net_family_lock);
|
||||
rcu_assign_pointer(net_families[family], NULL);
|
||||
RCU_INIT_POINTER(net_families[family], NULL);
|
||||
spin_unlock(&net_family_lock);
|
||||
|
||||
synchronize_rcu();
|
||||
|
||||
Reference in New Issue
Block a user