llist_del_first_this(9)
π llist_del_first_this (kernel API manual, bestie edition) π
Okay so picture this: you're deep in kernel-land, in the <purple>lock-less list</purple> department, and you've got one very specific little errand β deleting a given entry, but only if it happens to be the first one. That's the whole vibe of llist_del_first_this. It's from the Kernel API Manual, and honestly? It's giving "tiny function, big responsibilities." π
β¨ NAME β¨
llist_del_first_this β delete given entry of lock-less list if it is first π¦
πΈ SYNOPSIS πΈ
bool llist_del_first_this (struct llist_head *head , struct llist_node
*this );
Yes bestie, that line break in the middle is exactly how it's written, don't come for me. π
π ARGUMENTS π
headβ the head for your lock-less list. The main character of your list, basically. πthisβ a list entry. Just one little node, hoping it's first in line.
π DESCRIPTION π
So here's the tea: if the head of the list is the given entry, it gets deleted and the function returns true. Otherwise? Nothing happens and you get false. That's it. No cap, that's the entire contract. β¨
And the gorgeous part β multiple callers can safely call this concurrently with multiple llist_add callers, providing all the callers offer a different this. Like, that's the rule, okay? Different this for everybody. Share the list, not the node. π«Άπ₯
Fr fr though β the "different this for each caller" thing is a requirement, not a suggestion. Break it and you're on your own. π
π¦ SEE ALSO π¦
- Kernel file
./lib/llist.cβ that's where the magic lives, go read it, iykyk π llist_del_first(9)llist_reverse_order(9)
And that's a wrap, bestie! π This little page came to you from ./lib, dated October 2026 β go forth and delete responsibly. πβπ
π¦ 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