Lines Matching refs:sgl
101 struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents) in sg_last() argument
106 for_each_sg(sgl, sg, nents, i) in sg_last()
124 void sg_init_table(struct scatterlist *sgl, unsigned int nents) in sg_init_table() argument
126 memset(sgl, 0, sizeof(*sgl) * nents); in sg_init_table()
127 sg_init_marker(sgl, nents); in sg_init_table()
195 struct scatterlist *sgl, *next; in __sg_free_table() local
198 if (unlikely(!table->sgl)) in __sg_free_table()
201 sgl = table->sgl; in __sg_free_table()
213 next = sg_chain_ptr(&sgl[curr_max_ents - 1]); in __sg_free_table()
225 free_fn(sgl, alloc_size); in __sg_free_table()
226 sgl = next; in __sg_free_table()
230 table->sgl = NULL; in __sg_free_table()
327 table->sgl = sg; in __sg_alloc_table()
419 for_each_sg(sgt->sgl, s, sgt->orig_nents, i) { in __sg_alloc_table_from_pages()
490 struct scatterlist *sgl, *sg; in sgl_alloc_order() local
506 sgl = kmalloc_array(nalloc, sizeof(struct scatterlist), in sgl_alloc_order()
508 if (!sgl) in sgl_alloc_order()
511 sg_init_table(sgl, nalloc); in sgl_alloc_order()
512 sg = sgl; in sgl_alloc_order()
517 sgl_free(sgl); in sgl_alloc_order()
528 return sgl; in sgl_alloc_order()
560 void sgl_free_n_order(struct scatterlist *sgl, int nents, int order) in sgl_free_n_order() argument
566 for_each_sg(sgl, sg, nents, i) { in sgl_free_n_order()
573 kfree(sgl); in sgl_free_n_order()
582 void sgl_free_order(struct scatterlist *sgl, int order) in sgl_free_order() argument
584 sgl_free_n_order(sgl, INT_MAX, order); in sgl_free_order()
592 void sgl_free(struct scatterlist *sgl) in sgl_free() argument
594 sgl_free_order(sgl, 0); in sgl_free()
674 void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, in sg_miter_start() argument
679 __sg_page_iter_start(&miter->piter, sgl, nents, 0); in sg_miter_start()
840 size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf, in sg_copy_buffer() argument
852 sg_miter_start(&miter, sgl, nents, sg_flags); in sg_copy_buffer()
886 size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents, in sg_copy_from_buffer() argument
889 return sg_copy_buffer(sgl, nents, (void *)buf, buflen, 0, false); in sg_copy_from_buffer()
903 size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents, in sg_copy_to_buffer() argument
906 return sg_copy_buffer(sgl, nents, buf, buflen, 0, true); in sg_copy_to_buffer()
921 size_t sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents, in sg_pcopy_from_buffer() argument
924 return sg_copy_buffer(sgl, nents, (void *)buf, buflen, skip, false); in sg_pcopy_from_buffer()
939 size_t sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents, in sg_pcopy_to_buffer() argument
942 return sg_copy_buffer(sgl, nents, buf, buflen, skip, true); in sg_pcopy_to_buffer()
955 size_t sg_zero_buffer(struct scatterlist *sgl, unsigned int nents, in sg_zero_buffer() argument
962 sg_miter_start(&miter, sgl, nents, sg_flags); in sg_zero_buffer()