rbtree_posto...h_entry_safe(9)
β¨ NAME β¨
Okay so welcome to the Kernel API Manual, bestie π β the page title is rbtree_posto...h_entry_safe(9), and the full-name main character is rbtree_postorder_for_each_entry_safe. It iterates in post-order over an rb_root of a given type, and it allows the backing memory of @pos to be invalidated. That's the assignment, and it ate. π
β¨
π¦ SYNOPSIS π¦
rbtree_postorder_for_each_entry_safe (pos , n , root , field );
πΈ ARGUMENTS πΈ
posβ the'type *'to use as your loop cursor, bestie. It's literally the main character of each step. βnβ another'type *', this one for temporary storage. Think of it as the understudy holding space so the show can go on. πrootβ the original has no description here, so I'm not inventing lore, periodt. It's justroot, mysterious and iconic. πfieldβ the name of therb_nodefield within'type'. Give it the exact field name and slay. π
π DESCRIPTION π
Okay so rbtree_postorder_for_each_entry_safe provides a similar guarantee as list_for_each_entry_safe πβ¨ β it allows the iteration to continue independent of changes to pos by the body of the loop. That's the safe part, and it's highkey giving.
π¨ Important vibe check: note, however, that it cannot handle other modifications that re-order the rbtree it is iterating over. This includes callingrb_eraseonpos, asrb_erasemay rebalance the tree, causing us to miss some nodes. π So do not do that and expect a clean run, fr fr.
π SEE ALSO π
- Kernel file
./tools/include/linux/rbtree.h rb_add_cached(9)rb_add(9)rb_find_add(9)rb_find(9)rb_find_first(9)rb_next_match(9)rb_for_each(9)
iykyk π β that's the whole crew.
Source/version: ./tools/include/linux Β· date: October 2026 Β· title: rbtree_posto...h_entry_safe(9). Byeee, bestie β go iterate 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