STRUCT NS_TREE(9)
π struct ns_tree(9) β like, the whole namespace tree situation
okay bestie, welcome to struct ns_tree(9) β¨ β this is the page about namespace tree nodes and the active reference count, straight out of the Kernel API Manual. Yes it's kernel internals. Yes it's giving main character energy. Let's get into it π«Ά
β¨ SYNOPSIS β¨
struct ns_tree {
u64 ns_id;
atomic_t __ns_ref_active;
struct ns_tree_node ns_unified_node;
struct ns_tree_node ns_tree_node;
struct ns_tree_node ns_owner_node;
struct ns_tree_root ns_owner_root;
};
like, that's the whole thing. six fields. no cap π
πΈ Members πΈ
So each one of these lil fields has a job and honestly they're all doing the most:
ns_idβ the Unique namespace identifier β like a government name but for a namespace, one of a kind fr fr π__ns_ref_activeβ the Active reference count β and bestie listen to me: do not use directly π it's literally right there, marked with the underscores and everything. it's private. back away.ns_unified_nodeβ the node in the global namespace tree π the big one, the whole mapns_tree_nodeβ the node in the per-type namespace tree π your own little tree, sorted by type, iconicns_owner_nodeβ the node in the owner namespace's tree of owned namespaces π the "who do I belong to" linkns_owner_rootβ the Root of the tree of namespaces owned by this namespace β and here's the vibe check: it's only used when this namespace is an owner β so if you're not an owner, this field is just sitting there, lowkey unemployed π
π¦ SEE ALSO π¦
go read these next, iykwim:
- Kernel file
./include/linux/ns/nstree_types.h struct ns_tree_root(9)struct ns_tree_node(9)
they're the supporting cast and they ate, periodt π₯
okay that's the whole page, go touch grass or read the kernel source bestie π§π
this slay of a page lives in ./include/linux/ns and was dated October 2026 β see you then, mwah π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms