diff --git a/source/libs/tdb/src/db/tdb_mpool.c b/source/libs/tdb/src/db/tdb_mpool.c index c387b6adcc..0d9ddd9d46 100644 --- a/source/libs/tdb/src/db/tdb_mpool.c +++ b/source/libs/tdb/src/db/tdb_mpool.c @@ -15,7 +15,7 @@ #include "tdb_mpool.h" -int tdbOpenMP(TDB_MPOOL **mpp, uint64_t cachesize, pgsize_t pgsize) { +int tdbMPoolOpen(TDB_MPOOL **mpp, uint64_t cachesize, pgsize_t pgsize) { TDB_MPOOL *mp; size_t tsize; MP_PAGE * pagep; @@ -65,18 +65,7 @@ int tdbOpenMP(TDB_MPOOL **mpp, uint64_t cachesize, pgsize_t pgsize) { return 0; } -int tdbCloseMP(TDB_MPOOL *mp) { - // TODO - return 0; -} - -int tdbMPFetchPage(TDB_MPOOL *mp, pgid_t mpgid, void *p) { - // Search the hash - // TODO - return 0; -} - -int tdbMpUnfetchPage(TDB_MPOOL *mp, pgid_t mpgid, void *p) { +int tdbMPoolClose(TDB_MPOOL *mp) { // TODO return 0; } \ No newline at end of file diff --git a/source/libs/tdb/src/inc/tdb_inc.h b/source/libs/tdb/src/inc/tdb_inc.h index 3e16036722..17dd5254d6 100644 --- a/source/libs/tdb/src/inc/tdb_inc.h +++ b/source/libs/tdb/src/inc/tdb_inc.h @@ -27,6 +27,15 @@ extern "C" { typedef int32_t pgno_t; #define TDB_IVLD_PGID ((pgno_t)-1) +// fileid +#define TDB_FILE_UID_LEN 20 + +// pgid_t +typedef struct { + uint8_t fuid[TDB_FILE_UID_LEN]; + pgno_t pgid; +} pgid_t; + // framd_id_t typedef int32_t frame_id_t; @@ -37,9 +46,6 @@ typedef int32_t pgsize_t; #define TDB_DEFAULT_PGSIZE 4096 #define TDB_IS_PGSIZE_VLD(s) (((s) >= TDB_MIN_PGSIZE) && ((s) <= TDB_MAX_PGSIZE)) -// fileid -#define TDB_FILE_UID_LEN 20 - // tdb_log #define tdbError(var) diff --git a/source/libs/tdb/src/inc/tdb_mpool.h b/source/libs/tdb/src/inc/tdb_mpool.h index 2e9e9be73e..73596d91dd 100644 --- a/source/libs/tdb/src/inc/tdb_mpool.h +++ b/source/libs/tdb/src/inc/tdb_mpool.h @@ -26,17 +26,12 @@ extern "C" { typedef struct TDB_MPOOL TDB_MPOOL; typedef struct TDB_MPFILE TDB_MPFILE; -typedef struct { - uint8_t fuid[TDB_FILE_UID_LEN]; - pgno_t pgid; -} pgid_t; - typedef struct MP_PAGE { // SRWLatch rwLatch; - pgid_t mpgid; - uint8_t dirty; - uint8_t fileid[TDB_FILE_UID_LEN]; - int32_t pinRef; + pgid_t mpgid; + uint8_t dirty; + uint8_t fileid[TDB_FILE_UID_LEN]; + int32_t pinRef; TD_DLIST_NODE(MP_PAGE); char *page[]; } MP_PAGE; @@ -67,10 +62,8 @@ struct TDB_MPFILE { /*=================================================== Exposed apis ==================================================*/ // TDB_MPOOL -int tdbOpenMP(TDB_MPOOL **mpp, uint64_t cachesize, pgsize_t pgsize); -int tdbCloseMP(TDB_MPOOL *mp); -int tdbMPFetchPage(TDB_MPOOL *mp, pgid_t mpgid, void *p); -int tdbMpUnfetchPage(TDB_MPOOL *mp, pgid_t mpgid, void *p); +int tdbMPoolOpen(TDB_MPOOL **mpp, uint64_t cachesize, pgsize_t pgsize); +int tdbMPoolClose(TDB_MPOOL *mp); // TDB_MPFILE int tdbMPFOpen(TDB_MPFILE **mpfp, const char *fname, TDB_MPOOL *mp);