diff options
-rw-r--r-- | fs/bio.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -79,7 +79,6 @@ static struct bio_set *fs_bio_set; | |||
79 | static inline struct bio_vec *bvec_alloc_bs(gfp_t gfp_mask, int nr, unsigned long *idx, struct bio_set *bs) | 79 | static inline struct bio_vec *bvec_alloc_bs(gfp_t gfp_mask, int nr, unsigned long *idx, struct bio_set *bs) |
80 | { | 80 | { |
81 | struct bio_vec *bvl; | 81 | struct bio_vec *bvl; |
82 | struct biovec_slab *bp; | ||
83 | 82 | ||
84 | /* | 83 | /* |
85 | * see comment near bvec_array define! | 84 | * see comment near bvec_array define! |
@@ -98,10 +97,12 @@ static inline struct bio_vec *bvec_alloc_bs(gfp_t gfp_mask, int nr, unsigned lon | |||
98 | * idx now points to the pool we want to allocate from | 97 | * idx now points to the pool we want to allocate from |
99 | */ | 98 | */ |
100 | 99 | ||
101 | bp = bvec_slabs + *idx; | ||
102 | bvl = mempool_alloc(bs->bvec_pools[*idx], gfp_mask); | 100 | bvl = mempool_alloc(bs->bvec_pools[*idx], gfp_mask); |
103 | if (bvl) | 101 | if (bvl) { |
102 | struct biovec_slab *bp = bvec_slabs + *idx; | ||
103 | |||
104 | memset(bvl, 0, bp->nr_vecs * sizeof(struct bio_vec)); | 104 | memset(bvl, 0, bp->nr_vecs * sizeof(struct bio_vec)); |
105 | } | ||
105 | 106 | ||
106 | return bvl; | 107 | return bvl; |
107 | } | 108 | } |
@@ -166,7 +167,7 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs) | |||
166 | 167 | ||
167 | bio_init(bio); | 168 | bio_init(bio); |
168 | if (likely(nr_iovecs)) { | 169 | if (likely(nr_iovecs)) { |
169 | unsigned long idx; | 170 | unsigned long idx = 0; /* shut up gcc */ |
170 | 171 | ||
171 | bvl = bvec_alloc_bs(gfp_mask, nr_iovecs, &idx, bs); | 172 | bvl = bvec_alloc_bs(gfp_mask, nr_iovecs, &idx, bs); |
172 | if (unlikely(!bvl)) { | 173 | if (unlikely(!bvl)) { |