netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amos Jeffries <squid3@treenet.co.nz>
To: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 1/6] netfilter: xtables: replace XT_ENTRY_ITERATE macro
Date: Sat, 13 Feb 2010 23:29:15 +1300	[thread overview]
Message-ID: <4B767EFB.7030600@treenet.co.nz> (raw)
In-Reply-To: <1265970044-19518-2-git-send-email-jengelh@medozas.de>

Jan Engelhardt wrote:
> The macro is replaced by a list.h-like foreach loop. This makes
> the code much more inspectable.
> 
<snip>
>  	if (IS_ERR(counters))
> @@ -1967,9 +2009,12 @@ compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table,
>  	loc_cpu_entry = private->entries[raw_smp_processor_id()];
>  	pos = userptr;
>  	size = total_size;
> -	ret = IP6T_ENTRY_ITERATE(loc_cpu_entry, total_size,
> -				 compat_copy_entry_to_user,
> -				 &pos, &size, counters, &i);
> +	xt_entry_foreach(iter, loc_cpu_entry, total_size) {
> +		ret = compat_copy_entry_to_user(iter, &pos,
> +		      &size, counters, &i);
> +		if (ret != 0)
> +			break;
> +	}
>  

<snip>

>  	loc_cpu_entry = private->entries[raw_smp_processor_id()];
> -	IP6T_ENTRY_ITERATE(loc_cpu_entry, private->size, cleanup_entry, net, NULL);
> +	xt_entry_foreach(iter, loc_cpu_entry, private->size)
> +		if (cleanup_entry(iter, net, NULL) != 0)
> +			break;
>  	if (private->number > private->initial_entries)
>  		module_put(table_owner);
>  	xt_free_table_info(private);

Just my 2c, but you seem to be floating between several coding styles on 
this one.

AYJ

  reply	other threads:[~2010-02-13 10:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12 10:20 ip_tables: foreachs and reentrancy Jan Engelhardt
2010-02-12 10:20 ` [PATCH 1/6] netfilter: xtables: replace XT_ENTRY_ITERATE macro Jan Engelhardt
2010-02-13 10:29   ` Amos Jeffries [this message]
2010-02-13 10:39     ` Jan Engelhardt
2010-02-13 10:42       ` Amos Jeffries
2010-02-12 10:20 ` [PATCH 2/6] netfilter: xtables: optimize call flow around xt_entry_foreach Jan Engelhardt
2010-02-12 10:20 ` [PATCH 3/6] netfilter: xtables: replace XT_MATCH_ITERATE macro Jan Engelhardt
2010-02-12 10:20 ` [PATCH 4/6] netfilter: xtables: optimize call flow around xt_ematch_foreach Jan Engelhardt
2010-02-12 10:20 ` [PATCH 5/6] netfilter: xtables: reduce arguments to translate_table Jan Engelhardt
2010-02-12 10:20 ` [PATCH 6/6] netfilter: xtables2: make ip_tables reentrant Jan Engelhardt
2010-02-24 17:40 ` ip_tables: foreachs and reentrancy Patrick McHardy
2010-02-24 19:33   ` Jan Engelhardt
2010-02-25 10:24     ` Patrick McHardy
2010-02-25 11:07       ` Jan Engelhardt
2010-02-25 11:09         ` Patrick McHardy
2010-02-26 16:54     ` Patrick McHardy

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=4B767EFB.7030600@treenet.co.nz \
    --to=squid3@treenet.co.nz \
    --cc=netfilter-devel@vger.kernel.org \
    /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).