AC_HAVE_READDIR
AC_HAVE_FSETXATTR
AC_HAVE_MREMAP
+AC_NEED_INTERNAL_FSXATTR
if test "$enable_blkid" = yes; then
AC_HAVE_BLKID_TOPO
HAVE_FLS = @have_fls@
HAVE_FSETXATTR = @have_fsetxattr@
HAVE_MREMAP = @have_mremap@
+NEED_INTERNAL_FSXATTR = @need_internal_fsxattr@
GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
# -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
ifeq ($(ENABLE_BLKID),yes)
PCFLAGS+= -DENABLE_BLKID
endif
+ifeq ($(NEED_INTERNAL_FSXATTR),yes)
+PCFLAGS+= -DOVERRIDE_SYSTEM_FSXATTR
+endif
GCFLAGS = $(OPTIMIZER) $(DEBUG) \
#include <stdio.h>
#include <asm/types.h>
#include <mntent.h>
+#ifdef OVERRIDE_SYSTEM_FSXATTR
+# define fsxattr sys_fsxattr
+#endif
#include <linux/fs.h> /* fsxattr defintion for new kernels */
+#ifdef OVERRIDE_SYSTEM_FSXATTR
+# undef fsxattr
+#endif
static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
{
* are a copy of the definitions moved to linux/uapi/fs.h in the 4.5 kernel,
* so this is purely for supporting builds against old kernel headers.
*/
-#ifndef FS_IOC_FSGETXATTR
+#if !defined FS_IOC_FSGETXATTR || defined OVERRIDE_SYSTEM_FSXATTR
struct fsxattr {
__u32 fsx_xflags; /* xflags field value (get/set) */
__u32 fsx_extsize; /* extsize field value (get/set)*/
__u32 fsx_cowextsize; /* cow extsize field value (get/set) */
unsigned char fsx_pad[8];
};
+#endif
+#ifndef FS_IOC_FSGETXATTR
/*
* Flags for the fsx_xflags field
*/
#include "platform_defs.h"
#include "command.h"
#include <linux/fiemap.h>
-#include <linux/fs.h>
#include "init.h"
#include "io.h"
)
AC_SUBST(have_mremap)
])
+
+#
+# Check if we need to override the system struct fsxattr with
+# the internal definition. This /only/ happens if the system
+# actually defines struct fsxattr /and/ the system definition
+# is missing certain fields.
+#
+AC_DEFUN([AC_NEED_INTERNAL_FSXATTR],
+ [
+ AC_SUBST(need_internal_fsxattr)
+ ])