+#include "tests.h"
+
+#ifdef HAVE_LINUX_BTRFS_H
+
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <linux/fs.h>
#include <linux/btrfs.h>
#include <linux/magic.h>
-#include <linux/fiemap.h>
-#include "config.h"
-#include "tests.h"
#include "xlat.h"
#include "xlat/btrfs_balance_args.h"
#include "xlat/btrfs_features_incompat.h"
#include "xlat/btrfs_key_types.h"
-#include "xlat/fiemap_flags.h"
-#include "xlat/fiemap_extent_flags.h"
+#ifdef HAVE_LINUX_FIEMAP_H
+# include <linux/fiemap.h>
+# include "xlat/fiemap_flags.h"
+# include "xlat/fiemap_extent_flags.h"
+#endif
#ifndef BTRFS_LABEL_SIZE
#define BTRFS_LABEL_SIZE 256
", size=%" PRI__u64", inodes=0x%" PRI__x64
"}) = -1 EBADF (%m)\n", args.inum, args.size, args.fspath);
+#ifdef HAVE_LINUX_FIEMAP_H
if (btrfs_test_root) {
int size;
struct stat si;
close(fd);
free(fiemap);
}
+#endif /* HAVE_LINUX_FIEMAP_H */
}
/*
return 0;
}
+
+#else
+
+SKIP_MAIN_UNDEFINED("HAVE_LINUX_BTRFS_H")
+
+#endif