bio: make use of bvec_nr_vecs

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

Signed-off-by: Denis ChengRq <crquan@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by Denis ChengRq and committed by Jens Axboe 1ac0ae06 ba198efb

+3 -6
+3 -6
fs/bio.c
··· 77 77 */ 78 78 79 79 bvl = mempool_alloc(bs->bvec_pools[*idx], gfp_mask); 80 - if (bvl) { 81 - struct biovec_slab *bp = bvec_slabs + *idx; 82 - 83 - memset(bvl, 0, bp->nr_vecs * sizeof(struct bio_vec)); 84 - } 80 + if (bvl) 81 + memset(bvl, 0, bvec_nr_vecs(*idx) * sizeof(struct bio_vec)); 85 82 86 83 return bvl; 87 84 } ··· 146 149 goto out; 147 150 } 148 151 bio->bi_flags |= idx << BIO_POOL_OFFSET; 149 - bio->bi_max_vecs = bvec_slabs[idx].nr_vecs; 152 + bio->bi_max_vecs = bvec_nr_vecs(idx); 150 153 } 151 154 bio->bi_io_vec = bvl; 152 155 }