Skip to contentSkip to conversation

erofs-utils: fuse: fix compile error with older libfuse versions

PATCH New Gao Xiang 1 participant 1 message Aug 5, 2025

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs-utils: fuse: fix compile error with older libfuse versions

Fixes a43529e6c912 ("erofs-utils: fuse: kernel caching for readdir")
---
 configure.ac | 5 +++++
 fuse/main.c  | 4 ++++
 2 files changed, 9 insertions(+)
configure.ac +5 -0
index 2d42b1f..da6ae48 100644
@@ -403,6 +403,11 @@ AS_IF([test "x$enable_fuse" != "xno"], [
       have_fuse="yes"
     ], [have_fuse="no"])
   ])
+  AC_CHECK_MEMBERS([struct fuse_file_info.cache_readdir, struct fuse_file_info.keep_cache],
+    [], [], [[
+#include <fuse.h>
+  ]])
+
   LIBS="${saved_LIBS}"
   CPPFLAGS="${saved_CPPFLAGS}"], [have_fuse="no"])
 
fuse/main.c +4 -0
index c754805..c129a0c 100644
@@ -301,8 +301,12 @@ static void erofsfuse_opendir(fuse_req_t req, fuse_ino_t ino,
 	}
 
 	fi->fh = (uint64_t)vi;
+#ifdef HAVE_STRUCT_FUSE_FILE_INFO_CACHE_READDIR
 	fi->cache_readdir = 1;
+#endif
+#ifdef HAVE_STRUCT_FUSE_FILE_INFO_KEEP_CACHE
 	fi->keep_cache = 1;
+#endif
 	fuse_reply_open(req, fi);
 	return;
 
Signature · 1 line
2.43.5