Skip to content

Commit

Permalink
iov_iter: convert import_single_range() to ITER_UBUF
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe committed Mar 30, 2023
1 parent 747b1f6 commit e03ad4e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/iov_iter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e03ad4e

Please sign in to comment.