/* Return the exception data for a sector, or NULL if not remapped.  */
static struct dm_exception* dm_lookup_exception(struct dm_exception_table *et, chunk_t chunk)
/* Return the exception data for a sector, or NULL if not remapped.  */
static struct dm_exception* dm_lookup_exception(struct dm_exception_table *et, chunk_t chunk)
{
	struct list_head *slot;
	struct dm_exception *e;
	slot = &et->table[exception_hash(et, chunk)];
	list_for_each_entry (e, slot, hash_list)
		if (chunk >= e->old_chunk &&
		    chunk <= e->old_chunk + dm_consecutive_chunk_count(e))
			return e;
	return NULL;
}