Skip to content

Commit 79025e7

Browse files
axboezx2c4
authored andcommitted
random: wire up fops->splice_{read,write}_iter()
Now that random/urandom is using {read,write}_iter, we can wire it up to using the generic splice handlers. Fixes: 36e2c74 ("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>
1 parent 22b0a22 commit 79025e7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/char/random.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,8 @@ const struct file_operations random_fops = {
14121412
.compat_ioctl = compat_ptr_ioctl,
14131413
.fasync = random_fasync,
14141414
.llseek = noop_llseek,
1415+
.splice_read = generic_file_splice_read,
1416+
.splice_write = iter_file_splice_write,
14151417
};
14161418

14171419
const struct file_operations urandom_fops = {
@@ -1421,6 +1423,8 @@ const struct file_operations urandom_fops = {
14211423
.compat_ioctl = compat_ptr_ioctl,
14221424
.fasync = random_fasync,
14231425
.llseek = noop_llseek,
1426+
.splice_read = generic_file_splice_read,
1427+
.splice_write = iter_file_splice_write,
14241428
};
14251429

14261430

0 commit comments

Comments
 (0)