make_vfsuid(9)
π make_vfsuid(9) β the Kernel API Manual, bestie edition π¦
okay so real talk, this is a page from the Kernel API Manual and honestly? it's a little icon and you're gonna get it in like two seconds. let's go β¨
β¨ NAME β¨
make_vfsuid β maps a filesystem kuid according to an idmapping π
πΈ SYNOPSIS πΈ
vfsuid_t make_vfsuid (struct mnt_idmap *idmap , struct user_namespace
*fs_userns , kuid_t kuid );
like, yes, the line break is doing its own thing, copy it exactly, no cap π
π¦ ARGUMENTS π¦
idmapβ the mount's idmapping. that's the whole vibe of this one.fs_usernsβ the filesystem's idmapping. yes it also gets an idmap, they're matching β¨kuidβ thekuidto be mapped. that's the lil guy we're remapping π₯Ί
π DESCRIPTION π
So here's the tea: you take a kuid and you remap it from fs_userns into idmap. that's it, that's the function. π
Use this function when you're preparing a kuid to be reported to userspace. that's literally its whole job, bestie. it's giving middle-management-for-uids energy but like, in a good way π
now the fun part, the shortcuts π:
- If
initial_idmappingdetermines that this is not an idmapped mount, we can simply returnkuidunchanged. no work, no drama, we just hand it back π«Ά - If
initial_idmappingtells us that the filesystem is not mounted with an idmapping, we know the value ofkuidwon't change when callingfrom_kuidβ so we can simply retrieve the value via__kuid_valdirectly. efficient queen behavior β
π₯ RETURN π₯
returns the kuid mapped according to idmap. slay.
but heads up π β if kuid has no mapping in either idmap or fs_userns, you get INVALID_UID back. that's the "no thoughts, head empty" result. don't say I didn't warn you π
π SEE ALSO π
- Kernel file
./fs/mnt_idmapping.c initial_idmapping(9)make_vfsgid(9)from_vfsuid(9)from_vfsgid(9)vfsgid_in_group_p(9)mnt_idmap_get(9)mnt_idmap_put(9)
the whole friend group, all linked, all iconic π
and that's the page!! this one lives at ./fs, stamped October 2026, and it's literally the make_vfsuid(9) page from the Kernel API Manual β go read the friends, mwah ππ§β¨
π¦ 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