aboutsummaryrefslogtreecommitdiffstats
path: root/example/passthrough_hp.cc
diff options
context:
space:
mode:
authorJoanne Koong <joannelkoong@gmail.com>2025-02-12 11:00:11 -0800
committerBernd Schubert <bernd@bsbernd.com>2025-02-12 20:35:26 +0100
commit62c79d580ed9d89e6071c93986ea92c5d43aaeb9 (patch)
treed322521b97a3cc229aeabd57da3817f8d3e30dd5 /example/passthrough_hp.cc
parent34c505316083fed363752676ae4b9056abd251c7 (diff)
downloadlibfuse-62c79d580ed9d89e6071c93986ea92c5d43aaeb9.tar.gz
passthrough_hp: enable splice move by default
This commit enables splice moves by default, unless the caller opts into nosplice. Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Diffstat (limited to 'example/passthrough_hp.cc')
-rw-r--r--example/passthrough_hp.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/example/passthrough_hp.cc b/example/passthrough_hp.cc
index 41904e5..1c8db6c 100644
--- a/example/passthrough_hp.cc
+++ b/example/passthrough_hp.cc
@@ -165,7 +165,7 @@ static Fs fs{};
#define FUSE_BUF_COPY_FLAGS \
(fs.nosplice ? \
FUSE_BUF_NO_SPLICE : \
- static_cast<fuse_buf_copy_flags>(0))
+ static_cast<fuse_buf_copy_flags>(FUSE_BUF_SPLICE_MOVE))
static Inode& get_inode(fuse_ino_t ino) {
@@ -202,13 +202,15 @@ static void sfs_init(void *userdata, fuse_conn_info *conn) {
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 default.
+ // Just unset all, in case FUSE_CAP_SPLICE_WRITE or
+ // FUSE_CAP_SPLICE_MOVE would also get enabled by default.
fuse_unset_feature_flag(conn, FUSE_CAP_SPLICE_READ);
fuse_unset_feature_flag(conn, FUSE_CAP_SPLICE_WRITE);
+ fuse_unset_feature_flag(conn, FUSE_CAP_SPLICE_MOVE);
} else {
fuse_set_feature_flag(conn, FUSE_CAP_SPLICE_WRITE);
fuse_set_feature_flag(conn, FUSE_CAP_SPLICE_READ);
+ fuse_set_feature_flag(conn, FUSE_CAP_SPLICE_MOVE);
}
/* This is a local file system - no network coherency needed */