From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kirill Tkhai Subject: [PATCH RFC 08/25] net: Move proc_net_ns_ops to pernet_sys list Date: Fri, 17 Nov 2017 21:28:31 +0300 Message-ID: <151094331141.20009.618108555770576501.stgit@localhost.localdomain> References: <151094119999.20009.6955267140148739392.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: davem@davemloft.net, vyasevic@redhat.com, kstewart@linuxfoundation.org, pombredanne@nexb.com, vyasevich@gmail.com, mark.rutland@arm.com, gregkh@linuxfoundation.org, adobriyan@gmail.com, fw@strlen.de, nicolas.dichtel@6wind.com, xiyou.wangcong@gmail.com, roman.kapl@sysgo.com, paul@paul-moore.com, dsahern@gmail.com, daniel@iogearbox.net, lucien.xin@gmail.com, mschiffer@universe-factory.net, rshearma@brocade.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, ktkhai@virtuozzo.com, ebiederm@xmission.com, avagin@virtuozzo.com, gorcunov@virtuozzo.com, eric.dumazet@gmail.com, stephen@networkplumber.org, ktkhai@virtuozzo.com Return-path: Received: from mail-ve1eur01on0129.outbound.protection.outlook.com ([104.47.1.129]:2529 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966221AbdKQS2m (ORCPT ); Fri, 17 Nov 2017 13:28:42 -0500 In-Reply-To: <151094119999.20009.6955267140148739392.stgit@localhost.localdomain> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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); }