llist_for_each_entry(9)
π 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β thetype *to use as your loop cursor. Iconic little cursor behavior πnodeβ the fist entry of deleted list entries. (Yes, the page saysfist, notfirstβ keeping it exactly as written, no cap π)memberβ the name of thellist_nodewith 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:
init_llist_head(9)init_llist_node(9)llist_on_list(9)llist_entry(9)member_address_is_nonnull(9)llist_for_each(9)llist_for_each_safe(9)llist_for_each_entry_safe(9)llist_empty(9)llist_add_batch(9)llist_add(9)llist_del_all(9)llist_del_first_init(9)
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
- 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