STRUCT NS_TREE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 map
  • ns_tree_node β€” the node in the per-type namespace tree 🌈 your own little tree, sorted by type, iconic
  • ns_owner_node β€” the node in the owner namespace's tree of owned namespaces πŸŽ€ the "who do I belong to" link
  • ns_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