list_private...h_entry_safe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… list_private_for_each_entry_safe(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual β€” yes, the actual manual name, we're fancy here β€” and today's main character is list_private_for_each_entry_safe. no cap, this one is lowkey a lifesaver once you get it. let's go πŸ’–


✨ NAME ✨

list_private_for_each_entry_safe β€” iterate over list of given type safe against removal of list entry πŸ¦‹

like, literally walk your list and survive deleting stuff from it as you go. it's giving "I can have both" energy. periodt.


🌸 SYNOPSIS 🌸

list_private_for_each_entry_safe (pos , n , head , member );

yes the spacing is exactly like that, don't come for me, that's just how it's printed πŸ™ˆ


🫢 ARGUMENTS 🫢

  • pos β€” the type * to use as a loop cursor. this is your little main character pointer, the one doing the walking πŸ’«
  • n β€” another type * to use as temporary storage. think of it as the backup dancer holding the next position so nothing gets lost πŸŽ€
  • head β€” the head for your list. every list has one, it's the anchor, the group chat admin if you will πŸ‘‘
  • member β€” the name of the list_head within the struct. you gotta tell it where the list-ness lives inside your struct, iykyk πŸ”

πŸ’œ SEE ALSO πŸ’œ

so here's the whole squad, all of them, no skipping, we love a complete friend group:

  • Kernel file ./include/linux/list_private.h Private List Primitives(9)
  • list_private_entry(9)
  • list_private_first_entry(9)
  • list_private_last_entry(9)
  • list_private_next_entry(9)
  • list_private_next_entry_circular(9)
  • list_private_prev_entry(9)
  • list_private_prev_entry_circular(9)
  • list_private_entry_is_head(9)
  • list_private_for_each_entry(9)
  • list_private_for_each_entry_reverse(9)
  • list_private_for_each_entry_continue(9)
  • list_private_for_each_entry_continue_reverse(9)
  • list_private_for_each_entry_from(9)
  • list_private_for_each_entry_from_reverse(9)
  • list_private_for_each_entry_safe_continue(9)
  • list_private_for_each_entry_safe_from(9)
  • list_private_for_each_entry_safe_reverse(9)
  • list_private_safe_reset_next(9)

like, the whole family tree fr fr 🌈


heads up bestie: that's the literal list of references from the page β€” I'm not adding extra ones, I'm not dropping any. we keep every last one πŸ’€βœ¨

and that's the page!! source lives at ./include/linux, dated October 2026 β€” so it's basically a lil time traveler πŸ•°οΈπŸ’– mwah, go iterate safely, ily, bye πŸ§šβ€β™€οΈπŸ’…

πŸ“¦ where this page comes from