mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
53184082b0
commit
0eaae62aba
7 changed files with 34 additions and 129 deletions
14
fs/bio.c
14
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");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue