Commit c3b49420 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Paul E. McKenney

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: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Acked-by: default avatarPaul Moore <paul.moore@hp.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent 690273fc
...@@ -153,24 +153,6 @@ static const struct nla_policy netlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1 ...@@ -153,24 +153,6 @@ static const struct nla_policy netlbl_unlabel_genl_policy[NLBL_UNLABEL_A_MAX + 1
* Unlabeled Connection Hash Table Functions * Unlabeled Connection Hash Table Functions
*/ */
/**
* netlbl_unlhsh_free_addr4 - Frees an IPv4 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_addr4(struct rcu_head *entry)
{
struct netlbl_unlhsh_addr4 *ptr;
ptr = container_of(entry, struct netlbl_unlhsh_addr4, rcu);
kfree(ptr);
}
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
/** /**
* netlbl_unlhsh_free_addr6 - Frees an IPv6 address entry from the hash table * 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,7 +550,7 @@ static int netlbl_unlhsh_remove_addr4(struct net *net,
if (entry == NULL) if (entry == NULL)
return -ENOENT; return -ENOENT;
call_rcu(&entry->rcu, netlbl_unlhsh_free_addr4); kfree_rcu(entry, rcu);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment