kernfs_remove_by_name_ns(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kernfs_remove_by_name_ns β€” a.k.a. the "bye bestie, we're deleting you by name" girlie

okay so this is kernfs_remove_by_name_ns(9) from the Kernel API Manual (section 9, ikyk what that means 😌). she's a little syscall-adjacent gremlin whose whole personality is: find the kernfs_node and yeet it into the void. let's get into it ✨


🌸 SYNOPSIS 🌸

int kernfs_remove_by_name_ns (struct kernfs_node *parent , const char
*name , const struct ns_common *ns );

that's the whole vibe. three args, one int back, no cap. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • parent β€” the parent of the target 🧚 so like, the node's mom, basically. it's who she lives under.
  • name β€” the name of the kernfs_node to remove πŸ“› the one getting un-alived from the tree.
  • ns β€” the namespace tag of the kernfs_node to remove 🏷️ bc two nodes can share a name but live in different namespaces, and we're not about to commit a crime by removing the wrong one, bestie.

πŸ¦‹ DESCRIPTION πŸ¦‹

the way this works is genuinely so simple and it ate: it looks for the kernfs_node with that name and that ns under parent, and then it removes it. periodt. that's the whole function. πŸ”₯

like β€” find the node, delete the node. no extra steps, no drama, no side quests. πŸ‘‘


⭐ RETURN ⭐

  • 0 on success ✨ slay, it worked, the node is gone.
  • -ENOENT if such entry doesn't exist 😭 like you asked to delete a thing that was never there. awkward. it's not an error so much as a "girl, there's nothing to delete."

πŸ‘‘ SEE ALSO πŸ‘‘

this section is literally the entire friend group, ngl β€” go say hi to the family:


πŸ’€ reminder bestie: this removes an entry by name and ns under parent. if there's no such entry you get -ENOENT, not a crash β€” so check your return value, mkay? πŸ™ˆ

that's the whole page, mwah πŸ’– this cutie lives in ./fs/kernfs, dropped October 2026, and it's kernfs_remove_by_name_ns(9) forever and always πŸŒˆπŸ’…

πŸ“¦ where this page comes from