Cleanup (NTFS fiddling and fixed debug hexdump)
[tpg/acess2.git] / Kernel / vfs / nodecache.c
index c503e9c..a898d5d 100644 (file)
@@ -2,7 +2,7 @@
  * AcessMicro VFS
  * - File IO Passthru's
  */
-#include <common.h>
+#include <acess.h>
 #include "vfs.h"
 #include "vfs_int.h"
 
@@ -121,9 +121,9 @@ void Inode_UncacheNode(int Handle, Uint64 Inode)
        tCachedInode    *ent, *prev;
        
        cache = Inode_int_GetFSCache(Handle);
-       if(!cache)      return;
+       if(!cache)      return ;
        
-       if(Inode > cache->MaxCached)    return;
+       if(Inode > cache->MaxCached)    return ;
        
        // Search Cache
        ent = cache->FirstNode;
@@ -147,8 +147,10 @@ void Inode_UncacheNode(int Handle, Uint64 Inode)
                                
                        free(ent);
                }
-               return;
+               return ;
        }
+       
+       return ;
 }
 
 /**
@@ -158,7 +160,7 @@ void Inode_UncacheNode(int Handle, Uint64 Inode)
 void Inode_ClearCache(int Handle)
 {
        tInodeCache     *cache;
-       tInodeCache     *prev = (tInodeCache*) &gVFS_InodeCache;
+       tInodeCache     *prev = NULL;
        tCachedInode    *ent, *next;
        
        // Find the cache
@@ -184,7 +186,10 @@ void Inode_ClearCache(int Handle)
        }
        
        // Free Cache
-       prev->Next = cache->Next;
+       if(prev == NULL)
+               gVFS_InodeCache = cache->Next;
+       else
+               prev->Next = cache->Next;
        free(cache);
 }
 

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