Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ac0ae06 authored by Denis ChengRq's avatar Denis ChengRq Committed by Jens Axboe
Browse files

bio: make use of bvec_nr_vecs



Since introduced in 7ba1ba12, it should be made use of.

Signed-off-by: default avatarDenis ChengRq <crquan@gmail.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent ba198efb
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -77,11 +77,8 @@ struct bio_vec *bvec_alloc_bs(gfp_t gfp_mask, int nr, unsigned long *idx, struct
	 */

	bvl = mempool_alloc(bs->bvec_pools[*idx], gfp_mask);
	if (bvl) {
		struct biovec_slab *bp = bvec_slabs + *idx;

		memset(bvl, 0, bp->nr_vecs * sizeof(struct bio_vec));
	}
	if (bvl)
		memset(bvl, 0, bvec_nr_vecs(*idx) * sizeof(struct bio_vec));

	return bvl;
}
@@ -149,7 +146,7 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs)
				goto out;
			}
			bio->bi_flags |= idx << BIO_POOL_OFFSET;
			bio->bi_max_vecs = bvec_slabs[idx].nr_vecs;
			bio->bi_max_vecs = bvec_nr_vecs(idx);
		}
		bio->bi_io_vec = bvl;
	}