X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fdrv%2Fiocache.c;h=f42957c755d7a58ab0b60e8efa02197909227399;hb=a4a71f89713c34454ef254bbb1a1ea9ed773fa1b;hp=8ea6929a8a2401c97f108b91ad4eb6671f46bf19;hpb=75e87cf46a3899f76bae5c64e130cfc033562e9a;p=tpg%2Facess2.git diff --git a/Kernel/drv/iocache.c b/Kernel/drv/iocache.c index 8ea6929a..f42957c7 100644 --- a/Kernel/drv/iocache.c +++ b/Kernel/drv/iocache.c @@ -4,7 +4,8 @@ * * By thePowersGang (John Hodge) */ -#include +#define DEBUG 0 +#include #include // === TYPES === @@ -77,14 +78,19 @@ int IOCache_Read( tIOCache *Cache, Uint64 Sector, void *Buffer ) { tIOCache_Ent *ent; + ENTER("pCache XSector pBuffer", Cache, Sector, Buffer); + // Sanity Check! - if(!Cache || !Buffer) + if(!Cache || !Buffer) { + LEAVE('i', -1); return -1; + } // Lock LOCK( &Cache->Lock ); if(Cache->CacheSize == 0) { RELEASE( &Cache->Lock ); + LEAVE('i', -1); return -1; } @@ -96,6 +102,7 @@ int IOCache_Read( tIOCache *Cache, Uint64 Sector, void *Buffer ) memcpy(Buffer, ent->Data, Cache->SectorSize); ent->LastAccess = now(); RELEASE( &Cache->Lock ); + LEAVE('i', 1); return 1; } // It's a sorted list, so as soon as we go past `Sector` we know @@ -104,6 +111,7 @@ int IOCache_Read( tIOCache *Cache, Uint64 Sector, void *Buffer ) } RELEASE( &Cache->Lock ); + LEAVE('i', 0); return 0; }