diff options
author | Chunwei Chen <[email protected]> | 2017-05-16 10:49:03 -0700 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2017-06-09 14:05:15 -0700 |
commit | dbb48937ce6c7919328490659c691f019eeeefb4 (patch) | |
tree | d9b6515713a4fa5672f5d30ca9b4a50cd8790e8c | |
parent | 34a3a7c660b014754b6b97dbff6f6ef94626255a (diff) |
Add kmap_atomic in dmu_bio_copy
This is needed for 32 bit systems.
Signed-off-by: Chunwei Chen <[email protected]>
-rw-r--r-- | module/zfs/dmu.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 5e2a1db60..9baeb01fd 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -49,6 +49,7 @@ #ifdef _KERNEL #include <sys/vmsystm.h> #include <sys/zfs_znode.h> +#include <linux/kmap_compat.h> #endif /* @@ -1056,6 +1057,7 @@ dmu_bio_copy(void *arg_buf, int size, struct bio *bio, size_t bio_offset) char *bv_buf; int tocpy, bv_len, bv_offset; int offset = 0; + void *paddr; bio_for_each_segment4(bv, bvp, bio, iter) { @@ -1080,14 +1082,15 @@ dmu_bio_copy(void *arg_buf, int size, struct bio *bio, size_t bio_offset) tocpy = MIN(bv_len, size - offset); ASSERT3S(tocpy, >=, 0); - bv_buf = page_address(bvp->bv_page) + bv_offset; - ASSERT3P(bv_buf, !=, NULL); + paddr = zfs_kmap_atomic(bvp->bv_page, KM_USER0); + bv_buf = paddr + bv_offset; + ASSERT3P(paddr, !=, NULL); if (bio_data_dir(bio) == WRITE) memcpy(arg_buf + offset, bv_buf, tocpy); else memcpy(bv_buf, arg_buf + offset, tocpy); - + zfs_kunmap_atomic(paddr, KM_USER0); offset += tocpy; } out: |