llist_for_each_entry(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

llist_for_each_entry β€” iterate over some deleted entries of a lock-less list of a given type. Welcome to the Kernel API Manual, bestie ✨

🌸 SYNOPSIS 🌸

llist_for_each_entry (pos , node , member );

πŸŽ€ ARGUMENTS πŸŽ€

  • pos β€” the type * to use as your loop cursor. Iconic little cursor behavior πŸ’…
  • node β€” the fist entry of deleted list entries. (Yes, the page says fist, not first β€” keeping it exactly as written, no cap πŸ’€)
  • member β€” the name of the llist_node with the struct. That's the one, bestie.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so real talk: in general, some entries of the lock-less list can be traversed safely only after being removed from the list. That's why you start with an entry instead of the list head. Periodt.

If you're using this on entries deleted from the lock-less list directly, the traverse order is from the newest to the oldest added entry. If you want to go from the oldest to the newest, you must reverse the order by yourself before traversing. No auto-magic reversal, bestie β€” you're the main character of that part 😭πŸ’ͺ

🌈 SEE ALSO 🌈

Kernel file ./include/linux/llist.h, plus all these little legends:


That's the whole vibe: source/version ./include/linux, dated October 2026, from the Kernel API Manual β€” llist_for_each_entry(9) signing off with sparkles and a tiny bow πŸŽ€βœ¨πŸ’œ

πŸ“¦ where this page comes from