]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
libfrog: add fallback stubs for libfrog_statmount and fstatmount
authorAnthony Iliopoulos <ailiop@suse.com>
Wed, 13 May 2026 19:30:39 +0000 (21:30 +0200)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 14 May 2026 11:03:23 +0000 (13:03 +0200)
Add stubs for libfrog_statmount and fstatmount to enable compilation of
xfs_healer on systems that lack listmount support. Without these stubs,
statmount.c is not compiled, causing compilation errors due to missing
definitions. The stubs allow xfs_healer to fall back to walking the mount
table in userspace.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
libfrog/statmount.h

index b6f1338830a03e1e249215326d8e2609fd085914..13aaad3a99dca1c8ee1afc2b6783a397649f968e 100644 (file)
@@ -98,11 +98,23 @@ struct statmount {
 int libfrog_listmount(uint64_t mnt_id, int mnt_ns_fd, uint64_t *cursor,
                uint64_t *mnt_ids, size_t nr_mnt_ids);
 
+#ifdef HAVE_LISTMOUNT
 int libfrog_statmount(uint64_t mnt_id, int mnt_ns_fd, uint64_t statmount_flags,
                struct statmount *smbuf, size_t smbuf_size);
-
 int libfrog_fstatmount(int fd, uint64_t statmount_flags,
                struct statmount *smbuf, size_t smbuf_size);
+#else
+static inline int libfrog_statmount(uint64_t mnt_id, int mnt_ns_fd, uint64_t statmount_flags,
+               struct statmount *smbuf, size_t smbuf_size)
+{
+       return -ENOSYS;
+}
+static inline int libfrog_fstatmount(int fd, uint64_t statmount_flags,
+               struct statmount *smbuf, size_t smbuf_size)
+{
+       return -ENOSYS;
+}
+#endif
 
 static inline size_t libfrog_statmount_sizeof(size_t strings_bytes)
 {