public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-6.19] block: make the new blkzoned UAPI constants discoverable
@ 2026-01-21  7:31 Christoph Hellwig
  2026-01-21  8:16 ` Johannes Thumshirn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christoph Hellwig @ 2026-01-21  7:31 UTC (permalink / raw)
  To: axboe; +Cc: dlemoal, linux-block, aalbersh

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>
---
 include/uapi/linux/blkzoned.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/blkzoned.h b/include/uapi/linux/blkzoned.h
index e33f02703350..663836120966 100644
--- a/include/uapi/linux/blkzoned.h
+++ b/include/uapi/linux/blkzoned.h
@@ -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
 };
 
 /**
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH for-6.19] block: make the new blkzoned UAPI constants discoverable
  2026-01-21  7:31 [PATCH for-6.19] block: make the new blkzoned UAPI constants discoverable Christoph Hellwig
@ 2026-01-21  8:16 ` Johannes Thumshirn
  2026-01-21 14:48 ` Jens Axboe
  2026-01-22  5:52 ` Damien Le Moal
  2 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2026-01-21  8:16 UTC (permalink / raw)
  To: hch, axboe@kernel.dk
  Cc: dlemoal@kernel.org, linux-block@vger.kernel.org,
	aalbersh@redhat.com

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH for-6.19] block: make the new blkzoned UAPI constants discoverable
  2026-01-21  7:31 [PATCH for-6.19] block: make the new blkzoned UAPI constants discoverable Christoph Hellwig
  2026-01-21  8:16 ` Johannes Thumshirn
@ 2026-01-21 14:48 ` Jens Axboe
  2026-01-22  5:52 ` Damien Le Moal
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2026-01-21 14:48 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: dlemoal, linux-block, aalbersh


On Wed, 21 Jan 2026 08:31:49 +0100, Christoph Hellwig wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] block: make the new blkzoned UAPI constants discoverable
      commit: f5f2bad67a45cd1ef6f5b727da104694a81b3666

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH for-6.19] block: make the new blkzoned UAPI constants discoverable
  2026-01-21  7:31 [PATCH for-6.19] block: make the new blkzoned UAPI constants discoverable Christoph Hellwig
  2026-01-21  8:16 ` Johannes Thumshirn
  2026-01-21 14:48 ` Jens Axboe
@ 2026-01-22  5:52 ` Damien Le Moal
  2 siblings, 0 replies; 4+ messages in thread
From: Damien Le Moal @ 2026-01-22  5:52 UTC (permalink / raw)
  To: Christoph Hellwig, axboe; +Cc: linux-block, aalbersh

On 2026/01/21 18:31, Christoph Hellwig wrote:
> 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: Damien Le Moal <dlemoal@kernel.org>


-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-22  5:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-21  7:31 [PATCH for-6.19] block: make the new blkzoned UAPI constants discoverable Christoph Hellwig
2026-01-21  8:16 ` Johannes Thumshirn
2026-01-21 14:48 ` Jens Axboe
2026-01-22  5:52 ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox