]> git.ipfire.org Git - thirdparty/util-linux.git/commit
include: add VFS I/O abstraction layer
authorKarel Zak <kzak@redhat.com>
Tue, 30 Jun 2026 12:20:50 +0000 (14:20 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 9 Jul 2026 10:18:04 +0000 (12:18 +0200)
commit83523c7d8a2aa3c3ab889ed44181c889f1215cb3
treee207ff1dbe04b8be23ce8eb84eb8c623639e069b
parent042f192d623f35e92f97a7df48a0bb3183adef67
include: add VFS I/O abstraction layer

Add include/vfs.h with struct ul_vfs_ops — a pluggable I/O operations
table with function pointers matching POSIX signatures (read, write,
open, close, lseek, fsync). NULL function pointers fall back to real
syscalls. The size field enables forward/backward compatible struct
evolution.

Refactor include/all-io.h to use VFS dispatch internally:
  - ul_write_all() and ul_read_all() become macros calling
    __write_all(NULL, ...) and __read_all(NULL, ...)
  - New ul_vfs_write_all() and ul_vfs_read_all() macros pass
    through a VFS ops struct for custom I/O

Addresses: https://github.com/util-linux/util-linux/issues/4308
Signed-off-by: Karel Zak <kzak@redhat.com>
include/Makemodule.am
include/all-io.h
include/vfs.h [new file with mode: 0644]