/* Calculate number of records in a bmap btree block.  */
int xfs_bmbt_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
/* Calculate number of records in a bmap btree block.  */
int xfs_bmbt_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
{
	blocklen -= XFS_BMBT_BLOCK_LEN(mp);
	if (leaf)
		return blocklen / sizeof(xfs_bmbt_rec_t);
	return blocklen / (sizeof(xfs_bmbt_key_t) + sizeof(xfs_bmbt_ptr_t));
}