blk_mq_rq_from_pdu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ blk_mq_rq_from_pdu ✨

okay bestie, welcome to the blk_mq_rq_from_pdu(9) page from the Kernel API Manual πŸ’… this one is short and sweet and honestly kind of iconic β€” it's the little reverse-magic trick where you get your request back out of a PDU πŸŽ€


🌸 NAME 🌸

blk_mq_rq_from_pdu β€” cast a PDU to a request ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

struct request * blk_mq_rq_from_pdu (void *pdu );

πŸ’– ARGUMENTS πŸ’–

  • pdu β€” the PDU (Protocol Data Unit) to be casted 🫢 this is the thing you're handing over so it can get turned back into a request

⭐ RETURN ⭐

request β€” that's what you get back, no cap πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the vibe check: driver command data is immediately after the request. literally right behind it, following it in memory 🧚

so to get back to the original request, you subtract the request size. that's it. that's the whole trick. math but make it slay πŸ”₯


🌈 SEE ALSO 🌈


lowkey the whole page is like six lines and I'm obsessed with it for that πŸ™ˆ go read the friends listed above if you want the full lore, iykyk πŸ’œ

and that's the whole thing bestie!! πŸ“ this little cutie lives in ./include/linux and the page is dated October 2026 β€” signed off with love by blk_mq_rq_from_pdu(9) herself πŸ’Œ βœ¨πŸŽ€

πŸ“¦ where this page comes from