Lines Matching refs:nr_vecs

34 	int nr_vecs;  member
38 { .nr_vecs = 16, .name = "biovec-16" },
39 { .nr_vecs = 64, .name = "biovec-64" },
40 { .nr_vecs = 128, .name = "biovec-128" },
41 { .nr_vecs = BIO_MAX_VECS, .name = "biovec-max" },
44 static struct biovec_slab *biovec_slab(unsigned short nr_vecs) in biovec_slab() argument
46 switch (nr_vecs) { in biovec_slab()
158 void bvec_free(mempool_t *pool, struct bio_vec *bv, unsigned short nr_vecs) in bvec_free() argument
160 BUG_ON(nr_vecs > BIO_MAX_VECS); in bvec_free()
162 if (nr_vecs == BIO_MAX_VECS) in bvec_free()
164 else if (nr_vecs > BIO_INLINE_VECS) in bvec_free()
165 kmem_cache_free(biovec_slab(nr_vecs)->slab, bv); in bvec_free()
178 struct bio_vec *bvec_alloc(mempool_t *pool, unsigned short *nr_vecs, in bvec_alloc() argument
181 struct biovec_slab *bvs = biovec_slab(*nr_vecs); in bvec_alloc()
190 *nr_vecs = bvs->nr_vecs; in bvec_alloc()
197 if (*nr_vecs < BIO_MAX_VECS) { in bvec_alloc()
203 *nr_vecs = BIO_MAX_VECS; in bvec_alloc()
412 unsigned short nr_vecs, blk_opf_t opf, gfp_t gfp, in bio_alloc_percpu_cache() argument
428 bio_init(bio, bdev, nr_vecs ? bio->bi_inline_vecs : NULL, nr_vecs, opf); in bio_alloc_percpu_cache()
470 struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs, in bio_alloc_bioset() argument
479 if (WARN_ON_ONCE(!mempool_initialized(&bs->bvec_pool) && nr_vecs > 0)) in bio_alloc_bioset()
483 if (bs->cache && nr_vecs <= BIO_INLINE_VECS) { in bio_alloc_bioset()
484 bio = bio_alloc_percpu_cache(bdev, nr_vecs, opf, in bio_alloc_bioset()
531 if (nr_vecs > BIO_INLINE_VECS) { in bio_alloc_bioset()
534 bvl = bvec_alloc(&bs->bvec_pool, &nr_vecs, gfp_mask); in bio_alloc_bioset()
538 bvl = bvec_alloc(&bs->bvec_pool, &nr_vecs, gfp_mask); in bio_alloc_bioset()
543 bio_init(bio, bdev, bvl, nr_vecs, opf); in bio_alloc_bioset()
544 } else if (nr_vecs) { in bio_alloc_bioset()
575 struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask) in bio_kmalloc() argument
579 if (nr_vecs > UIO_MAXIOV) in bio_kmalloc()
581 return kmalloc(struct_size(bio, bi_inline_vecs, nr_vecs), gfp_mask); in bio_kmalloc()
1742 bvs->nr_vecs * sizeof(struct bio_vec), 0, in init_bio()