Skip to content

Commit fb8c884

Browse files
committed
fix: feature-detect fuse_file_info.parallel_direct_writes
The field appeared in libfuse 3.15, not 3.14 as the version check assumed (ubuntu-24.04 ships 3.14 and failed to build). Detect the struct member in configure instead of comparing version numbers.
1 parent ad0bfda commit fb8c884

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

configure.ac

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,22 @@ then
319319
else
320320
AC_MSG_RESULT([3])
321321
fi
322+
323+
dnl
324+
dnl struct fuse_file_info.parallel_direct_writes appeared in libfuse 3.15;
325+
dnl detect the member instead of relying on version numbers.
326+
dnl
327+
if test "x${with_fuse2}" != "xyes"
328+
then
329+
SAVE_CFLAGS=$CFLAGS
330+
CFLAGS="$CFLAGS ${FUSE_MODULE_CFLAGS} -DFUSE_USE_VERSION=31"
331+
AC_CHECK_MEMBER([struct fuse_file_info.parallel_direct_writes],
332+
[AC_DEFINE([HAVE_FUSE_PARALLEL_DIRECT_WRITES], [1],
333+
[Define to 1 if struct fuse_file_info has parallel_direct_writes])],
334+
[],
335+
[[#include <fuse.h>]])
336+
CFLAGS="$SAVE_CFLAGS"
337+
fi
322338
PKG_CHECK_MODULES([LIBXML2_MODULE], [libxml-2.0 >= 2.6.16])
323339

324340
if test "x${host_mac}" = "xyes"

src/ltfs_fuse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static void _ltfs_fuse_set_cache_flags(struct fuse_file_info *fi, struct ltfs_fu
117117
if (priv->direct_io) {
118118
fi->direct_io = 1;
119119
fi->keep_cache = 0;
120-
#if defined(HAVE_FUSE3) && FUSE_VERSION >= FUSE_MAKE_VERSION(3, 14)
120+
#ifdef HAVE_FUSE_PARALLEL_DIRECT_WRITES
121121
/* Writes are serialized further down; this only removes the
122122
* kernel-side exclusive lock for non-extending direct writes. */
123123
fi->parallel_direct_writes = 1;

0 commit comments

Comments
 (0)