kernfs_get_open_node(9)
π kernfs_get_open_node π
Ok so bestie, welcome to kernfs_get_open_node(9) from the Kernel API Manual β yes that's the whole function name, yes it's a mouthful, no we don't shorten it, iykyk π
β¨ NAME β¨
kernfs_get_open_node β get or create kernfs_open_node π¦
β¨ SYNOPSIS β¨
int kernfs_get_open_node (struct kernfs_node *kn , struct kernfs_open_file *of );
β¨ ARGUMENTS β¨
knβ the targetkernfs_node, like, the one you're actually here for πΈofβ thekernfs_open_filefor this instance of open. one per open, no sharing, periodt π
β¨ DESCRIPTION β¨
Okay so here's the tea β: if kn->attr.open already exists? iconic, we just increment its reference count. but if it does not exist yet? we create one. main character energy, honestly π
And of gets chained to the files list. that's it, that's the whole vibe π«Ά
Locking: Kernel thread context β may sleep π΄. so like, don't do this somewhere that can't nap, fr fr.
β¨ RETURN β¨
0on success π slay-errnoon failure π (negative errno, not a mysterious vibes-based number)
β¨ SEE ALSO β¨
- Kernel file
./fs/kernfs/file.c of_on(9)kernfs_deref_open_node_locked(9)kernfs_unlink_open_file(9)kernfs_notify(9)__kernfs_create_file(9)
go read those next bestie, it's giving "required reading" πβ¨
kiss kiss, this page came from ./fs/kernfs and it's dated October 2026 β see u in the next man page, love u bye πππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms