Commit 93d2341c authored by Matthew Dobson's avatar Matthew Dobson Committed by Linus Torvalds
Browse files

[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: default avatarMatthew Dobson <colpatch@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent fec433aa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2191,7 +2191,7 @@ static int cfq_init_queue(request_queue_t *q, elevator_t *e)
	if (!cfqd->cfq_hash)
		goto out_cfqhash;

	cfqd->crq_pool = mempool_create(BLKDEV_MIN_RQ, mempool_alloc_slab, mempool_free_slab, crq_pool);
	cfqd->crq_pool = mempool_create_slab_pool(BLKDEV_MIN_RQ, crq_pool);
	if (!cfqd->crq_pool)
		goto out_crqpool;

+1 −3
Original line number Diff line number Diff line
@@ -211,9 +211,7 @@ aoeblk_gdalloc(void *vp)
		return;
	}

	d->bufpool = mempool_create(MIN_BUFS,
				    mempool_alloc_slab, mempool_free_slab,
				    buf_pool_cache);
	d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache);
	if (d->bufpool == NULL) {
		printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate bufpool "
			"for %ld.%ld\n", d->aoemajor, d->aoeminor);
+1 −2
Original line number Diff line number Diff line
@@ -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;
+1 −2
Original line number Diff line number Diff line
@@ -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;
+1 −2
Original line number Diff line number Diff line
@@ -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;
Loading