diff mbox series

btrfs: wire up iter_file_splice_write

Message ID 20200709162206.113927-1-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series btrfs: wire up iter_file_splice_write | expand

Commit Message

Christoph Hellwig July 9, 2020, 4:22 p.m. UTC
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>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Andy Lavr <andy.lavr@gmail.com>
---
 fs/btrfs/file.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Sterba July 9, 2020, 5:24 p.m. UTC | #1
On Thu, Jul 09, 2020 at 06:22:06PM +0200, Christoph Hellwig wrote:
> 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.

Do you want this patch to go in this cycle? I have some more patches
queued and don't mind adding it if it makes development of your patchset
easier.
Christoph Hellwig July 9, 2020, 5:26 p.m. UTC | #2
On Thu, Jul 09, 2020 at 07:24:28PM +0200, David Sterba wrote:
> On Thu, Jul 09, 2020 at 06:22:06PM +0200, Christoph Hellwig wrote:
> > 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.
> 
> Do you want this patch to go in this cycle? I have some more patches
> queued and don't mind adding it if it makes development of your patchset
> easier.

That would be great.
diff mbox series

Patch

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 2520605afc256e..b0d2c976587e52 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -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,