]> www.infradead.org Git - users/hch/block.git/commit
blk-mq: add a dma mapping iterator
authorChristoph Hellwig <hch@lst.de>
Sat, 5 Oct 2024 04:31:50 +0000 (06:31 +0200)
committerChristoph Hellwig <hch@lst.de>
Sat, 5 Oct 2024 17:19:34 +0000 (19:19 +0200)
commit8273e482f73d244c61a750e8b3757429c3d898df
treea455153cc6900a5b6adc6bef0332ea8440865261
parent4efd58fca48c18675130589882ca529988ede443
blk-mq: add a dma mapping iterator

blk_rq_map_sg is maze of nested loops.  Untangle it by creating an
iterator that returns [paddr,len] tuples for DMA mapping, and then
implement the DMA logic on top of this.  This not only removes code
at the source level, but also generates nicer binary code:

$ size block/blk-merge.o.*
   text    data     bss     dec     hex filename
  10001     432       0   10433    28c1 block/blk-merge.o.new
  10317     468       0   10785    2a21 block/blk-merge.o.old

Last but not least it will be used as a building block for a new
DMA mapping helper that doesn't rely on struct scatterlist.

Signed-off-by: Christoph Hellwig <hch@lst.de>
block/blk-merge.c