Re: [PATCH 35/50] xfs_db: report rt group and block number in the bmap command

Christoph Hellwig
2024-12-10T05:49:27Z

On Fri, Dec 06, 2024 at 04:14:05PM -0800, Darrick J. Wong wrote:
> +static void
> +print_group_bmbt(
> + bool isrt,
> + int whichfork,
> + const struct bmap_ext *be)
> +{
> + unsigned int gno;
> + unsigned long long gbno;
> +
> + if (whichfork == XFS_DATA_FORK && isrt) {
> + gno = xfs_rtb_to_rgno(mp, be->startblock);
> + gbno = xfs_rtb_to_rgbno(mp, be->startblock);
> + } else {
> + gno = XFS_FSB_TO_AGNO(mp, be->startblock);
> + gbno = XFS_FSB_TO_AGBNO(mp, be->startblock);

Maybe use xfs_fsb_to_gno and xfs_fsb_to_gbno here?

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>