net,rcu: convert call_rcu(netlbl_unlhsh_free_addr6) to kfree_rcu()
authorLai Jiangshan <laijs@cn.fujitsu.com>
Fri, 18 Mar 2011 04:04:50 +0000 (12:04 +0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 8 May 2011 05:51:06 +0000 (22:51 -0700)
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>
net/netlabel/netlabel_unlabeled.c

index 4e5ad90cc21cb3bcb06bf1df2253ae0d13fa0129..9c38658fba8b9afc61fdf5a158331a8f8a69c167 100644 (file)
@@ -153,26 +153,6 @@ static const struct nla_policy netlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1
  * Unlabeled Connection Hash Table Functions
  */
 
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-/**
- * netlbl_unlhsh_free_addr6 - Frees an IPv6 address entry from the hash table
- * @entry: the entry's RCU field
- *
- * Description:
- * This function is designed to be used as a callback to the call_rcu()
- * function so that memory allocated to a hash table address entry can be
- * released safely.
- *
- */
-static void netlbl_unlhsh_free_addr6(struct rcu_head *entry)
-{
-       struct netlbl_unlhsh_addr6 *ptr;
-
-       ptr = container_of(entry, struct netlbl_unlhsh_addr6, rcu);
-       kfree(ptr);
-}
-#endif /* IPv6 */
-
 /**
  * netlbl_unlhsh_free_iface - Frees an interface entry from the hash table
  * @entry: the entry's RCU field
@@ -611,7 +591,7 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
        if (entry == NULL)
                return -ENOENT;
 
-       call_rcu(&entry->rcu, netlbl_unlhsh_free_addr6);
+       kfree_rcu(entry, rcu);
        return 0;
 }
 #endif /* IPv6 */