diff options
| author | Darrick J. Wong <djwong@kernel.org> | 2024-11-03 20:19:35 -0800 | 
|---|---|---|
| committer | Darrick J. Wong <djwong@kernel.org> | 2024-11-05 13:38:44 -0800 | 
| commit | e0b5b97dde8e4737d06cb5888abd88373abc22df (patch) | |
| tree | 2e3bc144a4a8a44bd5b31281a9758b3e83ac1371 /fs/xfs/xfs_rtalloc.c | |
| parent | ceaa0bd773e2d6d5726d6535f605ecd6b26d2fcc (diff) | |
xfs: move the min and max group block numbers to xfs_group
Move the min and max agblock numbers to the generic xfs_group structure
so that we can start building validators for extents within an rtgroup.
While we're at it, use check_add_overflow for the extent length
computation because that has much better overflow checking.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
| -rw-r--r-- | fs/xfs/xfs_rtalloc.c | 8 | 
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 42070587e856..8520d72afac0 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -878,7 +878,8 @@ xfs_growfs_rt_bmblock(  	if (!nmp)  		return -ENOMEM; -	rtg->rtg_extents = xfs_rtgroup_extents(nmp, rtg_rgno(rtg)); +	xfs_rtgroup_calc_geometry(nmp, rtg, rtg_rgno(rtg), +			nmp->m_sb.sb_rgcount, nmp->m_sb.sb_rextents);  	/*  	 * Recompute the growfsrt reservation from the new rsumsize, so that the @@ -1137,7 +1138,8 @@ out_error:  	/*  	 * Reset rtg_extents to the old value if adding more blocks failed.  	 */ -	rtg->rtg_extents = xfs_rtgroup_extents(rtg_mount(rtg), rtg_rgno(rtg)); +	xfs_rtgroup_calc_geometry(mp, rtg, rtg_rgno(rtg), mp->m_sb.sb_rgcount, +			mp->m_sb.sb_rextents);  	if (old_rsum_cache) {  		kvfree(rtg->rtg_rsum_cache);  		rtg->rtg_rsum_cache = old_rsum_cache; @@ -1519,8 +1521,6 @@ xfs_rtmount_rtg(  {  	int			error, i; -	rtg->rtg_extents = xfs_rtgroup_extents(mp, rtg_rgno(rtg)); -  	for (i = 0; i < XFS_RTGI_MAX; i++) {  		error = xfs_rtginode_load(rtg, i, tp);  		if (error)  | 
