The BTRFS_DEV_ALLOCATION_* values sit in include/uapi/linux/btrfs_tree.h
inside #ifdef CONFIG_BTRFS_ALLOCATOR_HINTS, to keep them away from
userspace until the interface is settled. A CONFIG_ symbol in a UAPI
header is rejected by scripts/headers_install.sh:
error: include/uapi/linux/btrfs_tree.h: leak CONFIG_BTRFS_ALLOCATOR_HINTS to user-space
so 'make headers_install' (and the deb/rpm package targets, which run
it) fail with the patch set applied.
The values are on-disk format: they give the meaning of the low bits of
dev_item.type, and userspace (btrfs-progs) needs them to read and set a
device's hint. Defining them changes no userspace-visible structure.
So drop the guard and always export the values. The code that acts on
the hints stays under CONFIG_BTRFS_ALLOCATOR_HINTS.
Assisted-by: Claude:claude-opus-5-5
struct btrfs_key_ptr ptrs[];
} __attribute__ ((__packed__));
-/*
- * This defines the chunk allocation hints for a device. It uses an ifdef guard
- * in UAPI to avoid exposing it to userspace.
- */
-#ifdef CONFIG_BTRFS_ALLOCATOR_HINTS
/* dev_item.type */
/* btrfs chunk allocation hints */
#define BTRFS_DEV_ALLOCATION_NONE_ONLY (5ULL)
/* 6..7 are unused values */
-#endif /* CONFIG_BTRFS_ALLOCATOR_HINTS */
-
struct btrfs_dev_item {
/* the internal btrfs device id */
__le64 devid;