/* Everyone (including functions in this file), should use this function to access the md->map field, and make sure they call dm_table_put() when finished.  */
struct dm_table* dm_get_live_table(struct mapped_device *md)
/* Everyone (including functions in this file), should use this function to access the md->map field, and make sure they call dm_table_put() when finished.  */
struct dm_table* dm_get_live_table(struct mapped_device *md)
{
	struct dm_table *t;
	unsigned long flags;
	read_lock_irqsave(&md->map_lock, flags);
	t = md->map;
	if (t)
		dm_table_get(t);
	read_unlock_irqrestore(&md->map_lock, flags);
	return t;
}