public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] xfs: add write pointer to xfs_rtgroup_geometry
@ 2026-03-13  0:24 Wilfred Mallawa
  2026-03-13  0:24 ` [PATCH 2/3] man/xfs_rtgroup_geometry: add rg_writepointer field description Wilfred Mallawa
  2026-03-13  0:24 ` [PATCH 3/3] xfs_io: report rg_writepointer in report rg_info() Wilfred Mallawa
  0 siblings, 2 replies; 7+ messages in thread
From: Wilfred Mallawa @ 2026-03-13  0:24 UTC (permalink / raw)
  To: Darrick J . Wong, Christoph Hellwig
  Cc: Alistair Francis, Damien Le'Moal, linux-xfs, Wilfred Mallawa,
	Carlos Maiolino

From: Wilfred Mallawa <wilfred.mallawa@wdc.com>

Source kernel commit: c6ce65cb17aa9321687d1b8a842487f839e1a548

There is currently no XFS ioctl that allows userspace to retrieve the
write pointer for a specific realtime group block for zoned XFS. On zoned
block devices, userspace can obtain this information via zone reports from
the underlying device. However, for zoned XFS operating on regular block
devices, no equivalent mechanism exists.

Access to the realtime group write pointer is useful to userspace
development and analysis tools such as Zonar [1]. So extend the existing
struct xfs_rtgroup_geometry to add a new rg_writepointer field. This field
is valid if XFS_RTGROUP_GEOM_WRITEPOINTER flag is set. The rg_writepointer
field specifies the location of the current writepointer as a block offset
into the respective rtgroup.

[1] https://lwn.net/Articles/1059364/

Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
---
 libxfs/xfs_fs.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
index d165de607..185f09f32 100644
--- a/libxfs/xfs_fs.h
+++ b/libxfs/xfs_fs.h
@@ -995,7 +995,8 @@ struct xfs_rtgroup_geometry {
 	__u32 rg_sick;		/* o: sick things in ag */
 	__u32 rg_checked;	/* o: checked metadata in ag */
 	__u32 rg_flags;		/* i/o: flags for this ag */
-	__u32 rg_reserved[27];	/* o: zero */
+	__u32 rg_writepointer;  /* o: write pointer block offset for zoned */
+	__u32 rg_reserved[26];	/* o: zero */
 };
 #define XFS_RTGROUP_GEOM_SICK_SUPER	(1U << 0)  /* superblock */
 #define XFS_RTGROUP_GEOM_SICK_BITMAP	(1U << 1)  /* rtbitmap */
@@ -1003,6 +1004,8 @@ struct xfs_rtgroup_geometry {
 #define XFS_RTGROUP_GEOM_SICK_RMAPBT	(1U << 3)  /* reverse mappings */
 #define XFS_RTGROUP_GEOM_SICK_REFCNTBT	(1U << 4)  /* reference counts */
 
+#define XFS_RTGROUP_GEOM_WRITEPOINTER  (1U << 0)  /* write pointer */
+
 /* Health monitor event domains */
 
 /* affects the whole fs */
-- 
2.53.0


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

end of thread, other threads:[~2026-03-16  9:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13  0:24 [PATCH 1/3] xfs: add write pointer to xfs_rtgroup_geometry Wilfred Mallawa
2026-03-13  0:24 ` [PATCH 2/3] man/xfs_rtgroup_geometry: add rg_writepointer field description Wilfred Mallawa
2026-03-13  3:27   ` Darrick J. Wong
2026-03-16  9:04   ` Christoph Hellwig
2026-03-13  0:24 ` [PATCH 3/3] xfs_io: report rg_writepointer in report rg_info() Wilfred Mallawa
2026-03-13  3:28   ` Darrick J. Wong
2026-03-16  9:04   ` Christoph Hellwig

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