map = dm_get_table(md); dm_table_postsuspend_targets(map); 
r = 0;  out: 
int dm_suspend(struct mapped_device *md){	struct dm_table *map;	DECLARE_WAITQUEUE(wait, current);	int r = -EINVAL;	down_read(&md->lock);	if (test_bit(DMF_BLOCK_IO, &md->flags))		goto out_read_unlock;	map = dm_get_table(md);	/* This does not get reverted if there's an error later. */	dm_table_presuspend_targets(map);	/* Flush I/O to the device. */	r = __lock_fs(md);	if (r) {		dm_table_put(map);		goto out_read_unlock;	}	up_read(&md->lock);	/*	 * First we set the BLOCK_IO flag so no more ios will be mapped.	 *	 * If the flag is already set we know another thread is trying to	 * suspend as well, so we leave the fs locked for this thread.	 */	r = -EINVAL;	down_write(&md->lock);	if (test_and_set_bit(DMF_BLOCK_IO, &md->flags)) {		if (map)			dm_table_put(map);		goto out_write_unlock;	}	add_wait_queue(&md->wait, &wait);	up_write(&md->lock);	/* unplug */	if (map) {		dm_table_unplug_all(map);		dm_table_put(map);	}	/*	 * Then we wait for the already mapped ios to	 * complete.	 */	while (1) {		set_current_state(TASK_INTERRUPTIBLE);		if (!atomic_read(&md->pending) || signal_pending(current))			break;		io_schedule();	}	set_current_state(TASK_RUNNING);	down_write(&md->lock);	remove_wait_queue(&md->wait, &wait);	/* were we interrupted ? */	r = -EINTR;	if (atomic_read(&md->pending))		goto out_unfreeze;	set_bit(DMF_SUSPENDED, &md->flags);	map = dm_get_table(md);	dm_table_postsuspend_targets(map);	dm_table_put(map);	up_write(&md->lock);	return 0;out_unfreeze:	__unlock_fs(md);	clear_bit(DMF_BLOCK_IO, &md->flags);out_write_unlock:	up_write(&md->lock);	return r;out_read_unlock:	up_read(&md->lock);	return r;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2ca3310e78912a527d7d2c62c01da7cbf7346b8d/dm.c/clean/drivers/md/dm.c