STRUCT NS_TREE_ROOT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct ns_tree_root β€” Root of a namespace tree πŸ’–

okay bestie, welcome to the struct ns_tree_root(9) page, part of the Kernel API Manual ✨ this one's short and sweet and honestly kinda iconic β€” it's the literal root of a namespace tree, the main character of the whole operation πŸ‘‘


🌸 SYNOPSIS 🌸

struct ns_tree_root {
    struct rb_root ns_rb;
    struct list_head ns_list_head;
 };

like, that's it. two members. minimalism ate πŸ’…


πŸŽ€ Members πŸŽ€

  • ns_rb β€” the red-black tree root, and its whole job is efficient lookups πŸ”₯ rb-trees stay balanced so you're never stuck digging forever, no cap.
  • ns_list_head β€” the list head for sequential iteration πŸ¦‹ this is the one you grab when you wanna just walk through everything in order.

✨ Description ✨

so here's the vibe: every namespace tree keeps both an rbtree (for O(log n) lookups πŸ‘€) and a list (for efficient sequential iteration πŸƒβ€β™€οΈπŸ’¨). two structures, one tree, dual-wielding energy fr fr.

and the important bit β€” the list is kept in the same sorted order as the rbtree 🌈 so whichever one you're using, you get consistency. lowkey elegant. highkey obsessed πŸ’œ


🫢 SEE ALSO 🫢

  • Kernel file ./include/linux/ns/nstree_types.h
  • struct ns_tree_node(9)
  • struct ns_tree(9)

go read the friends of this struct, they're all in the same header and they all slay in their own way 🧚


ngl this one's a short page, but that's because the struct speaks for itself πŸ’€ two members, zero drama.

that's the whole page bestie! πŸ’– this came from the ./include/linux/ns corner of the kernel, dated October 2026 β€” go forth and traverse your trees responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from