netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 20/36] net,rcu: convert call_rcu(netlbl_unlhsh_free_addr4) to kfree_rcu()
@ 2011-03-18  4:03 Lai Jiangshan
  2011-03-18 19:36 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Lai Jiangshan @ 2011-03-18  4:03 UTC (permalink / raw)
  To: Paul E. McKenney, Ingo Molnar, Paul Moore, David S. Miller,
	netdev, linux-ke



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>
---
 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 e2b0a68..4e5ad90 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
  * 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)
 /**
  * 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,
 	if (entry == NULL)
 		return -ENOENT;
 
-	call_rcu(&entry->rcu, netlbl_unlhsh_free_addr4);
+	kfree_rcu(entry, rcu);
 	return 0;
 }
 
-- 
1.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 20/36] net,rcu: convert call_rcu(netlbl_unlhsh_free_addr4) to kfree_rcu()
  2011-03-18  4:03 [PATCH 20/36] net,rcu: convert call_rcu(netlbl_unlhsh_free_addr4) to kfree_rcu() Lai Jiangshan
@ 2011-03-18 19:36 ` David Miller
  2011-03-18 20:05   ` Paul Moore
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2011-03-18 19:36 UTC (permalink / raw)
  To: laijs; +Cc: paulmck, mingo, paul.moore, netdev, linux-kernel

From: Lai Jiangshan <laijs@cn.fujitsu.com>
Date: Fri, 18 Mar 2011 12:03:56 +0800

> 
> 
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 20/36] net,rcu: convert call_rcu(netlbl_unlhsh_free_addr4) to kfree_rcu()
  2011-03-18 19:36 ` David Miller
@ 2011-03-18 20:05   ` Paul Moore
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Moore @ 2011-03-18 20:05 UTC (permalink / raw)
  To: David Miller; +Cc: laijs, paulmck, mingo, netdev, linux-kernel

On Friday, March 18, 2011 3:36:51 PM David Miller wrote:
> From: Lai Jiangshan <laijs@cn.fujitsu.com>
> Date: Fri, 18 Mar 2011 12:03:56 +0800
> 
> > 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>

Me too ...

Acked-by: Paul Moore <paul.moore@hp.com>

--
paul moore
linux @ hp

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-18 20:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-18  4:03 [PATCH 20/36] net,rcu: convert call_rcu(netlbl_unlhsh_free_addr4) to kfree_rcu() Lai Jiangshan
2011-03-18 19:36 ` David Miller
2011-03-18 20:05   ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).