/* Calculate number of records in an alloc btree block.  */
int xfs_allocbt_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
/* Calculate number of records in an alloc btree block.  */
int xfs_allocbt_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
{
	blocklen -= XFS_ALLOC_BLOCK_LEN(mp);
	if (leaf)
		return blocklen / sizeof(xfs_alloc_rec_t);
	return blocklen / (sizeof(xfs_alloc_key_t) + sizeof(xfs_alloc_ptr_t));
}