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 |
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>
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 --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 = {
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(-)