btrfs-progs: include linux/const.h to fix build with 5.12+ headers

btrfs-tools compile fails with mips, musl and 5.12+ headers.

The definition of __ALIGN_KERNEL has moved in 5.12+ kernels, so we
add an explicit include of const.h to pickup the macro:

  | make: *** [Makefile:595: mkfs.btrfs] Error 1
  | make: *** Waiting for unfinished jobs....
  | libbtrfs.a(volumes.o): in function `dev_extent_search_start':
  | /usr/src/debug/btrfs-tools/5.12.1-r0/git/kernel-shared/volumes.c:464: undefined reference to `__ALIGN_KERNEL'
  | collect2: error: ld returned 1 exit status

This is safe for older kernel's as well, since the header still
exists, and is valid to include.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
[remove invalid OE Upstream-status]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Bruce Ashfield 2021-12-30 15:23:59 +02:00 committed by David Sterba
parent 07320bd20f
commit b28f7bd9bb
1 changed files with 1 additions and 0 deletions

View File

@ -29,6 +29,7 @@
#include <stddef.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/const.h>
#include <stdint.h>
#include <features.h>