hlist_add_fake(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ hlist_add_fake(9) ✨

okay so bestie, we're in the Kernel API Manual today and this page is genuinely a little icon of list trickery πŸ’…


🌸 NAME

hlist_add_fake β€” creates a fake hlist that's literally just one single headless node, no cap


πŸŽ€ SYNOPSIS

void hlist_add_fake (struct hlist_node *n );

πŸ¦‹ ARGUMENTS

  • n β€” the node you're turning into a fake list, that's it, that's the whole vibe

πŸ’– DESCRIPTION

so what this does is it makes n appear to be its own predecessor on a headless hlist 🫢 like she's showing up to the party as her own plus-one.

the whole point of this? it's giving "let things like hlist_del work correctly" β€” specifically in cases where there is no list at all. no list, no problem, we just fake the predecessor link and everyone's happy ✨

fr fr the trick is that downstream code expects a predecessor to exist, so instead of adding a bunch of null checks everywhere you just make the node pretend. iconic behavior tbh πŸ‘‘

🌈 SEE ALSO

Kernel file ./include/linux/list.h β€” and okay bestie, the related-pages list here is long, so buckle up πŸ“


and that's the whole page, bestie πŸ§šπŸ’œ this one lives down in ./include/linux, and it's tagged October 2026 in the Kernel API Manual β€” so like, save the date ig πŸ’« see u in the kernel sources 🫢

πŸ“¦ where this page comes from