]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gtp: Convert gtp_net_exit_batch_rtnl() to ->exit_rtnl().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 11 Apr 2025 20:52:40 +0000 (13:52 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Apr 2025 00:08:44 +0000 (17:08 -0700)
gtp_net_exit_batch_rtnl() iterates the dying netns list
and performs the same operations for each.

Let's use ->exit_rtnl().

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/20250411205258.63164-12-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/gtp.c

index ef793607890d94c99f1b6df02f942ea6e5a73878..d4dec741c7f443175bbe31b3d6b3b07c9603e754 100644 (file)
@@ -2475,23 +2475,19 @@ static int __net_init gtp_net_init(struct net *net)
        return 0;
 }
 
-static void __net_exit gtp_net_exit_batch_rtnl(struct list_head *net_list,
-                                              struct list_head *dev_to_kill)
+static void __net_exit gtp_net_exit_rtnl(struct net *net,
+                                        struct list_head *dev_to_kill)
 {
-       struct net *net;
-
-       list_for_each_entry(net, net_list, exit_list) {
-               struct gtp_net *gn = net_generic(net, gtp_net_id);
-               struct gtp_dev *gtp, *gtp_next;
+       struct gtp_net *gn = net_generic(net, gtp_net_id);
+       struct gtp_dev *gtp, *gtp_next;
 
-               list_for_each_entry_safe(gtp, gtp_next, &gn->gtp_dev_list, list)
-                       gtp_dellink(gtp->dev, dev_to_kill);
-       }
+       list_for_each_entry_safe(gtp, gtp_next, &gn->gtp_dev_list, list)
+               gtp_dellink(gtp->dev, dev_to_kill);
 }
 
 static struct pernet_operations gtp_net_ops = {
        .init   = gtp_net_init,
-       .exit_batch_rtnl = gtp_net_exit_batch_rtnl,
+       .exit_rtnl = gtp_net_exit_rtnl,
        .id     = &gtp_net_id,
        .size   = sizeof(struct gtp_net),
 };