Lines Matching refs:nents

47 	int nents;
48 for (nents = 0; sg; sg = sg_next(sg))
49 nents++;
50 return nents;
70 int nents;
76 for (nents = 0, total = 0; sg; sg = sg_next(sg)) {
77 nents++;
80 return nents;
90 * @nents: Number of entries in the scatterlist
97 * the important bit is that @nents@ denotes the number of entries that
101 struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents)
106 for_each_sg(sgl, sg, nents, i)
117 * @nents: Number of entries in table
124 void sg_init_table(struct scatterlist *sgl, unsigned int nents)
126 memset(sgl, 0, sizeof(*sgl) * nents);
127 sg_init_marker(sgl, nents);
149 static struct scatterlist *sg_kmalloc(unsigned int nents, gfp_t gfp_mask)
151 if (nents == SG_MAX_SINGLE_ALLOC) {
165 return kmalloc_array(nents, sizeof(struct scatterlist),
169 static void sg_kfree(struct scatterlist *sg, unsigned int nents)
171 if (nents == SG_MAX_SINGLE_ALLOC) {
248 * @nents: Number of entries in sg list
256 * This function returns a @table @nents long. The allocator is
258 * Thus if @nents is bigger than @max_ents, the scatterlists will be
266 int __sg_alloc_table(struct sg_table *table, unsigned int nents,
278 if (nents == 0)
281 if (WARN_ON_ONCE(nents > max_ents))
285 left = nents;
312 table->nents = ++table->orig_nents;
318 table->nents = table->orig_nents += sg_size;
347 * @nents: Number of entries in sg list
351 * Allocate and initialize an sg table. If @nents@ is larger than
355 int sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask)
359 ret = __sg_alloc_table(table, nents, SG_MAX_SINGLE_ALLOC,
394 table->nents = 0;
517 sgt->nents += added_nents;
631 * @nents: Maximum number of elements to free
636 * freed separately then it's essential to set nents correctly to avoid that a
638 * - All pages in a chained scatterlist can be freed at once by setting @nents
641 void sgl_free_n_order(struct scatterlist *sgl, int nents, int order)
647 for_each_sg(sgl, sg, nents, i) {
682 struct scatterlist *sglist, unsigned int nents,
686 piter->__nents = nents;
747 * @nents: number of sg entries
756 unsigned int nents, unsigned int flags)
760 __sg_page_iter_start(&miter->piter, sgl, nents, 0);
911 * @nents: Number of SG entries
921 size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
933 sg_miter_start(&miter, sgl, nents, sg_flags);
960 * @nents: Number of SG entries
967 size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents,
970 return sg_copy_buffer(sgl, nents, (void *)buf, buflen, 0, false);
977 * @nents: Number of SG entries
984 size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents,
987 return sg_copy_buffer(sgl, nents, buf, buflen, 0, true);
994 * @nents: Number of SG entries
1002 size_t sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents,
1005 return sg_copy_buffer(sgl, nents, (void *)buf, buflen, skip, false);
1012 * @nents: Number of SG entries
1020 size_t sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents,
1023 return sg_copy_buffer(sgl, nents, buf, buflen, skip, true);
1030 * @nents: Number of SG entries
1036 size_t sg_zero_buffer(struct scatterlist *sgl, unsigned int nents,
1043 sg_miter_start(&miter, sgl, nents, sg_flags);