make_vfsuid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the kuid to 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_idmapping determines that this is not an idmapped mount, we can simply return kuid unchanged. no work, no drama, we just hand it back 🫢
  • If initial_idmapping tells us that the filesystem is not mounted with an idmapping, we know the value of kuid won't change when calling from_kuid β€” so we can simply retrieve the value via __kuid_val directly. 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 πŸ‘‘

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