[PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-17 Thread Pavel Emelyanov
I proposed introducing a list_for_each_entry_continue_reverse macro to be used in setup_net() when unrolling the failed -init callback. Here is the macro and some more cleanup in the setup_net() itself to remove one variable from the stack :) Minor, but the code looks nicer. Signed-off-by: Pavel

Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-17 Thread Eric W. Biederman
Pavel Emelyanov [EMAIL PROTECTED] writes: I proposed introducing a list_for_each_entry_continue_reverse macro to be used in setup_net() when unrolling the failed -init callback. Here is the macro and some more cleanup in the setup_net() itself to remove one variable from the stack :) Minor,

[PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-17 Thread Pavel Emelyanov
[snip] Pavel if you are going down this route. Could you look at cleanup_net as well. The reverse walk there could probably benefit from being list_for_each_entry_reverse. Oh! Thanks a lot ;) Here's the new patch. Log: I proposed introducing a list_for_each_entry_continue_reverse macro to

Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-17 Thread David Miller
From: [EMAIL PROTECTED] (Eric W. Biederman) Date: Mon, 17 Sep 2007 07:07:42 -0600 Pavel if you are going down this route. Could you look at cleanup_net as well. The reverse walk there could probably benefit from being list_for_each_entry_reverse. Pavel please resubmit this work after

Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-16 Thread David Miller
From: Stephen Hemminger [EMAIL PROTECTED] Date: Fri, 14 Sep 2007 22:07:14 +0200 Could we just make it so dev-init is not allowed to fail? Then it can be a void function and the nasty unwind code can go? Someone (not me :-) need to do an audit to find all current users of this function and

Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-16 Thread Eric W. Biederman
David Miller [EMAIL PROTECTED] writes: From: Stephen Hemminger [EMAIL PROTECTED] Date: Fri, 14 Sep 2007 22:07:14 +0200 Could we just make it so dev-init is not allowed to fail? Then it can be a void function and the nasty unwind code can go? Someone (not me :-) need to do an audit to find

Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-16 Thread David Miller
From: [EMAIL PROTECTED] (Eric W. Biederman) Date: Sun, 16 Sep 2007 18:06:00 -0600 I did that audit when I replied to Stephen the first time and I just redid it to verify myself. We are calling functions that can fail from the init function (kmalloc in the most common). So the init function

[PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-14 Thread Pavel Emelyanov
I proposed introducing a list_for_each_entry_continue_reverse macro to be used in setup_net() when unrolling the failed -init callback. Here is the macro and some more cleanup in the setup_net() itself to remove one variable from the stack :) Minor, but the code looks nicer. Signed-off-by: Pavel

Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-14 Thread Stephen Hemminger
On Fri, 14 Sep 2007 11:39:32 +0400 Pavel Emelyanov [EMAIL PROTECTED] wrote: I proposed introducing a list_for_each_entry_continue_reverse macro to be used in setup_net() when unrolling the failed -init callback. Here is the macro and some more cleanup in the setup_net() itself to remove

Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-14 Thread Eric W. Biederman
Stephen Hemminger [EMAIL PROTECTED] writes: On Fri, 14 Sep 2007 11:39:32 +0400 Pavel Emelyanov [EMAIL PROTECTED] wrote: I proposed introducing a list_for_each_entry_continue_reverse macro to be used in setup_net() when unrolling the failed -init callback. Here is the macro and some more

Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-14 Thread Eric W. Biederman
Pavel Emelyanov [EMAIL PROTECTED] writes: I proposed introducing a list_for_each_entry_continue_reverse macro to be used in setup_net() when unrolling the failed -init callback. Here is the macro and some more cleanup in the setup_net() itself to remove one variable from the stack :) Minor,

Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-14 Thread Stephen Hemminger
On Fri, 14 Sep 2007 08:41:07 -0600 [EMAIL PROTECTED] (Eric W. Biederman) wrote: Stephen Hemminger [EMAIL PROTECTED] writes: On Fri, 14 Sep 2007 11:39:32 +0400 Pavel Emelyanov [EMAIL PROTECTED] wrote: I proposed introducing a list_for_each_entry_continue_reverse macro to be used in

Re: [PATCH][NETNS] Use list_for_each_entry_continue_reverse in setup_net

2007-09-14 Thread Eric W. Biederman
Stephen Hemminger [EMAIL PROTECTED] writes: Could we just make it so dev-init is not allowed to fail? Then it can be a void function and the nasty unwind code can go? Unfortunately we need to allocate memory, and perform other operations that can fail. That's the nature of the problem. So I