* [PATCH 6/7] udf: use simple_malloc()/simple_free()
@ 2008-11-16 4:34 Lai Jiangshan
0 siblings, 0 replies; only message in thread
From: Lai Jiangshan @ 2008-11-16 4:34 UTC (permalink / raw)
To: Jan Kara, Andrew Morton; +Cc: Linux Kernel Mailing List
use simple_malloc()/simple_free() instead of current codes.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/fs/udf/super.c b/fs/udf/super.c
index e25e701..165ca64 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1069,10 +1069,7 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
size = sizeof(struct udf_bitmap) +
(sizeof(struct buffer_head *) * nr_groups);
- if (size <= PAGE_SIZE)
- bitmap = kmalloc(size, GFP_KERNEL);
- else
- bitmap = vmalloc(size); /* TODO: get rid of vmalloc */
+ bitmap = simple_malloc(size);
if (bitmap == NULL) {
udf_error(sb, __func__,
@@ -1801,17 +1798,12 @@ static void udf_sb_free_bitmap(struct udf_bitmap *bitmap)
{
int i;
int nr_groups = bitmap->s_nr_groups;
- int size = sizeof(struct udf_bitmap) + (sizeof(struct buffer_head *) *
- nr_groups);
for (i = 0; i < nr_groups; i++)
if (bitmap->s_block_bitmap[i])
brelse(bitmap->s_block_bitmap[i]);
- if (size <= PAGE_SIZE)
- kfree(bitmap);
- else
- vfree(bitmap);
+ simple_free(bitmap);
}
static void udf_free_partition(struct udf_part_map *map)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-11-16 4:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-16 4:34 [PATCH 6/7] udf: use simple_malloc()/simple_free() Lai Jiangshan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox