diff options
author | Denis ChengRq <crquan@gmail.com> | 2008-08-04 05:56:30 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-08-06 06:30:04 -0400 |
commit | 1ac0ae062cecd37587f5b951089f90e1d9d91769 (patch) | |
tree | 87c622f207ade7854abeb077acacd3fcd5761501 /fs/bio.c | |
parent | ba198efb5ef4e5f4927a18ff95a58f40c58cbaa9 (diff) |
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>
Diffstat (limited to 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -77,11 +77,8 @@ struct bio_vec *bvec_alloc_bs(gfp_t gfp_mask, int nr, unsigned long *idx, struct | |||
77 | */ | 77 | */ |
78 | 78 | ||
79 | bvl = mempool_alloc(bs->bvec_pools[*idx], gfp_mask); | 79 | bvl = mempool_alloc(bs->bvec_pools[*idx], gfp_mask); |
80 | if (bvl) { | 80 | if (bvl) |
81 | struct biovec_slab *bp = bvec_slabs + *idx; | 81 | memset(bvl, 0, bvec_nr_vecs(*idx) * sizeof(struct bio_vec)); |
82 | |||
83 | memset(bvl, 0, bp->nr_vecs * sizeof(struct bio_vec)); | ||
84 | } | ||
85 | 82 | ||
86 | return bvl; | 83 | return bvl; |
87 | } | 84 | } |
@@ -149,7 +146,7 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs) | |||
149 | goto out; | 146 | goto out; |
150 | } | 147 | } |
151 | bio->bi_flags |= idx << BIO_POOL_OFFSET; | 148 | bio->bi_flags |= idx << BIO_POOL_OFFSET; |
152 | bio->bi_max_vecs = bvec_slabs[idx].nr_vecs; | 149 | bio->bi_max_vecs = bvec_nr_vecs(idx); |
153 | } | 150 | } |
154 | bio->bi_io_vec = bvl; | 151 | bio->bi_io_vec = bvl; |
155 | } | 152 | } |