net: reintroduce missing rcu_assign_pointer() calls
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 12 Jan 2012 04:41:32 +0000 (04:41 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Jan 2012 20:26:56 +0000 (12:26 -0800)
commit a9b3cd7f32 (rcu: convert uses of rcu_assign_pointer(x, NULL) to
RCU_INIT_POINTER) did a lot of incorrect changes, since it did a
complete conversion of rcu_assign_pointer(x, y) to RCU_INIT_POINTER(x,
y).

We miss needed barriers, even on x86, when y is not NULL.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
32 files changed:
net/core/net-sysfs.c
net/core/netpoll.c
net/decnet/dn_dev.c
net/ipv4/devinet.c
net/ipv4/fib_trie.c
net/ipv4/igmp.c
net/ipv4/ipip.c
net/ipv4/ipmr.c
net/ipv6/addrconf.c
net/ipv6/ip6_tunnel.c
net/ipv6/raw.c
net/ipv6/sit.c
net/mac80211/agg-rx.c
net/mac80211/cfg.c
net/mac80211/ibss.c
net/mac80211/sta_info.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_ecache.c
net/netfilter/nf_conntrack_extend.c
net/netfilter/nf_conntrack_helper.c
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_log.c
net/netfilter/nf_queue.c
net/netfilter/nfnetlink.c
net/netlabel/netlabel_domainhash.c
net/netlabel/netlabel_unlabeled.c
net/phonet/af_phonet.c
net/phonet/pn_dev.c
net/phonet/socket.c
net/socket.c
net/sunrpc/auth_gss/auth_gss.c
net/xfrm/xfrm_user.c

index abf4393a77b3b1de706931815a72680bfbd78586..f3dbd4f596a4904a99650d18ae73c9a963126aa8 100644 (file)
@@ -1177,9 +1177,9 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
                        nonempty = 1;
        }
 
-       if (nonempty)
-               RCU_INIT_POINTER(dev->xps_maps, new_dev_maps);
-       else {
+       if (nonempty) {
+               rcu_assign_pointer(dev->xps_maps, new_dev_maps);
+       else {
                kfree(new_dev_maps);
                RCU_INIT_POINTER(dev->xps_maps, NULL);
        }
index 0d38808a2305d06c642f7192ece302c9b2a971c2..556b082986696d8b80b09c4f687cff23bc540a45 100644 (file)
@@ -765,7 +765,7 @@ int __netpoll_setup(struct netpoll *np)
        }
 
        /* last thing to do is link it to the net device structure */
-       RCU_INIT_POINTER(ndev->npinfo, npinfo);
+       rcu_assign_pointer(ndev->npinfo, npinfo);
 
        return 0;
 
index 2ab16e12520c525db2a84f0bb80eb4857f55f217..74d321a60e7b5751901c2a2e7d185e54043185ec 100644 (file)
@@ -388,7 +388,7 @@ static int dn_dev_insert_ifa(struct dn_dev *dn_db, struct dn_ifaddr *ifa)
        }
 
        ifa->ifa_next = dn_db->ifa_list;
-       RCU_INIT_POINTER(dn_db->ifa_list, ifa);
+       rcu_assign_pointer(dn_db->ifa_list, ifa);
 
        dn_ifaddr_notify(RTM_NEWADDR, ifa);
        blocking_notifier_call_chain(&dnaddr_chain, NETDEV_UP, ifa);
@@ -1093,7 +1093,7 @@ static struct dn_dev *dn_dev_create(struct net_device *dev, int *err)
 
        memcpy(&dn_db->parms, p, sizeof(struct dn_dev_parms));
 
-       RCU_INIT_POINTER(dev->dn_ptr, dn_db);
+       rcu_assign_pointer(dev->dn_ptr, dn_db);
        dn_db->dev = dev;
        init_timer(&dn_db->timer);
 
index 65f01dc47565bcc26282d4472bbd9c3fb2d3712c..e41c40f48cfe053f28baa3fe9dcf4179ce5a1f37 100644 (file)
@@ -258,7 +258,7 @@ static struct in_device *inetdev_init(struct net_device *dev)
                ip_mc_up(in_dev);
 
        /* we can receive as soon as ip_ptr is set -- do this last */
-       RCU_INIT_POINTER(dev->ip_ptr, in_dev);
+       rcu_assign_pointer(dev->ip_ptr, in_dev);
 out:
        return in_dev;
 out_kfree:
index d04b13ae18fecc3b641ecf5a45279a620307f15f..2b555a5521e0b60f8b373b4c72e70d896da15ff0 100644 (file)
@@ -205,7 +205,7 @@ static inline struct tnode *node_parent_rcu(const struct rt_trie_node *node)
        return (struct tnode *)(parent & ~NODE_TYPE_MASK);
 }
 
-/* Same as RCU_INIT_POINTER
+/* Same as rcu_assign_pointer
  * but that macro() assumes that value is a pointer.
  */
 static inline void node_set_parent(struct rt_trie_node *node, struct tnode *ptr)
@@ -529,7 +529,7 @@ static void tnode_put_child_reorg(struct tnode *tn, int i, struct rt_trie_node *
        if (n)
                node_set_parent(n, tn);
 
-       RCU_INIT_POINTER(tn->child[i], n);
+       rcu_assign_pointer(tn->child[i], n);
 }
 
 #define MAX_WORK 10
@@ -1015,7 +1015,7 @@ static void trie_rebalance(struct trie *t, struct tnode *tn)
 
                tp = node_parent((struct rt_trie_node *) tn);
                if (!tp)
-                       RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn);
+                       rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
 
                tnode_free_flush();
                if (!tp)
@@ -1027,7 +1027,7 @@ static void trie_rebalance(struct trie *t, struct tnode *tn)
        if (IS_TNODE(tn))
                tn = (struct tnode *)resize(t, (struct tnode *)tn);
 
-       RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn);
+       rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
        tnode_free_flush();
 }
 
@@ -1164,7 +1164,7 @@ static struct list_head *fib_insert_node(struct trie *t, u32 key, int plen)
                        put_child(t, (struct tnode *)tp, cindex,
                                  (struct rt_trie_node *)tn);
                } else {
-                       RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn);
+                       rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
                        tp = tn;
                }
        }
index 5104bc0bbdbe73d43f0b92e659e7fb2dda24928f..450e5d21ed2af271574874479bd0c0d341bf6b38 100644 (file)
@@ -1249,7 +1249,7 @@ void ip_mc_inc_group(struct in_device *in_dev, __be32 addr)
 
        im->next_rcu = in_dev->mc_list;
        in_dev->mc_count++;
-       RCU_INIT_POINTER(in_dev->mc_list, im);
+       rcu_assign_pointer(in_dev->mc_list, im);
 
 #ifdef CONFIG_IP_MULTICAST
        igmpv3_del_delrec(in_dev, im->multiaddr);
@@ -1821,7 +1821,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr)
        iml->next_rcu = inet->mc_list;
        iml->sflist = NULL;
        iml->sfmode = MCAST_EXCLUDE;
-       RCU_INIT_POINTER(inet->mc_list, iml);
+       rcu_assign_pointer(inet->mc_list, iml);
        ip_mc_inc_group(in_dev, addr);
        err = 0;
 done:
@@ -2008,7 +2008,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
                        atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc);
                        kfree_rcu(psl, rcu);
                }
-               RCU_INIT_POINTER(pmc->sflist, newpsl);
+               rcu_assign_pointer(pmc->sflist, newpsl);
                psl = newpsl;
        }
        rv = 1; /* > 0 for insert logic below if sl_count is 0 */
@@ -2111,7 +2111,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
        } else
                (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,
                        0, NULL, 0);
-       RCU_INIT_POINTER(pmc->sflist, newpsl);
+       rcu_assign_pointer(pmc->sflist, newpsl);
        pmc->sfmode = msf->imsf_fmode;
        err = 0;
 done:
index 413ed1ba7a5a16976d80ca39fadad9ec719dd6e5..22a19931530910a4f6eae62fb28889f019b2dc68 100644 (file)
@@ -231,7 +231,7 @@ static void ipip_tunnel_unlink(struct ipip_net *ipn, struct ip_tunnel *t)
             (iter = rtnl_dereference(*tp)) != NULL;
             tp = &iter->next) {
                if (t == iter) {
-                       RCU_INIT_POINTER(*tp, t->next);
+                       rcu_assign_pointer(*tp, t->next);
                        break;
                }
        }
@@ -241,8 +241,8 @@ static void ipip_tunnel_link(struct ipip_net *ipn, struct ip_tunnel *t)
 {
        struct ip_tunnel __rcu **tp = ipip_bucket(ipn, t);
 
-       RCU_INIT_POINTER(t->next, rtnl_dereference(*tp));
-       RCU_INIT_POINTER(*tp, t);
+       rcu_assign_pointer(t->next, rtnl_dereference(*tp));
+       rcu_assign_pointer(*tp, t);
 }
 
 static struct ip_tunnel * ipip_tunnel_locate(struct net *net,
@@ -792,7 +792,7 @@ static int __net_init ipip_fb_tunnel_init(struct net_device *dev)
                return -ENOMEM;
 
        dev_hold(dev);
-       RCU_INIT_POINTER(ipn->tunnels_wc[0], tunnel);
+       rcu_assign_pointer(ipn->tunnels_wc[0], tunnel);
        return 0;
 }
 
index 8e54490ee3f490d6c07c99e87481b3a1dd395744..7bc2db6db8d407987bbd06f59a25cf1b0f488989 100644 (file)
@@ -1225,7 +1225,7 @@ int ip_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, unsi
 
                ret = ip_ra_control(sk, 1, mrtsock_destruct);
                if (ret == 0) {
-                       RCU_INIT_POINTER(mrt->mroute_sk, sk);
+                       rcu_assign_pointer(mrt->mroute_sk, sk);
                        IPV4_DEVCONF_ALL(net, MC_FORWARDING)++;
                }
                rtnl_unlock();
index 0ba0866230c99367db4f3706b15cb2ed0ff91dbf..a225d5ee3c2fc877f25e7af417c58de124fe8cb9 100644 (file)
@@ -429,7 +429,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
        ndev->tstamp = jiffies;
        addrconf_sysctl_register(ndev);
        /* protected by rtnl_lock */
-       RCU_INIT_POINTER(dev->ip6_ptr, ndev);
+       rcu_assign_pointer(dev->ip6_ptr, ndev);
 
        /* Join all-node multicast group */
        ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes);
index e1f7761815f36903687dd45f0da702c86ec4f159..aa21da6a09cd66bc2cad80cb227d8514e5466658 100644 (file)
@@ -218,8 +218,8 @@ ip6_tnl_link(struct ip6_tnl_net *ip6n, struct ip6_tnl *t)
 {
        struct ip6_tnl __rcu **tp = ip6_tnl_bucket(ip6n, &t->parms);
 
-       RCU_INIT_POINTER(t->next , rtnl_dereference(*tp));
-       RCU_INIT_POINTER(*tp, t);
+       rcu_assign_pointer(t->next , rtnl_dereference(*tp));
+       rcu_assign_pointer(*tp, t);
 }
 
 /**
@@ -237,7 +237,7 @@ ip6_tnl_unlink(struct ip6_tnl_net *ip6n, struct ip6_tnl *t)
             (iter = rtnl_dereference(*tp)) != NULL;
             tp = &iter->next) {
                if (t == iter) {
-                       RCU_INIT_POINTER(*tp, t->next);
+                       rcu_assign_pointer(*tp, t->next);
                        break;
                }
        }
@@ -1450,7 +1450,7 @@ static int __net_init ip6_fb_tnl_dev_init(struct net_device *dev)
 
        t->parms.proto = IPPROTO_IPV6;
        dev_hold(dev);
-       RCU_INIT_POINTER(ip6n->tnls_wc[0], t);
+       rcu_assign_pointer(ip6n->tnls_wc[0], t);
        return 0;
 }
 
index a4894f4f1944e600d93a1f2a9cde719cfe528bb0..d02f7e4dd6113c8c23cb8a3f7ee9be9cbae37685 100644 (file)
@@ -131,7 +131,7 @@ static mh_filter_t __rcu *mh_filter __read_mostly;
 
 int rawv6_mh_filter_register(mh_filter_t filter)
 {
-       RCU_INIT_POINTER(mh_filter, filter);
+       rcu_assign_pointer(mh_filter, filter);
        return 0;
 }
 EXPORT_SYMBOL(rawv6_mh_filter_register);
index 3b6dac956bb09e74cd9119b7763b786b02789743..133768e52912bd561930736f36c0085c594000b4 100644 (file)
@@ -182,7 +182,7 @@ static void ipip6_tunnel_unlink(struct sit_net *sitn, struct ip_tunnel *t)
             (iter = rtnl_dereference(*tp)) != NULL;
             tp = &iter->next) {
                if (t == iter) {
-                       RCU_INIT_POINTER(*tp, t->next);
+                       rcu_assign_pointer(*tp, t->next);
                        break;
                }
        }
@@ -192,8 +192,8 @@ static void ipip6_tunnel_link(struct sit_net *sitn, struct ip_tunnel *t)
 {
        struct ip_tunnel __rcu **tp = ipip6_bucket(sitn, t);
 
-       RCU_INIT_POINTER(t->next, rtnl_dereference(*tp));
-       RCU_INIT_POINTER(*tp, t);
+       rcu_assign_pointer(t->next, rtnl_dereference(*tp));
+       rcu_assign_pointer(*tp, t);
 }
 
 static void ipip6_tunnel_clone_6rd(struct net_device *dev, struct sit_net *sitn)
@@ -393,7 +393,7 @@ ipip6_tunnel_add_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a, int chg)
        p->addr = a->addr;
        p->flags = a->flags;
        t->prl_count++;
-       RCU_INIT_POINTER(t->prl, p);
+       rcu_assign_pointer(t->prl, p);
 out:
        return err;
 }
@@ -1177,7 +1177,7 @@ static int __net_init ipip6_fb_tunnel_init(struct net_device *dev)
        if (!dev->tstats)
                return -ENOMEM;
        dev_hold(dev);
-       RCU_INIT_POINTER(sitn->tunnels_wc[0], tunnel);
+       rcu_assign_pointer(sitn->tunnels_wc[0], tunnel);
        return 0;
 }
 
index 96debba2c407bfeeb91d95ce1524521a07745958..1068f668ac4ec3434b1524624df98c5bf08e5074 100644 (file)
@@ -332,7 +332,7 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
        status = WLAN_STATUS_SUCCESS;
 
        /* activate it for RX */
-       RCU_INIT_POINTER(sta->ampdu_mlme.tid_rx[tid], tid_agg_rx);
+       rcu_assign_pointer(sta->ampdu_mlme.tid_rx[tid], tid_agg_rx);
 
        if (timeout)
                mod_timer(&tid_agg_rx->session_timer, TU_TO_EXP_TIME(timeout));
index 850bb96bd6805204685083dde687b8097bd19b0f..e60df48fa4d4d235016398706bf3b32e5633c1e0 100644 (file)
@@ -616,7 +616,7 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata,
 
        sdata->vif.bss_conf.dtim_period = new->dtim_period;
 
-       RCU_INIT_POINTER(sdata->u.ap.beacon, new);
+       rcu_assign_pointer(sdata->u.ap.beacon, new);
 
        synchronize_rcu();
 
@@ -1033,7 +1033,7 @@ static int ieee80211_change_station(struct wiphy *wiphy,
                                return -EBUSY;
                        }
 
-                       RCU_INIT_POINTER(vlansdata->u.vlan.sta, sta);
+                       rcu_assign_pointer(vlansdata->u.vlan.sta, sta);
                }
 
                sta->sdata = vlansdata;
index f8a32bf98216c1bb40dadf82bfa67153a349ec9f..b3d76b756cd55e4c8e513bfa506c336ab77e667b 100644 (file)
@@ -207,7 +207,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
                *pos++ = 0; /* U-APSD no in use */
        }
 
-       RCU_INIT_POINTER(ifibss->presp, skb);
+       rcu_assign_pointer(ifibss->presp, skb);
 
        sdata->vif.bss_conf.beacon_int = beacon_int;
        sdata->vif.bss_conf.basic_rates = basic_rates;
index b197136aea2c1d67d5223d58d248e6de7fbccb3f..3c428d4839c7c5cca61ba535197068f3b5c10dbd 100644 (file)
@@ -73,7 +73,7 @@ static int sta_info_hash_del(struct ieee80211_local *local,
        if (!s)
                return -ENOENT;
        if (s == sta) {
-               RCU_INIT_POINTER(local->sta_hash[STA_HASH(sta->sta.addr)],
+               rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)],
                                   s->hnext);
                return 0;
        }
@@ -83,7 +83,7 @@ static int sta_info_hash_del(struct ieee80211_local *local,
                s = rcu_dereference_protected(s->hnext,
                                        lockdep_is_held(&local->sta_mtx));
        if (rcu_access_pointer(s->hnext)) {
-               RCU_INIT_POINTER(s->hnext, sta->hnext);
+               rcu_assign_pointer(s->hnext, sta->hnext);
                return 0;
        }
 
@@ -226,7 +226,7 @@ static void sta_info_hash_add(struct ieee80211_local *local,
 {
        lockdep_assert_held(&local->sta_mtx);
        sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)];
-       RCU_INIT_POINTER(local->sta_hash[STA_HASH(sta->sta.addr)], sta);
+       rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta);
 }
 
 static void sta_unblock(struct work_struct *wk)
index e875f8902db3e7224b566e88e7bb82a73646a24f..76613f5a55c0c557920c1f52f2d67a20c0934eda 100644 (file)
@@ -777,7 +777,7 @@ init_conntrack(struct net *net, struct nf_conn *tmpl,
                if (exp->helper) {
                        help = nf_ct_helper_ext_add(ct, GFP_ATOMIC);
                        if (help)
-                               RCU_INIT_POINTER(help->helper, exp->helper);
+                               rcu_assign_pointer(help->helper, exp->helper);
                }
 
 #ifdef CONFIG_NF_CONNTRACK_MARK
index b62c4148b92131444f6e132cb55a058991d68379..14af6329bdda21843ada4be624093e1ac6f980fb 100644 (file)
@@ -91,7 +91,7 @@ int nf_conntrack_register_notifier(struct net *net,
                ret = -EBUSY;
                goto out_unlock;
        }
-       RCU_INIT_POINTER(net->ct.nf_conntrack_event_cb, new);
+       rcu_assign_pointer(net->ct.nf_conntrack_event_cb, new);
        mutex_unlock(&nf_ct_ecache_mutex);
        return ret;
 
@@ -128,7 +128,7 @@ int nf_ct_expect_register_notifier(struct net *net,
                ret = -EBUSY;
                goto out_unlock;
        }
-       RCU_INIT_POINTER(net->ct.nf_expect_event_cb, new);
+       rcu_assign_pointer(net->ct.nf_expect_event_cb, new);
        mutex_unlock(&nf_ct_ecache_mutex);
        return ret;
 
index 4605c947dcc49e751478aaffb816e17470998185..641ff5f967186676a0f99f14b70cb68201038fb9 100644 (file)
@@ -169,7 +169,7 @@ int nf_ct_extend_register(struct nf_ct_ext_type *type)
           before updating alloc_size */
        type->alloc_size = ALIGN(sizeof(struct nf_ct_ext), type->align)
                           + type->len;
-       RCU_INIT_POINTER(nf_ct_ext_types[type->id], type);
+       rcu_assign_pointer(nf_ct_ext_types[type->id], type);
        update_alloc_size(type);
 out:
        mutex_unlock(&nf_ct_ext_type_mutex);
index c9e0de08aa872bcbd61a4bf0b8171669a632a914..299fec91f74189a562f7fcb0d47914d9b279c286 100644 (file)
@@ -157,7 +157,7 @@ int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl,
                memset(&help->help, 0, sizeof(help->help));
        }
 
-       RCU_INIT_POINTER(help->helper, helper);
+       rcu_assign_pointer(help->helper, helper);
 out:
        return ret;
 }
index e07dc3ae930ea3a2aa3947eb841e47a3cb23173f..2a4834b83332afa2ebf87b37102cd2a9d6dcd8d1 100644 (file)
@@ -1172,7 +1172,7 @@ ctnetlink_change_helper(struct nf_conn *ct, const struct nlattr * const cda[])
                return -EOPNOTSUPP;
        }
 
-       RCU_INIT_POINTER(help->helper, helper);
+       rcu_assign_pointer(help->helper, helper);
 
        return 0;
 }
index ce0c406f58a8b645cc4500c85dfad2008d0db70d..957374a234d410bbf87bee24f3fee4428a5ff678 100644 (file)
@@ -55,7 +55,7 @@ int nf_log_register(u_int8_t pf, struct nf_logger *logger)
                llog = rcu_dereference_protected(nf_loggers[pf],
                                                 lockdep_is_held(&nf_log_mutex));
                if (llog == NULL)
-                       RCU_INIT_POINTER(nf_loggers[pf], logger);
+                       rcu_assign_pointer(nf_loggers[pf], logger);
        }
 
        mutex_unlock(&nf_log_mutex);
@@ -92,7 +92,7 @@ int nf_log_bind_pf(u_int8_t pf, const struct nf_logger *logger)
                mutex_unlock(&nf_log_mutex);
                return -ENOENT;
        }
-       RCU_INIT_POINTER(nf_loggers[pf], logger);
+       rcu_assign_pointer(nf_loggers[pf], logger);
        mutex_unlock(&nf_log_mutex);
        return 0;
 }
@@ -250,7 +250,7 @@ static int nf_log_proc_dostring(ctl_table *table, int write,
                        mutex_unlock(&nf_log_mutex);
                        return -ENOENT;
                }
-               RCU_INIT_POINTER(nf_loggers[tindex], logger);
+               rcu_assign_pointer(nf_loggers[tindex], logger);
                mutex_unlock(&nf_log_mutex);
        } else {
                mutex_lock(&nf_log_mutex);
index 99ffd2885088fc3606270984386713b959b75285..b3a7db678b8dddf12e9495630e0e051a0b78cfe9 100644 (file)
@@ -40,7 +40,7 @@ int nf_register_queue_handler(u_int8_t pf, const struct nf_queue_handler *qh)
        else if (old)
                ret = -EBUSY;
        else {
-               RCU_INIT_POINTER(queue_handler[pf], qh);
+               rcu_assign_pointer(queue_handler[pf], qh);
                ret = 0;
        }
        mutex_unlock(&queue_handler_mutex);
index c879c1a2370e46829c442095b98a58ce705d78b3..b4f8d849480cfb9a6cffa57063a54b5152dfce75 100644 (file)
@@ -59,7 +59,7 @@ int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n)
                nfnl_unlock();
                return -EBUSY;
        }
-       RCU_INIT_POINTER(subsys_table[n->subsys_id], n);
+       rcu_assign_pointer(subsys_table[n->subsys_id], n);
        nfnl_unlock();
 
        return 0;
@@ -210,7 +210,7 @@ static int __net_init nfnetlink_net_init(struct net *net)
        if (!nfnl)
                return -ENOMEM;
        net->nfnl_stash = nfnl;
-       RCU_INIT_POINTER(net->nfnl, nfnl);
+       rcu_assign_pointer(net->nfnl, nfnl);
        return 0;
 }
 
index 38204112b9f4a0faec6e629e3431359c17033b38..d8d42433755051023320299f919f69db9e58ec29 100644 (file)
@@ -282,7 +282,7 @@ int __init netlbl_domhsh_init(u32 size)
                INIT_LIST_HEAD(&hsh_tbl->tbl[iter]);
 
        spin_lock(&netlbl_domhsh_lock);
-       RCU_INIT_POINTER(netlbl_domhsh, hsh_tbl);
+       rcu_assign_pointer(netlbl_domhsh, hsh_tbl);
        spin_unlock(&netlbl_domhsh_lock);
 
        return 0;
@@ -330,7 +330,7 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry,
                                    &rcu_dereference(netlbl_domhsh)->tbl[bkt]);
                } else {
                        INIT_LIST_HEAD(&entry->list);
-                       RCU_INIT_POINTER(netlbl_domhsh_def, entry);
+                       rcu_assign_pointer(netlbl_domhsh_def, entry);
                }
 
                if (entry->type == NETLBL_NLTYPE_ADDRSELECT) {
index 4b5fa0fe78fd36a3e4055328535ffa3283eae642..e7ff694f1049be48b3193d4a0b3ffded63aecbcd 100644 (file)
@@ -354,7 +354,7 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_add_iface(int ifindex)
                INIT_LIST_HEAD(&iface->list);
                if (netlbl_unlhsh_rcu_deref(netlbl_unlhsh_def) != NULL)
                        goto add_iface_failure;
-               RCU_INIT_POINTER(netlbl_unlhsh_def, iface);
+               rcu_assign_pointer(netlbl_unlhsh_def, iface);
        }
        spin_unlock(&netlbl_unlhsh_lock);
 
@@ -1447,11 +1447,9 @@ int __init netlbl_unlabel_init(u32 size)
        for (iter = 0; iter < hsh_tbl->size; iter++)
                INIT_LIST_HEAD(&hsh_tbl->tbl[iter]);
 
-       rcu_read_lock();
        spin_lock(&netlbl_unlhsh_lock);
-       RCU_INIT_POINTER(netlbl_unlhsh, hsh_tbl);
+       rcu_assign_pointer(netlbl_unlhsh, hsh_tbl);
        spin_unlock(&netlbl_unlhsh_lock);
-       rcu_read_unlock();
 
        register_netdevice_notifier(&netlbl_unlhsh_netdev_notifier);
 
index bf10ea8fbbf95bd349d0f69f18527a524d5d3a9c..d65f699fbf343a98d788a8f49286c71dc4f7887f 100644 (file)
@@ -480,7 +480,7 @@ int __init_or_module phonet_proto_register(unsigned int protocol,
        if (proto_tab[protocol])
                err = -EBUSY;
        else
-               RCU_INIT_POINTER(proto_tab[protocol], pp);
+               rcu_assign_pointer(proto_tab[protocol], pp);
        mutex_unlock(&proto_tab_lock);
 
        return err;
index c5827614376bd18c668a99d76b1b61f4b9f57011..9b9a85ecc4c79d70c88db78a12e5d54309e28d43 100644 (file)
@@ -390,7 +390,7 @@ int phonet_route_add(struct net_device *dev, u8 daddr)
        daddr = daddr >> 2;
        mutex_lock(&routes->lock);
        if (routes->table[daddr] == NULL) {
-               RCU_INIT_POINTER(routes->table[daddr], dev);
+               rcu_assign_pointer(routes->table[daddr], dev);
                dev_hold(dev);
                err = 0;
        }
index 3f8d0b1603b98f5c1c2ad5105b6a3226c27df1f3..4c7eff30dfa9e4cc3bb54418e4dda44841b4d9be 100644 (file)
@@ -680,7 +680,7 @@ int pn_sock_bind_res(struct sock *sk, u8 res)
        mutex_lock(&resource_mutex);
        if (pnres.sk[res] == NULL) {
                sock_hold(sk);
-               RCU_INIT_POINTER(pnres.sk[res], sk);
+               rcu_assign_pointer(pnres.sk[res], sk);
                ret = 0;
        }
        mutex_unlock(&resource_mutex);
index e56162cd65b053b7a86119737dd7ca91329573d7..28a96af484b421ee06fffbe87358c1811693c97f 100644 (file)
@@ -2492,7 +2492,7 @@ int sock_register(const struct net_proto_family *ops)
                                      lockdep_is_held(&net_family_lock)))
                err = -EEXIST;
        else {
-               RCU_INIT_POINTER(net_families[ops->family], ops);
+               rcu_assign_pointer(net_families[ops->family], ops);
                err = 0;
        }
        spin_unlock(&net_family_lock);
index afb56553dfe72d630aea0737020ff973a815f34f..db0efdec4e4516b58601e4bb4cda5b3ff9dbdc47 100644 (file)
@@ -122,7 +122,7 @@ gss_cred_set_ctx(struct rpc_cred *cred, struct gss_cl_ctx *ctx)
        if (!test_bit(RPCAUTH_CRED_NEW, &cred->cr_flags))
                return;
        gss_get_ctx(ctx);
-       RCU_INIT_POINTER(gss_cred->gc_ctx, ctx);
+       rcu_assign_pointer(gss_cred->gc_ctx, ctx);
        set_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
        smp_mb__before_clear_bit();
        clear_bit(RPCAUTH_CRED_NEW, &cred->cr_flags);
index e0d747a2e80341eb736c4348212770c3db41c4ad..637f11a1e4df931e772baca8a9a68f1c9bcde2cb 100644 (file)
@@ -2927,7 +2927,7 @@ static int __net_init xfrm_user_net_init(struct net *net)
        if (nlsk == NULL)
                return -ENOMEM;
        net->xfrm.nlsk_stash = nlsk; /* Don't set to NULL */
-       RCU_INIT_POINTER(net->xfrm.nlsk, nlsk);
+       rcu_assign_pointer(net->xfrm.nlsk, nlsk);
        return 0;
 }