Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Carlos Maiolino <cem@kernel.org>,
	Damien Le Moal <dlemoal@kernel.org>,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/6] xfs: add a xfs_rtgroup_raw_size helper
Date: Fri, 9 Jan 2026 17:00:07 -0800	[thread overview]
Message-ID: <20260110010007.GW15551@frogsfrogsfrogs> (raw)
In-Reply-To: <20260109172139.2410399-3-hch@lst.de>

On Fri, Jan 09, 2026 at 06:20:47PM +0100, Christoph Hellwig wrote:
> Add a helper to figure the on-disk size of a group, accounting for the
> XFS_SB_FEAT_INCOMPAT_ZONE_GAPS feature if needed.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/xfs/libxfs/xfs_rtgroup.h | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/fs/xfs/libxfs/xfs_rtgroup.h b/fs/xfs/libxfs/xfs_rtgroup.h
> index 73cace4d25c7..c0b9f9f2c413 100644
> --- a/fs/xfs/libxfs/xfs_rtgroup.h
> +++ b/fs/xfs/libxfs/xfs_rtgroup.h
> @@ -371,4 +371,19 @@ xfs_rtgs_to_rfsbs(
>  	return xfs_groups_to_rfsbs(mp, nr_groups, XG_TYPE_RTG);
>  }
>  
> +/*
> + * Return the "raw" size of a group on the hardware device.  This includes the
> + * daddr gaps present for XFS_SB_FEAT_INCOMPAT_ZONE_GAPS file systems.
> + */
> +static inline xfs_rgblock_t
> +xfs_rtgroup_raw_size(
> +	struct xfs_mount	*mp)
> +{
> +	struct xfs_groups	*g = &mp->m_groups[XG_TYPE_RTG];
> +
> +	if (g->has_daddr_gaps)
> +		return 1U << g->blklog;
> +	return g->blocks;
> +}
> +
>  #endif /* __LIBXFS_RTGROUP_H */
> -- 
> 2.47.3
> 
> 

  reply	other threads:[~2026-01-10  1:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-09 17:20 refactor zone reporting Christoph Hellwig
2026-01-09 17:20 ` [PATCH 1/6] xfs: add missing forward declaration in xfs_zones.h Christoph Hellwig
2026-01-10  0:50   ` Darrick J. Wong
2026-01-09 17:20 ` [PATCH 2/6] xfs: add a xfs_rtgroup_raw_size helper Christoph Hellwig
2026-01-10  1:00   ` Darrick J. Wong [this message]
2026-01-09 17:20 ` [PATCH 3/6] xfs: pass the write pointer to xfs_init_zone Christoph Hellwig
2026-01-10  1:11   ` Darrick J. Wong
2026-01-12 10:15   ` Damien Le Moal
2026-01-12 21:50     ` Darrick J. Wong
2026-01-13  7:47       ` Christoph Hellwig
2026-01-13  7:47     ` Christoph Hellwig
2026-01-13  9:27       ` Damien Le Moal
2026-01-09 17:20 ` [PATCH 4/6] xfs: split and refactor zone validation Christoph Hellwig
2026-01-10  1:44   ` Darrick J. Wong
2026-01-12 10:12     ` Christoph Hellwig
2026-01-09 17:20 ` [PATCH 5/6] xfs: check that used blocks are smaller than the write pointer Christoph Hellwig
2026-01-10  1:25   ` Darrick J. Wong
2026-01-09 17:20 ` [PATCH 6/6] xfs: use blkdev_get_zone_info to simply zone reporting Christoph Hellwig
2026-01-10  1:28   ` Darrick J. Wong
2026-01-13 10:33   ` Damien Le Moal
  -- strict thread matches above, loose matches on Subject: below --
2026-01-14  6:53 refactor zone reporting v2 Christoph Hellwig
2026-01-14  6:53 ` [PATCH 2/6] xfs: add a xfs_rtgroup_raw_size helper Christoph Hellwig
2026-01-14  9:56   ` Damien Le Moal
2026-01-16 14:04   ` Carlos Maiolino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260110010007.GW15551@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox