dm: small cleanup in dm_get_md()
Makes dm_get_md() and dm_get_from_kobject() have similar code. Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
parent
b9a41d21dc
commit
49de576970
|
@ -2074,17 +2074,12 @@ struct mapped_device *dm_get_md(dev_t dev)
|
||||||
spin_lock(&_minor_lock);
|
spin_lock(&_minor_lock);
|
||||||
|
|
||||||
md = idr_find(&_minor_idr, minor);
|
md = idr_find(&_minor_idr, minor);
|
||||||
if (md) {
|
if (!md || md == MINOR_ALLOCED || (MINOR(disk_devt(dm_disk(md))) != minor) ||
|
||||||
if ((md == MINOR_ALLOCED ||
|
test_bit(DMF_FREEING, &md->flags) || dm_deleting_md(md)) {
|
||||||
(MINOR(disk_devt(dm_disk(md))) != minor) ||
|
md = NULL;
|
||||||
dm_deleting_md(md) ||
|
goto out;
|
||||||
test_bit(DMF_FREEING, &md->flags))) {
|
|
||||||
md = NULL;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
dm_get(md);
|
|
||||||
}
|
}
|
||||||
|
dm_get(md);
|
||||||
out:
|
out:
|
||||||
spin_unlock(&_minor_lock);
|
spin_unlock(&_minor_lock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue