Skip to content

Commit 0b6672f

Browse files
Christoph Hellwiggregkh
authored andcommitted
kernfs: wire up ->splice_read and ->splice_write
commit f2d6c27 upstream. Wire up the splice_read and splice_write methods to the default helpers using ->read_iter and ->write_iter now that those are implemented for kernfs. This restores support to use splice and sendfile on kernfs files. Fixes: 36e2c74 ("fs: don't allow splice read/write without explicit ops") Reported-by: Siddharth Gupta <sidgup@codeaurora.org> Tested-by: Siddharth Gupta <sidgup@codeaurora.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20210120204631.274206-4-hch@lst.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1116745 commit 0b6672f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/kernfs/file.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@ const struct file_operations kernfs_file_fops = {
949949
.release = kernfs_fop_release,
950950
.poll = kernfs_fop_poll,
951951
.fsync = noop_fsync,
952+
.splice_read = generic_file_splice_read,
953+
.splice_write = iter_file_splice_write,
952954
};
953955

954956
/**

0 commit comments

Comments
 (0)