diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2011-03-18 00:03:56 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-05-08 01:51:05 -0400 |
commit | c3b494209cc6084bd76d823d185a60ee5bd40b0d (patch) | |
tree | ed08df0a6c1af516c9cf9d60dd0b457d2f738f66 /net/netlabel/netlabel_unlabeled.c | |
parent | 690273fc70e94a07d70044881e5e52926301bcd3 (diff) |
net,rcu: convert call_rcu(netlbl_unlhsh_free_addr4) to kfree_rcu()
The rcu callback netlbl_unlhsh_free_addr4() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(netlbl_unlhsh_free_addr4).
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: David S. Miller <davem@davemloft.net>
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/netlabel_unlabeled.c')
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index e2b0a680dd56..4e5ad90cc21c 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -153,24 +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 | /** | ||
157 | * netlbl_unlhsh_free_addr4 - Frees an IPv4 address entry from the hash table | ||
158 | * @entry: the entry's RCU field | ||
159 | * | ||
160 | * Description: | ||
161 | * This function is designed to be used as a callback to the call_rcu() | ||
162 | * function so that memory allocated to a hash table address entry can be | ||
163 | * released safely. | ||
164 | * | ||
165 | */ | ||
166 | static void netlbl_unlhsh_free_addr4(struct rcu_head *entry) | ||
167 | { | ||
168 | struct netlbl_unlhsh_addr4 *ptr; | ||
169 | |||
170 | ptr = container_of(entry, struct netlbl_unlhsh_addr4, rcu); | ||
171 | kfree(ptr); | ||
172 | } | ||
173 | |||
174 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 156 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
175 | /** | 157 | /** |
176 | * netlbl_unlhsh_free_addr6 - Frees an IPv6 address entry from the hash table | 158 | * netlbl_unlhsh_free_addr6 - Frees an IPv6 address entry from the hash table |
@@ -568,7 +550,7 @@ static int netlbl_unlhsh_remove_addr4(struct net *net, | |||
568 | if (entry == NULL) | 550 | if (entry == NULL) |
569 | return -ENOENT; | 551 | return -ENOENT; |
570 | 552 | ||
571 | call_rcu(&entry->rcu, netlbl_unlhsh_free_addr4); | 553 | kfree_rcu(entry, rcu); |
572 | return 0; | 554 | return 0; |
573 | } | 555 | } |
574 | 556 | ||