Commit d3f761104b097738932afcc310fbbbbfb007ef92
1 parent
f735b5eeb9
Exists in
master
and in
4 other branches
bio: get rid of bio_vec clearing
We don't need to clear the memory used for adding bio_vec entries, since nobody should be looking at members unitialized. Any valid use should be below bio->bi_vcnt, and that members up until that count must be valid since they were added through bio_add_page(). Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Showing 1 changed file with 1 additions and 5 deletions Side-by-side Diff
fs/bio.c
... | ... | @@ -180,7 +180,7 @@ |
180 | 180 | * kzalloc() for the exact number of vecs right away. |
181 | 181 | */ |
182 | 182 | if (!bs) |
183 | - bvl = kzalloc(nr * sizeof(struct bio_vec), gfp_mask); | |
183 | + bvl = kmalloc(nr * sizeof(struct bio_vec), gfp_mask); | |
184 | 184 | |
185 | 185 | /* |
186 | 186 | * see comment near bvec_array define! |
... | ... | @@ -237,9 +237,6 @@ |
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
240 | - if (bvl) | |
241 | - memset(bvl, 0, bvec_nr_vecs(*idx) * sizeof(struct bio_vec)); | |
242 | - | |
243 | 240 | return bvl; |
244 | 241 | } |
245 | 242 | |
... | ... | @@ -325,7 +322,6 @@ |
325 | 322 | idx = 0; |
326 | 323 | bvl = bio->bi_inline_vecs; |
327 | 324 | nr_iovecs = BIO_INLINE_VECS; |
328 | - memset(bvl, 0, BIO_INLINE_VECS * sizeof(*bvl)); | |
329 | 325 | } else { |
330 | 326 | bvl = bvec_alloc_bs(gfp_mask, nr_iovecs, &idx, |
331 | 327 | bs); |