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