/* Returns unbound table for the caller to free.  */
static struct dm_table* __unbind(struct mapped_device *md)
/* Returns unbound table for the caller to free.  */
static struct dm_table* __unbind(struct mapped_device *md)
{
	struct dm_table *map = md->map;
	unsigned long flags;
	if (!map)
		return NULL;
	dm_table_event_callback(map, NULL, NULL);
	write_lock_irqsave(&md->map_lock, flags);
	md->map = NULL;
	write_unlock_irqrestore(&md->map_lock, flags);
	return map;
}