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

From: Kirill Tkhai
Date: Fri Nov 17 2017 - 13:29:22 EST


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@xxxxxxxxxxxxx>
---
fs/proc/proc_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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);
}