From 6da314df7c99254bb3d1675b3552ba1860621ea2 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 11 Mar 2022 08:14:54 +0000 Subject: [PATCH] more TDB --- source/libs/tdb/src/inc/tdbPCache.h | 3 ++- source/libs/tdb/src/inc/tdbPage.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/libs/tdb/src/inc/tdbPCache.h b/source/libs/tdb/src/inc/tdbPCache.h index fe5131e58b..ff4f1acbb6 100644 --- a/source/libs/tdb/src/inc/tdbPCache.h +++ b/source/libs/tdb/src/inc/tdbPCache.h @@ -31,7 +31,8 @@ extern "C" { SPage *pLruNext; \ SPage *pLruPrev; \ SPage *pDirtyNext; \ - SPager *pPager; + SPager *pPager; \ + SPgid pgid; int tdbPCacheOpen(int pageSize, int cacheSize, SPCache **ppCache); int tdbPCacheClose(SPCache *pCache); diff --git a/source/libs/tdb/src/inc/tdbPage.h b/source/libs/tdb/src/inc/tdbPage.h index f4738dbfad..322f2448bb 100644 --- a/source/libs/tdb/src/inc/tdbPage.h +++ b/source/libs/tdb/src/inc/tdbPage.h @@ -22,6 +22,7 @@ extern "C" { typedef u8 SCell; +// Page header typedef struct __attribute__((__packed__)) { u16 flags; u16 nCells; @@ -30,6 +31,7 @@ typedef struct __attribute__((__packed__)) { u16 nFree; } SPageHdr; +// Large page header (pageSize >= 65536 (64K)) typedef struct __attribute__((__packed__)) { u16 flags; u8 nCells[3]; @@ -48,7 +50,6 @@ struct SPage { u8 szOffset; pthread_spinlock_t lock; // Fields below used by pager and am - SPgid pgid; SPageHdr *pPageHdr; SPageFtr *pPageFtr; u8 *aCellIdx;