Added BochsGA to build
[tpg/acess2.git] / Kernel / drv / iocache.c
index 743dabc..2b4755c 100644 (file)
@@ -46,7 +46,7 @@ tIOCache      *gIOCache_Caches = NULL;
  */
 tIOCache *IOCache_Create( tIOCache_WriteCallback Write, Uint32 ID, int SectorSize, int CacheSize )
 {
-       tIOCache        *ret = malloc( sizeof(tIOCache) );
+       tIOCache        *ret = calloc( 1, sizeof(tIOCache) );
        
        // Sanity Check
        if(!ret)        return NULL;
@@ -57,8 +57,6 @@ tIOCache *IOCache_Create( tIOCache_WriteCallback Write, Uint32 ID, int SectorSiz
        ret->ID = ID;
        ret->Write = Write;
        ret->CacheSize = CacheSize;
-       ret->CacheUsed = 0;
-       ret->Entries = 0;
        
        // Append to list
        SHORTLOCK( &glIOCache_Caches );
@@ -307,14 +305,14 @@ void IOCache_Destroy( tIOCache *Cache )
        // Remove from list
        SHORTLOCK( &glIOCache_Caches );
        {
-               tIOCache        *ent;
-               tIOCache        *prev = (tIOCache*)&gIOCache_Caches;
-               for(ent = gIOCache_Caches;
-                       ent;
-                       prev = ent, ent = ent->Next )
+               tIOCache        *cache;
+               tIOCache        *prev_cache = (tIOCache*)&gIOCache_Caches;
+               for(cache = gIOCache_Caches;
+                       cache;
+                       prev_cache = cache, cache = cache->Next )
                {
-                       if(ent == Cache) {
-                               prev->Next = ent->Next;
+                       if(cache == Cache) {
+                               prev_cache->Next = cache->Next;
                                break;
                        }
                }

UCC git Repository :: git.ucc.asn.au