kernfs_get_inode(9)
π kernfs_get_inode(9) π
okay bestie, welcome to the Kernel API Manual, section 9 β we're doing kernfs_get_inode today and honestly? it's giving "short but iconic" β¨
β¨ NAME β¨
kernfs_get_inode β get inode for kernfs_node π
π¦ SYNOPSIS π¦
struct inode * kernfs_get_inode (struct super_block *sb , struct
kernfs_node *kn );
πΈ ARGUMENTS πΈ
sbβ the super block. yes, that super block. she's the vibe check for the whole thing π«Άknβ thekernfs_nodewe're allocating an inode for. main character energy fr π
π DESCRIPTION π
So the way that this works: you use kernfs_get_inode to get the inode for kn. and like β if such inode doesn't exist yet? no worries, bestie, a new inode is allocated and the basics are initialized β¨. the new inode is returned locked π (not me emphasizing that, it's literally in the page).
Locking: Kernel thread context (may sleep) π΄ β so yes, you can sleep here, it's allowed, we love that for you.
π RETURN π
Pointer to the allocated inode on success π, NULL on failure π. that's it, that's the whole return.
β SEE ALSO β
- Kernel file
./fs/kernfs/inode.cπ kernfs_setattr(9)β go read her next, iykyk π§
ngl, this whole page lives in ./fs/kernfs, so if you get lost, that's where the tea is π
and that's the page!! π written under the Kernel API Manual umbrella, dated October 2026, sourced from ./fs/kernfs β slay, periodt, go allocate some inodes responsibly ππ
π¦ 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