kernfs_add_one(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kernfs_add_one(9) β€” Kernel API Manual πŸ’…

Welcome to the Kernel API Manual, bestie β€” this is the kernfs_add_one(9) page, and we're gonna make it make sense. ✨


🌸 NAME 🌸

kernfs_add_one β€” add a kernfs_node to its parent without warning. No cap, that's literally the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

Okay so the signature is giving:

int kernfs_add_one (struct kernfs_node *kn );

πŸŽ€ ARGUMENTS πŸŽ€

  • kn β€” the kernfs_node to be added. That's the whole argument, bestie. 🫢

πŸ’– DESCRIPTION πŸ’–

Before you call this, you β€” the caller β€” must already have initialized kn->parent. This function is not gonna do that for you, fr fr. πŸ™ˆ

If kn is a directory, this function increments nlink of the parent's inode. It also links kn into the children list of the parent. Slay. πŸ’…


🌈 RETURN 🌈

  • 0 β€” success, iconic. πŸ‘‘
  • -EEXIST β€” an entry with the given name already exists. Duplicate detected, no thank you. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./fs/kernfs/dir.c β€” that's where this lives. 🧚


Cute lil sign-off: this page is from ./fs/kernfs, dated October 2026, and it's serving kernfs_add_one(9). Byeee, ily, go initialize your parents. πŸ’–πŸ¦‹

πŸ“¦ where this page comes from