Lines Matching defs:nr_vecs
41 int nr_vecs;
45 { .nr_vecs = 16, .name = "biovec-16" },
46 { .nr_vecs = 64, .name = "biovec-64" },
47 { .nr_vecs = 128, .name = "biovec-128" },
48 { .nr_vecs = BIO_MAX_VECS, .name = "biovec-max" },
51 static struct biovec_slab *biovec_slab(unsigned short nr_vecs)
53 switch (nr_vecs) {
504 * @nr_vecs: number of bvecs to pre-allocate
535 struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
543 /* should not use nobvec bioset for nr_vecs > 0 */
544 if (WARN_ON_ONCE(!mempool_initialized(&bs->bvec_pool) && nr_vecs > 0))
549 if (bs->cache && nr_vecs <= BIO_INLINE_VECS) {
563 if (bio && nr_vecs > BIO_INLINE_VECS) {
564 struct biovec_slab *bvs = biovec_slab(nr_vecs);
567 * Upgrade nr_vecs to take full advantage of the allocation.
570 nr_vecs = bvs->nr_vecs;
596 if (nr_vecs > BIO_INLINE_VECS) {
597 nr_vecs = BIO_MAX_VECS;
602 if (nr_vecs && nr_vecs <= BIO_INLINE_VECS)
603 bio_init_inline(bio, bdev, nr_vecs, opf);
605 bio_init(bio, bdev, bvecs, nr_vecs, opf);
613 * @nr_vecs: number of bio_vecs to allocate
627 struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask)
631 if (nr_vecs > BIO_MAX_INLINE_VECS)
633 return kmalloc(sizeof(*bio) + nr_vecs * sizeof(struct bio_vec),
2000 bvs->nr_vecs * sizeof(struct bio_vec), 0,