AC_NEED_INTERNAL_FSXATTR
AC_NEED_INTERNAL_FSCRYPT_ADD_KEY_ARG
AC_NEED_INTERNAL_FSCRYPT_POLICY_V2
+AC_NEED_INTERNAL_STATX
AC_HAVE_GETFSMAP
AC_HAVE_MAP_SYNC
AC_HAVE_DEVMAPPER
NEED_INTERNAL_FSXATTR = @need_internal_fsxattr@
NEED_INTERNAL_FSCRYPT_ADD_KEY_ARG = @need_internal_fscrypt_add_key_arg@
NEED_INTERNAL_FSCRYPT_POLICY_V2 = @need_internal_fscrypt_policy_v2@
+NEED_INTERNAL_STATX = @need_internal_statx@
HAVE_GETFSMAP = @have_getfsmap@
HAVE_MAP_SYNC = @have_map_sync@
HAVE_DEVMAPPER = @have_devmapper@
ifeq ($(NEED_INTERNAL_FSCRYPT_POLICY_V2),yes)
PCFLAGS+= -DOVERRIDE_SYSTEM_FSCRYPT_POLICY_V2
endif
+ifeq ($(NEED_INTERNAL_STATX),yes)
+PCFLAGS+= -DOVERRIDE_SYSTEM_STATX
+endif
ifeq ($(HAVE_GETFSMAP),yes)
PCFLAGS+= -DHAVE_GETFSMAP
endif
* Portions of statx support written by David Howells (dhowells@redhat.com)
*/
+#ifdef OVERRIDE_SYSTEM_STATX
+#define statx sys_statx
+#endif
+
#include "command.h"
#include "input.h"
#include "init.h"
printf("stat.rdev_minor = %u\n", stx->stx_rdev_minor);
printf("stat.dev_major = %u\n", stx->stx_dev_major);
printf("stat.dev_minor = %u\n", stx->stx_dev_minor);
+ printf("stat.atomic_write_unit_min = %u\n", stx->stx_atomic_write_unit_min);
+ printf("stat.atomic_write_unit_max = %u\n", stx->stx_atomic_write_unit_max);
+ printf("stat.atomic_write_segments_max = %u\n", stx->stx_atomic_write_segments_max);
return 0;
}
__s32 tv_nsec;
__s32 __reserved;
};
+#endif
/*
* Structures for the extended file attribute retrieval system call
* will have values installed for compatibility purposes so that stat() and
* co. can be emulated in userspace.
*/
+#ifdef OVERRIDE_SYSTEM_STATX
+#undef statx
struct statx {
/* 0x00 */
__u32 stx_mask; /* What results were written [uncond] */
__u32 stx_dev_major; /* ID of device containing file [uncond] */
__u32 stx_dev_minor;
/* 0x90 */
- __u64 __spare2[14]; /* Spare space for future expansion */
+ __u64 stx_mnt_id;
+ __u32 stx_dio_mem_align; /* Memory buffer alignment for direct I/O */
+ __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */
+ /* 0xa0 */
+ __u64 stx_subvol; /* Subvolume identifier */
+ __u32 stx_atomic_write_unit_min; /* Min atomic write unit in bytes */
+ __u32 stx_atomic_write_unit_max; /* Max atomic write unit in bytes */
+ /* 0xb0 */
+ __u32 stx_atomic_write_segments_max; /* Max atomic write segment count */
+ __u32 __spare1[1];
+ /* 0xb8 */
+ __u64 __spare3[9]; /* Spare space for future expansion */
/* 0x100 */
};
+#endif
+#ifndef STATX_TYPE
/*
* Flags to be stx_mask
*
#define STATX_ATTR_AUTOMOUNT 0x00001000 /* Dir: Automount trigger */
#endif /* STATX_TYPE */
+
+#ifndef STATX_WRITE_ATOMIC
+#define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */
+#endif
+
#endif /* XFS_IO_STATX_H */
AC_SUBST(need_internal_fscrypt_policy_v2)
])
+#
+# Check if we need to override the system struct statx with
+# the internal definition. This /only/ happens if the system
+# actually defines struct statx /and/ the system definition
+# is missing certain fields.
+#
+AC_DEFUN([AC_NEED_INTERNAL_STATX],
+ [ AC_CHECK_TYPE(struct statx,
+ [
+ AC_CHECK_MEMBER(struct statx.stx_atomic_write_unit_min,
+ ,
+ need_internal_statx=yes,
+ [#include <linux/stat.h>]
+ )
+ ],,
+ [#include <linux/stat.h>]
+ )
+ AC_SUBST(need_internal_statx)
+ ])
+
#
# Check if we have a FS_IOC_GETFSMAP ioctl (Linux)
#