It's not as easy as this. Note that you can have more than one page
entry in a bio, so if you simply use bio_data() on each bio and then
jump to the next through bi_next, then you are discarding every page but
the first one.
You want to do something like this:
rq_for_each_bio(bio, rq)
bio_for_each_segment(bio_vec, bio, i)
/* handle each bio_vec */
DAC960 needs a huge cleanup to support highmem as well, Virtual_to_Bus32
and Virtual_to_Bus64, yuck, chest pains.
As a reference, read drivers/block/cciss.c for example which I've
converted to use the blk_rq_map_sg interface. Basically you don't have
to worry about any of this. You can check ide-dma.c too, note how easy
it is to setup a scatterlist mapping for DMA from a request now:
/*
* map the request into a scatterlist
*/
nr_sg_entries = blk_rq_map_sg(q, rq, sg_table);
/*
* map the scatterlist pages for streaming dma
*/
sg_nents = pci_map_sg(dev, sg_table, nr_sg_entries, data_dir);
-- Jens Axboe- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/