/* Pick up the last hashvalue from a leaf block.  */
xfs_dahash_t xfs_attr_leaf_lasthash(xfs_dabuf_t *bp, int *count)
/* Pick up the last hashvalue from a leaf block.  */
xfs_dahash_t xfs_attr_leaf_lasthash(xfs_dabuf_t *bp, int *count)
{
	xfs_attr_leafblock_t *leaf;
	leaf = bp->data;
	ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
	if (count)
		*count = be16_to_cpu(leaf->hdr.count);
	if (!leaf->hdr.count)
		return(0);
	return be32_to_cpu(leaf->entries[be16_to_cpu(leaf->hdr.count)-1].hashval);
}