Tidy labels in alloc_dev to make later patches more clear.
No functional change in this patch.
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
}
if (!try_module_get(THIS_MODULE))
}
if (!try_module_get(THIS_MODULE))
/* get a minor number for the dev */
if (minor == DM_ANY_MINOR)
/* get a minor number for the dev */
if (minor == DM_ANY_MINOR)
else
r = specific_minor(md, minor);
if (r < 0)
else
r = specific_minor(md, minor);
if (r < 0)
memset(md, 0, sizeof(*md));
init_rwsem(&md->io_lock);
memset(md, 0, sizeof(*md));
init_rwsem(&md->io_lock);
md->queue = blk_alloc_queue(GFP_KERNEL);
if (!md->queue)
md->queue = blk_alloc_queue(GFP_KERNEL);
if (!md->queue)
md->queue->queuedata = md;
md->queue->backing_dev_info.congested_fn = dm_any_congested;
md->queue->queuedata = md;
md->queue->backing_dev_info.congested_fn = dm_any_congested;
md->io_pool = mempool_create_slab_pool(MIN_IOS, _io_cache);
if (!md->io_pool)
md->io_pool = mempool_create_slab_pool(MIN_IOS, _io_cache);
if (!md->io_pool)
md->tio_pool = mempool_create_slab_pool(MIN_IOS, _tio_cache);
if (!md->tio_pool)
md->tio_pool = mempool_create_slab_pool(MIN_IOS, _tio_cache);
if (!md->tio_pool)
md->bs = bioset_create(16, 16);
if (!md->bs)
md->bs = bioset_create(16, 16);
if (!md->bs)
md->disk = alloc_disk(1);
if (!md->disk)
md->disk = alloc_disk(1);
if (!md->disk)
atomic_set(&md->pending, 0);
init_waitqueue_head(&md->wait);
atomic_set(&md->pending, 0);
init_waitqueue_head(&md->wait);
mempool_destroy(md->tio_pool);
mempool_destroy(md->tio_pool);
mempool_destroy(md->io_pool);
mempool_destroy(md->io_pool);
blk_cleanup_queue(md->queue);
blk_cleanup_queue(md->queue);
kfree(md);
return NULL;
}
kfree(md);
return NULL;
}