diff options
author | Bernd Schubert <bschubert@ddn.com> | 2022-03-24 00:05:02 +0100 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2022-03-31 15:27:02 +0100 |
commit | f0bba7ef2ad5b5da2c9ad9df37665863e71b8cce (patch) | |
tree | 6023ea99815668c873b90182f4a453e5af8c10b4 | |
parent | f8a24e9ec779dee3d23cd25f5bf6fc1c377e7d0a (diff) | |
download | fuse-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.cc | 20 |
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; + } } |