From 1577b46b7c81e490cf5c8f0e90d0e5d0c09b5414 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 28 Nov 2012 12:35:01 -0300 Subject: Split out rmgr rm_desc functions into their own files This is necessary (but not sufficient) to have them compilable outside of a backend environment. --- src/backend/access/gist/gistxlog.c | 49 -------------------------------------- 1 file changed, 49 deletions(-) (limited to 'src/backend/access/gist/gistxlog.c') diff --git a/src/backend/access/gist/gistxlog.c b/src/backend/access/gist/gistxlog.c index 4440499d48..f9c8fcbcf5 100644 --- a/src/backend/access/gist/gistxlog.c +++ b/src/backend/access/gist/gistxlog.c @@ -362,55 +362,6 @@ gist_redo(XLogRecPtr lsn, XLogRecord *record) MemoryContextReset(opCtx); } -static void -out_target(StringInfo buf, RelFileNode node) -{ - appendStringInfo(buf, "rel %u/%u/%u", - node.spcNode, node.dbNode, node.relNode); -} - -static void -out_gistxlogPageUpdate(StringInfo buf, gistxlogPageUpdate *xlrec) -{ - out_target(buf, xlrec->node); - appendStringInfo(buf, "; block number %u", xlrec->blkno); -} - -static void -out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec) -{ - appendStringInfo(buf, "page_split: "); - out_target(buf, xlrec->node); - appendStringInfo(buf, "; block number %u splits to %d pages", - xlrec->origblkno, xlrec->npage); -} - -void -gist_desc(StringInfo buf, uint8 xl_info, char *rec) -{ - uint8 info = xl_info & ~XLR_INFO_MASK; - - switch (info) - { - case XLOG_GIST_PAGE_UPDATE: - appendStringInfo(buf, "page_update: "); - out_gistxlogPageUpdate(buf, (gistxlogPageUpdate *) rec); - break; - case XLOG_GIST_PAGE_SPLIT: - out_gistxlogPageSplit(buf, (gistxlogPageSplit *) rec); - break; - case XLOG_GIST_CREATE_INDEX: - appendStringInfo(buf, "create_index: rel %u/%u/%u", - ((RelFileNode *) rec)->spcNode, - ((RelFileNode *) rec)->dbNode, - ((RelFileNode *) rec)->relNode); - break; - default: - appendStringInfo(buf, "unknown gist op code %u", info); - break; - } -} - void gist_xlog_startup(void) { -- cgit v1.2.1