On Mon, Jan 26, 2015 at 10:02:30AM +0800, Ming Lei wrote: > >> Sorry, I have one question: I understand one bvec should only cover > >> one page, but > >> one sg may cover lots of pages, so could ITER_BVEC handle that correctly? > > > > Each scatterlist entry only contains a single page, which is returned > > I mean scatterlist does not guarantee that, and one sg entry often > contains lots of pages, which DMA/bus address is continuous. But we still get away with using page_address(), so from the VM point of view that matters here it's the same as a single high order page. > > by sg_page(sg). The existing code already relies on it because it > > kmaps that page. > > If the existing target code path can guarantee that one sg entry > only contains one page, it should be better to use bio_vec explicitly > instead of scatterlist. While it allocates a single page per SGL entry (see target_alloc_sgl), it uses the scatterlist to allow drivers to dma map it for hardware access, so a scatterlist seems useful here. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html