/* Change the cursor to point to the last record in the current block at the given level. Other levels are unaffected.  */
STATIC int xfs_btree_lastrec(xfs_btree_cur_t *cur, int level)
/* Change the cursor to point to the last record in the current block at the given level. Other levels are unaffected.  */
STATIC int xfs_btree_lastrec(xfs_btree_cur_t *cur, int level)
{
	struct xfs_btree_block	*block;
	xfs_buf_t		*bp;
	block = xfs_btree_get_block(cur, level, &bp);
	xfs_btree_check_block(cur, block, level, bp);
	if (!block->bb_numrecs)
		return 0;
	cur->bc_ptrs[level] = be16_to_cpu(block->bb_numrecs);
	return 1;
}