generic_fillattr(9)
π generic_fillattr(9)
okay so bestie, welcome to the Kernel API Manual β we're talking about generic_fillattr today and honestly? she's the default queen π
β¨ NAME β¨
generic_fillattr β fill in the basic attributes from the inode struct π
πΈ SYNOPSIS πΈ
void generic_fillattr (struct mnt_idmap *idmap , u32 request_mask ,
struct inode *inode , struct kstat *stat );
π¦ ARGUMENTS π¦
idmapβ the idmap of the mount theinodewas found from π«Άrequest_maskβ statxrequest_mask, literally what you're asking forinodeβ the inode we're using as the source, the main character of this whole operation πstatβ where to fill in the attributes, your output spot β¨
π DESCRIPTION π
So what she does is fill in the basic attributes in the kstat structure from data that's to be found on the VFS inode structure. That's it, that's the vibe. π
And here's the iconic part: this is the default if no getattr inode operation is supplied. no cap, she's the fallback that always shows up for you. π
Now, the idmap situation β listen up:
If the inode has been found through an idmapped mount, the idmap of the vfsmount must be passed through idmap. This function will then take care to map the inode according to idmap before filling in the uid and gid filds (yes, filds π you know what we mean). π
On non-idmapped mounts, or if permission checking is to be performed on the raw inode, simply pass nop_mnt_idmap. periodt. π
fr fr though β get theidmapwrong and youruid/gidmapping is gonna be a whole mess π picknop_mnt_idmapwhen you're on a non-idmapped mount or checking the raw inode, okay bestie?
π§ SEE ALSO π§
- Kernel file
./fs/stat.c fill_mg_cmtime(9)generic_fill_statx_attr(9)generic_fill_statx_atomic_writes(9)vfs_getattr_nosec(9)vfs_fstat(9)vfs_statx(9)sys_statx(9)
and that's the whole page bestie, ily, go fill some attributes πβ¨
this cutie lives under ./fs, dated October 2026 β mwah, slay, see you in the kernel ππ¦
π¦ 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