Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: make the new blkzoned UAPI constants discoverable

The Linux 6.19 merge window added the new BLKREPORTZONESV2 ioctl, and
with it the new BLK_ZONE_REP_CACHED and BLK_ZONE_COND_ACTIVE constants.

The two constants are defined as part of enums, which makes it very
painful for userspace to discover if they are present in the installed
system headers.

Use the #define to the same name trick to make them trivially
discoverable using CPP directives.

Fixes: 0bf0e2e46668 ("block: track zone conditions")
Fixes: b30ffcdc0c15 ("block: introduce BLKREPORTZONESV2 ioctl")
Reported-by: Andrey Albershteyn <aalbersh@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
f5f2bad6 47bdf1d2

+4 -2
+4 -2
include/uapi/linux/blkzoned.h
··· 81 81 BLK_ZONE_COND_FULL = 0xE, 82 82 BLK_ZONE_COND_OFFLINE = 0xF, 83 83 84 - BLK_ZONE_COND_ACTIVE = 0xFF, 84 + BLK_ZONE_COND_ACTIVE = 0xFF, /* added in Linux 6.19 */ 85 + #define BLK_ZONE_COND_ACTIVE BLK_ZONE_COND_ACTIVE 85 86 }; 86 87 87 88 /** ··· 101 100 BLK_ZONE_REP_CAPACITY = (1U << 0), 102 101 103 102 /* Input flags */ 104 - BLK_ZONE_REP_CACHED = (1U << 31), 103 + BLK_ZONE_REP_CACHED = (1U << 31), /* added in Linux 6.19 */ 104 + #define BLK_ZONE_REP_CACHED BLK_ZONE_REP_CACHED 105 105 }; 106 106 107 107 /**