@@ -3893,14 +3893,17 @@ static void copy_pages(struct page *dst_page, struct page *src_page,
char *src_kaddr;
if (dst_page != src_page)
+ {
src_kaddr = kmap_atomic(src_page, KM_USER1);
+ memcpy(dst_kaddr + dst_off, src_kaddr + src_off, len);
+ kunmap_atomic(src_kaddr, KM_USER1);
+ }
else
+ {
src_kaddr = dst_kaddr;
-
- memcpy(dst_kaddr + dst_off, src_kaddr + src_off, len);
+ memmove(dst_kaddr + dst_off, src_kaddr + src_off, len);
+ }
kunmap_atomic(dst_kaddr, KM_USER0);
- if (dst_page != src_page)
- kunmap_atomic(src_kaddr, KM_USER1);
}
void memcpy_extent_buffer(struct extent_buffer *dst, unsigned long dst_offset,