summaryrefslogtreecommitdiff
path: root/fs/bio.c
diff options
context:
space:
mode:
authorMatthew Dobson <colpatch@us.ibm.com>2006-03-26 01:37:47 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 08:56:59 -0800
commit0eaae62abaa1ad1f231932b6cdd9fb1b91df6651 (patch)
treecda02cffff075a8b542ddcea4fa0ff0064130502 /fs/bio.c
parent53184082b070dfb077218828fdf839826102ed96 (diff)
downloadlinux-stable-0eaae62abaa1ad1f231932b6cdd9fb1b91df6651.tar.gz
linux-stable-0eaae62abaa1ad1f231932b6cdd9fb1b91df6651.tar.bz2
linux-stable-0eaae62abaa1ad1f231932b6cdd9fb1b91df6651.zip
[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 'fs/bio.c')
-rw-r--r--fs/bio.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/bio.c b/fs/bio.c
index 49db9286a3b4..377046d82945 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1125,16 +1125,6 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors)
return bp;
}
-static void *bio_pair_alloc(gfp_t gfp_flags, void *data)
-{
- return kmalloc(sizeof(struct bio_pair), gfp_flags);
-}
-
-static void bio_pair_free(void *bp, void *data)
-{
- kfree(bp);
-}
-
/*
* create memory pools for biovec's in a bio_set.
@@ -1254,8 +1244,8 @@ static int __init init_bio(void)
if (!fs_bio_set)
panic("bio: can't allocate bios\n");
- bio_split_pool = mempool_create(BIO_SPLIT_ENTRIES,
- bio_pair_alloc, bio_pair_free, NULL);
+ bio_split_pool = mempool_create_kmalloc_pool(BIO_SPLIT_ENTRIES,
+ sizeof(struct bio_pair));
if (!bio_split_pool)
panic("bio: can't create split pool\n");