* [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* [PATCH 2/3] man/xfs_rtgroup_geometry: add rg_writepointer field description
2026-03-13 0:24 [PATCH 1/3] xfs: add write pointer to xfs_rtgroup_geometry Wilfred Mallawa
@ 2026-03-13 0:24 ` 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
1 sibling, 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
From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Update the man/man2/ioctl_xfs_rtgroup_geometry.2 to add a description
for the new rg_writepointer field.
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
---
man/man2/ioctl_xfs_rtgroup_geometry.2 | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/man/man2/ioctl_xfs_rtgroup_geometry.2 b/man/man2/ioctl_xfs_rtgroup_geometry.2
index 37e229b43..5d264acac 100644
--- a/man/man2/ioctl_xfs_rtgroup_geometry.2
+++ b/man/man2/ioctl_xfs_rtgroup_geometry.2
@@ -23,7 +23,8 @@ struct xfs_rtgroup_geometry {
__u32 rg_sick;
__u32 rg_checked;
__u32 rg_flags;
- __u32 rg_reserved[27];
+ __u32 rg_writepointer;
+ __u32 rg_reserved[26];
};
.fi
.in
@@ -39,6 +40,11 @@ filesystem blocks.
The caller can set this field to change the operational behavior of the ioctl.
Currently no flags are defined, so this field must be zero.
.TP
+.I rg_writepointer
+For zoned devices, return the writepointer block offset into the respective
+realtime group. This field is valid only if the XFS_RTGROUP_GEOM_WRITEPOINTER
+flag is set in rg_flags.
+.TP
.IR rg_reserved " and " rg_pad
All reserved fields will be set to zero on return.
.PP
--
2.53.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 2/3] man/xfs_rtgroup_geometry: add rg_writepointer field description
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
1 sibling, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2026-03-13 3:27 UTC (permalink / raw)
To: Wilfred Mallawa
Cc: Christoph Hellwig, Alistair Francis, Damien Le'Moal,
linux-xfs, Wilfred Mallawa
On Fri, Mar 13, 2026 at 10:24:55AM +1000, Wilfred Mallawa wrote:
> From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
>
> Update the man/man2/ioctl_xfs_rtgroup_geometry.2 to add a description
> for the new rg_writepointer field.
>
> Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> ---
> man/man2/ioctl_xfs_rtgroup_geometry.2 | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/man/man2/ioctl_xfs_rtgroup_geometry.2 b/man/man2/ioctl_xfs_rtgroup_geometry.2
> index 37e229b43..5d264acac 100644
> --- a/man/man2/ioctl_xfs_rtgroup_geometry.2
> +++ b/man/man2/ioctl_xfs_rtgroup_geometry.2
> @@ -23,7 +23,8 @@ struct xfs_rtgroup_geometry {
> __u32 rg_sick;
> __u32 rg_checked;
> __u32 rg_flags;
> - __u32 rg_reserved[27];
> + __u32 rg_writepointer;
> + __u32 rg_reserved[26];
> };
> .fi
> .in
> @@ -39,6 +40,11 @@ filesystem blocks.
> The caller can set this field to change the operational behavior of the ioctl.
> Currently no flags are defined, so this field must be zero.
> .TP
> +.I rg_writepointer
> +For zoned devices, return the writepointer block offset into the respective
> +realtime group. This field is valid only if the XFS_RTGROUP_GEOM_WRITEPOINTER
> +flag is set in rg_flags.
> +.TP
Oooh a docs update ❤️
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> .IR rg_reserved " and " rg_pad
> All reserved fields will be set to zero on return.
> .PP
> --
> 2.53.0
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 2/3] man/xfs_rtgroup_geometry: add rg_writepointer field description
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
1 sibling, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2026-03-16 9:04 UTC (permalink / raw)
To: Wilfred Mallawa
Cc: Darrick J . Wong, Christoph Hellwig, Alistair Francis,
Damien Le'Moal, linux-xfs, Wilfred Mallawa
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] xfs_io: report rg_writepointer in report rg_info()
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 0:24 ` Wilfred Mallawa
2026-03-13 3:28 ` Darrick J. Wong
2026-03-16 9:04 ` Christoph Hellwig
1 sibling, 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
From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
If the XFS_RTGROUP_GEOM_WRITEPOINTER field is set, then print the
writepointer in struct xfs_rtgroup_geometry.
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
---
io/aginfo.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/io/aginfo.c b/io/aginfo.c
index f81986f0d..978f0f3b8 100644
--- a/io/aginfo.c
+++ b/io/aginfo.c
@@ -132,6 +132,9 @@ report_rginfo(
printf(_("Checked: 0x%x\n"), rgeo.rg_checked);
printf(_("Flags: 0x%x\n"), rgeo.rg_flags);
+ if (rgeo.rg_flags & XFS_RTGROUP_GEOM_WRITEPOINTER)
+ printf(_("Writepointer: 0x%u\n"), rgeo.rg_writepointer);
+
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 3/3] xfs_io: report rg_writepointer in report rg_info()
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
1 sibling, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2026-03-13 3:28 UTC (permalink / raw)
To: Wilfred Mallawa
Cc: Christoph Hellwig, Alistair Francis, Damien Le'Moal,
linux-xfs, Wilfred Mallawa
On Fri, Mar 13, 2026 at 10:24:56AM +1000, Wilfred Mallawa wrote:
> From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
>
> If the XFS_RTGROUP_GEOM_WRITEPOINTER field is set, then print the
> writepointer in struct xfs_rtgroup_geometry.
>
> Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> ---
> io/aginfo.c | 3 +++
Looks good to me!
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> 1 file changed, 3 insertions(+)
>
> diff --git a/io/aginfo.c b/io/aginfo.c
> index f81986f0d..978f0f3b8 100644
> --- a/io/aginfo.c
> +++ b/io/aginfo.c
> @@ -132,6 +132,9 @@ report_rginfo(
> printf(_("Checked: 0x%x\n"), rgeo.rg_checked);
> printf(_("Flags: 0x%x\n"), rgeo.rg_flags);
>
> + if (rgeo.rg_flags & XFS_RTGROUP_GEOM_WRITEPOINTER)
> + printf(_("Writepointer: 0x%u\n"), rgeo.rg_writepointer);
> +
> return 0;
> }
>
> --
> 2.53.0
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 3/3] xfs_io: report rg_writepointer in report rg_info()
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
1 sibling, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2026-03-16 9:04 UTC (permalink / raw)
To: Wilfred Mallawa
Cc: Darrick J . Wong, Christoph Hellwig, Alistair Francis,
Damien Le'Moal, linux-xfs, Wilfred Mallawa
Looks good and thanks a lot!
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [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