Re: [PATCH 1/3] nstree: make struct ns_tree private
From: Jan Kara <jack@suse.cz>
Date: 2025-09-24 11:46:56
Also in:
cgroups, linux-fsdevel
On Wed 24-09-25 13:33:58, Christian Brauner wrote:
Don't expose it directly. There's no need to do that. Signed-off-by: Christian Brauner <brauner@kernel.org>
Nice. Feel free to add: Reviewed-by: Jan Kara <jack@suse.cz> Honza
quoted hunk ↗ jump to hunk
--- include/linux/nstree.h | 13 ------------- kernel/nstree.c | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-)diff --git a/include/linux/nstree.h b/include/linux/nstree.h index 29ad6402260c..8b8636690473 100644 --- a/include/linux/nstree.h +++ b/include/linux/nstree.h@@ -9,19 +9,6 @@ #include <linux/rculist.h> #include <linux/cookie.h> -/** - * struct ns_tree - Namespace tree - * @ns_tree: Rbtree of namespaces of a particular type - * @ns_list: Sequentially walkable list of all namespaces of this type - * @ns_tree_lock: Seqlock to protect the tree and list - */ -struct ns_tree { - struct rb_root ns_tree; - struct list_head ns_list; - seqlock_t ns_tree_lock; - int type; -}; - extern struct ns_tree cgroup_ns_tree; extern struct ns_tree ipc_ns_tree; extern struct ns_tree mnt_ns_tree;diff --git a/kernel/nstree.c b/kernel/nstree.c index bbe8bedc924c..113d681857f1 100644 --- a/kernel/nstree.c +++ b/kernel/nstree.c@@ -4,6 +4,19 @@ #include <linux/proc_ns.h> #include <linux/vfsdebug.h> +/** + * struct ns_tree - Namespace tree + * @ns_tree: Rbtree of namespaces of a particular type + * @ns_list: Sequentially walkable list of all namespaces of this type + * @ns_tree_lock: Seqlock to protect the tree and list + */ +struct ns_tree { + struct rb_root ns_tree; + struct list_head ns_list; + seqlock_t ns_tree_lock; + int type; +}; + struct ns_tree mnt_ns_tree = { .ns_tree = RB_ROOT, .ns_list = LIST_HEAD_INIT(mnt_ns_tree.ns_list),-- 2.47.3
-- Jan Kara [off-list ref] SUSE Labs, CR