Re: [PATCH 07/27] xfs_db: display the realtime rmap btree contents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 06, 2025 at 02:51:33PM -0800, Darrick J. Wong wrote:
> +static int
> +rtrmaproot_rec_count(
> +	void			*obj,
> +	int			startoff)
> +{
> +	struct xfs_rtrmap_root	*block;
> +#ifdef DEBUG
> +	struct xfs_dinode	*dip = obj;
> +#endif
> +
> +	ASSERT(bitoffs(startoff) == 0);
> +	ASSERT(obj == iocur_top->data);
> +	block = (struct xfs_rtrmap_root *)((char *)obj + byteize(startoff));
> +	ASSERT((char *)block == XFS_DFORK_DPTR(dip));

Hmm, wouldn't this be cleaner by turning the logic around:

	struct xfs_dinode	*dip = obj;
	struct xfs_rtrmap_root	*block = XFS_DFORK_DPTR(dip);

	...

	ASSERT(block == obj + byteize(startoff));

Same for the other uses of this pattern.

Otherwise looks good (as good as xfs_db can look like anyway..)

Reviewed-by: Christoph Hellwig <hch@xxxxxx>




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux