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/dm-io.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/dm-io.c')
-rw-r--r-- | drivers/md/dm-io.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index 4809b209fbb1..da663d2ff552 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c | |||
@@ -32,16 +32,6 @@ struct io { | |||
32 | static unsigned _num_ios; | 32 | static unsigned _num_ios; |
33 | static mempool_t *_io_pool; | 33 | static mempool_t *_io_pool; |
34 | 34 | ||
35 | static void *alloc_io(gfp_t gfp_mask, void *pool_data) | ||
36 | { | ||
37 | return kmalloc(sizeof(struct io), gfp_mask); | ||
38 | } | ||
39 | |||
40 | static void free_io(void *element, void *pool_data) | ||
41 | { | ||
42 | kfree(element); | ||
43 | } | ||
44 | |||
45 | static unsigned int pages_to_ios(unsigned int pages) | 35 | static unsigned int pages_to_ios(unsigned int pages) |
46 | { | 36 | { |
47 | return 4 * pages; /* too many ? */ | 37 | return 4 * pages; /* too many ? */ |
@@ -65,7 +55,8 @@ static int resize_pool(unsigned int new_ios) | |||
65 | 55 | ||
66 | } else { | 56 | } else { |
67 | /* create new pool */ | 57 | /* create new pool */ |
68 | _io_pool = mempool_create(new_ios, alloc_io, free_io, NULL); | 58 | _io_pool = mempool_create_kmalloc_pool(new_ios, |
59 | sizeof(struct io)); | ||
69 | if (!_io_pool) | 60 | if (!_io_pool) |
70 | return -ENOMEM; | 61 | return -ENOMEM; |
71 | 62 | ||