@@ -22,14 +22,14 @@
#include <stdbool.h>
#if BTRFS_FLAT_INCLUDES
+#include "libbtrfs/kerncompat.h"
#include "kernel-lib/list.h"
#include "kernel-lib/rbtree.h"
-#include "libbtrfs/kerncompat.h"
#include "libbtrfs/ioctl.h"
#else
+#include <btrfs/kerncompat.h>
#include <btrfs/list.h>
#include <btrfs/rbtree.h>
-#include <btrfs/kerncompat.h>
#include <btrfs/ioctl.h>
#endif /* BTRFS_FLAT_INCLUDES */
@@ -24,10 +24,10 @@
#include <fcntl.h>
#include <limits.h>
#include <errno.h>
-#include "kernel-lib/rbtree.h"
#include "libbtrfs/ctree.h"
#include "libbtrfs/send-utils.h"
#include "libbtrfs/ioctl.h"
+#include "kernel-lib/rbtree.h"
static int btrfs_subvolid_resolve_sub(int fd, char *path, size_t *path_len,
u64 subvol_id);
We're keeping a libbtrfs compatible kerncompat.h around to make it easier to modify the rest of btrfs-progs. Unfortunately we also use some of kernel-lib in libbtrfs, and those also include kerncompat.h. Those getting included first means we'll pull include/kerncompat.h instead of libbtrfs/kerncompat.h, which will mess things up. Fix this by making sure we include our local copy of kerncompat.h first before we include any other header in btrfs-progs. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- libbtrfs/ctree.h | 4 ++-- libbtrfs/send-utils.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)