提交 add314fa 编写于 作者: H Hongze Cheng

more

上级 f60c0729
......@@ -16,6 +16,7 @@
#include "tdbInt.h"
struct SBTree {
pgno_t rootPage;
// TODO
};
......
......@@ -123,7 +123,9 @@ int pgCacheClose(SPgCache *pPgCache) {
}
SPage *pgCacheFetch(SPgCache *pPgCache, pgid_t pgid) {
// TODO
SPage *pPage;
// 1. Check if the page is cached
return NULL;
}
......
......@@ -67,12 +67,22 @@ int pgFileClose(SPgFile *pPgFile) {
}
SPage *pgFileFetch(SPgFile *pPgFile, pgno_t pgno) {
// TODO
return NULL;
SPgCache *pPgCache;
SPage * pPage;
pgid_t pgid;
pPgCache = pPgFile->pPgCache;
pPage = NULL;
memcpy(pgid.fileid, pPgFile->fileid, TDB_FILE_ID_LEN);
pgid.pgno = pgno;
pPage = pgCacheFetch(pPgCache, pgid);
return pPage;
}
int pgFileRelease(SPage *pPage) {
// TODO
pgCacheRelease(pPage);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册