diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/brd.c | 20 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_bitmap.c | 50 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 4 | ||||
-rw-r--r-- | drivers/block/loop.c | 16 | ||||
-rw-r--r-- | drivers/block/pktcdvd.c | 8 |
5 files changed, 49 insertions, 49 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c index ec246437f5a4..531ceb31d0ff 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c | |||
@@ -242,9 +242,9 @@ static void copy_to_brd(struct brd_device *brd, const void *src, | |||
242 | page = brd_lookup_page(brd, sector); | 242 | page = brd_lookup_page(brd, sector); |
243 | BUG_ON(!page); | 243 | BUG_ON(!page); |
244 | 244 | ||
245 | dst = kmap_atomic(page, KM_USER1); | 245 | dst = kmap_atomic(page); |
246 | memcpy(dst + offset, src, copy); | 246 | memcpy(dst + offset, src, copy); |
247 | kunmap_atomic(dst, KM_USER1); | 247 | kunmap_atomic(dst); |
248 | 248 | ||
249 | if (copy < n) { | 249 | if (copy < n) { |
250 | src += copy; | 250 | src += copy; |
@@ -253,9 +253,9 @@ static void copy_to_brd(struct brd_device *brd, const void *src, | |||
253 | page = brd_lookup_page(brd, sector); | 253 | page = brd_lookup_page(brd, sector); |
254 | BUG_ON(!page); | 254 | BUG_ON(!page); |
255 | 255 | ||
256 | dst = kmap_atomic(page, KM_USER1); | 256 | dst = kmap_atomic(page); |
257 | memcpy(dst, src, copy); | 257 | memcpy(dst, src, copy); |
258 | kunmap_atomic(dst, KM_USER1); | 258 | kunmap_atomic(dst); |
259 | } | 259 | } |
260 | } | 260 | } |
261 | 261 | ||
@@ -273,9 +273,9 @@ static void copy_from_brd(void *dst, struct brd_device *brd, | |||
273 | copy = min_t(size_t, n, PAGE_SIZE - offset); | 273 | copy = min_t(size_t, n, PAGE_SIZE - offset); |
274 | page = brd_lookup_page(brd, sector); | 274 | page = brd_lookup_page(brd, sector); |
275 | if (page) { | 275 | if (page) { |
276 | src = kmap_atomic(page, KM_USER1); | 276 | src = kmap_atomic(page); |
277 | memcpy(dst, src + offset, copy); | 277 | memcpy(dst, src + offset, copy); |
278 | kunmap_atomic(src, KM_USER1); | 278 | kunmap_atomic(src); |
279 | } else | 279 | } else |
280 | memset(dst, 0, copy); | 280 | memset(dst, 0, copy); |
281 | 281 | ||
@@ -285,9 +285,9 @@ static void copy_from_brd(void *dst, struct brd_device *brd, | |||
285 | copy = n - copy; | 285 | copy = n - copy; |
286 | page = brd_lookup_page(brd, sector); | 286 | page = brd_lookup_page(brd, sector); |
287 | if (page) { | 287 | if (page) { |
288 | src = kmap_atomic(page, KM_USER1); | 288 | src = kmap_atomic(page); |
289 | memcpy(dst, src, copy); | 289 | memcpy(dst, src, copy); |
290 | kunmap_atomic(src, KM_USER1); | 290 | kunmap_atomic(src); |
291 | } else | 291 | } else |
292 | memset(dst, 0, copy); | 292 | memset(dst, 0, copy); |
293 | } | 293 | } |
@@ -309,7 +309,7 @@ static int brd_do_bvec(struct brd_device *brd, struct page *page, | |||
309 | goto out; | 309 | goto out; |
310 | } | 310 | } |
311 | 311 | ||
312 | mem = kmap_atomic(page, KM_USER0); | 312 | mem = kmap_atomic(page); |
313 | if (rw == READ) { | 313 | if (rw == READ) { |
314 | copy_from_brd(mem + off, brd, sector, len); | 314 | copy_from_brd(mem + off, brd, sector, len); |
315 | flush_dcache_page(page); | 315 | flush_dcache_page(page); |
@@ -317,7 +317,7 @@ static int brd_do_bvec(struct brd_device *brd, struct page *page, | |||
317 | flush_dcache_page(page); | 317 | flush_dcache_page(page); |
318 | copy_to_brd(brd, mem + off, sector, len); | 318 | copy_to_brd(brd, mem + off, sector, len); |
319 | } | 319 | } |
320 | kunmap_atomic(mem, KM_USER0); | 320 | kunmap_atomic(mem); |
321 | 321 | ||
322 | out: | 322 | out: |
323 | return err; | 323 | return err; |
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 912f585a760f..3030201c69d8 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c | |||
@@ -289,25 +289,25 @@ static unsigned int bm_bit_to_page_idx(struct drbd_bitmap *b, u64 bitnr) | |||
289 | return page_nr; | 289 | return page_nr; |
290 | } | 290 | } |
291 | 291 | ||
292 | static unsigned long *__bm_map_pidx(struct drbd_bitmap *b, unsigned int idx, const enum km_type km) | 292 | static unsigned long *__bm_map_pidx(struct drbd_bitmap *b, unsigned int idx) |
293 | { | 293 | { |
294 | struct page *page = b->bm_pages[idx]; | 294 | struct page *page = b->bm_pages[idx]; |
295 | return (unsigned long *) kmap_atomic(page, km); | 295 | return (unsigned long *) kmap_atomic(page); |
296 | } | 296 | } |
297 | 297 | ||
298 | static unsigned long *bm_map_pidx(struct drbd_bitmap *b, unsigned int idx) | 298 | static unsigned long *bm_map_pidx(struct drbd_bitmap *b, unsigned int idx) |
299 | { | 299 | { |
300 | return __bm_map_pidx(b, idx, KM_IRQ1); | 300 | return __bm_map_pidx(b, idx); |
301 | } | 301 | } |
302 | 302 | ||
303 | static void __bm_unmap(unsigned long *p_addr, const enum km_type km) | 303 | static void __bm_unmap(unsigned long *p_addr) |
304 | { | 304 | { |
305 | kunmap_atomic(p_addr, km); | 305 | kunmap_atomic(p_addr); |
306 | }; | 306 | }; |
307 | 307 | ||
308 | static void bm_unmap(unsigned long *p_addr) | 308 | static void bm_unmap(unsigned long *p_addr) |
309 | { | 309 | { |
310 | return __bm_unmap(p_addr, KM_IRQ1); | 310 | return __bm_unmap(p_addr); |
311 | } | 311 | } |
312 | 312 | ||
313 | /* long word offset of _bitmap_ sector */ | 313 | /* long word offset of _bitmap_ sector */ |
@@ -543,15 +543,15 @@ static unsigned long bm_count_bits(struct drbd_bitmap *b) | |||
543 | 543 | ||
544 | /* all but last page */ | 544 | /* all but last page */ |
545 | for (idx = 0; idx < b->bm_number_of_pages - 1; idx++) { | 545 | for (idx = 0; idx < b->bm_number_of_pages - 1; idx++) { |
546 | p_addr = __bm_map_pidx(b, idx, KM_USER0); | 546 | p_addr = __bm_map_pidx(b, idx); |
547 | for (i = 0; i < LWPP; i++) | 547 | for (i = 0; i < LWPP; i++) |
548 | bits += hweight_long(p_addr[i]); | 548 | bits += hweight_long(p_addr[i]); |
549 | __bm_unmap(p_addr, KM_USER0); | 549 | __bm_unmap(p_addr); |
550 | cond_resched(); | 550 | cond_resched(); |
551 | } | 551 | } |
552 | /* last (or only) page */ | 552 | /* last (or only) page */ |
553 | last_word = ((b->bm_bits - 1) & BITS_PER_PAGE_MASK) >> LN2_BPL; | 553 | last_word = ((b->bm_bits - 1) & BITS_PER_PAGE_MASK) >> LN2_BPL; |
554 | p_addr = __bm_map_pidx(b, idx, KM_USER0); | 554 | p_addr = __bm_map_pidx(b, idx); |
555 | for (i = 0; i < last_word; i++) | 555 | for (i = 0; i < last_word; i++) |
556 | bits += hweight_long(p_addr[i]); | 556 | bits += hweight_long(p_addr[i]); |
557 | p_addr[last_word] &= cpu_to_lel(mask); | 557 | p_addr[last_word] &= cpu_to_lel(mask); |
@@ -559,7 +559,7 @@ static unsigned long bm_count_bits(struct drbd_bitmap *b) | |||
559 | /* 32bit arch, may have an unused padding long */ | 559 | /* 32bit arch, may have an unused padding long */ |
560 | if (BITS_PER_LONG == 32 && (last_word & 1) == 0) | 560 | if (BITS_PER_LONG == 32 && (last_word & 1) == 0) |
561 | p_addr[last_word+1] = 0; | 561 | p_addr[last_word+1] = 0; |
562 | __bm_unmap(p_addr, KM_USER0); | 562 | __bm_unmap(p_addr); |
563 | return bits; | 563 | return bits; |
564 | } | 564 | } |
565 | 565 | ||
@@ -970,11 +970,11 @@ static void bm_page_io_async(struct bm_aio_ctx *ctx, int page_nr, int rw) __must | |||
970 | * to use pre-allocated page pool */ | 970 | * to use pre-allocated page pool */ |
971 | void *src, *dest; | 971 | void *src, *dest; |
972 | page = alloc_page(__GFP_HIGHMEM|__GFP_WAIT); | 972 | page = alloc_page(__GFP_HIGHMEM|__GFP_WAIT); |
973 | dest = kmap_atomic(page, KM_USER0); | 973 | dest = kmap_atomic(page); |
974 | src = kmap_atomic(b->bm_pages[page_nr], KM_USER1); | 974 | src = kmap_atomic(b->bm_pages[page_nr]); |
975 | memcpy(dest, src, PAGE_SIZE); | 975 | memcpy(dest, src, PAGE_SIZE); |
976 | kunmap_atomic(src, KM_USER1); | 976 | kunmap_atomic(src); |
977 | kunmap_atomic(dest, KM_USER0); | 977 | kunmap_atomic(dest); |
978 | bm_store_page_idx(page, page_nr); | 978 | bm_store_page_idx(page, page_nr); |
979 | } else | 979 | } else |
980 | page = b->bm_pages[page_nr]; | 980 | page = b->bm_pages[page_nr]; |
@@ -1163,7 +1163,7 @@ int drbd_bm_write_page(struct drbd_conf *mdev, unsigned int idx) __must_hold(loc | |||
1163 | * this returns a bit number, NOT a sector! | 1163 | * this returns a bit number, NOT a sector! |
1164 | */ | 1164 | */ |
1165 | static unsigned long __bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo, | 1165 | static unsigned long __bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo, |
1166 | const int find_zero_bit, const enum km_type km) | 1166 | const int find_zero_bit) |
1167 | { | 1167 | { |
1168 | struct drbd_bitmap *b = mdev->bitmap; | 1168 | struct drbd_bitmap *b = mdev->bitmap; |
1169 | unsigned long *p_addr; | 1169 | unsigned long *p_addr; |
@@ -1178,7 +1178,7 @@ static unsigned long __bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo, | |||
1178 | while (bm_fo < b->bm_bits) { | 1178 | while (bm_fo < b->bm_bits) { |
1179 | /* bit offset of the first bit in the page */ | 1179 | /* bit offset of the first bit in the page */ |
1180 | bit_offset = bm_fo & ~BITS_PER_PAGE_MASK; | 1180 | bit_offset = bm_fo & ~BITS_PER_PAGE_MASK; |
1181 | p_addr = __bm_map_pidx(b, bm_bit_to_page_idx(b, bm_fo), km); | 1181 | p_addr = __bm_map_pidx(b, bm_bit_to_page_idx(b, bm_fo)); |
1182 | 1182 | ||
1183 | if (find_zero_bit) | 1183 | if (find_zero_bit) |
1184 | i = find_next_zero_bit_le(p_addr, | 1184 | i = find_next_zero_bit_le(p_addr, |
@@ -1187,7 +1187,7 @@ static unsigned long __bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo, | |||
1187 | i = find_next_bit_le(p_addr, | 1187 | i = find_next_bit_le(p_addr, |
1188 | PAGE_SIZE*8, bm_fo & BITS_PER_PAGE_MASK); | 1188 | PAGE_SIZE*8, bm_fo & BITS_PER_PAGE_MASK); |
1189 | 1189 | ||
1190 | __bm_unmap(p_addr, km); | 1190 | __bm_unmap(p_addr); |
1191 | if (i < PAGE_SIZE*8) { | 1191 | if (i < PAGE_SIZE*8) { |
1192 | bm_fo = bit_offset + i; | 1192 | bm_fo = bit_offset + i; |
1193 | if (bm_fo >= b->bm_bits) | 1193 | if (bm_fo >= b->bm_bits) |
@@ -1215,7 +1215,7 @@ static unsigned long bm_find_next(struct drbd_conf *mdev, | |||
1215 | if (BM_DONT_TEST & b->bm_flags) | 1215 | if (BM_DONT_TEST & b->bm_flags) |
1216 | bm_print_lock_info(mdev); | 1216 | bm_print_lock_info(mdev); |
1217 | 1217 | ||
1218 | i = __bm_find_next(mdev, bm_fo, find_zero_bit, KM_IRQ1); | 1218 | i = __bm_find_next(mdev, bm_fo, find_zero_bit); |
1219 | 1219 | ||
1220 | spin_unlock_irq(&b->bm_lock); | 1220 | spin_unlock_irq(&b->bm_lock); |
1221 | return i; | 1221 | return i; |
@@ -1239,13 +1239,13 @@ unsigned long drbd_bm_find_next_zero(struct drbd_conf *mdev, unsigned long bm_fo | |||
1239 | unsigned long _drbd_bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo) | 1239 | unsigned long _drbd_bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo) |
1240 | { | 1240 | { |
1241 | /* WARN_ON(!(BM_DONT_SET & mdev->b->bm_flags)); */ | 1241 | /* WARN_ON(!(BM_DONT_SET & mdev->b->bm_flags)); */ |
1242 | return __bm_find_next(mdev, bm_fo, 0, KM_USER1); | 1242 | return __bm_find_next(mdev, bm_fo, 0); |
1243 | } | 1243 | } |
1244 | 1244 | ||
1245 | unsigned long _drbd_bm_find_next_zero(struct drbd_conf *mdev, unsigned long bm_fo) | 1245 | unsigned long _drbd_bm_find_next_zero(struct drbd_conf *mdev, unsigned long bm_fo) |
1246 | { | 1246 | { |
1247 | /* WARN_ON(!(BM_DONT_SET & mdev->b->bm_flags)); */ | 1247 | /* WARN_ON(!(BM_DONT_SET & mdev->b->bm_flags)); */ |
1248 | return __bm_find_next(mdev, bm_fo, 1, KM_USER1); | 1248 | return __bm_find_next(mdev, bm_fo, 1); |
1249 | } | 1249 | } |
1250 | 1250 | ||
1251 | /* returns number of bits actually changed. | 1251 | /* returns number of bits actually changed. |
@@ -1273,14 +1273,14 @@ static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s, | |||
1273 | unsigned int page_nr = bm_bit_to_page_idx(b, bitnr); | 1273 | unsigned int page_nr = bm_bit_to_page_idx(b, bitnr); |
1274 | if (page_nr != last_page_nr) { | 1274 | if (page_nr != last_page_nr) { |
1275 | if (p_addr) | 1275 | if (p_addr) |
1276 | __bm_unmap(p_addr, KM_IRQ1); | 1276 | __bm_unmap(p_addr); |
1277 | if (c < 0) | 1277 | if (c < 0) |
1278 | bm_set_page_lazy_writeout(b->bm_pages[last_page_nr]); | 1278 | bm_set_page_lazy_writeout(b->bm_pages[last_page_nr]); |
1279 | else if (c > 0) | 1279 | else if (c > 0) |
1280 | bm_set_page_need_writeout(b->bm_pages[last_page_nr]); | 1280 | bm_set_page_need_writeout(b->bm_pages[last_page_nr]); |
1281 | changed_total += c; | 1281 | changed_total += c; |
1282 | c = 0; | 1282 | c = 0; |
1283 | p_addr = __bm_map_pidx(b, page_nr, KM_IRQ1); | 1283 | p_addr = __bm_map_pidx(b, page_nr); |
1284 | last_page_nr = page_nr; | 1284 | last_page_nr = page_nr; |
1285 | } | 1285 | } |
1286 | if (val) | 1286 | if (val) |
@@ -1289,7 +1289,7 @@ static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s, | |||
1289 | c -= (0 != __test_and_clear_bit_le(bitnr & BITS_PER_PAGE_MASK, p_addr)); | 1289 | c -= (0 != __test_and_clear_bit_le(bitnr & BITS_PER_PAGE_MASK, p_addr)); |
1290 | } | 1290 | } |
1291 | if (p_addr) | 1291 | if (p_addr) |
1292 | __bm_unmap(p_addr, KM_IRQ1); | 1292 | __bm_unmap(p_addr); |
1293 | if (c < 0) | 1293 | if (c < 0) |
1294 | bm_set_page_lazy_writeout(b->bm_pages[last_page_nr]); | 1294 | bm_set_page_lazy_writeout(b->bm_pages[last_page_nr]); |
1295 | else if (c > 0) | 1295 | else if (c > 0) |
@@ -1342,13 +1342,13 @@ static inline void bm_set_full_words_within_one_page(struct drbd_bitmap *b, | |||
1342 | { | 1342 | { |
1343 | int i; | 1343 | int i; |
1344 | int bits; | 1344 | int bits; |
1345 | unsigned long *paddr = kmap_atomic(b->bm_pages[page_nr], KM_IRQ1); | 1345 | unsigned long *paddr = kmap_atomic(b->bm_pages[page_nr]); |
1346 | for (i = first_word; i < last_word; i++) { | 1346 | for (i = first_word; i < last_word; i++) { |
1347 | bits = hweight_long(paddr[i]); | 1347 | bits = hweight_long(paddr[i]); |
1348 | paddr[i] = ~0UL; | 1348 | paddr[i] = ~0UL; |
1349 | b->bm_set += BITS_PER_LONG - bits; | 1349 | b->bm_set += BITS_PER_LONG - bits; |
1350 | } | 1350 | } |
1351 | kunmap_atomic(paddr, KM_IRQ1); | 1351 | kunmap_atomic(paddr); |
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | /* Same thing as drbd_bm_set_bits, | 1354 | /* Same thing as drbd_bm_set_bits, |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index af2a25049bce..e09f9cebbb20 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -2526,10 +2526,10 @@ void drbd_bcast_ee(struct drbd_conf *mdev, | |||
2526 | 2526 | ||
2527 | page = e->pages; | 2527 | page = e->pages; |
2528 | page_chain_for_each(page) { | 2528 | page_chain_for_each(page) { |
2529 | void *d = kmap_atomic(page, KM_USER0); | 2529 | void *d = kmap_atomic(page); |
2530 | unsigned l = min_t(unsigned, len, PAGE_SIZE); | 2530 | unsigned l = min_t(unsigned, len, PAGE_SIZE); |
2531 | memcpy(tl, d, l); | 2531 | memcpy(tl, d, l); |
2532 | kunmap_atomic(d, KM_USER0); | 2532 | kunmap_atomic(d); |
2533 | tl = (unsigned short*)((char*)tl + l); | 2533 | tl = (unsigned short*)((char*)tl + l); |
2534 | len -= l; | 2534 | len -= l; |
2535 | if (len == 0) | 2535 | if (len == 0) |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index cd504353b278..bbca966f8f66 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -93,16 +93,16 @@ static int transfer_none(struct loop_device *lo, int cmd, | |||
93 | struct page *loop_page, unsigned loop_off, | 93 | struct page *loop_page, unsigned loop_off, |
94 | int size, sector_t real_block) | 94 | int size, sector_t real_block) |
95 | { | 95 | { |
96 | char *raw_buf = kmap_atomic(raw_page, KM_USER0) + raw_off; | 96 | char *raw_buf = kmap_atomic(raw_page) + raw_off; |
97 | char *loop_buf = kmap_atomic(loop_page, KM_USER1) + loop_off; | 97 | char *loop_buf = kmap_atomic(loop_page) + loop_off; |
98 | 98 | ||
99 | if (cmd == READ) | 99 | if (cmd == READ) |
100 | memcpy(loop_buf, raw_buf, size); | 100 | memcpy(loop_buf, raw_buf, size); |
101 | else | 101 | else |
102 | memcpy(raw_buf, loop_buf, size); | 102 | memcpy(raw_buf, loop_buf, size); |
103 | 103 | ||
104 | kunmap_atomic(loop_buf, KM_USER1); | 104 | kunmap_atomic(loop_buf); |
105 | kunmap_atomic(raw_buf, KM_USER0); | 105 | kunmap_atomic(raw_buf); |
106 | cond_resched(); | 106 | cond_resched(); |
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
@@ -112,8 +112,8 @@ static int transfer_xor(struct loop_device *lo, int cmd, | |||
112 | struct page *loop_page, unsigned loop_off, | 112 | struct page *loop_page, unsigned loop_off, |
113 | int size, sector_t real_block) | 113 | int size, sector_t real_block) |
114 | { | 114 | { |
115 | char *raw_buf = kmap_atomic(raw_page, KM_USER0) + raw_off; | 115 | char *raw_buf = kmap_atomic(raw_page) + raw_off; |
116 | char *loop_buf = kmap_atomic(loop_page, KM_USER1) + loop_off; | 116 | char *loop_buf = kmap_atomic(loop_page) + loop_off; |
117 | char *in, *out, *key; | 117 | char *in, *out, *key; |
118 | int i, keysize; | 118 | int i, keysize; |
119 | 119 | ||
@@ -130,8 +130,8 @@ static int transfer_xor(struct loop_device *lo, int cmd, | |||
130 | for (i = 0; i < size; i++) | 130 | for (i = 0; i < size; i++) |
131 | *out++ = *in++ ^ key[(i & 511) % keysize]; | 131 | *out++ = *in++ ^ key[(i & 511) % keysize]; |
132 | 132 | ||
133 | kunmap_atomic(loop_buf, KM_USER1); | 133 | kunmap_atomic(loop_buf); |
134 | kunmap_atomic(raw_buf, KM_USER0); | 134 | kunmap_atomic(raw_buf); |
135 | cond_resched(); | 135 | cond_resched(); |
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index d59edeabd93f..ba66e4445f41 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -987,14 +987,14 @@ static void pkt_copy_bio_data(struct bio *src_bio, int seg, int offs, struct pag | |||
987 | 987 | ||
988 | while (copy_size > 0) { | 988 | while (copy_size > 0) { |
989 | struct bio_vec *src_bvl = bio_iovec_idx(src_bio, seg); | 989 | struct bio_vec *src_bvl = bio_iovec_idx(src_bio, seg); |
990 | void *vfrom = kmap_atomic(src_bvl->bv_page, KM_USER0) + | 990 | void *vfrom = kmap_atomic(src_bvl->bv_page) + |
991 | src_bvl->bv_offset + offs; | 991 | src_bvl->bv_offset + offs; |
992 | void *vto = page_address(dst_page) + dst_offs; | 992 | void *vto = page_address(dst_page) + dst_offs; |
993 | int len = min_t(int, copy_size, src_bvl->bv_len - offs); | 993 | int len = min_t(int, copy_size, src_bvl->bv_len - offs); |
994 | 994 | ||
995 | BUG_ON(len < 0); | 995 | BUG_ON(len < 0); |
996 | memcpy(vto, vfrom, len); | 996 | memcpy(vto, vfrom, len); |
997 | kunmap_atomic(vfrom, KM_USER0); | 997 | kunmap_atomic(vfrom); |
998 | 998 | ||
999 | seg++; | 999 | seg++; |
1000 | offs = 0; | 1000 | offs = 0; |
@@ -1019,10 +1019,10 @@ static void pkt_make_local_copy(struct packet_data *pkt, struct bio_vec *bvec) | |||
1019 | offs = 0; | 1019 | offs = 0; |
1020 | for (f = 0; f < pkt->frames; f++) { | 1020 | for (f = 0; f < pkt->frames; f++) { |
1021 | if (bvec[f].bv_page != pkt->pages[p]) { | 1021 | if (bvec[f].bv_page != pkt->pages[p]) { |
1022 | void *vfrom = kmap_atomic(bvec[f].bv_page, KM_USER0) + bvec[f].bv_offset; | 1022 | void *vfrom = kmap_atomic(bvec[f].bv_page) + bvec[f].bv_offset; |
1023 | void *vto = page_address(pkt->pages[p]) + offs; | 1023 | void *vto = page_address(pkt->pages[p]) + offs; |
1024 | memcpy(vto, vfrom, CD_FRAMESIZE); | 1024 | memcpy(vto, vfrom, CD_FRAMESIZE); |
1025 | kunmap_atomic(vfrom, KM_USER0); | 1025 | kunmap_atomic(vfrom); |
1026 | bvec[f].bv_page = pkt->pages[p]; | 1026 | bvec[f].bv_page = pkt->pages[p]; |
1027 | bvec[f].bv_offset = offs; | 1027 | bvec[f].bv_offset = offs; |
1028 | } else { | 1028 | } else { |