list_privat...ry_safe_from(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

list_private_for_each_entry_safe_from β€” okay so this is the one that iterates over a list starting from where you currently are, and it's safe against removal (yes bestie, that means you can yeet entries mid-loop, we love a resilient icon ✨)


✨ SYNOPSIS ✨

list_private_for_each_entry_safe_from (pos , n , head , member );

That's the whole vibe. Four little arguments, one big slay πŸŽ€


🌸 ARGUMENTS 🌸

  • pos β€” the type * you're using as your loop cursor. This is the main character of the loop, the one keeping track of where you're at πŸ’…
  • n β€” another type *, and this one's just here as temporary storage. Lowkey the sidekick that makes the "safe" part possible 🫢
  • head β€” the head of your list. Every list has one, and this is yours πŸ‘‘
  • member β€” the name of the list_head inside the struct. Like, the actual field name, not the type. Precision, bestie πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea: this iterates over a list of the given type, starting from the current point, and it's safe against removal of the list entry. Meaning if you delete stuff while you're looping (which, honestly, iconic behaviour), nothing explodes 😭πŸ”₯

It's giving "I know where I am and I know what I'm doing." Main character energy fr fr.


🌈 SEE ALSO 🌈

Bestie, this family is huge, so buckle up. All of these live in the kernel file ./include/linux/list_private.h:

That's the whole squad. Go read them, iykyk πŸ§šπŸ’œ


Heads up cutie: this page comes from ./include/linux, and it's dated October 2026 β€” so like, mark your calendar bestie ⭐

Anyway that's the page!! Go loop over those lists safely, you absolute legend πŸ“πŸ‘‘πŸ’€

πŸ“¦ where this page comes from