From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul E. McKenney" Subject: Re: [PATCH 3/3] netfilter: replace list_for_each_continue_rcu with new interface Date: Mon, 20 Aug 2012 17:02:55 -0700 Message-ID: <20120821000254.GP2435@linux.vnet.ibm.com> References: <502CB939.3050008@linux.vnet.ibm.com> <502DC9A3.2070703@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: LKML , "netdev@vger.kernel.org" , netfilter@vger.kernel.org, coreteam@netfilter.org, netfilter-devel@vger.kernel.org, David Miller , kaber@trash.net, pablo@netfilter.org To: Michael Wang Return-path: Received: from e32.co.us.ibm.com ([32.97.110.150]:51791 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751702Ab2HUAEZ (ORCPT ); Mon, 20 Aug 2012 20:04:25 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Aug 2012 18:04:22 -0600 Content-Disposition: inline In-Reply-To: <502DC9A3.2070703@linux.vnet.ibm.com> Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Fri, Aug 17, 2012 at 12:33:39PM +0800, Michael Wang wrote: > From: Michael Wang > > This patch replaces list_for_each_continue_rcu() with > list_for_each_entry_continue_rcu() to allow removing > list_for_each_continue_rcu(). > > Signed-off-by: Michael Wang Reviewed-by: Paul E. McKenney > --- > net/netfilter/core.c | 11 +++++++---- > 1 files changed, 7 insertions(+), 4 deletions(-) > > diff --git a/net/netfilter/core.c b/net/netfilter/core.c > index e19f365..50225bd 100644 > --- a/net/netfilter/core.c > +++ b/net/netfilter/core.c > @@ -131,14 +131,14 @@ unsigned int nf_iterate(struct list_head *head, > int hook_thresh) > { > unsigned int verdict; > + struct nf_hook_ops *elem = list_entry_rcu(*i, > + struct nf_hook_ops, list); > > /* > * The caller must not block between calls to this > * function because of risk of continuing from deleted element. > */ > - list_for_each_continue_rcu(*i, head) { > - struct nf_hook_ops *elem = (struct nf_hook_ops *)*i; > - > + list_for_each_entry_continue_rcu(elem, head, list) { > if (hook_thresh > elem->priority) > continue; > > @@ -155,11 +155,14 @@ repeat: > continue; > } > #endif > - if (verdict != NF_REPEAT) > + if (verdict != NF_REPEAT) { > + *i = &elem->list; > return verdict; > + } > goto repeat; > } > } > + *i = &elem->list; > return NF_ACCEPT; > } > > -- > 1.7.4.1 > >