diff options
author | Joanne Koong <joannelkoong@gmail.com> | 2025-02-12 11:00:11 -0800 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-04-15 00:50:26 +0200 |
commit | db59dd41ab4ed2ca89dae32aa6f106f82bb1056e (patch) | |
tree | 044343e262be8b1bff836f828546b34f9b4799b6 /example/passthrough_hp.cc | |
parent | cf87c46bcdadb67a9b62833178feb24ab3d69708 (diff) | |
download | libfuse-db59dd41ab4ed2ca89dae32aa6f106f82bb1056e.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.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/example/passthrough_hp.cc b/example/passthrough_hp.cc index d87ca5f..8b5214c 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 */ |