rb_add(9)
π rb_add(9) π
okay so bestie, welcome to rb_add(9) from the Kernel API Manual β this is the red-black tree girlie's insert function and she is literally here to drop one node into one tree. no cap. πΈ
β¨ NAME β¨
rb_add β insert @node into @tree π
like that's it, that's the whole job, and she does it flawlessly π
π SYNOPSIS π
void rb_add (struct rb_node *node , struct rb_root *tree , bool
(*less)(struct rb_node *, const struct rb_node *) );
look at her. iconic signature. three little arguments and a whole lot of tree energy π¦
π ARGUMENTS π
nodeβ the node you wanna insert. your main character. she's going in the tree, periodt. β¨treeβ the tree you're insertingnodeinto. the venue. the group chat. the whole vibe. π³lessβ the operator that defines the (partial) node order. so like, this is the function pointer that tells everything how to sort itself out, and yes bestie it's a partial order, that's what the man page says, don't come for me π
ngllessbeing a function pointer withstruct rb_node *andconst struct rb_node *as its params is giving "i know exactly what i'm doing" energy and honestly? she does π
π«Ά SEE ALSO π«Ά
okay so if you're obsessed with this one (and you should be), the whole friend group is right here:
- Kernel file
./tools/include/linux/rbtree.hβ go read the source bestie, it's right there π rbtree_postorder_for_each_entry_safe(9)rb_add_cached(9)rb_find_add(9)rb_find(9)rb_find_first(9)rb_next_match(9)rb_for_each(9)
every single one of them, no skips, we don't leave the squad behind ππ
and that's the page!! mwah π this little masterpiece lives in ./tools/include/linux and the date on it is October 2026 β so yeah, she's from the future, she's from the kernel, she's rb_add(9) and she ate. πππ
π¦ 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