Commit 26b6e051bc36b968a0b5ac96903b99e050d20b87
Committed by
Linus Torvalds
1 parent
f183323d38
Exists in
master
and in
7 other branches
[PATCH] mempool: use common mempool kzalloc allocator
This patch changes a mempool user, which is basically just a wrapper around kzalloc(), to use the common mempool_kmalloc/kfree, rather than its own wrapper function, removing duplicated code. 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>
Showing 1 changed file with 2 additions and 15 deletions Side-by-side Diff
drivers/md/multipath.c
... | ... | @@ -35,18 +35,6 @@ |
35 | 35 | #define NR_RESERVED_BUFS 32 |
36 | 36 | |
37 | 37 | |
38 | -static void *mp_pool_alloc(gfp_t gfp_flags, void *data) | |
39 | -{ | |
40 | - struct multipath_bh *mpb; | |
41 | - mpb = kzalloc(sizeof(*mpb), gfp_flags); | |
42 | - return mpb; | |
43 | -} | |
44 | - | |
45 | -static void mp_pool_free(void *mpb, void *data) | |
46 | -{ | |
47 | - kfree(mpb); | |
48 | -} | |
49 | - | |
50 | 38 | static int multipath_map (multipath_conf_t *conf) |
51 | 39 | { |
52 | 40 | int i, disks = conf->raid_disks; |
... | ... | @@ -494,9 +482,8 @@ |
494 | 482 | } |
495 | 483 | mddev->degraded = conf->raid_disks = conf->working_disks; |
496 | 484 | |
497 | - conf->pool = mempool_create(NR_RESERVED_BUFS, | |
498 | - mp_pool_alloc, mp_pool_free, | |
499 | - NULL); | |
485 | + conf->pool = mempool_create_kzalloc_pool(NR_RESERVED_BUFS, | |
486 | + sizeof(struct multipath_bh)); | |
500 | 487 | if (conf->pool == NULL) { |
501 | 488 | printk(KERN_ERR |
502 | 489 | "multipath: couldn't allocate memory for %s\n", |