from_kqid(9)
β¨ 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.
β οΈ Ifkqidhas no mapping intarg(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 π
- Kernel file
./fs/quota/kqid.cβ the source, go read it, it ate π qid_eq(9)qid_lt(9)from_kqid_munged(9)qid_valid(9)
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
- 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