kernfs_unlink_sibling(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to the Kernel API Manual β€” this one's about kernfs_unlink_sibling(9) and it's honestly a whole little vibe. buckle up πŸŽ€


🌸 NAME 🌸

kernfs_unlink_sibling β€” unlink a kernfs_node from the sibling rbtree. that's it, that's the job πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

bool kernfs_unlink_sibling (struct kernfs_node *kn );

literally one function, one arg, returning a bool. clean. minimal. main character energy ✨


πŸ“ ARGUMENTS πŸ“

  • kn β€” the kernfs_node of interest πŸ‘€ like, this is the node we're talking about, the one we're trying to unlink.

πŸ’œ DESCRIPTION πŸ’œ

so the whole point: this function tries to unlink kn from its sibling rbtree β€” and that rbtree starts from kn->parent->dir.children. yep, that exact path, no cap. 🌈

Locking: the kernfs_rwsem must be held exclusive. fr fr, don't skip this, it's not a suggestion 😭


πŸ‘‘ RETURN πŸ‘‘

  • returns true if kn was actually removed β€” slay, it worked πŸ’–
  • returns false if kn wasn't on the rbtree β€” no harm done, it just wasn't there πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

kernel file ./fs/kernfs/dir.c β€” and here's the whole friend group, all of them, every single one 🫢


bestie reminder: hold that kernfs_rwsem exclusive or the vibe check will not pass πŸ’€

and that's the whole page!! sourced from ./fs/kernfs, dated October 2026, filed under kernfs_unlink_sibling(9) β€” mwah, love u, go unlink responsibly πŸ’…πŸ’–

πŸ“¦ where this page comes from