diff options
author | Matthew Dobson <colpatch@us.ibm.com> | 2006-03-26 04:37:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:56:59 -0500 |
commit | 0eaae62abaa1ad1f231932b6cdd9fb1b91df6651 (patch) | |
tree | cda02cffff075a8b542ddcea4fa0ff0064130502 /drivers/md/bitmap.c | |
parent | 53184082b070dfb077218828fdf839826102ed96 (diff) |
[PATCH] mempool: use common mempool kmalloc allocator
This patch changes several mempool users, all of which are basically just
wrappers around kmalloc(), to use the common mempool_kmalloc/kfree, rather
than their own wrapper function, removing a bunch of 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/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index e1c18aa1d712..f8ffaee20ff8 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -89,16 +89,6 @@ int bitmap_active(struct bitmap *bitmap) | |||
89 | } | 89 | } |
90 | 90 | ||
91 | #define WRITE_POOL_SIZE 256 | 91 | #define WRITE_POOL_SIZE 256 |
92 | /* mempool for queueing pending writes on the bitmap file */ | ||
93 | static void *write_pool_alloc(gfp_t gfp_flags, void *data) | ||
94 | { | ||
95 | return kmalloc(sizeof(struct page_list), gfp_flags); | ||
96 | } | ||
97 | |||
98 | static void write_pool_free(void *ptr, void *data) | ||
99 | { | ||
100 | kfree(ptr); | ||
101 | } | ||
102 | 92 | ||
103 | /* | 93 | /* |
104 | * just a placeholder - calls kmalloc for bitmap pages | 94 | * just a placeholder - calls kmalloc for bitmap pages |
@@ -1564,8 +1554,8 @@ int bitmap_create(mddev_t *mddev) | |||
1564 | spin_lock_init(&bitmap->write_lock); | 1554 | spin_lock_init(&bitmap->write_lock); |
1565 | INIT_LIST_HEAD(&bitmap->complete_pages); | 1555 | INIT_LIST_HEAD(&bitmap->complete_pages); |
1566 | init_waitqueue_head(&bitmap->write_wait); | 1556 | init_waitqueue_head(&bitmap->write_wait); |
1567 | bitmap->write_pool = mempool_create(WRITE_POOL_SIZE, write_pool_alloc, | 1557 | bitmap->write_pool = mempool_create_kmalloc_pool(WRITE_POOL_SIZE, |
1568 | write_pool_free, NULL); | 1558 | sizeof(struct page_list)); |
1569 | err = -ENOMEM; | 1559 | err = -ENOMEM; |
1570 | if (!bitmap->write_pool) | 1560 | if (!bitmap->write_pool) |
1571 | goto error; | 1561 | goto error; |