From db59dd41ab4ed2ca89dae32aa6f106f82bb1056e Mon Sep 17 00:00:00 2001 From: Joanne Koong Date: Wed, 12 Feb 2025 11:00:11 -0800 Subject: 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 --- example/passthrough_hp.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'example') 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(0)) + static_cast(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 */ -- cgit v1.2.3