/* Calculate number of records in a bmap btree inode root.  */
int xfs_bmdr_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
/* Calculate number of records in a bmap btree inode root.  */
int xfs_bmdr_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
{
	blocklen -= sizeof(xfs_bmdr_block_t);
	if (leaf)
		return blocklen / sizeof(xfs_bmdr_rec_t);
	return blocklen / (sizeof(xfs_bmdr_key_t) + sizeof(xfs_bmdr_ptr_t));
}