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

Signed-off-by: Denis ChengRq <crquan@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
Denis ChengRq 2008-08-04 11:56:30 +02:00 коммит произвёл Jens Axboe
Родитель ba198efb5e
Коммит 1ac0ae062c
1 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -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); bvl = mempool_alloc(bs->bvec_pools[*idx], gfp_mask);
if (bvl) { if (bvl)
struct biovec_slab *bp = bvec_slabs + *idx; memset(bvl, 0, bvec_nr_vecs(*idx) * sizeof(struct bio_vec));
memset(bvl, 0, bp->nr_vecs * sizeof(struct bio_vec));
}
return bvl; return bvl;
} }
@ -149,7 +146,7 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs)
goto out; goto out;
} }
bio->bi_flags |= idx << BIO_POOL_OFFSET; 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; bio->bi_io_vec = bvl;
} }