generic_fillattr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the inode was found from 🫢
  • request_mask β€” statx request_mask, literally what you're asking for
  • inode β€” 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 the idmap wrong and your uid/gid mapping is gonna be a whole mess 😭 pick nop_mnt_idmap when you're on a non-idmapped mount or checking the raw inode, okay bestie?

🧚 SEE ALSO 🧚


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