__mmc_claim_host(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __mmc_claim_host β€” like, the exclusive-host-claiming one πŸ’…

okay so this is a page from the Kernel API Manual bestie, and it's all about __mmc_claim_host β€” the function that goes "this host is MINE" exclusively. no sharing, no splitting, periodt. πŸ‘‘


✨ NAME ✨

__mmc_claim_host β€” exclusively claim a host 🫢


🌸 SYNOPSIS 🌸

int __mmc_claim_host (struct mmc_host *host , struct mmc_ctx *ctx ,
       atomic_t *abort );

literally that's the whole signature, no cap ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • host β€” the mmc host you're claiming, bestie. this is the actual thing you want πŸ’–
  • ctx β€” the context that claims the host. or NULL, in which case the default context gets used instead (lowkey convenient ngl) πŸ™ˆ
  • abort β€” whether or not the operation should be aborted. yes it's a whole "should we bail" situation πŸƒβ€β™€οΈ

πŸ¦‹ DESCRIPTION πŸ¦‹

so you're claiming a host for a set of operations. main character energy only, one at a time πŸŽ€

here's the tea though: if abort is non-null and dereferences to a non-zero value, then this will return prematurely with that non-zero value without acquiring the lock. like it just leaves, no lock, nothing. πŸ’€

otherwise? it returns zero with the lock held. so like, zero means you got it, you're holding the lock, slay πŸ’…

fr fr double-check that abort situation before you go assuming you've got the lock β€” a premature return means no lock at all, and that's the kind of thing that ruins your whole day 😭

🌈 SEE ALSO 🌈

the kernel file ./drivers/mmc/core/core.c says hi, and so do all these besties:

go read them, they're iconic too πŸ‘‘


okay that's the whole page, mwah πŸ’– this one came out of ./drivers/mmc/core, dated October 2026, and it's filed under __mmc_claim_host(9) β€” take care of her, she holds locks 🫢✨

πŸ“¦ where this page comes from