/* Return the last hash value in the leaf. Stale entries are ok.  */
xfs_dahash_t xfs_dir2_leafn_lasthash(xfs_dabuf_t *bp, int *count)
/* Return the last hash value in the leaf. Stale entries are ok.  */
xfs_dahash_t xfs_dir2_leafn_lasthash(xfs_dabuf_t *bp, int *count)
{
	xfs_dir2_leaf_t	*leaf;
	leaf = bp->data;
	ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC);
	if (count)
		*count = be16_to_cpu(leaf->hdr.count);
	if (!leaf->hdr.count)
		return 0;
	return be32_to_cpu(leaf->ents[be16_to_cpu(leaf->hdr.count) - 1].hashval);
}