diff -r 73ea206103e6 -r 43365a9b78a3 userlibandfileserver/fileserver/sfat32/sl_dir_cache.h --- a/userlibandfileserver/fileserver/sfat32/sl_dir_cache.h Wed Jun 23 19:44:53 2010 +0300 +++ b/userlibandfileserver/fileserver/sfat32/sl_dir_cache.h Tue Jul 06 15:50:07 2010 +0300 @@ -27,6 +27,7 @@ #include "sf_memory_client.h" #include "sl_cache.h" #include +#include //--------------------------------------------------------------------------------------------------------------------------------- class CDynamicDirCache; @@ -132,9 +133,11 @@ TUint32 PageSizeInSegs() const; +#if defined(_DEBUG) || defined(_DEBUG_RELEASE) // Debugging functions void Dump(); - void Info() const; + void Info(TDirCacheInfo* aInfo) const; +#endif //#if defined(_DEBUG) || defined(_DEBUG_RELEASE) protected: CDynamicDirCache(TDriveInterface& aDrive, TUint32 aMinSizeInBytes, TUint32 aMaxSizeInBytes, TUint32 aPageSizeInBytesLog2, TUint32 aWrGranularityLog2); @@ -145,7 +148,7 @@ TDynamicDirCachePage* FindPageByPos(TInt64 aPos); TDynamicDirCachePage* UpdateActivePageL(TInt64 aPos); - TDynamicDirCachePage* AllocateAndLockNewPage(TInt64 aStartMedPos); + TDynamicDirCachePage* AllocateAndLockNewPage(/*TInt64 aStartMedPos*/); TUint8* LockPage(TDynamicDirCachePage* aPage); TInt UnlockPage(TDynamicDirCachePage* aPage); TInt DecommitPage(TDynamicDirCachePage* aPage); @@ -159,7 +162,6 @@ TInt LookupTblAdd(TDynamicDirCachePage* aPage); TDynamicDirCachePage* LookupTblFind(TInt64 aPos); TInt ResetPagePos(TDynamicDirCachePage* aPage); - void MakePageLastLocked(TDynamicDirCachePage* aPage); void DoMakePageMRU(TInt64 aPos); void DoInvalidateCache(void); @@ -177,6 +179,9 @@ TDriveInterface& iDrive; ///< reference to the driver for media access TUint32 iCacheDisabled : 1; ///< if not 0 the cache is disabled totally and all reads and writes go via TDriveInterface directly + TDynamicDirCachePage* iLastVisitedPage; ///< a pointer to the last visited page, we always keep it locked + ///< to avoid excessive lock/unlock activities when we are scanning + ///< a page on the UnlockedQueue // data structures for LRU page list TCachePageList iLockedQ; ///< the locked queue that manages all locked pages, limited by minimum page number