diff --git a/source/libs/tdb/src/db/tdbPCache.c b/source/libs/tdb/src/db/tdbPCache.c index b3343bd170ccd2252db6bb1f56610887a1778c1c..879bfca7a62a5d7e2acd3fecfbe09e43d7beae0d 100644 --- a/source/libs/tdb/src/db/tdbPCache.c +++ b/source/libs/tdb/src/db/tdbPCache.c @@ -26,9 +26,6 @@ struct SPCache { SPage ** pgHash; int nRecyclable; SPage lru; - int nDirty; - SPage * pDirty; - SPage * pDirtyTail; }; #define PCACHE_PAGE_HASH(pPgid) \ @@ -248,9 +245,5 @@ static int tdbPCacheOpenImpl(SPCache *pCache) { pCache->lru.pLruNext = &(pCache->lru); pCache->lru.pLruPrev = &(pCache->lru); - // Open dirty list - pCache->nDirty = 0; - pCache->pDirty = pCache->pDirtyTail = NULL; - return 0; } \ No newline at end of file diff --git a/source/libs/tdb/src/db/tdbPFile.c b/source/libs/tdb/src/db/tdbPFile.c index 31047807bf83a3c2cb88dc15f0a4f2c55c4ce228..1e580b32629c2ab6d2b8d63f8e4b16fcb7a13c68 100644 --- a/source/libs/tdb/src/db/tdbPFile.c +++ b/source/libs/tdb/src/db/tdbPFile.c @@ -25,6 +25,9 @@ struct SPFile { SPCache *pCache; SPgno dbFileSize; SPgno dbOrigSize; + int nDirty; + SPage * pDirty; + SPage * pDirtyTail; }; static int tdbPFileReadPage(SPFile *pFile, SPage *pPage); diff --git a/source/libs/tdb/src/inc/tdbEnv.h b/source/libs/tdb/src/inc/tdbEnv.h index 3969eae5763270db9e17054a3a75c7b0ef971986..d779e842bdf675f397bc5a560ba18a7b76e20824 100644 --- a/source/libs/tdb/src/inc/tdbEnv.h +++ b/source/libs/tdb/src/inc/tdbEnv.h @@ -20,13 +20,12 @@ extern "C" { #endif -typedef struct STEnv STEnv; -struct STEnv { +typedef struct STEnv { char * rootDir; char * jfname; int jfd; SPCache *pCache; -}; +} STEnv; int tdbEnvOpen(const char *rootDir, int pageSize, int cacheSize, STEnv **ppEnv); int tdbEnvClose(STEnv *pEnv);