diff mbox series

[v1,net-next,09/14] bridge: Convert br_net_exit_batch_rtnl() to ->exit_rtnl().

Message ID 20250410022004.8668-10-kuniyu@amazon.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: Convert ->exit_batch_rtnl() to ->exit_rtnl(). | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: bridge@lists.linux.dev
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 29 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-04-11--03-00 (tests: 900)

Commit Message

Kuniyuki Iwashima April 10, 2025, 2:19 a.m. UTC
br_net_exit_batch_rtnl() iterates the dying netns list and
performs the same operation for each.

Let's use ->exit_rtnl().

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
---
Cc: Nikolay Aleksandrov <razor@blackwall.org>
Cc: Ido Schimmel <idosch@nvidia.com>
---
 net/bridge/br.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

Comments

Ido Schimmel April 10, 2025, 7:05 a.m. UTC | #1
On Wed, Apr 09, 2025 at 07:19:30PM -0700, Kuniyuki Iwashima wrote:
> br_net_exit_batch_rtnl() iterates the dying netns list and
> performs the same operation for each.
> 
> Let's use ->exit_rtnl().
> 
> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Nikolay Aleksandrov April 10, 2025, 9:04 a.m. UTC | #2
On 4/10/25 05:19, Kuniyuki Iwashima wrote:
> br_net_exit_batch_rtnl() iterates the dying netns list and
> performs the same operation for each.
> 
> Let's use ->exit_rtnl().
> 
> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> ---
> Cc: Nikolay Aleksandrov <razor@blackwall.org>
> Cc: Ido Schimmel <idosch@nvidia.com>
> ---
>  net/bridge/br.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/net/bridge/br.c b/net/bridge/br.c
> index 183fcb362f9e..c16913aac84c 100644
> --- a/net/bridge/br.c
> +++ b/net/bridge/br.c
> @@ -363,21 +363,20 @@ void br_opt_toggle(struct net_bridge *br, enum net_bridge_opts opt, bool on)
>  		clear_bit(opt, &br->options);
>  }
>  
> -static void __net_exit br_net_exit_batch_rtnl(struct list_head *net_list,
> -					      struct list_head *dev_to_kill)
> +static void __net_exit br_net_exit_rtnl(struct net *net,
> +					struct list_head *dev_to_kill)
>  {
>  	struct net_device *dev;
> -	struct net *net;
>  
> -	ASSERT_RTNL();
> -	list_for_each_entry(net, net_list, exit_list)
> -		for_each_netdev(net, dev)
> -			if (netif_is_bridge_master(dev))
> -				br_dev_delete(dev, dev_to_kill);
> +	ASSERT_RTNL_NET(net);
> +
> +	for_each_netdev(net, dev)
> +		if (netif_is_bridge_master(dev))
> +			br_dev_delete(dev, dev_to_kill);
>  }
>  
>  static struct pernet_operations br_net_ops = {
> -	.exit_batch_rtnl = br_net_exit_batch_rtnl,
> +	.exit_rtnl = br_net_exit_rtnl,
>  };
>  
>  static const struct stp_proto br_stp_proto = {

Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
diff mbox series

Patch

diff --git a/net/bridge/br.c b/net/bridge/br.c
index 183fcb362f9e..c16913aac84c 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -363,21 +363,20 @@  void br_opt_toggle(struct net_bridge *br, enum net_bridge_opts opt, bool on)
 		clear_bit(opt, &br->options);
 }
 
-static void __net_exit br_net_exit_batch_rtnl(struct list_head *net_list,
-					      struct list_head *dev_to_kill)
+static void __net_exit br_net_exit_rtnl(struct net *net,
+					struct list_head *dev_to_kill)
 {
 	struct net_device *dev;
-	struct net *net;
 
-	ASSERT_RTNL();
-	list_for_each_entry(net, net_list, exit_list)
-		for_each_netdev(net, dev)
-			if (netif_is_bridge_master(dev))
-				br_dev_delete(dev, dev_to_kill);
+	ASSERT_RTNL_NET(net);
+
+	for_each_netdev(net, dev)
+		if (netif_is_bridge_master(dev))
+			br_dev_delete(dev, dev_to_kill);
 }
 
 static struct pernet_operations br_net_ops = {
-	.exit_batch_rtnl = br_net_exit_batch_rtnl,
+	.exit_rtnl = br_net_exit_rtnl,
 };
 
 static const struct stp_proto br_stp_proto = {