@@ -70,7 +70,7 @@ AC_HAVE_SEEK_DATA
AC_HAVE_BMV_OF_SHARED
AC_HAVE_NFTW
AC_HAVE_RLIMIT_NOFILE
-AC_HAVE_XFS_IOC_EXCHANGE_RANGE
+AC_NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE
AC_HAVE_FICLONE
AC_CHECK_FUNCS([renameat2])
@@ -72,7 +72,7 @@ HAVE_SEEK_DATA = @have_seek_data@
HAVE_NFTW = @have_nftw@
HAVE_BMV_OF_SHARED = @have_bmv_of_shared@
HAVE_RLIMIT_NOFILE = @have_rlimit_nofile@
-HAVE_XFS_IOC_EXCHANGE_RANGE = @have_xfs_ioc_exchange_range@
+NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE = @need_internal_xfs_ioc_exchange_range@
HAVE_FICLONE = @have_ficlone@
GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
@@ -36,8 +36,8 @@ ifeq ($(HAVE_COPY_FILE_RANGE),yes)
LCFLAGS += -DHAVE_COPY_FILE_RANGE
endif
-ifeq ($(HAVE_XFS_IOC_EXCHANGE_RANGE),yes)
-LCFLAGS += -DHAVE_XFS_IOC_EXCHANGE_RANGE
+ifeq ($(NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE),yes)
+LCFLAGS += -DNEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE
endif
default: depend $(TARGETS)
@@ -92,16 +92,17 @@ AC_DEFUN([AC_HAVE_BMV_OF_SHARED],
AC_SUBST(have_bmv_of_shared)
])
-# Check if we have XFS_IOC_EXCHANGE_RANGE
-AC_DEFUN([AC_HAVE_XFS_IOC_EXCHANGE_RANGE],
- [ AC_MSG_CHECKING([for XFS_IOC_EXCHANGE_RANGE])
+# Check if we need to override the system XFS_IOC_EXCHANGE_RANGE
+AC_DEFUN([AC_NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE],
+ [ AC_MSG_CHECKING([for new enough XFS_IOC_EXCHANGE_RANGE])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <xfs/xfs.h>
]], [[
struct xfs_exch_range obj;
ioctl(-1, XFS_IOC_EXCHANGE_RANGE, &obj);
- ]])],[have_xfs_ioc_exchange_range=yes
- AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
- AC_SUBST(have_xfs_ioc_exchange_range)
+ ]])],[AC_MSG_RESULT(yes)],
+ [need_internal_xfs_ioc_exchange_range=yes
+ AC_MSG_RESULT(no)])
+ AC_SUBST(need_internal_xfs_ioc_exchange_range)
])
@@ -99,8 +99,8 @@ ifeq ($(HAVE_FICLONE),yes)
TARGETS += t_reflink_read_race
endif
-ifeq ($(HAVE_XFS_IOC_EXCHANGE_RANGE),yes)
-LCFLAGS += -DHAVE_XFS_IOC_EXCHANGE_RANGE
+ifeq ($(NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE),yes)
+LCFLAGS += -DNEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE
endif
CFILES = $(TARGETS:=.c)
@@ -171,7 +171,7 @@
#include <sys/mman.h>
#endif
-#ifndef HAVE_XFS_IOC_EXCHANGE_RANGE
+#ifdef NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE
# include "fiexchange.h"
#endif
@@ -19,8 +19,8 @@ ifeq ($(HAVE_URING), true)
LLDLIBS += -luring
endif
-ifeq ($(HAVE_XFS_IOC_EXCHANGE_RANGE),yes)
-LCFLAGS += -DHAVE_XFS_IOC_EXCHANGE_RANGE
+ifeq ($(NEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE),yes)
+LCFLAGS += -DNEED_INTERNAL_XFS_IOC_EXCHANGE_RANGE
endif
default: depend $(TARGETS)