]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: export zoned geometry via XFS_FSOP_GEOM
authorChristoph Hellwig <hch@lst.de>
Mon, 14 Apr 2025 05:35:57 +0000 (07:35 +0200)
committerAndrey Albershteyn <aalbersh@kernel.org>
Tue, 29 Apr 2025 16:09:57 +0000 (18:09 +0200)
Source kernel commit: 1fd8159e7ca41203798b6f65efaf1724eb318cd4

Export the zoned geometry information so that userspace can query it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_fs.h
libxfs/xfs_sb.c

index 2c3171262b445b4b50c08efe5bd647fd183ca2b1..5e66fb2b2cc7b75e9cb312a4485a6ed11f4a5287 100644 (file)
@@ -189,7 +189,9 @@ struct xfs_fsop_geom {
        uint32_t        checked;        /* o: checked fs & rt metadata  */
        __u32           rgextents;      /* rt extents in a realtime group */
        __u32           rgcount;        /* number of realtime groups    */
-       __u64           reserved[16];   /* reserved space               */
+       __u64           rtstart;        /* start of internal rt section */
+       __u64           rtreserved;     /* RT (zoned) reserved blocks   */
+       __u64           reserved[14];   /* reserved space               */
 };
 
 #define XFS_FSOP_GEOM_SICK_COUNTERS    (1 << 0)  /* summary counters */
@@ -247,6 +249,7 @@ typedef struct xfs_fsop_resblks {
 #define XFS_FSOP_GEOM_FLAGS_EXCHANGE_RANGE (1 << 24) /* exchange range */
 #define XFS_FSOP_GEOM_FLAGS_PARENT     (1 << 25) /* linux parent pointers */
 #define XFS_FSOP_GEOM_FLAGS_METADIR    (1 << 26) /* metadata directories */
+#define XFS_FSOP_GEOM_FLAGS_ZONED      (1 << 27) /* zoned rt device */
 
 /*
  * Minimum and maximum sizes need for growth checks.
index a95d712363fa2b396e151e5fe1567811f1457162..8344b40e4ab922e1d7e9a966ae4aede70136c039 100644 (file)
@@ -1566,6 +1566,8 @@ xfs_fs_geometry(
                geo->flags |= XFS_FSOP_GEOM_FLAGS_EXCHANGE_RANGE;
        if (xfs_has_metadir(mp))
                geo->flags |= XFS_FSOP_GEOM_FLAGS_METADIR;
+       if (xfs_has_zoned(mp))
+               geo->flags |= XFS_FSOP_GEOM_FLAGS_ZONED;
        geo->rtsectsize = sbp->sb_blocksize;
        geo->dirblocksize = xfs_dir2_dirblock_bytes(sbp);
 
@@ -1586,6 +1588,10 @@ xfs_fs_geometry(
                geo->rgcount = sbp->sb_rgcount;
                geo->rgextents = sbp->sb_rgextents;
        }
+       if (xfs_has_zoned(mp)) {
+               geo->rtstart = sbp->sb_rtstart;
+               geo->rtreserved = sbp->sb_rtreserved;
+       }
 }
 
 /* Read a secondary superblock. */