mirror of
https://github.com/ukui/kernel.git
synced 2026-03-09 10:07:04 -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
@@ -553,7 +553,7 @@ static void garp_release_port(struct net_device *dev)
|
|||||||
if (rtnl_dereference(port->applicants[i]))
|
if (rtnl_dereference(port->applicants[i]))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rcu_assign_pointer(dev->garp_port, NULL);
|
RCU_INIT_POINTER(dev->garp_port, NULL);
|
||||||
kfree_rcu(port, rcu);
|
kfree_rcu(port, rcu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -605,7 +605,7 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl
|
|||||||
|
|
||||||
ASSERT_RTNL();
|
ASSERT_RTNL();
|
||||||
|
|
||||||
rcu_assign_pointer(port->applicants[appl->type], NULL);
|
RCU_INIT_POINTER(port->applicants[appl->type], NULL);
|
||||||
|
|
||||||
/* Delete timer and generate a final TRANSMIT_PDU event to flush out
|
/* Delete timer and generate a final TRANSMIT_PDU event to flush out
|
||||||
* all pending messages before the applicant is gone. */
|
* all pending messages before the applicant is gone. */
|
||||||
|
|||||||
+2
-2
@@ -88,9 +88,9 @@ void stp_proto_unregister(const struct stp_proto *proto)
|
|||||||
{
|
{
|
||||||
mutex_lock(&stp_proto_mutex);
|
mutex_lock(&stp_proto_mutex);
|
||||||
if (is_zero_ether_addr(proto->group_address))
|
if (is_zero_ether_addr(proto->group_address))
|
||||||
rcu_assign_pointer(stp_proto, NULL);
|
RCU_INIT_POINTER(stp_proto, NULL);
|
||||||
else
|
else
|
||||||
rcu_assign_pointer(garp_protos[proto->group_address[5] -
|
RCU_INIT_POINTER(garp_protos[proto->group_address[5] -
|
||||||
GARP_ADDR_MIN], NULL);
|
GARP_ADDR_MIN], NULL);
|
||||||
synchronize_rcu();
|
synchronize_rcu();
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -133,7 +133,7 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
|
|||||||
if (grp->nr_vlans == 0) {
|
if (grp->nr_vlans == 0) {
|
||||||
vlan_gvrp_uninit_applicant(real_dev);
|
vlan_gvrp_uninit_applicant(real_dev);
|
||||||
|
|
||||||
rcu_assign_pointer(real_dev->vlgrp, NULL);
|
RCU_INIT_POINTER(real_dev->vlgrp, NULL);
|
||||||
|
|
||||||
/* Free the group, after all cpu's are done. */
|
/* Free the group, after all cpu's are done. */
|
||||||
call_rcu(&grp->rcu, vlan_rcu_free);
|
call_rcu(&grp->rcu, vlan_rcu_free);
|
||||||
|
|||||||
@@ -87,14 +87,14 @@ static int __init ebtable_broute_init(void)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
/* see br_input.c */
|
/* see br_input.c */
|
||||||
rcu_assign_pointer(br_should_route_hook,
|
RCU_INIT_POINTER(br_should_route_hook,
|
||||||
(br_should_route_hook_t *)ebt_broute);
|
(br_should_route_hook_t *)ebt_broute);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __exit ebtable_broute_fini(void)
|
static void __exit ebtable_broute_fini(void)
|
||||||
{
|
{
|
||||||
rcu_assign_pointer(br_should_route_hook, NULL);
|
RCU_INIT_POINTER(br_should_route_hook, NULL);
|
||||||
synchronize_net();
|
synchronize_net();
|
||||||
unregister_pernet_subsys(&broute_net_ops);
|
unregister_pernet_subsys(&broute_net_ops);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -108,7 +108,7 @@ struct cflayer *cfmuxl_remove_dnlayer(struct cflayer *layr, u8 phyid)
|
|||||||
int idx = phyid % DN_CACHE_SIZE;
|
int idx = phyid % DN_CACHE_SIZE;
|
||||||
|
|
||||||
spin_lock_bh(&muxl->transmit_lock);
|
spin_lock_bh(&muxl->transmit_lock);
|
||||||
rcu_assign_pointer(muxl->dn_cache[idx], NULL);
|
RCU_INIT_POINTER(muxl->dn_cache[idx], NULL);
|
||||||
dn = get_from_id(&muxl->frml_list, phyid);
|
dn = get_from_id(&muxl->frml_list, phyid);
|
||||||
if (dn == NULL)
|
if (dn == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
@@ -164,7 +164,7 @@ struct cflayer *cfmuxl_remove_uplayer(struct cflayer *layr, u8 id)
|
|||||||
if (up == NULL)
|
if (up == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
rcu_assign_pointer(muxl->up_cache[idx], NULL);
|
RCU_INIT_POINTER(muxl->up_cache[idx], NULL);
|
||||||
list_del_rcu(&up->node);
|
list_del_rcu(&up->node);
|
||||||
out:
|
out:
|
||||||
spin_unlock_bh(&muxl->receive_lock);
|
spin_unlock_bh(&muxl->receive_lock);
|
||||||
@@ -261,7 +261,7 @@ static void cfmuxl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl,
|
|||||||
|
|
||||||
idx = layer->id % UP_CACHE_SIZE;
|
idx = layer->id % UP_CACHE_SIZE;
|
||||||
spin_lock_bh(&muxl->receive_lock);
|
spin_lock_bh(&muxl->receive_lock);
|
||||||
rcu_assign_pointer(muxl->up_cache[idx], NULL);
|
RCU_INIT_POINTER(muxl->up_cache[idx], NULL);
|
||||||
list_del_rcu(&layer->node);
|
list_del_rcu(&layer->node);
|
||||||
spin_unlock_bh(&muxl->receive_lock);
|
spin_unlock_bh(&muxl->receive_lock);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -719,7 +719,7 @@ int can_proto_register(const struct can_proto *cp)
|
|||||||
proto);
|
proto);
|
||||||
err = -EBUSY;
|
err = -EBUSY;
|
||||||
} else
|
} else
|
||||||
rcu_assign_pointer(proto_tab[proto], cp);
|
RCU_INIT_POINTER(proto_tab[proto], cp);
|
||||||
|
|
||||||
mutex_unlock(&proto_tab_lock);
|
mutex_unlock(&proto_tab_lock);
|
||||||
|
|
||||||
@@ -740,7 +740,7 @@ void can_proto_unregister(const struct can_proto *cp)
|
|||||||
|
|
||||||
mutex_lock(&proto_tab_lock);
|
mutex_lock(&proto_tab_lock);
|
||||||
BUG_ON(proto_tab[proto] != cp);
|
BUG_ON(proto_tab[proto] != cp);
|
||||||
rcu_assign_pointer(proto_tab[proto], NULL);
|
RCU_INIT_POINTER(proto_tab[proto], NULL);
|
||||||
mutex_unlock(&proto_tab_lock);
|
mutex_unlock(&proto_tab_lock);
|
||||||
|
|
||||||
synchronize_rcu();
|
synchronize_rcu();
|
||||||
|
|||||||
+2
-2
@@ -3094,8 +3094,8 @@ void netdev_rx_handler_unregister(struct net_device *dev)
|
|||||||
{
|
{
|
||||||
|
|
||||||
ASSERT_RTNL();
|
ASSERT_RTNL();
|
||||||
rcu_assign_pointer(dev->rx_handler, NULL);
|
RCU_INIT_POINTER(dev->rx_handler, NULL);
|
||||||
rcu_assign_pointer(dev->rx_handler_data, NULL);
|
RCU_INIT_POINTER(dev->rx_handler_data, NULL);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
|
EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
|
||||||
|
|
||||||
|
|||||||
@@ -487,7 +487,7 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
|
|||||||
if (ops->nr_goto_rules > 0) {
|
if (ops->nr_goto_rules > 0) {
|
||||||
list_for_each_entry(tmp, &ops->rules_list, list) {
|
list_for_each_entry(tmp, &ops->rules_list, list) {
|
||||||
if (rtnl_dereference(tmp->ctarget) == rule) {
|
if (rtnl_dereference(tmp->ctarget) == rule) {
|
||||||
rcu_assign_pointer(tmp->ctarget, NULL);
|
RCU_INIT_POINTER(tmp->ctarget, NULL);
|
||||||
ops->unresolved_rules++;
|
ops->unresolved_rules++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -645,7 +645,7 @@ int sk_detach_filter(struct sock *sk)
|
|||||||
filter = rcu_dereference_protected(sk->sk_filter,
|
filter = rcu_dereference_protected(sk->sk_filter,
|
||||||
sock_owned_by_user(sk));
|
sock_owned_by_user(sk));
|
||||||
if (filter) {
|
if (filter) {
|
||||||
rcu_assign_pointer(sk->sk_filter, NULL);
|
RCU_INIT_POINTER(sk->sk_filter, NULL);
|
||||||
sk_filter_uncharge(sk, filter);
|
sk_filter_uncharge(sk, filter);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -987,10 +987,10 @@ static ssize_t store_xps_map(struct netdev_queue *queue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nonempty)
|
if (nonempty)
|
||||||
rcu_assign_pointer(dev->xps_maps, new_dev_maps);
|
RCU_INIT_POINTER(dev->xps_maps, new_dev_maps);
|
||||||
else {
|
else {
|
||||||
kfree(new_dev_maps);
|
kfree(new_dev_maps);
|
||||||
rcu_assign_pointer(dev->xps_maps, NULL);
|
RCU_INIT_POINTER(dev->xps_maps, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev_maps)
|
if (dev_maps)
|
||||||
|
|||||||
+2
-2
@@ -760,7 +760,7 @@ int __netpoll_setup(struct netpoll *np)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* last thing to do is link it to the net device structure */
|
/* last thing to do is link it to the net device structure */
|
||||||
rcu_assign_pointer(ndev->npinfo, npinfo);
|
RCU_INIT_POINTER(ndev->npinfo, npinfo);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -901,7 +901,7 @@ void __netpoll_cleanup(struct netpoll *np)
|
|||||||
if (ops->ndo_netpoll_cleanup)
|
if (ops->ndo_netpoll_cleanup)
|
||||||
ops->ndo_netpoll_cleanup(np->dev);
|
ops->ndo_netpoll_cleanup(np->dev);
|
||||||
|
|
||||||
rcu_assign_pointer(np->dev->npinfo, NULL);
|
RCU_INIT_POINTER(np->dev->npinfo, NULL);
|
||||||
|
|
||||||
/* avoid racing with NAPI reading npinfo */
|
/* avoid racing with NAPI reading npinfo */
|
||||||
synchronize_rcu_bh();
|
synchronize_rcu_bh();
|
||||||
|
|||||||
+2
-2
@@ -387,7 +387,7 @@ struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
|
|||||||
|
|
||||||
if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
|
if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
|
||||||
sk_tx_queue_clear(sk);
|
sk_tx_queue_clear(sk);
|
||||||
rcu_assign_pointer(sk->sk_dst_cache, NULL);
|
RCU_INIT_POINTER(sk->sk_dst_cache, NULL);
|
||||||
dst_release(dst);
|
dst_release(dst);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1158,7 +1158,7 @@ static void __sk_free(struct sock *sk)
|
|||||||
atomic_read(&sk->sk_wmem_alloc) == 0);
|
atomic_read(&sk->sk_wmem_alloc) == 0);
|
||||||
if (filter) {
|
if (filter) {
|
||||||
sk_filter_uncharge(sk, filter);
|
sk_filter_uncharge(sk, filter);
|
||||||
rcu_assign_pointer(sk->sk_filter, NULL);
|
RCU_INIT_POINTER(sk->sk_filter, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
sock_disable_timestamp(sk, SOCK_TIMESTAMP);
|
sock_disable_timestamp(sk, SOCK_TIMESTAMP);
|
||||||
|
|||||||
+3
-3
@@ -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;
|
ifa->ifa_next = dn_db->ifa_list;
|
||||||
rcu_assign_pointer(dn_db->ifa_list, ifa);
|
RCU_INIT_POINTER(dn_db->ifa_list, ifa);
|
||||||
|
|
||||||
dn_ifaddr_notify(RTM_NEWADDR, ifa);
|
dn_ifaddr_notify(RTM_NEWADDR, ifa);
|
||||||
blocking_notifier_call_chain(&dnaddr_chain, NETDEV_UP, 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));
|
memcpy(&dn_db->parms, p, sizeof(struct dn_dev_parms));
|
||||||
|
|
||||||
rcu_assign_pointer(dev->dn_ptr, dn_db);
|
RCU_INIT_POINTER(dev->dn_ptr, dn_db);
|
||||||
dn_db->dev = dev;
|
dn_db->dev = dev;
|
||||||
init_timer(&dn_db->timer);
|
init_timer(&dn_db->timer);
|
||||||
|
|
||||||
@@ -1101,7 +1101,7 @@ static struct dn_dev *dn_dev_create(struct net_device *dev, int *err)
|
|||||||
|
|
||||||
dn_db->neigh_parms = neigh_parms_alloc(dev, &dn_neigh_table);
|
dn_db->neigh_parms = neigh_parms_alloc(dev, &dn_neigh_table);
|
||||||
if (!dn_db->neigh_parms) {
|
if (!dn_db->neigh_parms) {
|
||||||
rcu_assign_pointer(dev->dn_ptr, NULL);
|
RCU_INIT_POINTER(dev->dn_ptr, NULL);
|
||||||
kfree(dn_db);
|
kfree(dn_db);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -258,7 +258,7 @@ static struct in_device *inetdev_init(struct net_device *dev)
|
|||||||
ip_mc_up(in_dev);
|
ip_mc_up(in_dev);
|
||||||
|
|
||||||
/* we can receive as soon as ip_ptr is set -- do this last */
|
/* we can receive as soon as ip_ptr is set -- do this last */
|
||||||
rcu_assign_pointer(dev->ip_ptr, in_dev);
|
RCU_INIT_POINTER(dev->ip_ptr, in_dev);
|
||||||
out:
|
out:
|
||||||
return in_dev;
|
return in_dev;
|
||||||
out_kfree:
|
out_kfree:
|
||||||
@@ -291,7 +291,7 @@ static void inetdev_destroy(struct in_device *in_dev)
|
|||||||
inet_free_ifa(ifa);
|
inet_free_ifa(ifa);
|
||||||
}
|
}
|
||||||
|
|
||||||
rcu_assign_pointer(dev->ip_ptr, NULL);
|
RCU_INIT_POINTER(dev->ip_ptr, NULL);
|
||||||
|
|
||||||
devinet_sysctl_unregister(in_dev);
|
devinet_sysctl_unregister(in_dev);
|
||||||
neigh_parms_release(&arp_tbl, in_dev->arp_parms);
|
neigh_parms_release(&arp_tbl, in_dev->arp_parms);
|
||||||
@@ -1175,7 +1175,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
case NETDEV_REGISTER:
|
case NETDEV_REGISTER:
|
||||||
printk(KERN_DEBUG "inetdev_event: bug\n");
|
printk(KERN_DEBUG "inetdev_event: bug\n");
|
||||||
rcu_assign_pointer(dev->ip_ptr, NULL);
|
RCU_INIT_POINTER(dev->ip_ptr, NULL);
|
||||||
break;
|
break;
|
||||||
case NETDEV_UP:
|
case NETDEV_UP:
|
||||||
if (!inetdev_valid_mtu(dev->mtu))
|
if (!inetdev_valid_mtu(dev->mtu))
|
||||||
|
|||||||
+6
-6
@@ -204,7 +204,7 @@ static inline struct tnode *node_parent_rcu(const struct rt_trie_node *node)
|
|||||||
return (struct tnode *)(parent & ~NODE_TYPE_MASK);
|
return (struct tnode *)(parent & ~NODE_TYPE_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Same as rcu_assign_pointer
|
/* Same as RCU_INIT_POINTER
|
||||||
* but that macro() assumes that value is a pointer.
|
* but that macro() assumes that value is a pointer.
|
||||||
*/
|
*/
|
||||||
static inline void node_set_parent(struct rt_trie_node *node, struct tnode *ptr)
|
static inline void node_set_parent(struct rt_trie_node *node, struct tnode *ptr)
|
||||||
@@ -528,7 +528,7 @@ static void tnode_put_child_reorg(struct tnode *tn, int i, struct rt_trie_node *
|
|||||||
if (n)
|
if (n)
|
||||||
node_set_parent(n, tn);
|
node_set_parent(n, tn);
|
||||||
|
|
||||||
rcu_assign_pointer(tn->child[i], n);
|
RCU_INIT_POINTER(tn->child[i], n);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_WORK 10
|
#define MAX_WORK 10
|
||||||
@@ -1014,7 +1014,7 @@ static void trie_rebalance(struct trie *t, struct tnode *tn)
|
|||||||
|
|
||||||
tp = node_parent((struct rt_trie_node *) tn);
|
tp = node_parent((struct rt_trie_node *) tn);
|
||||||
if (!tp)
|
if (!tp)
|
||||||
rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
|
RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn);
|
||||||
|
|
||||||
tnode_free_flush();
|
tnode_free_flush();
|
||||||
if (!tp)
|
if (!tp)
|
||||||
@@ -1026,7 +1026,7 @@ static void trie_rebalance(struct trie *t, struct tnode *tn)
|
|||||||
if (IS_TNODE(tn))
|
if (IS_TNODE(tn))
|
||||||
tn = (struct tnode *)resize(t, (struct tnode *)tn);
|
tn = (struct tnode *)resize(t, (struct tnode *)tn);
|
||||||
|
|
||||||
rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
|
RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn);
|
||||||
tnode_free_flush();
|
tnode_free_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1163,7 +1163,7 @@ static struct list_head *fib_insert_node(struct trie *t, u32 key, int plen)
|
|||||||
put_child(t, (struct tnode *)tp, cindex,
|
put_child(t, (struct tnode *)tp, cindex,
|
||||||
(struct rt_trie_node *)tn);
|
(struct rt_trie_node *)tn);
|
||||||
} else {
|
} else {
|
||||||
rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
|
RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn);
|
||||||
tp = tn;
|
tp = tn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1621,7 +1621,7 @@ static void trie_leaf_remove(struct trie *t, struct leaf *l)
|
|||||||
put_child(t, (struct tnode *)tp, cindex, NULL);
|
put_child(t, (struct tnode *)tp, cindex, NULL);
|
||||||
trie_rebalance(t, tp);
|
trie_rebalance(t, tp);
|
||||||
} else
|
} else
|
||||||
rcu_assign_pointer(t->trie, NULL);
|
RCU_INIT_POINTER(t->trie, NULL);
|
||||||
|
|
||||||
free_leaf(l);
|
free_leaf(l);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -34,7 +34,7 @@ int gre_add_protocol(const struct gre_protocol *proto, u8 version)
|
|||||||
if (gre_proto[version])
|
if (gre_proto[version])
|
||||||
goto err_out_unlock;
|
goto err_out_unlock;
|
||||||
|
|
||||||
rcu_assign_pointer(gre_proto[version], proto);
|
RCU_INIT_POINTER(gre_proto[version], proto);
|
||||||
spin_unlock(&gre_proto_lock);
|
spin_unlock(&gre_proto_lock);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ int gre_del_protocol(const struct gre_protocol *proto, u8 version)
|
|||||||
if (rcu_dereference_protected(gre_proto[version],
|
if (rcu_dereference_protected(gre_proto[version],
|
||||||
lockdep_is_held(&gre_proto_lock)) != proto)
|
lockdep_is_held(&gre_proto_lock)) != proto)
|
||||||
goto err_out_unlock;
|
goto err_out_unlock;
|
||||||
rcu_assign_pointer(gre_proto[version], NULL);
|
RCU_INIT_POINTER(gre_proto[version], NULL);
|
||||||
spin_unlock(&gre_proto_lock);
|
spin_unlock(&gre_proto_lock);
|
||||||
synchronize_rcu();
|
synchronize_rcu();
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+5
-5
@@ -1242,7 +1242,7 @@ void ip_mc_inc_group(struct in_device *in_dev, __be32 addr)
|
|||||||
|
|
||||||
im->next_rcu = in_dev->mc_list;
|
im->next_rcu = in_dev->mc_list;
|
||||||
in_dev->mc_count++;
|
in_dev->mc_count++;
|
||||||
rcu_assign_pointer(in_dev->mc_list, im);
|
RCU_INIT_POINTER(in_dev->mc_list, im);
|
||||||
|
|
||||||
#ifdef CONFIG_IP_MULTICAST
|
#ifdef CONFIG_IP_MULTICAST
|
||||||
igmpv3_del_delrec(in_dev, im->multiaddr);
|
igmpv3_del_delrec(in_dev, im->multiaddr);
|
||||||
@@ -1813,7 +1813,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr)
|
|||||||
iml->next_rcu = inet->mc_list;
|
iml->next_rcu = inet->mc_list;
|
||||||
iml->sflist = NULL;
|
iml->sflist = NULL;
|
||||||
iml->sfmode = MCAST_EXCLUDE;
|
iml->sfmode = MCAST_EXCLUDE;
|
||||||
rcu_assign_pointer(inet->mc_list, iml);
|
RCU_INIT_POINTER(inet->mc_list, iml);
|
||||||
ip_mc_inc_group(in_dev, addr);
|
ip_mc_inc_group(in_dev, addr);
|
||||||
err = 0;
|
err = 0;
|
||||||
done:
|
done:
|
||||||
@@ -1835,7 +1835,7 @@ static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
|
|||||||
}
|
}
|
||||||
err = ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr,
|
err = ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr,
|
||||||
iml->sfmode, psf->sl_count, psf->sl_addr, 0);
|
iml->sfmode, psf->sl_count, psf->sl_addr, 0);
|
||||||
rcu_assign_pointer(iml->sflist, NULL);
|
RCU_INIT_POINTER(iml->sflist, NULL);
|
||||||
/* decrease mem now to avoid the memleak warning */
|
/* decrease mem now to avoid the memleak warning */
|
||||||
atomic_sub(IP_SFLSIZE(psf->sl_max), &sk->sk_omem_alloc);
|
atomic_sub(IP_SFLSIZE(psf->sl_max), &sk->sk_omem_alloc);
|
||||||
kfree_rcu(psf, rcu);
|
kfree_rcu(psf, rcu);
|
||||||
@@ -2000,7 +2000,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
|
|||||||
atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc);
|
atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc);
|
||||||
kfree_rcu(psl, rcu);
|
kfree_rcu(psl, rcu);
|
||||||
}
|
}
|
||||||
rcu_assign_pointer(pmc->sflist, newpsl);
|
RCU_INIT_POINTER(pmc->sflist, newpsl);
|
||||||
psl = newpsl;
|
psl = newpsl;
|
||||||
}
|
}
|
||||||
rv = 1; /* > 0 for insert logic below if sl_count is 0 */
|
rv = 1; /* > 0 for insert logic below if sl_count is 0 */
|
||||||
@@ -2103,7 +2103,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
|
|||||||
} else
|
} else
|
||||||
(void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,
|
(void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,
|
||||||
0, NULL, 0);
|
0, NULL, 0);
|
||||||
rcu_assign_pointer(pmc->sflist, newpsl);
|
RCU_INIT_POINTER(pmc->sflist, newpsl);
|
||||||
pmc->sfmode = msf->imsf_fmode;
|
pmc->sfmode = msf->imsf_fmode;
|
||||||
err = 0;
|
err = 0;
|
||||||
done:
|
done:
|
||||||
|
|||||||
+5
-5
@@ -231,7 +231,7 @@ static void ipip_tunnel_unlink(struct ipip_net *ipn, struct ip_tunnel *t)
|
|||||||
(iter = rtnl_dereference(*tp)) != NULL;
|
(iter = rtnl_dereference(*tp)) != NULL;
|
||||||
tp = &iter->next) {
|
tp = &iter->next) {
|
||||||
if (t == iter) {
|
if (t == iter) {
|
||||||
rcu_assign_pointer(*tp, t->next);
|
RCU_INIT_POINTER(*tp, t->next);
|
||||||
break;
|
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);
|
struct ip_tunnel __rcu **tp = ipip_bucket(ipn, t);
|
||||||
|
|
||||||
rcu_assign_pointer(t->next, rtnl_dereference(*tp));
|
RCU_INIT_POINTER(t->next, rtnl_dereference(*tp));
|
||||||
rcu_assign_pointer(*tp, t);
|
RCU_INIT_POINTER(*tp, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ip_tunnel * ipip_tunnel_locate(struct net *net,
|
static struct ip_tunnel * ipip_tunnel_locate(struct net *net,
|
||||||
@@ -301,7 +301,7 @@ static void ipip_tunnel_uninit(struct net_device *dev)
|
|||||||
struct ipip_net *ipn = net_generic(net, ipip_net_id);
|
struct ipip_net *ipn = net_generic(net, ipip_net_id);
|
||||||
|
|
||||||
if (dev == ipn->fb_tunnel_dev)
|
if (dev == ipn->fb_tunnel_dev)
|
||||||
rcu_assign_pointer(ipn->tunnels_wc[0], NULL);
|
RCU_INIT_POINTER(ipn->tunnels_wc[0], NULL);
|
||||||
else
|
else
|
||||||
ipip_tunnel_unlink(ipn, netdev_priv(dev));
|
ipip_tunnel_unlink(ipn, netdev_priv(dev));
|
||||||
dev_put(dev);
|
dev_put(dev);
|
||||||
@@ -791,7 +791,7 @@ static int __net_init ipip_fb_tunnel_init(struct net_device *dev)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
dev_hold(dev);
|
dev_hold(dev);
|
||||||
rcu_assign_pointer(ipn->tunnels_wc[0], tunnel);
|
RCU_INIT_POINTER(ipn->tunnels_wc[0], tunnel);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1176,7 +1176,7 @@ static void mrtsock_destruct(struct sock *sk)
|
|||||||
ipmr_for_each_table(mrt, net) {
|
ipmr_for_each_table(mrt, net) {
|
||||||
if (sk == rtnl_dereference(mrt->mroute_sk)) {
|
if (sk == rtnl_dereference(mrt->mroute_sk)) {
|
||||||
IPV4_DEVCONF_ALL(net, MC_FORWARDING)--;
|
IPV4_DEVCONF_ALL(net, MC_FORWARDING)--;
|
||||||
rcu_assign_pointer(mrt->mroute_sk, NULL);
|
RCU_INIT_POINTER(mrt->mroute_sk, NULL);
|
||||||
mroute_clean_tables(mrt);
|
mroute_clean_tables(mrt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1224,7 +1224,7 @@ int ip_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, unsi
|
|||||||
|
|
||||||
ret = ip_ra_control(sk, 1, mrtsock_destruct);
|
ret = ip_ra_control(sk, 1, mrtsock_destruct);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
rcu_assign_pointer(mrt->mroute_sk, sk);
|
RCU_INIT_POINTER(mrt->mroute_sk, sk);
|
||||||
IPV4_DEVCONF_ALL(net, MC_FORWARDING)++;
|
IPV4_DEVCONF_ALL(net, MC_FORWARDING)++;
|
||||||
}
|
}
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
|
|||||||
@@ -70,14 +70,14 @@ static unsigned int help(struct sk_buff *skb,
|
|||||||
|
|
||||||
static void __exit nf_nat_amanda_fini(void)
|
static void __exit nf_nat_amanda_fini(void)
|
||||||
{
|
{
|
||||||
rcu_assign_pointer(nf_nat_amanda_hook, NULL);
|
RCU_INIT_POINTER(nf_nat_amanda_hook, NULL);
|
||||||
synchronize_rcu();
|
synchronize_rcu();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init nf_nat_amanda_init(void)
|
static int __init nf_nat_amanda_init(void)
|
||||||
{
|
{
|
||||||
BUG_ON(nf_nat_amanda_hook != NULL);
|
BUG_ON(nf_nat_amanda_hook != NULL);
|
||||||
rcu_assign_pointer(nf_nat_amanda_hook, help);
|
RCU_INIT_POINTER(nf_nat_amanda_hook, help);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user