rbtree_posto...h_entry_safe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 just root, mysterious and iconic. πŸ™ˆ
  • field β€” the name of the rb_node field 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 calling rb_erase on pos, as rb_erase may rebalance the tree, causing us to miss some nodes. πŸ’€ So do not do that and expect a clean run, fr fr.

🌈 SEE ALSO 🌈

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