]> git.hungrycats.org Git - linux/commit
btrfs: allocator hints: define the hint values unconditionally in the UAPI header
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 4 Oct 2026 04:44:02 +0000 (00:44 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Thu, 12 Nov 2026 15:24:16 +0000 (10:24 -0500)
commit13ef4203e7f55466fddfef278aa63a704db31970
treebd2adbdb8704c3eb8596ef10855c86020615dd70
parentfa401eea94fa3a52dca7cd8b069048cd825bd17d
btrfs: allocator hints: define the hint values unconditionally in the UAPI header

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
include/uapi/linux/btrfs_tree.h