aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlabel
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2011-03-18 00:04:50 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-05-08 01:51:06 -0400
commit6b2622328110b9c1094a4f644a6cdc9b6d5450ac (patch)
treea3914fa82cea51365e2a626f50cdddb55bf5dbec /net/netlabel
parentc3b494209cc6084bd76d823d185a60ee5bd40b0d (diff)
net,rcu: convert call_rcu(netlbl_unlhsh_free_addr6) to kfree_rcu()
The rcu callback netlbl_unlhsh_free_addr6() just calls a kfree(), so we use kfree_rcu() instead of the call_rcu(netlbl_unlhsh_free_addr6). Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Acked-by: Paul Moore <paul.moore@hp.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'net/netlabel')
-rw-r--r--net/netlabel/netlabel_unlabeled.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 4e5ad90cc21..9c38658fba8 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -153,26 +153,6 @@ static const struct nla_policy netlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1
153 * Unlabeled Connection Hash Table Functions 153 * Unlabeled Connection Hash Table Functions
154 */ 154 */
155 155
156#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
157/**
158 * netlbl_unlhsh_free_addr6 - Frees an IPv6 address entry from the hash table
159 * @entry: the entry's RCU field
160 *
161 * Description:
162 * This function is designed to be used as a callback to the call_rcu()
163 * function so that memory allocated to a hash table address entry can be
164 * released safely.
165 *
166 */
167static void netlbl_unlhsh_free_addr6(struct rcu_head *entry)
168{
169 struct netlbl_unlhsh_addr6 *ptr;
170
171 ptr = container_of(entry, struct netlbl_unlhsh_addr6, rcu);
172 kfree(ptr);
173}
174#endif /* IPv6 */
175
176/** 156/**
177 * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table 157 * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table
178 * @entry: the entry's RCU field 158 * @entry: the entry's RCU field
@@ -611,7 +591,7 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
611 if (entry == NULL) 591 if (entry == NULL)
612 return -ENOENT; 592 return -ENOENT;
613 593
614 call_rcu(&entry->rcu, netlbl_unlhsh_free_addr6); 594 kfree_rcu(entry, rcu);
615 return 0; 595 return 0;
616} 596}
617#endif /* IPv6 */ 597#endif /* IPv6 */