@@ -69,15 +69,39 @@ AC_PACKAGE_WANT_LIBBTRFSUTIL
AC_HAVE_COPY_FILE_RANGE
AC_CHECK_FUNCS([renameat2])
AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <linux/mount.h>]])
-AC_CHECK_TYPES([struct btrfs_qgroup_limit], [], [], [[#include <linux/btrfs.h>]])
-AC_CHECK_TYPES([struct btrfs_qgroup_inherit], [], [], [[#include <linux/btrfs.h>]])
-AC_CHECK_TYPES([struct btrfs_ioctl_vol_args], [], [], [[#include <linux/btrfs.h>]])
-AC_CHECK_TYPES([struct btrfs_ioctl_vol_args_v2], [], [], [[#include <linux/btrfs.h>]])
-AC_CHECK_TYPES([struct btrfs_ioctl_ino_lookup_args], [], [], [[#include <linux/btrfs.h>]])
-AC_CHECK_TYPES([struct btrfs_ioctl_ino_lookup_user_args], [], [], [[#include <linux/btrfs.h>]])
-AC_CHECK_TYPES([struct btrfs_ioctl_get_subvol_rootref_args], [], [], [[#include <linux/btrfs.h>]])
+AC_CHECK_TYPES([struct btrfs_qgroup_limit], [], [], [[
+#include <stddef.h>
+#include <linux/btrfs.h>
+]])
+AC_CHECK_TYPES([struct btrfs_qgroup_inherit], [], [], [[
+#include <stddef.h>
+#include <linux/btrfs.h>
+]])
+AC_CHECK_TYPES([struct btrfs_ioctl_vol_args], [], [], [[
+#include <stddef.h>
+#include <linux/btrfs.h>
+]])
+AC_CHECK_TYPES([struct btrfs_ioctl_vol_args_v2], [], [], [[
+#include <stddef.h>
+#include <linux/btrfs.h>
+]])
+AC_CHECK_TYPES([struct btrfs_ioctl_ino_lookup_args], [], [], [[
+#include <stddef.h>
+#include <linux/btrfs.h>
+]])
+AC_CHECK_TYPES([struct btrfs_ioctl_ino_lookup_user_args], [], [], [[
+#include <stddef.h>
+#include <linux/btrfs.h>
+]])
+AC_CHECK_TYPES([struct btrfs_ioctl_get_subvol_rootref_args], [], [], [[
+#include <stddef.h>
+#include <linux/btrfs.h>
+]])
AC_CHECK_HEADERS([linux/btrfs.h linux/btrfs_tree.h])
-AC_CHECK_MEMBERS([struct btrfs_ioctl_vol_args_v2.subvolid], [], [], [[#include <linux/btrfs.h>]])
+AC_CHECK_MEMBERS([struct btrfs_ioctl_vol_args_v2.subvolid], [], [], [[
+#include <stddef.h>
+#include <linux/btrfs.h>
+]])
AC_CONFIG_HEADER(include/config.h)
AC_CONFIG_FILES([include/builddefs])
On old distros, we can't detect some btrfs structs because of undeclared 'NULL' in btrfs_err_str function. This function has been removed after kernel commit 68598d2ea8863 ("btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h"). Fix this bug in xfstests layer by adding stddef.h because NULL is defined in stddef.h(it is in /usr/lib/gcc*/ directory). Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com> --- configure.ac | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-)