Skip to content

Commit f5f2bad

Browse files
Christoph Hellwigaxboe
authored andcommitted
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: 0bf0e2e ("block: track zone conditions") Fixes: b30ffcd ("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>
1 parent 47bdf1d commit f5f2bad

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

include/uapi/linux/blkzoned.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ enum blk_zone_cond {
8181
BLK_ZONE_COND_FULL = 0xE,
8282
BLK_ZONE_COND_OFFLINE = 0xF,
8383

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
8586
};
8687

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

102103
/* Input flags */
103-
BLK_ZONE_REP_CACHED = (1U << 31),
104+
BLK_ZONE_REP_CACHED = (1U << 31), /* added in Linux 6.19 */
105+
#define BLK_ZONE_REP_CACHED BLK_ZONE_REP_CACHED
104106
};
105107

106108
/**

0 commit comments

Comments
 (0)