summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schubert <bschubert@ddn.com>2022-03-24 00:05:02 +0100
committerNikolaus Rath <Nikolaus@rath.org>2022-03-31 15:27:02 +0100
commitf0bba7ef2ad5b5da2c9ad9df37665863e71b8cce (patch)
tree6023ea99815668c873b90182f4a453e5af8c10b4
parentf8a24e9ec779dee3d23cd25f5bf6fc1c377e7d0a (diff)
downloadfuse-f0bba7ef2ad5b5da2c9ad9df37665863e71b8cce.tar.gz
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.
-rw-r--r--example/passthrough_hp.cc20
1 files 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;
+ }
}