make_vfsgid(9)
β¨ make_vfsgid(9) β¨
okay so bestie, welcome to the Kernel API Manual page for make_vfsgid β she's a section 9 function and she's literally here to map a filesystem kgid according to an idmapping π
πΈ NAME πΈ
make_vfsgid β map a filesystem kgid according to an idmapping π«Ά
π SYNOPSIS π
vfsgid_t make_vfsgid (struct mnt_idmap *idmap , struct user_namespace
*fs_userns , kgid_t kgid );
like, three args, no drama β¨
π¦ ARGUMENTS π¦
idmapβ the mount's idmapping π this is the one we're remapping into.fs_usernsβ the filesystem's idmapping π this is where thekgidis coming from.kgidβ the actualkgidto be mapped π the little guy getting translated.
π DESCRIPTION π
Take a kgid and remap it from fs_userns into idmap. Use this function when you're preparing a kgid to be reported to userspace β that's the whole vibe, that's the assignment π
Now the fast paths, because she's efficient:
- If
initial_idmappingdetermines that this is not an idmapped mount, we can simply returnkgidunchanged. no cap, nothing to do, we're done π - If
initial_idmappingtells us that the filesystem is not mounted with an idmapping, we know the value ofkgidwon't change when callingfrom_kgid, so we can simply retrieve the value via__kgid_valdirectly π₯ lowkey a shortcut, highkey correct.
bestie please note: initial_idmapping is the vibe check that decides which path we take β don't sleep on it π
β RETURN β
kgid mapped according to idmap. π
But β and this is the important part β if kgid has no mapping in either idmap or fs_userns, then INVALID_GID is returned. π that's the sad path, that's the "she doesn't know her" path.
π SEE ALSO π
Kernel file ./fs/mnt_idmapping.c, plus the whole friend group:
initial_idmapping(9)make_vfsuid(9)from_vfsuid(9)from_vfsgid(9)vfsgid_in_group_p(9)mnt_idmap_get(9)mnt_idmap_put(9)
and that's the page, bestie!! π§ this one lives in ./fs and she's dated October 2026 β slay, go map some gids 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