diff mbox series

[RFC,10/25] net: Move sysctl_pernet_ops to pernet_sys list

Message ID 151094333307.20009.13442157680174781843.stgit@localhost.localdomain
State RFC, archived
Delegated to: David Miller
Headers show
Series [RFC,01/25] net: Assign net to net_namespace_list in setup_net() | expand

Commit Message

Kirill Tkhai Nov. 17, 2017, 6:28 p.m. UTC
This patch starts to convert pernet_subsys, registered
from core initcalls.

Since net/socket.o is the first linked file in net/Makefile,
its core initcalls execute the first. sysctl_pernet_ops is
the first pernet_subsys, registered from sock_init(), so
it goes ahead of others, registered via core_initcall().

Methods sysctl_net_init() and sysctl_net_exit() initialize
net::sysctls of a namespace.

pernet_operations::init()/exit() methods from the rest
of the list do not touch net::sysctls of strangers,
so it's safe to execute sysctl_pernet_ops's methods
in parallel with any other pernet_operations.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/sysctl_net.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 9aed6fe1bf1a..1b91db88e54a 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -103,7 +103,7 @@  __init int net_sysctl_init(void)
 	net_header = register_sysctl("net", empty);
 	if (!net_header)
 		goto out;
-	ret = register_pernet_subsys(&sysctl_pernet_ops);
+	ret = register_pernet_sys(&sysctl_pernet_ops);
 	if (ret)
 		goto out1;
 out: