aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMatthew Dobson <colpatch@us.ibm.com>2006-03-26 04:37:50 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:57:00 -0500
commit93d2341c750cda0df48a6cc67b35fe25f1ec47df (patch)
treef098a3bbfae65ce967591ee94d605c6e6bea21c6 /drivers/md
parentfec433aaaae32a02329ad7d71b0f3c91b7525077 (diff)
[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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-crypt.c3
-rw-r--r--drivers/md/dm-mpath.c3
-rw-r--r--drivers/md/dm-snap.c3
-rw-r--r--drivers/md/dm.c6
-rw-r--r--drivers/md/kcopyd.c3
5 files changed, 6 insertions, 12 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index d88b8eda3903..259e86f26549 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -616,8 +616,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
616 } 616 }
617 } 617 }
618 618
619 cc->io_pool = mempool_create(MIN_IOS, mempool_alloc_slab, 619 cc->io_pool = mempool_create_slab_pool(MIN_IOS, _crypt_io_pool);
620 mempool_free_slab, _crypt_io_pool);
621 if (!cc->io_pool) { 620 if (!cc->io_pool) {
622 ti->error = PFX "Cannot allocate crypt io mempool"; 621 ti->error = PFX "Cannot allocate crypt io mempool";
623 goto bad3; 622 goto bad3;
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index f72a82fb9434..1816f30678ed 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -179,8 +179,7 @@ static struct multipath *alloc_multipath(void)
179 m->queue_io = 1; 179 m->queue_io = 1;
180 INIT_WORK(&m->process_queued_ios, process_queued_ios, m); 180 INIT_WORK(&m->process_queued_ios, process_queued_ios, m);
181 INIT_WORK(&m->trigger_event, trigger_event, m); 181 INIT_WORK(&m->trigger_event, trigger_event, m);
182 m->mpio_pool = mempool_create(MIN_IOS, mempool_alloc_slab, 182 m->mpio_pool = mempool_create_slab_pool(MIN_IOS, _mpio_cache);
183 mempool_free_slab, _mpio_cache);
184 if (!m->mpio_pool) { 183 if (!m->mpio_pool) {
185 kfree(m); 184 kfree(m);
186 return NULL; 185 return NULL;
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index f3759dd7828e..7401540086df 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1174,8 +1174,7 @@ static int __init dm_snapshot_init(void)
1174 goto bad4; 1174 goto bad4;
1175 } 1175 }
1176 1176
1177 pending_pool = mempool_create(128, mempool_alloc_slab, 1177 pending_pool = mempool_create_slab_pool(128, pending_cache);
1178 mempool_free_slab, pending_cache);
1179 if (!pending_pool) { 1178 if (!pending_pool) {
1180 DMERR("Couldn't create pending pool."); 1179 DMERR("Couldn't create pending pool.");
1181 r = -ENOMEM; 1180 r = -ENOMEM;
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 8c82373f7ff3..a64798ef481e 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -823,13 +823,11 @@ static struct mapped_device *alloc_dev(unsigned int minor, int persistent)
823 md->queue->unplug_fn = dm_unplug_all; 823 md->queue->unplug_fn = dm_unplug_all;
824 md->queue->issue_flush_fn = dm_flush_all; 824 md->queue->issue_flush_fn = dm_flush_all;
825 825
826 md->io_pool = mempool_create(MIN_IOS, mempool_alloc_slab, 826 md->io_pool = mempool_create_slab_pool(MIN_IOS, _io_cache);
827 mempool_free_slab, _io_cache);
828 if (!md->io_pool) 827 if (!md->io_pool)
829 goto bad2; 828 goto bad2;
830 829
831 md->tio_pool = mempool_create(MIN_IOS, mempool_alloc_slab, 830 md->tio_pool = mempool_create_slab_pool(MIN_IOS, _tio_cache);
832 mempool_free_slab, _tio_cache);
833 if (!md->tio_pool) 831 if (!md->tio_pool)
834 goto bad3; 832 goto bad3;
835 833
diff --git a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c
index 0d54e8b7d9de..9dcb2c8a3853 100644
--- a/drivers/md/kcopyd.c
+++ b/drivers/md/kcopyd.c
@@ -227,8 +227,7 @@ static int jobs_init(void)
227 if (!_job_cache) 227 if (!_job_cache)
228 return -ENOMEM; 228 return -ENOMEM;
229 229
230 _job_pool = mempool_create(MIN_JOBS, mempool_alloc_slab, 230 _job_pool = mempool_create_slab_pool(MIN_JOBS, _job_cache);
231 mempool_free_slab, _job_cache);
232 if (!_job_pool) { 231 if (!_job_pool) {
233 kmem_cache_destroy(_job_cache); 232 kmem_cache_destroy(_job_cache);
234 return -ENOMEM; 233 return -ENOMEM;