list_for_ea...afe_continue(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– list_for_each_entry_safe_continue β€” NAME ✨

okay so hi bestie, welcome to the Kernel API Manual πŸŽ€ β€” this page is literally about list_for_each_entry_safe_continue, which is the "keep the list iteration going, but like, safely" one. No cap.

(yes the page header was out here truncating itself to list_for_ea...afe_continue(9) β€” she's a little dramatic, we love her anyway πŸ’…)


🌸 SYNOPSIS 🌸

list_for_each_entry_safe_continue (pos , n , head , member );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • pos β€” the *type ** you're using as your loop cursor. this is your main character ✨
  • n β€” another *type ** β€” this one's just holding space as temporary storage 🫢
  • head β€” the head of your list, the head that runs the whole thing πŸ‘‘
  • member β€” the name of the list_head sitting inside the struct, iykyk

πŸ’… DESCRIPTION πŸ’…

so basically: it iterates over a list of the given type, and it keeps going after the current point β€” but the iconic part? it's safe against removal of a list entry 😭πŸ”₯

like, you can be out here deleting stuff mid-loop and she's not gonna fall apart on you. ate and left no crumbs.

lowkey important: "safe against removal" is the whole reason you'd reach for this one instead of a plain loop. don't sleep on it 🫢

🌈 SEE ALSO 🌈

Kernel file ./tools/include/linux/list.h, plus the whole friend group (fr fr, it's a big group chat):


and that's the whole page bestie πŸ§šπŸ’œ this lil drop came from ./tools/include/linux and it's dated October 2026 β€” screenshot it, cite it, slay πŸ’…βœ¨

πŸ“¦ where this page comes from