From: Jens Axboe Date: Thu, 19 May 2022 23:31:37 +0000 (-0600) Subject: random: wire up fops->splice_{read,write}_iter() X-Git-Tag: v5.18.1~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08467db994c0cf6c16e347a99e374a432e6c3509;p=thirdparty%2Fkernel%2Fstable.git 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 [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 Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/char/random.c b/drivers/char/random.c index bfb7f5441f962..0f0ebea41fadf 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1429,6 +1429,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 = { @@ -1438,6 +1440,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, };