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: always fsync the device when flushing the cache * libext2fs: always fsync the device when closing the unix IO manager * libext2fs: only fsync the unix fd if we wrote to the device * libext2fs: invalidate cached blocks when freeing them * libext2fs: add tagged block IO for better caching * libext2fs: add tagged block IO caching to the unix IO manager * 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 | 29 ++++ lib/ext2fs/ext2fs.h | 4 + debian/libext2fs2t64.symbols | 5 + lib/ext2fs/alloc_stats.c | 7 + lib/ext2fs/closefs.c | 7 + lib/ext2fs/fileio.c | 26 +++- lib/ext2fs/io_manager.c | 56 ++++++++ lib/ext2fs/unix_io.c | 281 +++++++++++++++++++++++++++++++++++------- 8 files changed, 362 insertions(+), 53 deletions(-)