/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
+ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
*
* Copyright (C) 2002-2010 Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
* Created by Charles Manning <charles@aleph1.co.uk>
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
+ * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*/
+
#include "yaffs_allocator.h"
#include "yaffs_guts.h"
#include "yaffs_trace.h"
typedef struct yaffs_tnode_list yaffs_tnodelist_t;
-struct yaffs_obj_tList_struct {
+struct yaffs_obj_list_struct {
yaffs_obj_t *objects;
- struct yaffs_obj_tList_struct *next;
+ struct yaffs_obj_list_struct *next;
};
-typedef struct yaffs_obj_tList_struct yaffs_obj_tList;
+typedef struct yaffs_obj_list_struct yaffs_obj_list;
struct yaffs_AllocatorStruct {
yaffs_obj_t *freeObjects;
int nFreeObjects;
- yaffs_obj_tList *allocatedObjectList;
+ yaffs_obj_list *allocated_list;
};
typedef struct yaffs_AllocatorStruct yaffs_Allocator;
yaffs_Allocator *allocator = dev->allocator;
if(allocator) {
- allocator->allocatedObjectList = NULL;
+ allocator->allocated_list = NULL;
allocator->freeObjects = NULL;
allocator->nFreeObjects = 0;
} else
static void yaffs_deinit_raw_objs(yaffs_dev_t *dev)
{
yaffs_Allocator *allocator = dev->allocator;
- yaffs_obj_tList *tmp;
+ yaffs_obj_list *tmp;
if(!allocator){
YBUG();
return;
}
- while (allocator->allocatedObjectList) {
- tmp = allocator->allocatedObjectList->next;
- YFREE(allocator->allocatedObjectList->objects);
- YFREE(allocator->allocatedObjectList);
+ while (allocator->allocated_list) {
+ tmp = allocator->allocated_list->next;
+ YFREE(allocator->allocated_list->objects);
+ YFREE(allocator->allocated_list);
- allocator->allocatedObjectList = tmp;
+ allocator->allocated_list = tmp;
}
allocator->freeObjects = NULL;
int i;
yaffs_obj_t *newObjects;
- yaffs_obj_tList *list;
+ yaffs_obj_list *list;
if(!allocator){
YBUG();
/* make these things */
newObjects = YMALLOC(n_obj * sizeof(yaffs_obj_t));
- list = YMALLOC(sizeof(yaffs_obj_tList));
+ list = YMALLOC(sizeof(yaffs_obj_list));
if (!newObjects || !list) {
if (newObjects){
/* Now add this bunch of Objects to a list for freeing up. */
list->objects = newObjects;
- list->next = allocator->allocatedObjectList;
- allocator->allocatedObjectList = list;
+ list->next = allocator->allocated_list;
+ allocator->allocated_list = list;
return YAFFS_OK;
}