diff mbox series

[RFC,09/25] net: Move net_ns_ops to pernet_sys list

Message ID 151094332264.20009.7033089579618293933.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 pure initcalls.

Since net_ns_init() is the only pure initcall in net subsystem,
and there is no early initcalls; the pernet subsys, it registers,
is the first in pernet_operations list. So, we start with it.

net_ns_ops::net_ns_net_init/net_ns_net_init, methods use only
ida_simple_* functions, which are not need a synchronization.

So it's safe to execute them in parallel with any other
pernet_operations, and thus we convert net_ns_ops to pernet_sys type.

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

Patch

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 7aec8c1afe50..2e8295aa7003 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -899,7 +899,7 @@  static int __init net_ns_init(void)
 	init_net_initialized = true;
 	up_write(&net_sem);
 
-	register_pernet_subsys(&net_ns_ops);
+	register_pernet_sys(&net_ns_ops);
 
 	rtnl_register(PF_UNSPEC, RTM_NEWNSID, rtnl_net_newid, NULL,
 		      RTNL_FLAG_DOIT_UNLOCKED);