llist_del_first_init(9)
π
llist_del_first_init β a love letter to lock-less lists
okay so this is a page from the Kernel API Manual, section 9, and the star of the show is llist_del_first_init. she pops the first entry off a lock-less list and leaves it looking fresh and unlisted. bestie, it's giving "delete but make it clean" β¨
β¨ SYNOPSIS β¨
struct llist_node * llist_del_first_init (struct llist_head *head );
that's it. that's the whole vibe. π
πΈ ARGUMENTS πΈ
headβ the head of the lock-less list you wanna delete from. your main character pointer, basically. π
π¦ DESCRIPTION π¦
so this function behaves the same as llist_del_first, except β and this is the iconic part β llist_init_node gets called on the returned node. the way that works means llist_on_list will report false for that node. literally off the list. not on it. marked as being off-list. slay. π
no cap, that's the entire difference. same deletion energy, but the node comes back already de-listed and ready to be reused without any "wait, am i still on a list?" confusion. π§
π₯ SEE ALSO π₯
everything in the same friend group, all from the kernel file ./include/linux/llist.h:
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(9)llist_for_each_entry_safe(9)llist_empty(9)llist_add_batch(9)llist_add(9)llist_del_all(9)
fr fr go read llist_on_list(9) next, it's the one that makes the whole "am i on the list or not" thing click π«Ά
β bye bestie β
that's the whole page! π this little gem lives over in ./include/linux and the version stamped on it is October 2026 β so yeah, future-dated and still iconic. mwah. ππ
π¦ 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