Lines Matching refs:nents

49 	int nents;  in sg_nents()  local
50 for (nents = 0; sg; sg = sg_next(sg)) in sg_nents()
51 nents++; in sg_nents()
52 return nents; in sg_nents()
72 int nents; in sg_nents_for_len() local
78 for (nents = 0, total = 0; sg; sg = sg_next(sg)) { in sg_nents_for_len()
79 nents++; in sg_nents_for_len()
82 return nents; in sg_nents_for_len()
103 struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents) in sg_last() argument
108 for_each_sg(sgl, sg, nents, i) in sg_last()
126 void sg_init_table(struct scatterlist *sgl, unsigned int nents) in sg_init_table() argument
128 memset(sgl, 0, sizeof(*sgl) * nents); in sg_init_table()
129 sg_init_marker(sgl, nents); in sg_init_table()
151 static struct scatterlist *sg_kmalloc(unsigned int nents, gfp_t gfp_mask) in sg_kmalloc() argument
153 if (nents == SG_MAX_SINGLE_ALLOC) { in sg_kmalloc()
167 return kmalloc_array(nents, sizeof(struct scatterlist), in sg_kmalloc()
171 static void sg_kfree(struct scatterlist *sg, unsigned int nents) in sg_kfree() argument
173 if (nents == SG_MAX_SINGLE_ALLOC) { in sg_kfree()
285 int __sg_alloc_table(struct sg_table *table, unsigned int nents, in __sg_alloc_table() argument
297 if (nents == 0) in __sg_alloc_table()
300 if (WARN_ON_ONCE(nents > max_ents)) in __sg_alloc_table()
304 left = nents; in __sg_alloc_table()
331 table->nents = ++table->orig_nents; in __sg_alloc_table()
337 table->nents = table->orig_nents += sg_size; in __sg_alloc_table()
374 int sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask) in sg_alloc_table() argument
378 ret = __sg_alloc_table(table, nents, SG_MAX_SINGLE_ALLOC, in sg_alloc_table()
545 sgt_append->sgt.nents += added_nents; in sg_alloc_append_table_from_pages()
546 sgt_append->sgt.orig_nents = sgt_append->sgt.nents; in sg_alloc_append_table_from_pages()
685 void sgl_free_n_order(struct scatterlist *sgl, int nents, int order) in sgl_free_n_order() argument
691 for_each_sg(sgl, sg, nents, i) { in sgl_free_n_order()
726 struct scatterlist *sglist, unsigned int nents, in __sg_page_iter_start() argument
730 piter->__nents = nents; in __sg_page_iter_start()
801 unsigned int nents, unsigned int flags) in sg_miter_start() argument
805 __sg_page_iter_start(&miter->piter, sgl, nents, 0); in sg_miter_start()
962 size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf, in sg_copy_buffer() argument
974 sg_miter_start(&miter, sgl, nents, sg_flags); in sg_copy_buffer()
1008 size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents, in sg_copy_from_buffer() argument
1011 return sg_copy_buffer(sgl, nents, (void *)buf, buflen, 0, false); in sg_copy_from_buffer()
1025 size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents, in sg_copy_to_buffer() argument
1028 return sg_copy_buffer(sgl, nents, buf, buflen, 0, true); in sg_copy_to_buffer()
1043 size_t sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents, in sg_pcopy_from_buffer() argument
1046 return sg_copy_buffer(sgl, nents, (void *)buf, buflen, skip, false); in sg_pcopy_from_buffer()
1061 size_t sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents, in sg_pcopy_to_buffer() argument
1064 return sg_copy_buffer(sgl, nents, buf, buflen, skip, true); in sg_pcopy_to_buffer()
1077 size_t sg_zero_buffer(struct scatterlist *sgl, unsigned int nents, in sg_zero_buffer() argument
1084 sg_miter_start(&miter, sgl, nents, sg_flags); in sg_zero_buffer()
1113 struct scatterlist *sg = sgtable->sgl + sgtable->nents; in extract_user_to_sg()
1142 sgtable->nents++; in extract_user_to_sg()
1152 while (sgtable->nents > sgtable->orig_nents) in extract_user_to_sg()
1153 unpin_user_page(sg_page(&sgtable->sgl[--sgtable->nents])); in extract_user_to_sg()
1168 struct scatterlist *sg = sgtable->sgl + sgtable->nents; in extract_bvec_to_sg()
1186 sgtable->nents++; in extract_bvec_to_sg()
1214 struct scatterlist *sg = sgtable->sgl + sgtable->nents; in extract_kvec_to_sg()
1245 sgtable->nents++; in extract_kvec_to_sg()
1274 struct scatterlist *sg = sgtable->sgl + sgtable->nents; in extract_xarray_to_sg()
1297 sgtable->nents++; in extract_xarray_to_sg()