/*
* cache.c - A simple cache for file systems meta-data.
*
- * Copyright (c) 2000 Apple Computer, Inc.
+ * Copyright (c) 2000 - 2003 Apple Computer, Inc.
*
* DRI: Josh de Cesare
*/
};
typedef struct CacheEntry CacheEntry;
-#define kCacheSize (0x80000)
+#define kCacheSize (kFSCacheSize)
#define kCacheMinBlockSize (0x200)
#define kCacheMaxBlockSize (0x4000)
#define kCacheMaxEntries (kCacheSize / kCacheMinBlockSize)
static long gCacheNumEntries;
static long gCacheTime;
static CacheEntry gCacheEntries[kCacheMaxEntries];
-static char gCacheBuffer[kCacheSize];
+static char *gCacheBuffer = (char *)kFSCacheAddr;
unsigned long gCacheHits;
unsigned long gCacheMisses;
long CacheRead(CICell ih, char *buffer, long long offset,
long length, long cache)
{
- long cnt, oldestEntry, oldestTime, loadCache = 0;
+ long cnt, oldestEntry = 0, oldestTime, loadCache = 0;
CacheEntry *entry;
// See if the data can be cached.