llist_del_first_this(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ¦‹


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