/* Read in the allocation group free block array.  */
STATIC int xfs_alloc_read_agfl(xfs_mount_t *mp, xfs_trans_t *tp, xfs_agnumber_t agno, xfs_buf_t **bpp)
/* Read in the allocation group free block array.  */
STATIC int xfs_alloc_read_agfl(xfs_mount_t *mp, xfs_trans_t *tp, xfs_agnumber_t agno, xfs_buf_t **bpp)
{
	xfs_buf_t	*bp;
	int		error;
	ASSERT(agno != NULLAGNUMBER);
	error = xfs_trans_read_buf(
			mp, tp, mp->m_ddev_targp,
			XFS_AG_DADDR(mp, agno, XFS_AGFL_DADDR(mp)),
			XFS_FSS_TO_BB(mp, 1), 0, &bp);
	if (error)
		return error;
	ASSERT(bp);
	ASSERT(!XFS_BUF_GETERROR(bp));
	XFS_BUF_SET_VTYPE_REF(bp, B_FS_AGFL, XFS_AGFL_REF);
	*bpp = bp;
	return 0;
}