On Sun, Jan 25, 2015 at 9:43 PM, Christoph Hellwig <hch@xxxxxx> wrote: > On Fri, Jan 23, 2015 at 10:08:01PM +0800, Ming Lei wrote: >> > >> > for_each_sg(sgl, sg, sgl_nents, i) { >> > - iov[i].iov_len = sg->length; >> > - iov[i].iov_base = kmap(sg_page(sg)) + sg->offset; >> > - } >> > + bvec[i].bv_page = sg_page(sg); >> > + bvec[i].bv_len = sg->length; >> > + bvec[i].bv_offset = sg->offset; >> >> 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. > 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. Thanks, Ming Lei -- 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