diff options
Diffstat (limited to 'mm/bounce.c')
-rw-r--r-- | mm/bounce.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/mm/bounce.c b/mm/bounce.c index 5a7d58fb883b..523918b8c6dc 100644 --- a/mm/bounce.c +++ b/mm/bounce.c | |||
@@ -98,27 +98,24 @@ int init_emergency_isa_pool(void) | |||
98 | static void copy_to_high_bio_irq(struct bio *to, struct bio *from) | 98 | static void copy_to_high_bio_irq(struct bio *to, struct bio *from) |
99 | { | 99 | { |
100 | unsigned char *vfrom; | 100 | unsigned char *vfrom; |
101 | struct bio_vec *tovec, *fromvec; | 101 | struct bio_vec tovec, *fromvec = from->bi_io_vec; |
102 | int i; | 102 | struct bvec_iter iter; |
103 | 103 | ||
104 | bio_for_each_segment(tovec, to, i) { | 104 | bio_for_each_segment(tovec, to, iter) { |
105 | fromvec = from->bi_io_vec + i; | 105 | if (tovec.bv_page != fromvec->bv_page) { |
106 | 106 | /* | |
107 | /* | 107 | * fromvec->bv_offset and fromvec->bv_len might have |
108 | * not bounced | 108 | * been modified by the block layer, so use the original |
109 | */ | 109 | * copy, bounce_copy_vec already uses tovec->bv_len |
110 | if (tovec->bv_page == fromvec->bv_page) | 110 | */ |
111 | continue; | 111 | vfrom = page_address(fromvec->bv_page) + |
112 | 112 | tovec.bv_offset; | |
113 | /* | 113 | |
114 | * fromvec->bv_offset and fromvec->bv_len might have been | 114 | bounce_copy_vec(&tovec, vfrom); |
115 | * modified by the block layer, so use the original copy, | 115 | flush_dcache_page(tovec.bv_page); |
116 | * bounce_copy_vec already uses tovec->bv_len | 116 | } |
117 | */ | ||
118 | vfrom = page_address(fromvec->bv_page) + tovec->bv_offset; | ||
119 | 117 | ||
120 | bounce_copy_vec(tovec, vfrom); | 118 | fromvec++; |
121 | flush_dcache_page(tovec->bv_page); | ||
122 | } | 119 | } |
123 | } | 120 | } |
124 | 121 | ||
@@ -201,13 +198,14 @@ static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig, | |||
201 | { | 198 | { |
202 | struct bio *bio; | 199 | struct bio *bio; |
203 | int rw = bio_data_dir(*bio_orig); | 200 | int rw = bio_data_dir(*bio_orig); |
204 | struct bio_vec *to, *from; | 201 | struct bio_vec *to, from; |
202 | struct bvec_iter iter; | ||
205 | unsigned i; | 203 | unsigned i; |
206 | 204 | ||
207 | if (force) | 205 | if (force) |
208 | goto bounce; | 206 | goto bounce; |
209 | bio_for_each_segment(from, *bio_orig, i) | 207 | bio_for_each_segment(from, *bio_orig, iter) |
210 | if (page_to_pfn(from->bv_page) > queue_bounce_pfn(q)) | 208 | if (page_to_pfn(from.bv_page) > queue_bounce_pfn(q)) |
211 | goto bounce; | 209 | goto bounce; |
212 | 210 | ||
213 | return; | 211 | return; |