/* Guarantees nothing is using the device before it's deleted.  */
int dm_lock_for_deletion(struct mapped_device *md)
/* Guarantees nothing is using the device before it's deleted.  */
int dm_lock_for_deletion(struct mapped_device *md)
{
	int r = 0;
	spin_lock(&_minor_lock);
	if (dm_open_count(md))
		r = -EBUSY;
	else
		set_bit(DMF_DELETING, &md->flags);
	spin_unlock(&_minor_lock);
	return r;
}