diff mbox series

[RFC,08/25] net: Move proc_net_ns_ops to pernet_sys list

Message ID 151094331141.20009.618108555770576501.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 before initcalls.

Since proc_net_ns_ops is registered pernet_subsys,
made from:

start_kernel()->proc_root_init()->proc_net_init(),

and there is no a pernet_subsys, which is registered
earlier, we start from it.

proc_net_ns_ops::proc_net_ns_init()/proc_net_ns_exit()
register pernet net->proc_net and ->proc_net_stat, and
constructors and destructors of another pernet_operations
are not interested in foreign net's proc_net and proc_net_stat.
Proc filesystem privitives are synchronized on proc_subdir_lock.

So, it's safe to move proc_net_ns_ops to pernet_sys list
and execute its methods in parallel with another pernet
operations.

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

Patch

diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
index a2bf369c923d..5eb52765eeab 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -243,5 +243,5 @@  int __init proc_net_init(void)
 {
 	proc_symlink("net", NULL, "self/net");
 
-	return register_pernet_subsys(&proc_net_ns_ops);
+	return register_pernet_sys(&proc_net_ns_ops);
 }