Lines Matching refs:iter
89 #define for_each_sg_page(sgl, iter, nents, pgoffset) \
90 for (_sg_iter_init(sgl, iter, nents, pgoffset); \
91 (iter)->sg; _sg_iter_next(iter))
92 #define for_each_sg_dma_page(sgl, iter, nents, pgoffset) \
93 for_each_sg_page(sgl, &(iter)->base, nents, pgoffset)
95 #define for_each_sg(sglist, sg, sgmax, iter) \
96 for (iter = 0, sg = (sglist); iter < (sgmax); iter++, sg = sg_next(sg))
388 _sg_iter_next(struct sg_page_iter *iter)
393 sg = iter->sg;
396 ++iter->sg_pgoffset;
397 while (iter->sg_pgoffset >= pgcount) {
398 iter->sg_pgoffset -= pgcount;
400 --iter->maxents;
401 if (sg == NULL || iter->maxents == 0)
405 iter->sg = sg;
446 _sg_iter_init(struct scatterlist *sgl, struct sg_page_iter *iter,
450 iter->sg = sgl;
451 iter->sg_pgoffset = pgoffset - 1;
452 iter->maxents = nents;
453 _sg_iter_next(iter);
455 iter->sg = NULL;
456 iter->sg_pgoffset = 0;
457 iter->maxents = 0;