btrfs: wire up iter_file_splice_write
authorChristoph Hellwig <hch@lst.de>
Thu, 9 Jul 2020 16:22:06 +0000 (18:22 +0200)
committerDavid Sterba <dsterba@suse.com>
Thu, 9 Jul 2020 17:57:58 +0000 (19:57 +0200)
btrfs implements the iter_write op and thus can use the more efficient
iov_iter based splice implementation.  For now falling back to the less
efficient default is pretty harmless, but I have a pending series that
removes the default, and thus would cause btrfs to not support splice
at all.

Reported-by: Andy Lavr <andy.lavr@gmail.com>
Tested-by: Andy Lavr <andy.lavr@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c

index 2520605afc256ebe2d0e415051370100928f7b34..b0d2c976587e523c070a6d41df05fefeeead226b 100644 (file)
@@ -3509,6 +3509,7 @@ const struct file_operations btrfs_file_operations = {
        .read_iter      = generic_file_read_iter,
        .splice_read    = generic_file_splice_read,
        .write_iter     = btrfs_file_write_iter,
+       .splice_write   = iter_file_splice_write,
        .mmap           = btrfs_file_mmap,
        .open           = btrfs_file_open,
        .release        = btrfs_release_file,