from_kqid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ from_kqid(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so real talk, this is a page straight out of the Kernel API Manual (from_kqid(9)) and it's genuinely such a neat little function. it takes your kernel-internal quota id and translates it into whatever user namespace you're asking about. lowkey iconic behavior. let's get into it πŸ’…


🌸 NAME 🌸

from_kqid β€” Create a qid from a kqid user-namespace pair.

like yes, that's the whole vibe: one kqid, one user-namespace pair, one freshly-made qid. slay.


πŸ¦‹ SYNOPSIS πŸ¦‹

qid_t from_kqid (struct user_namespace *targ , struct kqid kqid );

that's it. two arguments, one return value, no drama. ✨


πŸ’– ARGUMENTS πŸ’–

  • targ β€” The user namespace we want a qid in. (literally "the target," bestie, it's giving main character energy πŸ‘‘)
  • kqid β€” The kernel internal quota identifier to start with. this is the thing you're translating, the little kernel-side original 🫢

πŸ”₯ DESCRIPTION πŸ”₯

Map kqid into the user-namespace specified by targ and return the resulting qid.

fr fr, that's the whole job: you hand it a kernel-internal quota identifier plus the namespace you care about, and it hands you back the qid as seen in that namespace. no cap, it's that clean.

There is always a mapping into the initial user_namespace. 🧚 so like, worst case scenario, the initial namespace always has your back β€” there's always somewhere for that kqid to land.

⚠️ If kqid has no mapping in targ (qid_t)-1 is returned. bestie, that's the "nope, not in this namespace" answer. not an error you can ignore β€” it's literally (qid_t)-1, so check for it. πŸ™ˆ

🌈 SEE ALSO 🌈

all the qid besties, together in one friend group πŸ’œ


and that's the page!! πŸ“

cute little sign-off: this one lives in ./fs/quota, it's the from_kqid(9) page, and it's dated October 2026 β€” so mark your calendar bestie, it's from the future βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from