]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: add pluggable VFS I/O support
authorKarel Zak <kzak@redhat.com>
Wed, 15 Jul 2026 10:21:29 +0000 (12:21 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 16 Jul 2026 08:30:00 +0000 (10:30 +0200)
commitfcaf3d82e765e0fc8030b0c8a4da88775354f49b
treec5f34d2c2a63438807be1fc427f2ac14b7adf822
parent2f7845b90a9d5d3e9832afc16e9b090009619385
libmount: add pluggable VFS I/O support

Add three new public APIs for pluggable VFS I/O operations:

- mnt_context_set_vfs(cxt, ops) -- set VFS on mount context (owned copy)
- mnt_cache_refer_vfs(cache, vfs) -- set VFS reference on cache (borrowed)
- mnt_table_refer_vfs(tb, vfs) -- set VFS reference on table (borrowed)

The VFS operations are automatically propagated from the context to its
cache and tables when they are created or set.

Convert blkid probe calls in cache.c (read_from_blkid, fstype_from_blkid)
from blkid_new_probe_from_filename() to the VFS-aware 3-step pattern:
blkid_new_probe() + blkid_probe_set_vfs() + blkid_probe_open_device().

Convert mnt_table_parse_file() to use ul_vfs_fopen() for VFS-aware
file opening.

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/cache.c
libmount/src/context.c
libmount/src/libmount.h.in
libmount/src/libmount.sym
libmount/src/mountP.h
libmount/src/tab.c
libmount/src/tab_parse.c