STRUCT NS_TREE_ROOT(9)
π 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
- 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