Commit 3c3db095 authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

fuse: use iov_iter based generic splice helpers



The default splice implementation is grossly inefficient and the iter based
ones work just fine, so use those instead.  I've measured an 8x speedup for
splice write (with len = 128k).

Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 23c94e1c
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -3156,6 +3156,7 @@ static const struct file_operations fuse_file_operations = {
	.lock		= fuse_file_lock,
	.lock		= fuse_file_lock,
	.flock		= fuse_file_flock,
	.flock		= fuse_file_flock,
	.splice_read	= generic_file_splice_read,
	.splice_read	= generic_file_splice_read,
	.splice_write	= iter_file_splice_write,
	.unlocked_ioctl	= fuse_file_ioctl,
	.unlocked_ioctl	= fuse_file_ioctl,
	.compat_ioctl	= fuse_file_compat_ioctl,
	.compat_ioctl	= fuse_file_compat_ioctl,
	.poll		= fuse_file_poll,
	.poll		= fuse_file_poll,
@@ -3174,11 +3175,12 @@ static const struct file_operations fuse_direct_io_file_operations = {
	.fsync		= fuse_fsync,
	.fsync		= fuse_fsync,
	.lock		= fuse_file_lock,
	.lock		= fuse_file_lock,
	.flock		= fuse_file_flock,
	.flock		= fuse_file_flock,
	.splice_read	= generic_file_splice_read,
	.splice_write	= iter_file_splice_write,
	.unlocked_ioctl	= fuse_file_ioctl,
	.unlocked_ioctl	= fuse_file_ioctl,
	.compat_ioctl	= fuse_file_compat_ioctl,
	.compat_ioctl	= fuse_file_compat_ioctl,
	.poll		= fuse_file_poll,
	.poll		= fuse_file_poll,
	.fallocate	= fuse_file_fallocate,
	.fallocate	= fuse_file_fallocate,
	/* no splice_read */
};
};


static const struct address_space_operations fuse_file_aops  = {
static const struct address_space_operations fuse_file_aops  = {