inode_init_owner(9)
π inode_init_owner β like, the kernel API manual edition π
okay so bestie, this is inode_init_owner(9) straight out of the Kernel API Manual, and it's the function that sets up a brand-new inode's uid, gid, and mode the way POSIX says you should. no cap, it's a small function with big main character energy. β¨
π SYNOPSIS
void inode_init_owner (struct mnt_idmap *idmap , struct inode *inode ,
const struct inode *dir , umode_t mode );
that's the whole signature, fr fr. four params, one void return, zero drama. π«Ά
πΈ ARGUMENTS
idmapβ the idmap of the mount that this inode was created from. yes, that idmap. πinodeβ the new inode, freshly born, needs its identity set. it's giving newborn era. πΌdirβ the directory inode. the parent. the one who raised it. πmodeβ the mode of the new inode. the vibe check of file permissions, basically. π
π¦ DESCRIPTION
okay so here's the tea π: if the inode was created through an idmapped mount, you have to pass the vfsmount's idmap through idmap. like, non-negotiable. then this function will take care of mapping the inode according to idmap before it goes and checks permissions and initializes i_uid and i_gid. nobody skips the mapping step on its watch. π―
and if you're on non-idmapped mounts? or if permission checking is supposed to happen on the raw inode? then just pass nop_mnt_idmap and keep it moving, bestie. π
π§ SEE ALSO
literally the entire inode cinematic universe, all in ./fs/inode.c under Kernel file β go read them all, i'm obsessed:
inode_init_always_gfp(9)alloc_inode(9)drop_nlink(9)clear_nlink(9)set_nlink(9)inc_nlink(9)inode_sb_list_add(9)__insert_inode_hash(9)__remove_inode_hash(9)evict_inodes(9)new_inode(9)unlock_new_inode(9)lock_two_nondirectories(9)unlock_two_nondirectories(9)inode_insert5(9)iget5_locked(9)iget5_locked_rcu(9)iget_locked(9)iunique(9)ihold(9)ilookup5_nowait(9)ilookup5(9)ilookup(9)find_inode_nowait(9)find_inode_rcu(9)find_inode_by_ino_rcu(9)iput(9)iput_not_last(9)bmap(9)inode_update_time(9)generic_update_time(9)atime_needs_update(9)file_remove_privs(9)current_time(9)file_update_time(9)file_modified_flags(9)file_modified(9)kiocb_modified(9)inode_owner_or_capable(9)inode_dio_wait(9)timestamp_truncate(9)inode_set_ctime_current(9)inode_set_ctime_deleg(9)in_group_or_capable(9)mode_strip_sgid(9)dump_inode(9)
π reminder that this page lives in ./fs and is dated October 2026 β so like, mark your calendar bestie, that's the versioning era we're in. π
and that's the whole page!! mwah π stay hydrated, pass your idmaps correctly, and remember: nop_mnt_idmap is your bestie when there's no idmapped mount in sight. πβ¨π
π¦ 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