/* Registers the exceptions that are present in the current area. 'full' is filled in to indicate if the area has been filled.  */
static int insert_exceptions(struct pstore *ps, int(*callback)(void *callback_context, chunk_t old, chunk_t new), void *callback_context, int *full)
/* Registers the exceptions that are present in the current area. 'full' is filled in to indicate if the area has been filled.  */
static int insert_exceptions(struct pstore *ps, int(*callback)(void *callback_context, chunk_t old, chunk_t new), void *callback_context, int *full)
{
	int r;
	unsigned int i;
	struct disk_exception de;
	*full = 1;
	for (i = 0; i < ps->exceptions_per_area; i++) {
		read_exception(ps, i, &de);
		if (de.new_chunk == 0LL) {
			ps->current_committed = i;
			*full = 0;
			break;
		}
		if (ps->next_free <= de.new_chunk)
			ps->next_free = de.new_chunk + 1;
		r = callback(callback_context, de.old_chunk, de.new_chunk);
		if (r)
			return r;
	}
	return 0;
}