vserver 1.9.3
[linux-2.6.git] / mm / highmem.c
index 9fc1106..c190cf8 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/init.h>
 #include <linux/hash.h>
 #include <linux/highmem.h>
-#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
 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);