diff options
Diffstat (limited to 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -264,13 +264,12 @@ EXPORT_SYMBOL(bio_init); | |||
264 | * bio_alloc_bioset - allocate a bio for I/O | 264 | * bio_alloc_bioset - allocate a bio for I/O |
265 | * @gfp_mask: the GFP_ mask given to the slab allocator | 265 | * @gfp_mask: the GFP_ mask given to the slab allocator |
266 | * @nr_iovecs: number of iovecs to pre-allocate | 266 | * @nr_iovecs: number of iovecs to pre-allocate |
267 | * @bs: the bio_set to allocate from. If %NULL, just use kmalloc | 267 | * @bs: the bio_set to allocate from. |
268 | * | 268 | * |
269 | * Description: | 269 | * Description: |
270 | * bio_alloc_bioset will first try its own mempool to satisfy the allocation. | 270 | * bio_alloc_bioset will try its own mempool to satisfy the allocation. |
271 | * If %__GFP_WAIT is set then we will block on the internal pool waiting | 271 | * If %__GFP_WAIT is set then we will block on the internal pool waiting |
272 | * for a &struct bio to become free. If a %NULL @bs is passed in, we will | 272 | * for a &struct bio to become free. |
273 | * fall back to just using @kmalloc to allocate the required memory. | ||
274 | * | 273 | * |
275 | * Note that the caller must set ->bi_destructor on successful return | 274 | * Note that the caller must set ->bi_destructor on successful return |
276 | * of a bio, to do the appropriate freeing of the bio once the reference | 275 | * of a bio, to do the appropriate freeing of the bio once the reference |
@@ -555,7 +554,7 @@ static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page | |||
555 | .bi_rw = bio->bi_rw, | 554 | .bi_rw = bio->bi_rw, |
556 | }; | 555 | }; |
557 | 556 | ||
558 | if (q->merge_bvec_fn(q, &bvm, prev) < len) { | 557 | if (q->merge_bvec_fn(q, &bvm, prev) < prev->bv_len) { |
559 | prev->bv_len -= len; | 558 | prev->bv_len -= len; |
560 | return 0; | 559 | return 0; |
561 | } | 560 | } |
@@ -608,7 +607,7 @@ static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page | |||
608 | * merge_bvec_fn() returns number of bytes it can accept | 607 | * merge_bvec_fn() returns number of bytes it can accept |
609 | * at this offset | 608 | * at this offset |
610 | */ | 609 | */ |
611 | if (q->merge_bvec_fn(q, &bvm, bvec) < len) { | 610 | if (q->merge_bvec_fn(q, &bvm, bvec) < bvec->bv_len) { |
612 | bvec->bv_page = NULL; | 611 | bvec->bv_page = NULL; |
613 | bvec->bv_len = 0; | 612 | bvec->bv_len = 0; |
614 | bvec->bv_offset = 0; | 613 | bvec->bv_offset = 0; |