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 /fs/bio.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 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -1125,16 +1125,6 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) | |||
1125 | return bp; | 1125 | return bp; |
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | static void *bio_pair_alloc(gfp_t gfp_flags, void *data) | ||
1129 | { | ||
1130 | return kmalloc(sizeof(struct bio_pair), gfp_flags); | ||
1131 | } | ||
1132 | |||
1133 | static void bio_pair_free(void *bp, void *data) | ||
1134 | { | ||
1135 | kfree(bp); | ||
1136 | } | ||
1137 | |||
1138 | 1128 | ||
1139 | /* | 1129 | /* |
1140 | * create memory pools for biovec's in a bio_set. | 1130 | * create memory pools for biovec's in a bio_set. |
@@ -1254,8 +1244,8 @@ static int __init init_bio(void) | |||
1254 | if (!fs_bio_set) | 1244 | if (!fs_bio_set) |
1255 | panic("bio: can't allocate bios\n"); | 1245 | panic("bio: can't allocate bios\n"); |
1256 | 1246 | ||
1257 | bio_split_pool = mempool_create(BIO_SPLIT_ENTRIES, | 1247 | bio_split_pool = mempool_create_kmalloc_pool(BIO_SPLIT_ENTRIES, |
1258 | bio_pair_alloc, bio_pair_free, NULL); | 1248 | sizeof(struct bio_pair)); |
1259 | if (!bio_split_pool) | 1249 | if (!bio_split_pool) |
1260 | panic("bio: can't create split pool\n"); | 1250 | panic("bio: can't create split pool\n"); |
1261 | 1251 | ||