summaryrefslogtreecommitdiff
path: root/yaffs_allocator.c
diff options
context:
space:
mode:
authorCharles Manning <cdhmanning@gmail.com>2010-12-07 13:45:55 +1300
committerCharles Manning <cdhmanning@gmail.com>2010-12-07 13:45:55 +1300
commitfb1a7ee223619260cfd9b6366fd78747cc572cd5 (patch)
tree17b1408b4ecfa48a9ef57fa27663244c9483c3f0 /yaffs_allocator.c
parent84f122f301b6a27295641fcbde3a6fbcfea78a99 (diff)
yaffs: Remove a whole lot of function wrappers and forward declarations
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Diffstat (limited to 'yaffs_allocator.c')
-rw-r--r--yaffs_allocator.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/yaffs_allocator.c b/yaffs_allocator.c
index b9fe31e..9af15c7 100644
--- a/yaffs_allocator.c
+++ b/yaffs_allocator.c
@@ -16,7 +16,7 @@
#include "yaffs_trace.h"
#include "yportenv.h"
-#ifdef CONFIG_YAFFS_YMALLOC_ALLOCATOR
+#ifdef CONFIG_YAFFS_KMALLOC_ALLOCATOR
void yaffs_deinit_raw_tnodes_and_objs(struct yaffs_dev *dev)
{
@@ -30,13 +30,13 @@ void yaffs_init_raw_tnodes_and_objs(struct yaffs_dev *dev)
struct yaffs_tnode *yaffs_alloc_raw_tnode(struct yaffs_dev *dev)
{
- return (struct yaffs_tnode *)YMALLOC(dev->tnode_size);
+ return (struct yaffs_tnode *)kmalloc(dev->tnode_size, GFP_NOFS);
}
void yaffs_free_raw_tnode(struct yaffs_dev *dev, struct yaffs_tnode *tn)
{
dev = dev;
- YFREE(tn);
+ kfree(tn);
}
void yaffs_init_raw_objs(struct yaffs_dev *dev)
@@ -52,14 +52,14 @@ void yaffs_deinit_raw_objs(struct yaffs_dev *dev)
struct yaffs_obj *yaffs_alloc_raw_obj(struct yaffs_dev *dev)
{
dev = dev;
- return (struct yaffs_obj *)YMALLOC(sizeof(struct yaffs_obj));
+ return (struct yaffs_obj *)kmalloc(sizeof(struct yaffs_obj));
}
void yaffs_free_raw_obj(struct yaffs_dev *dev, struct yaffs_obj *obj)
{
dev = dev;
- YFREE(obj);
+ kfree(obj);
}
#else
@@ -103,8 +103,8 @@ static void yaffs_deinit_raw_tnodes(struct yaffs_dev *dev)
while (allocator->alloc_tnode_list) {
tmp = allocator->alloc_tnode_list->next;
- YFREE(allocator->alloc_tnode_list->tnodes);
- YFREE(allocator->alloc_tnode_list);
+ kfree(allocator->alloc_tnode_list->tnodes);
+ kfree(allocator->alloc_tnode_list);
allocator->alloc_tnode_list = tmp;
}
@@ -149,7 +149,7 @@ static int yaffs_create_tnodes(struct yaffs_dev *dev, int n_tnodes)
/* make these things */
- new_tnodes = YMALLOC(n_tnodes * dev->tnode_size);
+ new_tnodes = kmalloc(n_tnodes * dev->tnode_size, GFP_NOFS);
mem = (u8 *) new_tnodes;
if (!new_tnodes) {
@@ -177,7 +177,7 @@ static int yaffs_create_tnodes(struct yaffs_dev *dev, int n_tnodes)
* but it just means we can't free this bunch of tnodes later.
*/
- tnl = YMALLOC(sizeof(struct yaffs_tnode_list));
+ tnl = kmalloc(sizeof(struct yaffs_tnode_list), GFP_NOFS);
if (!tnl) {
T(YAFFS_TRACE_ERROR,
(TSTR
@@ -261,8 +261,8 @@ static void yaffs_deinit_raw_objs(struct yaffs_dev *dev)
while (allocator->allocated_obj_list) {
tmp = allocator->allocated_obj_list->next;
- YFREE(allocator->allocated_obj_list->objects);
- YFREE(allocator->allocated_obj_list);
+ kfree(allocator->allocated_obj_list->objects);
+ kfree(allocator->allocated_obj_list);
allocator->allocated_obj_list = tmp;
}
@@ -289,16 +289,16 @@ static int yaffs_create_free_objs(struct yaffs_dev *dev, int n_obj)
return YAFFS_OK;
/* make these things */
- new_objs = YMALLOC(n_obj * sizeof(struct yaffs_obj));
- list = YMALLOC(sizeof(struct yaffs_obj_list));
+ new_objs = kmalloc(n_obj * sizeof(struct yaffs_obj), GFP_NOFS);
+ list = kmalloc(sizeof(struct yaffs_obj_list), GFP_NOFS);
if (!new_objs || !list) {
if (new_objs) {
- YFREE(new_objs);
+ kfree(new_objs);
new_objs = NULL;
}
if (list) {
- YFREE(list);
+ kfree(list);
list = NULL;
}
T(YAFFS_TRACE_ALLOCATE,
@@ -371,7 +371,7 @@ void yaffs_deinit_raw_tnodes_and_objs(struct yaffs_dev *dev)
yaffs_deinit_raw_tnodes(dev);
yaffs_deinit_raw_objs(dev);
- YFREE(dev->allocator);
+ kfree(dev->allocator);
dev->allocator = NULL;
} else {
YBUG();
@@ -383,7 +383,7 @@ void yaffs_init_raw_tnodes_and_objs(struct yaffs_dev *dev)
struct yaffs_allocator *allocator;
if (!dev->allocator) {
- allocator = YMALLOC(sizeof(struct yaffs_allocator));
+ allocator = kmalloc(sizeof(struct yaffs_allocator), GFP_NOFS);
if (allocator) {
dev->allocator = allocator;
yaffs_init_raw_tnodes(dev);