list_privat...ry_safe_from(9)
π 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β thetype *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β anothertype *, 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 thelist_headinside 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:
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(9)list_private_for_each_entry_safe_continue(9)list_private_for_each_entry_safe_reverse(9)list_private_safe_reset_next(9)
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
- 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