From f0bba7ef2ad5b5da2c9ad9df37665863e71b8cce Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Thu, 24 Mar 2022 00:05:02 +0100 Subject: passthrough_hp: Disable splice with the --nosplice option passthrough_hp was not updated when splice got enabled by default in libfuse3. I.e. the --nosplice option and condition on it was a noop. --- example/passthrough_hp.cc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/example/passthrough_hp.cc b/example/passthrough_hp.cc index a421182..5c61928 100644 --- a/example/passthrough_hp.cc +++ b/example/passthrough_hp.cc @@ -194,13 +194,19 @@ static void sfs_init(void *userdata, fuse_conn_info *conn) { if (conn->capable & FUSE_CAP_FLOCK_LOCKS) conn->want |= FUSE_CAP_FLOCK_LOCKS; - // Use splicing if supported. Since we are using writeback caching - // and readahead, individual requests should have a decent size so - // that splicing between fd's is well worth it. - if (conn->capable & FUSE_CAP_SPLICE_WRITE && !fs.nosplice) - conn->want |= FUSE_CAP_SPLICE_WRITE; - if (conn->capable & FUSE_CAP_SPLICE_READ && !fs.nosplice) - conn->want |= FUSE_CAP_SPLICE_READ; + if (fs.nosplice) { + // FUSE_CAP_SPLICE_READ is enabled in libfuse3 by default, + // see do_init() in in fuse_lowlevel.c + // Just unset both, in case FUSE_CAP_SPLICE_WRITE would also get enabled + // by detault. + conn->want &= ~FUSE_CAP_SPLICE_READ; + conn->want &= ~FUSE_CAP_SPLICE_WRITE; + } else { + if (conn->capable & FUSE_CAP_SPLICE_WRITE) + conn->want |= FUSE_CAP_SPLICE_WRITE; + if (conn->capable & FUSE_CAP_SPLICE_READ) + conn->want |= FUSE_CAP_SPLICE_READ; + } } -- cgit v1.2.1