]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: add blkid_probe_set_vfs() for pluggable I/O
authorKarel Zak <kzak@redhat.com>
Tue, 30 Jun 2026 12:38:56 +0000 (14:38 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 9 Jul 2026 10:18:04 +0000 (12:18 +0200)
commit19db6c490cc7f753f6af191a7818e8ca1767d52d
tree8e6717fc52a7418216d5e37295dbb184a0fc15ea
parent83523c7d8a2aa3c3ab889ed44181c889f1215cb3
libblkid: add blkid_probe_set_vfs() for pluggable I/O

Add public API to set custom VFS I/O operations on a blkid probe.
This allows callers (e.g., systemd fibers) to replace standard
read/write/lseek/open/close/fsync with custom implementations.

The ops struct is copied into a private allocation owned by the
probe. NULL function pointers fall back to standard syscalls.
Passing NULL resets to defaults.

New public symbol: blkid_probe_set_vfs()
New struct in public header: struct ul_vfs_ops (with include guard
shared with include/vfs.h)

Addresses: https://github.com/util-linux/util-linux/issues/4308
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/docs/libblkid-sections.txt
libblkid/src/blkid.h.in
libblkid/src/blkidP.h
libblkid/src/libblkid.sym
libblkid/src/probe.c