summaryrefslogtreecommitdiff
path: root/lib/iov_iter.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2021-04-27 12:29:53 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2021-06-10 11:45:22 -0400
commitc1d4d6a9ae88b87262fb5426823930bc471f6034 (patch)
treeecdcc96e3a00ddb580c968f7fb26f9b0b43d58df /lib/iov_iter.c
parent4b179e9a9c7c98550747b76405626dd59968f078 (diff)
copy_page_to_iter(): don't bother with kmap_atomic() for bvec/kvec cases
kmap_local_page() is enough there. Moreover, we can use _copy_to_iter() for actual copying in those cases - no useful extra checks on the address we are copying from in that call. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'lib/iov_iter.c')
-rw-r--r--lib/iov_iter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index d5f750cc6f4a..8aff4eb4fdfd 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -821,9 +821,9 @@ static size_t __copy_page_to_iter(struct page *page, size_t offset, size_t bytes
if (likely(iter_is_iovec(i)))
return copy_page_to_iter_iovec(page, offset, bytes, i);
if (iov_iter_is_bvec(i) || iov_iter_is_kvec(i) || iov_iter_is_xarray(i)) {
- void *kaddr = kmap_atomic(page);
- size_t wanted = copy_to_iter(kaddr + offset, bytes, i);
- kunmap_atomic(kaddr);
+ void *kaddr = kmap_local_page(page);
+ size_t wanted = _copy_to_iter(kaddr + offset, bytes, i);
+ kunmap_local(kaddr);
return wanted;
}
if (iov_iter_is_pipe(i))