#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;
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;
/*
*/
vfrom = page_address(fromvec->bv_page) + tovec->bv_offset;
+ flush_dcache_page(tovec->bv_page);
bounce_copy_vec(tovec, vfrom);
}
}
{
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;
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);
}
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);