diff options
author | Matthew Dobson <colpatch@us.ibm.com> | 2006-03-26 04:37:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:56:59 -0500 |
commit | 26b6e051bc36b968a0b5ac96903b99e050d20b87 (patch) | |
tree | b8f1aed358f5e19b1faf3e720247fdfa441f3b7c /drivers/md | |
parent | f183323d3822dee4d7b3147a59b6e8987fe201e0 (diff) |
[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>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/multipath.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 96f7af4ae400..1cc9de44ce86 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -35,18 +35,6 @@ | |||
35 | #define NR_RESERVED_BUFS 32 | 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 | static int multipath_map (multipath_conf_t *conf) | 38 | static int multipath_map (multipath_conf_t *conf) |
51 | { | 39 | { |
52 | int i, disks = conf->raid_disks; | 40 | int i, disks = conf->raid_disks; |
@@ -494,9 +482,8 @@ static int multipath_run (mddev_t *mddev) | |||
494 | } | 482 | } |
495 | mddev->degraded = conf->raid_disks = conf->working_disks; | 483 | mddev->degraded = conf->raid_disks = conf->working_disks; |
496 | 484 | ||
497 | conf->pool = mempool_create(NR_RESERVED_BUFS, | 485 | conf->pool = mempool_create_kzalloc_pool(NR_RESERVED_BUFS, |
498 | mp_pool_alloc, mp_pool_free, | 486 | sizeof(struct multipath_bh)); |
499 | NULL); | ||
500 | if (conf->pool == NULL) { | 487 | if (conf->pool == NULL) { |
501 | printk(KERN_ERR | 488 | printk(KERN_ERR |
502 | "multipath: couldn't allocate memory for %s\n", | 489 | "multipath: couldn't allocate memory for %s\n", |