From a657bc8a75cf40c3d0814fe6488ba4af56528f42 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Mon, 10 Nov 2025 16:08:17 +0100 Subject: nstree: switch to new structures Switch the nstree management to the new combined structures. Link: https://patch.msgid.link/20251110-work-namespace-nstree-fixes-v1-5-e8a9264e0fb9@kernel.org Signed-off-by: Christian Brauner --- kernel/nscommon.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'kernel/nscommon.c') diff --git a/kernel/nscommon.c b/kernel/nscommon.c index c910b979e433..88f70baccb75 100644 --- a/kernel/nscommon.c +++ b/kernel/nscommon.c @@ -2,6 +2,7 @@ /* Copyright (c) 2025 Christian Brauner */ #include +#include #include #include #include @@ -61,14 +62,10 @@ int __ns_common_init(struct ns_common *ns, u32 ns_type, const struct proc_ns_ope ns->ops = ops; ns->ns_id = 0; ns->ns_type = ns_type; - RB_CLEAR_NODE(&ns->ns_tree_node); - RB_CLEAR_NODE(&ns->ns_unified_tree_node); - RB_CLEAR_NODE(&ns->ns_owner_tree_node); - INIT_LIST_HEAD(&ns->ns_list_node); - INIT_LIST_HEAD(&ns->ns_unified_list_node); - ns->ns_owner_tree = RB_ROOT; - INIT_LIST_HEAD(&ns->ns_owner); - INIT_LIST_HEAD(&ns->ns_owner_entry); + ns_tree_node_init(&ns->ns_tree_node); + ns_tree_node_init(&ns->ns_unified_node); + ns_tree_node_init(&ns->ns_owner_node); + ns_tree_root_init(&ns->ns_owner_root); #ifdef CONFIG_DEBUG_VFS ns_debug(ns, ops); -- cgit From 6bf253855aa8c970d2191f87ee23f9f184ddaa79 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Mon, 10 Nov 2025 16:08:21 +0100 Subject: ns: rename is_initial_namespace() Rename is_initial_namespace() to ns_init_inum() and make it symmetrical with the ns id variant. Link: https://patch.msgid.link/20251110-work-namespace-nstree-fixes-v1-9-e8a9264e0fb9@kernel.org Signed-off-by: Christian Brauner --- kernel/nscommon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel/nscommon.c') diff --git a/kernel/nscommon.c b/kernel/nscommon.c index 88f70baccb75..bdc3c86231d3 100644 --- a/kernel/nscommon.c +++ b/kernel/nscommon.c @@ -82,7 +82,7 @@ int __ns_common_init(struct ns_common *ns, u32 ns_type, const struct proc_ns_ope * active use (installed in nsproxy) and decremented when all * active uses are gone. Initial namespaces are always active. */ - if (is_initial_namespace(ns)) + if (is_ns_init_inum(ns)) atomic_set(&ns->__ns_ref_active, 1); else atomic_set(&ns->__ns_ref_active, 0); -- cgit