random: convert to using fops->read_iter()
authorJens Axboe <axboe@kernel.dk>
Thu, 19 May 2022 23:31:36 +0000 (17:31 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 May 2022 07:29:17 +0000 (09:29 +0200)
commit7f8cea12a49425fe166fcd70fcbaa837803ab43d
tree4c277d0e5321be64e56ba316f37bf6b02fe49a5b
parent6244da28c6b3f7b413e32197acf5bd06dbe2ecb5
random: convert to using fops->read_iter()

commit 1b388e7765f2eaa137cf5d92b47ef5925ad83ced upstream.

This is a pre-requisite to wiring up splice() again for the random
and urandom drivers. It also allows us to remove the INT_MAX check in
getrandom(), because import_single_range() applies capping internally.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
[Jason: rewrote get_random_bytes_user() to simplify and also incorporate
 additional suggestions from Al.]
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c