blk_rq_dma_map_iter_next(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« blk_rq_dma_map_iter_next(9) β€” the kernel API manual page, bestie edition πŸ’«

okay so this is a section 9 (kernel API) manual page for blk_rq_dma_map_iter_next, and honestly? it's giving "small function, big job." let's get into it πŸŽ€


✨ NAME ✨

blk_rq_dma_map_iter_next β€” map the next DMA segment for a request

like, literally what it says on the tin, no cap πŸ’…


🌸 SYNOPSIS 🌸

bool blk_rq_dma_map_iter_next (struct request *req , struct device
*dma_dev , struct blk_dma_iter *iter );

she takes three things and hands you back a bool. iconic signature tbh 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • req β€” the request you wanna map. yes, that request. the one right in front of you πŸ’–
  • dma_dev β€” the device you're mapping to. pick your fave, she's not judging ✨
  • iter β€” the block layer DMA iterator. the little main character holding all your state πŸŽ€

πŸ”₯ DESCRIPTION πŸ”₯

so basically: this is the "and then what?" of the DMA mapping saga. you call blk_rq_dma_map_iter_start first, and then this function iterates you along to the next mapping. if you want the full breakdown of the arguments, the manpage says to go check out blk_rq_dma_map_iter_start β€” see there for a detailed description of the arguments. iykyk πŸ’…

she returns false if there's no segment to map, and that includes when it happened because of an error 😭. she returns true if it did, in fact, map a segment. slay.

now the tea on what comes back πŸ“:

  • if a segment was mapped β†’ the DMA address for it lands in iter.addr, and the length lands in iter.len. go off, queen πŸ‘‘
  • if no segment was mapped β†’ the status code comes back to you in iter.status. that's your vibe check, read it carefully ⭐
ngl bestie, always peek at iter.status when you get a false β€” that's where the actual story is πŸ™ˆ

🌈 SEE ALSO 🌈

the kernel file ./block/blk-mq-dma.c, plus the whole friend group of related calls β€” go say hi πŸ’œ:


and that's the whole page, bestie πŸ’– this one lives under ./block in the source tree, and it's stamped October 2026 in the kernel API manual. go map some segments, you absolute icon πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from