/* Try to retrieve the next record to the left/right from the current one.  */
STATIC int xfs_ialloc_next_rec(struct xfs_btree_cur *cur, xfs_inobt_rec_incore_t *rec, int *done, int left)
/* Try to retrieve the next record to the left/right from the current one.  */
STATIC int xfs_ialloc_next_rec(struct xfs_btree_cur *cur, xfs_inobt_rec_incore_t *rec, int *done, int left)
{
	int                     error;
	int			i;
	if (left)
		error = xfs_btree_decrement(cur, 0, &i);
	else
		error = xfs_btree_increment(cur, 0, &i);
	if (error)
		return error;
	*done = !i;
	if (i) {
		error = xfs_inobt_get_rec(cur, rec, &i);
		if (error)
			return error;
		XFS_WANT_CORRUPTED_RETURN(i == 1);
	}
	return 0;
}