random: wire up fops->splice_read_iter() random-splice
authorJens Axboe <axboe@kernel.dk>
Thu, 19 May 2022 19:26:55 +0000 (13:26 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 19 May 2022 21:01:31 +0000 (15:01 -0600)
Now that random/urandom is using read_iter, we can wire it up to using
the generic splice read handler.

Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/char/random.c

index 147921d471d871bd9284c404385f487068b87424..892513fb74799d8d0ec44d9a68580d7cd6dbe92f 100644 (file)
@@ -1415,6 +1415,7 @@ const struct file_operations random_fops = {
        .compat_ioctl = compat_ptr_ioctl,
        .fasync = random_fasync,
        .llseek = noop_llseek,
+       .splice_read = generic_file_splice_read,
 };
 
 const struct file_operations urandom_fops = {
@@ -1424,6 +1425,7 @@ const struct file_operations urandom_fops = {
        .compat_ioctl = compat_ptr_ioctl,
        .fasync = random_fasync,
        .llseek = noop_llseek,
+       .splice_read = generic_file_splice_read,
 };