[PATCH 6/7] udf: use simple_malloc()/simple_free()
From: Lai Jiangshan
Date: Sat Nov 15 2008 - 23:38:56 EST
use simple_malloc()/simple_free() instead of current codes.
Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---
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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/