public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 19/36] security,rcu: convert call_rcu(sel_netif_free) to kfree_rcu()
@ 2011-03-18  4:03 Lai Jiangshan
  2011-03-18 19:36 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2011-03-18  4:03 UTC (permalink / raw)
  To: Paul E. McKenney, Ingo Molnar, Stephen Smalley, James Morris,
	Eric Paris, linux-security-module, linux-kernel



The rcu callback sel_netif_free() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(sel_netif_free).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
 security/selinux/netif.c |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/security/selinux/netif.c b/security/selinux/netif.c
index d6095d6..58cc481 100644
--- a/security/selinux/netif.c
+++ b/security/selinux/netif.c
@@ -104,22 +104,6 @@ static int sel_netif_insert(struct sel_netif *netif)
 }
 
 /**
- * sel_netif_free - Frees an interface entry
- * @p: 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 interface entry can be
- * released safely.
- *
- */
-static void sel_netif_free(struct rcu_head *p)
-{
-	struct sel_netif *netif = container_of(p, struct sel_netif, rcu_head);
-	kfree(netif);
-}
-
-/**
  * sel_netif_destroy - Remove an interface record from the table
  * @netif: the existing interface record
  *
@@ -131,7 +115,7 @@ static void sel_netif_destroy(struct sel_netif *netif)
 {
 	list_del_rcu(&netif->list);
 	sel_netif_total--;
-	call_rcu(&netif->rcu_head, sel_netif_free);
+	kfree_rcu(netif, rcu_head);
 }
 
 /**
-- 
1.7.4

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

* Re: [PATCH 19/36] security,rcu: convert call_rcu(sel_netif_free) to kfree_rcu()
  2011-03-18  4:03 [PATCH 19/36] security,rcu: convert call_rcu(sel_netif_free) to kfree_rcu() Lai Jiangshan
@ 2011-03-18 19:36 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-03-18 19:36 UTC (permalink / raw)
  To: laijs
  Cc: paulmck, mingo, sds, jmorris, eparis, linux-security-module,
	linux-kernel

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

> 
> 
> The rcu callback sel_netif_free() just calls a kfree(),
> so we use kfree_rcu() instead of the call_rcu(sel_netif_free).
> 
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>

Acked-by: David S. Miller <davem@davemloft.net>

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

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

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox