[PATCHSET v8 1/6] libext2fs: refactoring for fuse2fs iomap support

Darrick J. Wong
2026-04-29T14:20:19Z

Hi all,

In preparation for connecting fuse, iomap, and fuse2fs for a much more
performant file IO path, make some changes to the Unix IO manager in
libext2fs so that we can have better IO. First we start by making
filesystem flushes a lot more efficient by eliding fsyncs when they're
not necessary, and allowing library clients to turn off the racy code
that writes the superblock byte by byte but exposes stale checksums.

XXX: The second part of this series adds IO tagging so that we could tag
IOs by inode number to distinguish file data blocks in cache from
everything else. This is temporary scaffolding whilst we're in the
middle adding directio and later buffered writes. Once we can use the
pagecache for all file IO activity I think we could drop the back half
of this series.

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=libext2fs-iomap-prep
---
Commits in this patchset:
* libext2fs: invalidate cached blocks when freeing them
* libext2fs: only flush affected blocks in unix_write_byte
* libext2fs: allow unix_write_byte when the write would be aligned
* libext2fs: allow clients to ask to write full superblocks
* libext2fs: allow callers to disallow I/O to file data blocks
---
lib/ext2fs/ext2_io.h | 8 ++++++-
lib/ext2fs/ext2fs.h | 4 +++
debian/libext2fs2t64.symbols | 1 +
lib/ext2fs/alloc_stats.c | 6 +++++
lib/ext2fs/closefs.c | 7 ++++++
lib/ext2fs/fileio.c | 12 +++++++++-
lib/ext2fs/io_manager.c | 9 +++++++
lib/ext2fs/unix_io.c | 51 ++++++++++++++++++++++++++++++++++++++++--
8 files changed, 93 insertions(+), 5 deletions(-)