summaryrefslogtreecommitdiff
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2022-08-20 01:33:00 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2022-08-30 07:15:51 +0300
commitb87846bd61c7c09560617da416208a5454530d57 (patch)
treee694fdbe8e363abbccaffb0a8b255e42eefe085c /fs/f2fs/super.c
parent605b0a778aa2599aa902ae639b8e9937c74b869b (diff)
downloadlinux-b87846bd61c7c09560617da416208a5454530d57.tar.xz
f2fs: use memcpy_{to,from}_page() where possible
This is simpler, and as a side effect it replaces several uses of kmap_atomic() with its recommended replacement kmap_local_page(). Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index fe462484f5fa..e910f0e39d76 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2470,7 +2470,6 @@ static ssize_t f2fs_quota_read(struct super_block *sb, int type, char *data,
size_t toread;
loff_t i_size = i_size_read(inode);
struct page *page;
- char *kaddr;
if (off > i_size)
return 0;
@@ -2503,9 +2502,7 @@ repeat:
return -EIO;
}
- kaddr = kmap_atomic(page);
- memcpy(data, kaddr + offset, tocopy);
- kunmap_atomic(kaddr);
+ memcpy_from_page(data, page, offset, tocopy);
f2fs_put_page(page, 1);
offset = 0;
@@ -2527,7 +2524,6 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type,
size_t towrite = len;
struct page *page;
void *fsdata = NULL;
- char *kaddr;
int err = 0;
int tocopy;
@@ -2546,10 +2542,7 @@ retry:
break;
}
- kaddr = kmap_atomic(page);
- memcpy(kaddr + offset, data, tocopy);
- kunmap_atomic(kaddr);
- flush_dcache_page(page);
+ memcpy_to_page(page, offset, data, tocopy);
a_ops->write_end(NULL, mapping, off, tocopy, tocopy,
page, fsdata);