aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/iov_iter.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-03-24 14:35:49 -0600
committerJens Axboe <axboe@kernel.dk>2023-03-30 08:12:29 -0600
commite03ad4ee2783e41afc90cc7848468aef10741c0e (patch)
tree71447ef07166a9ab75571b291927bebfb8f5cb98 /lib/iov_iter.c
parentiov_iter: overlay struct iovec and ubuf/len (diff)
downloadwireguard-linux-e03ad4ee2783e41afc90cc7848468aef10741c0e.tar.xz
wireguard-linux-e03ad4ee2783e41afc90cc7848468aef10741c0e.zip
iov_iter: convert import_single_range() to ITER_UBUF
Since we're just importing a single vector, we don't have to turn it into an ITER_IOVEC. Instead turn it into an ITER_UBUF, which is cheaper to iterate. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib/iov_iter.c')
-rw-r--r--lib/iov_iter.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 87488c4aad3f..f411bda1171f 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1870,9 +1870,7 @@ int import_single_range(int rw, void __user *buf, size_t len,
if (unlikely(!access_ok(buf, len)))
return -EFAULT;
- iov->iov_base = buf;
- iov->iov_len = len;
- iov_iter_init(i, rw, iov, 1, len);
+ iov_iter_ubuf(i, rw, buf, len);
return 0;
}
EXPORT_SYMBOL(import_single_range);