find_sub_ctxt(9)
β¨ find_sub_ctxt(9) β¨
okay so this is a page from the Kernel API Manual β yes bestie, the kernel has lore too π
and today's main character is find_sub_ctxt. Let's get into it π«Ά
πΈ NAME πΈ
find_sub_ctxt β fund sub-context
(it's giving "short and mysterious," and honestly? iconic.)
π SYNOPSIS π
int find_sub_ctxt (struct hfi1_filedata *fd , const struct
hfi1_user_info *uinfo );
π¦ ARGUMENTS π¦
fdβ a valid filedata pointer. literally has to be valid, no cap πuinfoβ the matching info you use to find a possible context to share.
π DESCRIPTION π
So here's the vibe check: the hfi1_mutex must be held when this function is called. Not optional, not "ehhh maybe," it's a whole requirement π₯
Why? Because it's necessary to ensure serialized creation of shared contexts. Like, no two of them racing in there at the same time β we keep that line single-file, periodt π
β RETURN β
0β no sub-context found π1β subcontext found and allocated π slayerrno:EINVALβ incorrect parameters πEBUSYβ all sub contexts in use π sorry bestie, they're all taken
π SEE ALSO π
Kernel file ./drivers/infiniband/hw/hfi1/file_ops.c, plus the whole friend group ππ
complete_subctxt(9)match_ctxt(9)user_exp_rcv_setup(9)user_exp_rcv_clear(9)user_exp_rcv_invalid(9)manage_rcvq(9)ctxt_reset(9)
and that's the page, bestie π§β¨ it lives down in ./drivers/infiniband/hw/hfi1, and this little masterpiece is dated October 2026 β future vibes only ππ go forth and hold that mutex π
π¦ 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