netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul.moore@hp.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@elte.hu>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 21/36] net,rcu: convert call_rcu(netlbl_unlhsh_free_addr6) to kfree_rcu()
Date: Fri, 18 Mar 2011 16:06:11 -0400	[thread overview]
Message-ID: <201103181606.12058.paul.moore@hp.com> (raw)
In-Reply-To: <4D82D9E2.4000408@cn.fujitsu.com>

On Friday, March 18, 2011 12:04:50 AM Lai Jiangshan wrote:
> 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>

> ---
>  net/netlabel/netlabel_unlabeled.c |   22 +---------------------
>  1 files changed, 1 insertions(+), 21 deletions(-)
> 
> diff --git a/net/netlabel/netlabel_unlabeled.c
> b/net/netlabel/netlabel_unlabeled.c index 4e5ad90..9c38658 100644
> --- a/net/netlabel/netlabel_unlabeled.c
> +++ b/net/netlabel/netlabel_unlabeled.c
> @@ -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 */


--
paul moore
linux @ hp

      reply	other threads:[~2011-03-18 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18  4:04 [PATCH 21/36] net,rcu: convert call_rcu(netlbl_unlhsh_free_addr6) to kfree_rcu() Lai Jiangshan
2011-03-18 20:06 ` Paul Moore [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201103181606.12058.paul.moore@hp.com \
    --to=paul.moore@hp.com \
    --cc=davem@davemloft.net \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).