summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-05-19 17:31:37 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-30 09:33:45 +0200
commit18c261e9485a238129b857a8e53d3e2da8ca8246 (patch)
treef720e368a7b0c38af27c50e3a82b96449d81be51
parentcf8f8d37586f5e492ea2a6dd82f10628a31f03b4 (diff)
random: wire up fops->splice_{read,write}_iter()
commit 79025e727a846be6fd215ae9cdb654368ac3f9a6 upstream. Now that random/urandom is using {read,write}_iter, we can wire it up to using the generic splice handlers. Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") Signed-off-by: Jens Axboe <axboe@kernel.dk> [Jason: added the splice_write path. Note that sendfile() and such still does not work for read, though it does for write, because of a file type restriction in splice_direct_to_actor(), which I'll address separately.] 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>
-rw-r--r--drivers/char/random.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 75d8942f4481..b3ce4201a51f 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1386,6 +1386,8 @@ const struct file_operations random_fops = {
.compat_ioctl = compat_ptr_ioctl,
.fasync = random_fasync,
.llseek = noop_llseek,
+ .splice_read = generic_file_splice_read,
+ .splice_write = iter_file_splice_write,
};
const struct file_operations urandom_fops = {
@@ -1395,6 +1397,8 @@ const struct file_operations urandom_fops = {
.compat_ioctl = compat_ptr_ioctl,
.fasync = random_fasync,
.llseek = noop_llseek,
+ .splice_read = generic_file_splice_read,
+ .splice_write = iter_file_splice_write,
};