diff options
author | Charles Manning <cdhmanning@gmail.com> | 2010-06-09 11:04:34 +1200 |
---|---|---|
committer | Charles Manning <cdhmanning@gmail.com> | 2010-06-14 11:42:09 +1200 |
commit | 8c9cad909837025664f112c900fb4f7d02cecae6 (patch) | |
tree | dd7c80df4af1a2c798c3af75f34544f65b6449ff /yaffs_guts.h | |
parent | c3e035fe74c2aa3bf6ff00aa715a264232cc09a7 (diff) |
yaffs: Refactor allocator
Refactoring the allocator allows alternate allocators to be switched in more easily
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Diffstat (limited to 'yaffs_guts.h')
-rw-r--r-- | yaffs_guts.h | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/yaffs_guts.h b/yaffs_guts.h index 84b53aa..d08a6f6 100644 --- a/yaffs_guts.h +++ b/yaffs_guts.h @@ -361,12 +361,6 @@ union yaffs_Tnode_union { typedef union yaffs_Tnode_union yaffs_Tnode; -struct yaffs_TnodeList_struct { - struct yaffs_TnodeList_struct *next; - yaffs_Tnode *tnodes; -}; - -typedef struct yaffs_TnodeList_struct yaffs_TnodeList; /*------------------------ Object -----------------------------*/ /* An object can be one of: @@ -479,13 +473,6 @@ struct yaffs_ObjectStruct { typedef struct yaffs_ObjectStruct yaffs_Object; -struct yaffs_ObjectList_struct { - yaffs_Object *objects; - struct yaffs_ObjectList_struct *next; -}; - -typedef struct yaffs_ObjectList_struct yaffs_ObjectList; - typedef struct { struct ylist_head list; int count; @@ -635,6 +622,7 @@ struct yaffs_DeviceStruct { /* Stuff to support wide tnodes */ __u32 tnodeWidth; __u32 tnodeMask; + __u32 tnodeSize; /* Stuff for figuring out file offset to chunk conversions */ __u32 chunkShift; /* Shift value */ @@ -686,19 +674,13 @@ struct yaffs_DeviceStruct { __u32 allocationPage; int allocationBlockFinder; /* Used to search for next allocation block */ - int nTnodesCreated; - yaffs_Tnode *freeTnodes; - int nFreeTnodes; - yaffs_TnodeList *allocatedTnodeList; - - int nObjectsCreated; - yaffs_Object *freeObjects; - int nFreeObjects; + /* Object and Tnode memory management */ + void *allocator; + int nObjects; + int nTnodes; int nHardLinks; - yaffs_ObjectList *allocatedObjectList; - yaffs_ObjectBucket objectBucket[YAFFS_NOBJECT_BUCKETS]; __u32 bucketFinder; |