hlist_bl_for_each_entry(9)
π hlist_bl_for_each_entry (Kernel API Manual, bestie)
okay so this is a page from the Kernel API Manual and honestly? it's a little one but it's iconic. sit down, grab a strawberry π, we're learning to walk a list.
β¨ NAME β¨
hlist_bl_for_each_entry β literally iterate over a list of a given type. that's the whole vibe. main character energy for your linked list π¦
πΈ SYNOPSIS πΈ
hlist_bl_for_each_entry (tpos , pos , head , member );
so you've got the macro, you've got four things going in, and it's gonna loop for you. slay.
π ARGUMENTS π
four besties walk into a macro:
tposβ the type*you're using as your loop cursor. that's your main character pointer, the one you actually get to touch inside the loop. πposβ thestruct hlist_nodeyou're using as a loop cursor. yes it's also a cursor, no it's not the same one, they're different cursors, it's giving two-cursor household π«Άheadβ the head of your list. like, the very start of it. the front door. the entrance. πmemberβ the name of thehlist_nodeinside the struct. iykyk β it's the field name that lets the macro figure out where the node lives inside your type. π
ngl,tposandposboth being cursors is a lot, but that's the design and we respect it π
π SEE ALSO π
- Kernel file
./include/linux/list_bl.hβ go read it, it's right there πΈ hlist_bl_for_each_entry_safe(9)β the safe one. the responsible sibling. check it out fr fr π₯
that's the page!! no cap, that's genuinely all of it, every argument accounted for, nothing skipped, we ate and left no crumbs πβ¨
made with love from ./include/linux, dated October 2026, and yeah the page is literally called hlist_bl_for_each_entry(9) β bye bestie, go walk some lists ππ§
π¦ 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