diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-08-01 12:19:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-02 07:29:23 -0400 |
commit | a9b3cd7f323b2e57593e7215362a7b02fc933e3a (patch) | |
tree | eba1741956aef3015d5b1a07253bf93c4c1bc7df /net/ipv4/ipmr.c | |
parent | 76f793e3a47139d340185cbc1a314740c09b13d3 (diff) |
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>
Diffstat (limited to 'net/ipv4/ipmr.c')
-rw-r--r-- | net/ipv4/ipmr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 58e879157976..f550285c977b 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1176,7 +1176,7 @@ static void mrtsock_destruct(struct sock *sk) | |||
1176 | ipmr_for_each_table(mrt, net) { | 1176 | ipmr_for_each_table(mrt, net) { |
1177 | if (sk == rtnl_dereference(mrt->mroute_sk)) { | 1177 | if (sk == rtnl_dereference(mrt->mroute_sk)) { |
1178 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)--; | 1178 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)--; |
1179 | rcu_assign_pointer(mrt->mroute_sk, NULL); | 1179 | RCU_INIT_POINTER(mrt->mroute_sk, NULL); |
1180 | mroute_clean_tables(mrt); | 1180 | mroute_clean_tables(mrt); |
1181 | } | 1181 | } |
1182 | } | 1182 | } |
@@ -1224,7 +1224,7 @@ int ip_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, unsi | |||
1224 | 1224 | ||
1225 | ret = ip_ra_control(sk, 1, mrtsock_destruct); | 1225 | ret = ip_ra_control(sk, 1, mrtsock_destruct); |
1226 | if (ret == 0) { | 1226 | if (ret == 0) { |
1227 | rcu_assign_pointer(mrt->mroute_sk, sk); | 1227 | RCU_INIT_POINTER(mrt->mroute_sk, sk); |
1228 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)++; | 1228 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)++; |
1229 | } | 1229 | } |
1230 | rtnl_unlock(); | 1230 | rtnl_unlock(); |