[PATCH] mempool: use mempool_create_slab_pool()
Modify well over a dozen mempool users to call mempool_create_slab_pool() rather than calling mempool_create() with extra arguments, saving about 30 lines of code and increasing readability. Signed-off-by: Matthew Dobson <colpatch@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
fec433aaaa
commit
93d2341c75
@@ -616,8 +616,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
cc->io_pool = mempool_create(MIN_IOS, mempool_alloc_slab,
|
||||
mempool_free_slab, _crypt_io_pool);
|
||||
cc->io_pool = mempool_create_slab_pool(MIN_IOS, _crypt_io_pool);
|
||||
if (!cc->io_pool) {
|
||||
ti->error = PFX "Cannot allocate crypt io mempool";
|
||||
goto bad3;
|
||||
|
@@ -179,8 +179,7 @@ static struct multipath *alloc_multipath(void)
|
||||
m->queue_io = 1;
|
||||
INIT_WORK(&m->process_queued_ios, process_queued_ios, m);
|
||||
INIT_WORK(&m->trigger_event, trigger_event, m);
|
||||
m->mpio_pool = mempool_create(MIN_IOS, mempool_alloc_slab,
|
||||
mempool_free_slab, _mpio_cache);
|
||||
m->mpio_pool = mempool_create_slab_pool(MIN_IOS, _mpio_cache);
|
||||
if (!m->mpio_pool) {
|
||||
kfree(m);
|
||||
return NULL;
|
||||
|
@@ -1174,8 +1174,7 @@ static int __init dm_snapshot_init(void)
|
||||
goto bad4;
|
||||
}
|
||||
|
||||
pending_pool = mempool_create(128, mempool_alloc_slab,
|
||||
mempool_free_slab, pending_cache);
|
||||
pending_pool = mempool_create_slab_pool(128, pending_cache);
|
||||
if (!pending_pool) {
|
||||
DMERR("Couldn't create pending pool.");
|
||||
r = -ENOMEM;
|
||||
|
@@ -823,13 +823,11 @@ static struct mapped_device *alloc_dev(unsigned int minor, int persistent)
|
||||
md->queue->unplug_fn = dm_unplug_all;
|
||||
md->queue->issue_flush_fn = dm_flush_all;
|
||||
|
||||
md->io_pool = mempool_create(MIN_IOS, mempool_alloc_slab,
|
||||
mempool_free_slab, _io_cache);
|
||||
md->io_pool = mempool_create_slab_pool(MIN_IOS, _io_cache);
|
||||
if (!md->io_pool)
|
||||
goto bad2;
|
||||
|
||||
md->tio_pool = mempool_create(MIN_IOS, mempool_alloc_slab,
|
||||
mempool_free_slab, _tio_cache);
|
||||
md->tio_pool = mempool_create_slab_pool(MIN_IOS, _tio_cache);
|
||||
if (!md->tio_pool)
|
||||
goto bad3;
|
||||
|
||||
|
@@ -227,8 +227,7 @@ static int jobs_init(void)
|
||||
if (!_job_cache)
|
||||
return -ENOMEM;
|
||||
|
||||
_job_pool = mempool_create(MIN_JOBS, mempool_alloc_slab,
|
||||
mempool_free_slab, _job_cache);
|
||||
_job_pool = mempool_create_slab_pool(MIN_JOBS, _job_cache);
|
||||
if (!_job_pool) {
|
||||
kmem_cache_destroy(_job_cache);
|
||||
return -ENOMEM;
|
||||
|
Reference in New Issue
Block a user