mergerfs/vendored/libfuse/lib
Antonio S. Musumeci 8eed256747 Restore splice zero-copy I/O as runtime options
Reinstate the splice read/write/move paths removed in 84592a9f, now
gated behind runtime options with negotiated pipe sizing and fallback
logging.

- Transport: msgbuf-piped splice receive, fd-referenced splice reply
  (vmsplice + splice), splice-move pipe-bounce, and restored
  fuse_buf_copy/fuse_buf_flags plumbing for copy fallbacks
- Negotiation: new pipe-max-size option (auto-raised at INIT when
  possible; the sysctl read/write is factored into src/pipe_max_size.cpp
  so fuse_init.cpp and option_parser.cpp share one implementation);
  fuse-msg-size clamped to what the pipe can hold; splice is disabled
  at INIT with a warning if the sysctl can't fit even the minimum,
  retracting the FUSE_CAP_SPLICE_* bits already advertised to the
  kernel in that case
- Read replies and splice-move are gated at 128 KiB (below that the
  syscalls cost more than the copy they avoid); every fallback path
  degrades to the copy path and logs once per process via SysLog
- msgbuf pipe cache is process-global and mutex-guarded (mutex_lockguard)
  so pipes can move between read and worker threads under
  process-thread mode
- API simplified after review: collapsed the three per-axis options
  (splice-read/write/move) into a single splice boolean (default on);
  no-splice-read/write/move and the bare splice-read/write/move
  spellings stay registered as accepted no-ops so existing mount
  options don't fail the mount, but they do NOT alter the splice
  knob - upgraders with no-splice-* in their config get splice
  enabled and must set splice=false explicitly (see
  deprecated_options.md)
- Fixed several correctness issues found in parallel review: a
  dropped write_buf registration that silently corrupted writes, a
  dirty-pipe reuse bug in msgbuf_free, an iov double-send in
  fuse_reply_data's splice-move fallback, and pipe-capacity math that
  assumed a 4096-byte page size
- Modernized the transport/negotiation code to this codebase's C++
  style: RAII (unique_ptr/DEFER) instead of malloc/free and manual fd
  close(), std::from_chars/to_chars instead of stoul/snprintf,
  _ReplyPipe's pipe ops as methods instead of free functions closing
  over a thread_local global, and vendored/libfuse/lib/buffer.cpp (a
  near-verbatim port of upstream's buffer.c) brought in line with the
  rest of the fork
- Documented splice and pipe-max-size options (mkdocs, FAQ,
  deprecated-options list); added tools/bench-splice.sh
- Benchmarked on tmpfs: seq_write +21%, seq_read +52%, small_write
  +5%, small_read +12%; validated with a 1h soak (~271 GiB
  hash-verified I/O, zero integrity failures), a live-mount round-trip
  of I/O above the splice threshold, and the existing unit/smoke
  suites at their pre-existing baseline

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-07 11:24:16 -04:00
..
buffer.cpp Restore splice zero-copy I/O as runtime options 2026-09-07 11:24:16 -04:00
cpu.cpp libfuse: small safety and portability fixes across opt/cpu/fusermount/maintenance_thread 2026-04-18 13:47:23 -05:00
cpu.hpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
crc32b.cpp Convert vendored/libfuse C sources to C++17 2026-03-24 21:13:34 -04:00
crc32b.h Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
debug.cpp Require C++20-capable build toolchains 2026-05-13 13:55:43 -05:00
format.cpp Move fmtlib to vendored and upgrade to 12.1.0 2026-03-02 01:09:16 -05:00
fuse.cpp Restore splice zero-copy I/O as runtime options 2026-09-07 11:24:16 -04:00
fuse_cfg.cpp Use shared_mutex for fuse log config 2026-05-14 00:22:06 -04:00
fuse_dirents.cpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
fuse_i.hpp Manage cloned /dev/fuse fds in sessions 2026-05-14 20:13:07 -05:00
fuse_loop.cpp Manage cloned /dev/fuse fds in sessions 2026-05-14 20:13:07 -05:00
fuse_lowlevel.cpp Restore splice zero-copy I/O as runtime options 2026-09-07 11:24:16 -04:00
fuse_msgbuf.cpp Restore splice zero-copy I/O as runtime options 2026-09-07 11:24:16 -04:00
fuse_opt.cpp libfuse: small safety and portability fixes across opt/cpu/fusermount/maintenance_thread 2026-04-18 13:47:23 -05:00
fuse_req.cpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
fuse_session.cpp Manage cloned /dev/fuse fds in sessions 2026-05-14 20:13:07 -05:00
fuse_signals.cpp libfuse: use atomic fuse_session pointer in signal handler 2026-04-18 13:47:23 -05:00
helper.cpp Use unmount() on FreeBSD for ENOTCONN umount 2026-05-07 17:49:24 -04:00
maintenance_thread.cpp libfuse: small safety and portability fixes across opt/cpu/fusermount/maintenance_thread 2026-04-18 13:47:23 -05:00
mount.cpp Convert vendored/libfuse C sources to C++17 2026-03-24 21:13:34 -04:00
mount.hpp Convert vendored/libfuse C sources to C++17 2026-03-24 21:13:34 -04:00
mount_bsd.h Convert vendored/libfuse C sources to C++17 2026-03-24 21:13:34 -04:00
mount_generic.h Fallback to fusermount3 where available 2026-03-24 21:13:34 -04:00
mount_util.h replace raw C-strings with std::string in converted libfuse files 2026-03-24 21:13:34 -04:00
node.cpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
node.hpp Remove timed node removal 2026-05-06 20:49:46 -04:00
pin_threads.cpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
pin_threads.hpp Move 3rd party libraries to "vendored" directory 2026-03-02 01:09:16 -05:00
xalloc.hpp libfuse: harden fuse.cpp against NULL nodes; use lock guards; check allocations 2026-04-18 13:47:23 -05:00