Skip to content

Commit 75f107f

Browse files
author
Ming Lei
committed
iov_iter: convert import_single_range() to ITER_UBUF
JIRA: https://issues.redhat.com/browse/RHEL-87739 commit e03ad4e Author: Jens Axboe <axboe@kernel.dk> Date: Fri Mar 24 14:35:49 2023 -0600 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> Signed-off-by: Ming Lei <ming.lei@redhat.com>
1 parent ed83677 commit 75f107f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/iov_iter.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,9 +1915,7 @@ int import_single_range(int rw, void __user *buf, size_t len,
19151915
if (unlikely(!access_ok(buf, len)))
19161916
return -EFAULT;
19171917

1918-
iov->iov_base = buf;
1919-
iov->iov_len = len;
1920-
iov_iter_init(i, rw, iov, 1, len);
1918+
iov_iter_ubuf(i, rw, buf, len);
19211919
return 0;
19221920
}
19231921
EXPORT_SYMBOL(import_single_range);

0 commit comments

Comments
 (0)