| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #ifndef BRIN_PAGE_H |
| #define BRIN_PAGE_H |
|
|
| #include "storage/block.h" |
| #include "storage/itemptr.h" |
|
|
| |
| |
| |
| |
| |
| |
| typedef struct BrinSpecialSpace |
| { |
| uint16 vector[MAXALIGN(1) / sizeof(uint16)]; |
| } BrinSpecialSpace; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| #define BrinPageType(page) \ |
| (((BrinSpecialSpace *) \ |
| PageGetSpecialPointer(page))->vector[MAXALIGN(1) / sizeof(uint16) - 1]) |
|
|
| #define BrinPageFlags(page) \ |
| (((BrinSpecialSpace *) \ |
| PageGetSpecialPointer(page))->vector[MAXALIGN(1) / sizeof(uint16) - 2]) |
|
|
| |
| #define BRIN_PAGETYPE_META 0xF091 |
| #define BRIN_PAGETYPE_REVMAP 0xF092 |
| #define BRIN_PAGETYPE_REGULAR 0xF093 |
|
|
| #define BRIN_IS_META_PAGE(page) (BrinPageType(page) == BRIN_PAGETYPE_META) |
| #define BRIN_IS_REVMAP_PAGE(page) (BrinPageType(page) == BRIN_PAGETYPE_REVMAP) |
| #define BRIN_IS_REGULAR_PAGE(page) (BrinPageType(page) == BRIN_PAGETYPE_REGULAR) |
|
|
| |
| #define BRIN_EVACUATE_PAGE (1 << 0) |
|
|
|
|
| |
| typedef struct BrinMetaPageData |
| { |
| uint32 brinMagic; |
| uint32 brinVersion; |
| BlockNumber pagesPerRange; |
| BlockNumber lastRevmapPage; |
| } BrinMetaPageData; |
|
|
| #define BRIN_CURRENT_VERSION 1 |
| #define BRIN_META_MAGIC 0xA8109CFA |
|
|
| #define BRIN_METAPAGE_BLKNO 0 |
|
|
| |
| typedef struct RevmapContents |
| { |
| |
| |
| |
| |
| |
| ItemPointerData rm_tids[1]; |
| } RevmapContents; |
|
|
| #define REVMAP_CONTENT_SIZE \ |
| (BLCKSZ - MAXALIGN(SizeOfPageHeaderData) - \ |
| offsetof(RevmapContents, rm_tids) - \ |
| MAXALIGN(sizeof(BrinSpecialSpace))) |
| |
| #define REVMAP_PAGE_MAXITEMS \ |
| (REVMAP_CONTENT_SIZE / sizeof(ItemPointerData)) |
|
|
| #endif |
|
|