blk_rq_dma_map_iter_start(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… blk_rq_dma_map_iter_start(9) β€” Kernel API Manual

okay bestie, welcome to the Kernel API Manual ✨ this one's a (9) page, aka the good stuff, and it's literally about kicking off DMA mapping for a request. sit down, hydrate, let's go 🫢


✨ NAME ✨

blk_rq_dma_map_iter_start β€” map the first DMA segment for a request πŸŽ€


🌸 SYNOPSIS 🌸

bool blk_rq_dma_map_iter_start (struct request *req , struct device
*dma_dev , struct dma_iova_state *state , struct blk_dma_iter *iter );

like, yes, it's a bool. it's giving "did this work or not" energy πŸ’€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • req β€” the request you wanna map. the main character, fr fr πŸ‘‘
  • dma_dev β€” the device you're mapping it to. where it's all going πŸ’«
  • state β€” the DMA IOVA state. bestie, you gotta hold onto this one, more on that below πŸ™ˆ
  • iter β€” the block layer DMA iterator. lives in the moment, only needed at map time ⭐

πŸ’– DESCRIPTION πŸ’–

so here's the vibe: this starts the DMA mapping of req to dma_dev. easy.

now the cute part β€” state and iter are provided by the caller and they don't need to be initialized. love that for you, no setup arc required ✨ but heads up: state needs to be stored so you can use it at unmap time, while iter is only needed at map time. write that down, iykyk πŸŽ€

it returns false if there's no segment to map β€” and yes, that includes when it's false because of an error 😭 β€” or true if it did map a segment. periodt.

if a segment got mapped, the DMA address for it comes back in iter.addr and the length in iter.len. and if no segment was mapped? then the status code comes back in iter.status. simple as πŸ¦‹

after this, the caller can call blk_rq_dma_map_coalesce to check whether further segments still need mapping, or just go straight to blk_rq_dma_map_iter_next to try to map the following segments. your call, main character 🌈


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie, no cap πŸ’… it lives in ./block, dated October 2026, and this little group chat is officially over β€” go map some segments, slay πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from