hlist_nulls...h_entry_safe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– hlist_nulls_for_each_entry_safe πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” yes, the actual kernel API manual, and yes, we're gonna get through this together 🫢 this one's like a tiny little page but it's honestly iconic if you're the kind of girl who likes walking a list while other people are out here deleting stuff from it 😭


🌸 NAME 🌸

hlist_nulls_for_each_entry_safe β€” iterate over list of given type safe against removal of list entry

like literally that's the whole vibe: you're iterating over a list of a given type, and you're safe against removal of the list entry while you do it πŸ’… no cap, that's the whole point.


✨ SYNOPSIS ✨

hlist_nulls_for_each_entry_safe (tpos , pos , head , member );

that's it, that's the whole call πŸŽ€ four things go in, and the spaces before the commas are canon, we don't touch them, we respect them πŸ™


πŸ¦‹ ARGUMENTS πŸ¦‹

  • tpos β€” the type * to use as a loop cursor. like, the type, with a star, it's a pointer bestie ⭐ this is your main character cursor.
  • pos β€” the struct hlist_nulls_node to use as a loop cursor. this one's the node-shaped cursor, the little structural one that's doing the actual walking 🧚
  • head β€” the head of the list. the whole thing starts here, this is the doorway πŸ‘‘
  • member β€” the name of the hlist_nulls_node within the struct. i.e. which field inside your struct is the list node β€” you gotta tell it, it can't guess, it's not psychic 😭
two cursors, one loop, zero fear. tpos is the typed one, pos is the node one, and member is how the macro finds the node inside your struct. that's the whole squad πŸ’œ

πŸ”₯ SEE ALSO πŸ”₯

kernel file ./include/linux/rculist_nulls.h β€” go read it, it's giving source of truth ✨

and the whole friend group:

like, that's the entire nulls-hlist-rcu group chat and you should absolutely go say hi to all of them 🫢


okay that's the page!! mwah πŸ’‹ this one came straight out of ./include/linux and it's dated October 2026 β€” so yeah, it's from the future, we don't question it, we just say thank you and slay πŸŒˆβ­πŸ’…

πŸ“¦ where this page comes from