fs: 9p: add generic splice_write file operation
authorDominique Martinet <asmadeus@codewreck.org>
Tue, 1 Dec 2020 15:09:37 +0000 (16:09 +0100)
committerDominique Martinet <asmadeus@codewreck.org>
Tue, 1 Dec 2020 20:40:47 +0000 (21:40 +0100)
The default splice operations got removed recently, add it back to 9p
with iter_file_splice_write like many other filesystems do.

Link: http://lkml.kernel.org/r/1606837496-21717-1-git-send-email-asmadeus@codewreck.org
Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops")
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/9p/vfs_file.c

index 01026b47018cd2feca14889c6c41997a2847e769..be5768949cb15eeab32623f122cb6bbf21791697 100644 (file)
@@ -656,6 +656,7 @@ const struct file_operations v9fs_cached_file_operations = {
        .lock = v9fs_file_lock,
        .mmap = v9fs_file_mmap,
        .splice_read = generic_file_splice_read,
+       .splice_write = iter_file_splice_write,
        .fsync = v9fs_file_fsync,
 };
 
@@ -669,6 +670,7 @@ const struct file_operations v9fs_cached_file_operations_dotl = {
        .flock = v9fs_file_flock_dotl,
        .mmap = v9fs_file_mmap,
        .splice_read = generic_file_splice_read,
+       .splice_write = iter_file_splice_write,
        .fsync = v9fs_file_fsync_dotl,
 };
 
@@ -681,6 +683,7 @@ const struct file_operations v9fs_file_operations = {
        .lock = v9fs_file_lock,
        .mmap = generic_file_readonly_mmap,
        .splice_read = generic_file_splice_read,
+       .splice_write = iter_file_splice_write,
        .fsync = v9fs_file_fsync,
 };
 
@@ -694,6 +697,7 @@ const struct file_operations v9fs_file_operations_dotl = {
        .flock = v9fs_file_flock_dotl,
        .mmap = generic_file_readonly_mmap,
        .splice_read = generic_file_splice_read,
+       .splice_write = iter_file_splice_write,
        .fsync = v9fs_file_fsync_dotl,
 };
 
@@ -706,6 +710,7 @@ const struct file_operations v9fs_mmap_file_operations = {
        .lock = v9fs_file_lock,
        .mmap = v9fs_mmap_file_mmap,
        .splice_read = generic_file_splice_read,
+       .splice_write = iter_file_splice_write,
        .fsync = v9fs_file_fsync,
 };
 
@@ -719,5 +724,6 @@ const struct file_operations v9fs_mmap_file_operations_dotl = {
        .flock = v9fs_file_flock_dotl,
        .mmap = v9fs_mmap_file_mmap,
        .splice_read = generic_file_splice_read,
+       .splice_write = iter_file_splice_write,
        .fsync = v9fs_file_fsync_dotl,
 };