X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=mm%2Fhighmem.c;h=c190cf80af4d5b5e80ea42a2ca79148442fde9e8;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=9fc1106994ef1d337f3fdc9408aea24699cc23d3;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/mm/highmem.c b/mm/highmem.c index 9fc110699..c190cf80a 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -26,7 +26,6 @@ #include #include #include -#include #include static mempool_t *page_pool, *isa_page_pool; @@ -285,7 +284,7 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from) struct bio_vec *tovec, *fromvec; int i; - bio_for_each_segment(tovec, to, i) { + __bio_for_each_segment(tovec, to, i, 0) { fromvec = from->bi_io_vec + i; /* @@ -301,6 +300,7 @@ static void copy_to_high_bio_irq(struct bio *to, struct bio *from) */ vfrom = page_address(fromvec->bv_page) + tovec->bv_offset; + flush_dcache_page(tovec->bv_page); bounce_copy_vec(tovec, vfrom); } } @@ -309,17 +309,15 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool) { struct bio *bio_orig = bio->bi_private; struct bio_vec *bvec, *org_vec; - int i; + int i, err = 0; if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) - goto out_eio; - - set_bit(BIO_UPTODATE, &bio_orig->bi_flags); + err = -EIO; /* * free up bounce indirect pages used */ - bio_for_each_segment(bvec, bio, i) { + __bio_for_each_segment(bvec, bio, i, 0) { org_vec = bio_orig->bi_io_vec + i; if (bvec->bv_page == org_vec->bv_page) continue; @@ -327,8 +325,7 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool) mempool_free(bvec->bv_page, pool); } -out_eio: - bio_endio(bio_orig, bio_orig->bi_size, 0); + bio_endio(bio_orig, bio_orig->bi_size, err); bio_put(bio); } @@ -410,6 +407,7 @@ static void __blk_queue_bounce(request_queue_t *q, struct bio **bio_orig, if (rw == WRITE) { char *vto, *vfrom; + flush_dcache_page(from->bv_page); vto = page_address(to->bv_page) + to->bv_offset; vfrom = kmap(from->bv_page) + from->bv_offset; memcpy(vto, vfrom, to->bv_len);