[PATCHSET 3/9] fuse2fs: clean up operation startup

Darrick J. Wong
2025-11-06T22:28:25Z

Hi all,

Reduce the amount of boilerplate in fuse2fs by creating helper functions
to start and finish a file operation instead of open-coding the logic
all over the place. This also fixes a couple of theoretical races.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

Comments and questions are, as always, welcome.

e2fsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/e2fsprogs.git/log/?h=fuse2fs-refactor-operation-startup
---
Commits in this patchset:
* fuse2fs: rework FUSE2FS_CHECK_CONTEXT not to rely on global_fs
* fuse2fs: rework checking file handles
* fuse2fs: rework fallocate file handle extraction
* fuse2fs: consolidate file handle checking in op_ioctl
* fuse2fs: move fs assignment closer to locking the bfl
* fuse2fs: clean up operation startup
* fuse2fs: clean up operation completion
* fuse2fs: clean up more boilerplate
* fuse2fs: collect runtime of various operations
---
configure | 37 ++++
configure.ac | 19 ++
lib/config.h.in | 3
misc/fuse2fs.c | 475 ++++++++++++++++++++++++++++---------------------------
4 files changed, 303 insertions(+), 231 deletions(-)