Lines Matching refs:nr_vecs

38 	int nr_vecs;  member
42 { .nr_vecs = 16, .name = "biovec-16" },
43 { .nr_vecs = 64, .name = "biovec-64" },
44 { .nr_vecs = 128, .name = "biovec-128" },
45 { .nr_vecs = BIO_MAX_VECS, .name = "biovec-max" },
48 static struct biovec_slab *biovec_slab(unsigned short nr_vecs) in biovec_slab() argument
50 switch (nr_vecs) { in biovec_slab()
162 void bvec_free(mempool_t *pool, struct bio_vec *bv, unsigned short nr_vecs) in bvec_free() argument
164 BUG_ON(nr_vecs > BIO_MAX_VECS); in bvec_free()
166 if (nr_vecs == BIO_MAX_VECS) in bvec_free()
168 else if (nr_vecs > BIO_INLINE_VECS) in bvec_free()
169 kmem_cache_free(biovec_slab(nr_vecs)->slab, bv); in bvec_free()
182 struct bio_vec *bvec_alloc(mempool_t *pool, unsigned short *nr_vecs, in bvec_alloc() argument
185 struct biovec_slab *bvs = biovec_slab(*nr_vecs); in bvec_alloc()
194 *nr_vecs = bvs->nr_vecs; in bvec_alloc()
201 if (*nr_vecs < BIO_MAX_VECS) { in bvec_alloc()
207 *nr_vecs = BIO_MAX_VECS; in bvec_alloc()
444 unsigned short nr_vecs, blk_opf_t opf, gfp_t gfp, in bio_alloc_percpu_cache() argument
464 bio_init(bio, bdev, nr_vecs ? bio->bi_inline_vecs : NULL, nr_vecs, opf); in bio_alloc_percpu_cache()
503 struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs, in bio_alloc_bioset() argument
512 if (WARN_ON_ONCE(!mempool_initialized(&bs->bvec_pool) && nr_vecs > 0)) in bio_alloc_bioset()
516 if (bs->cache && nr_vecs <= BIO_INLINE_VECS) { in bio_alloc_bioset()
517 bio = bio_alloc_percpu_cache(bdev, nr_vecs, opf, in bio_alloc_bioset()
566 if (nr_vecs > BIO_INLINE_VECS) { in bio_alloc_bioset()
569 bvl = bvec_alloc(&bs->bvec_pool, &nr_vecs, gfp_mask); in bio_alloc_bioset()
573 bvl = bvec_alloc(&bs->bvec_pool, &nr_vecs, gfp_mask); in bio_alloc_bioset()
578 bio_init(bio, bdev, bvl, nr_vecs, opf); in bio_alloc_bioset()
579 } else if (nr_vecs) { in bio_alloc_bioset()
610 struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask) in bio_kmalloc() argument
614 if (nr_vecs > BIO_MAX_INLINE_VECS) in bio_kmalloc()
616 return kmalloc(struct_size(bio, bi_inline_vecs, nr_vecs), gfp_mask); in bio_kmalloc()
1746 bvs->nr_vecs * sizeof(struct bio_vec), 0, in init_bio()