From dbb48937ce6c7919328490659c691f019eeeefb4 Mon Sep 17 00:00:00 2001 From: Chunwei Chen Date: Tue, 16 May 2017 10:49:03 -0700 Subject: [PATCH] Add kmap_atomic in dmu_bio_copy This is needed for 32 bit systems. Signed-off-by: Chunwei Chen --- module/zfs/dmu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 5e2a1db601..9baeb01fd1 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -49,6 +49,7 @@ #ifdef _KERNEL #include #include +#include #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: