Commit f5f2bad6 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

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: 0bf0e2e4 ("block: track zone conditions")
Fixes: b30ffcdc ("block: introduce BLKREPORTZONESV2 ioctl")
Reported-by: default avatarAndrey Albershteyn <aalbersh@redhat.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 47bdf1d2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -81,7 +81,8 @@ enum blk_zone_cond {
	BLK_ZONE_COND_FULL	= 0xE,
	BLK_ZONE_COND_OFFLINE	= 0xF,

	BLK_ZONE_COND_ACTIVE	= 0xFF,
	BLK_ZONE_COND_ACTIVE	= 0xFF, /* added in Linux 6.19 */
#define BLK_ZONE_COND_ACTIVE	BLK_ZONE_COND_ACTIVE
};

/**
@@ -100,7 +101,8 @@ enum blk_zone_report_flags {
	BLK_ZONE_REP_CAPACITY	= (1U << 0),

	/* Input flags */
	BLK_ZONE_REP_CACHED	= (1U << 31),
	BLK_ZONE_REP_CACHED	= (1U << 31), /* added in Linux 6.19 */
#define BLK_ZONE_REP_CACHED	BLK_ZONE_REP_CACHED
};

/**