]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: add a rtg_blocks helper
authorChristoph Hellwig <hch@lst.de>
Mon, 14 Apr 2025 05:35:49 +0000 (07:35 +0200)
committerAndrey Albershteyn <aalbersh@kernel.org>
Tue, 29 Apr 2025 16:09:57 +0000 (18:09 +0200)
Source kernel commit: 012482b3308a49a84c2a7df08218dd4ad081e1da

Shortcut dereferencing the xg_block_count field in the generic group
structure.

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_rtgroup.c
libxfs/xfs_rtgroup.h

index 24fb160b806757e1da52aea2473fb6e81e611248..6f65ecc3015ddac66bce34758253d312282b60ff 100644 (file)
@@ -267,7 +267,7 @@ xfs_rtgroup_get_geometry(
        /* Fill out form. */
        memset(rgeo, 0, sizeof(*rgeo));
        rgeo->rg_number = rtg_rgno(rtg);
-       rgeo->rg_length = rtg_group(rtg)->xg_block_count;
+       rgeo->rg_length = rtg_blocks(rtg);
        xfs_rtgroup_geom_health(rtg, rgeo);
        return 0;
 }
index 03f39d4e43fc7f3a9583730e5634a46520ceed21..9c7e03f913cb5322fb16ec3fa3d699e1a111c83e 100644 (file)
@@ -66,6 +66,11 @@ static inline xfs_rgnumber_t rtg_rgno(const struct xfs_rtgroup *rtg)
        return rtg->rtg_group.xg_gno;
 }
 
+static inline xfs_rgblock_t rtg_blocks(const struct xfs_rtgroup *rtg)
+{
+       return rtg->rtg_group.xg_block_count;
+}
+
 static inline struct xfs_inode *rtg_bitmap(const struct xfs_rtgroup *rtg)
 {
        return rtg->rtg_inodes[XFS_RTGI_BITMAP];