From 43afb55c007a6ea5af146342289c5e1683364ba0 Mon Sep 17 00:00:00 2001 From: Mark Dilger Date: Mon, 19 Oct 2020 18:00:34 -0700 Subject: [PATCH v1 2/2] Moving RmgrData from xlog_internal.h to its own header. --- src/backend/access/transam/rmgr.c | 1 + src/backend/access/transam/xlog.c | 1 + src/backend/utils/misc/guc.c | 1 + src/bin/initdb/initdb.c | 1 + src/bin/pg_checksums/pg_checksums.c | 1 + src/include/access/rmgr_internal.h | 45 +++++++++++++++++++++++++++++ src/include/access/xlog_internal.h | 33 --------------------- 7 files changed, 50 insertions(+), 33 deletions(-) create mode 100644 src/include/access/rmgr_internal.h diff --git a/src/backend/access/transam/rmgr.c b/src/backend/access/transam/rmgr.c index 58091f6b52..e30f18a4b2 100644 --- a/src/backend/access/transam/rmgr.c +++ b/src/backend/access/transam/rmgr.c @@ -18,6 +18,7 @@ #include "access/multixact.h" #include "access/nbtxlog.h" #include "access/spgxlog.h" +#include "access/rmgr_internal.h" #include "access/xact.h" #include "access/xlog_internal.h" #include "catalog/storage_xlog.h" diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 52a67b1170..a7ffe05e54 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -27,6 +27,7 @@ #include "access/heaptoast.h" #include "access/multixact.h" #include "access/rewriteheap.h" +#include "access/rmgr_internal.h" #include "access/subtrans.h" #include "access/timeline.h" #include "access/transam.h" diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index a62d64eaa4..085441c836 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -32,6 +32,7 @@ #include "access/commit_ts.h" #include "access/gin.h" #include "access/rmgr.h" +#include "access/rmgr_internal.h" #include "access/tableam.h" #include "access/transam.h" #include "access/twophase.h" diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index ee3bfa82f4..d86b488a2f 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -72,6 +72,7 @@ #include "fe_utils/string_utils.h" #include "getaddrinfo.h" #include "getopt_long.h" +#include "lib/stringinfo.h" #include "mb/pg_wchar.h" #include "miscadmin.h" diff --git a/src/bin/pg_checksums/pg_checksums.c b/src/bin/pg_checksums/pg_checksums.c index ffdc23945c..db5d8a0ee5 100644 --- a/src/bin/pg_checksums/pg_checksums.c +++ b/src/bin/pg_checksums/pg_checksums.c @@ -24,6 +24,7 @@ #include "common/file_perm.h" #include "common/file_utils.h" #include "common/logging.h" +#include "common/relpath.h" #include "getopt_long.h" #include "pg_getopt.h" #include "storage/bufpage.h" diff --git a/src/include/access/rmgr_internal.h b/src/include/access/rmgr_internal.h new file mode 100644 index 0000000000..7ed8aca847 --- /dev/null +++ b/src/include/access/rmgr_internal.h @@ -0,0 +1,45 @@ +/* + * rmgr_internal.h + * + * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * src/include/access/rmgr_internal.h + */ +#ifndef RMGR_INTERNAL_H +#define RMGR_INTERNAL_H + +#include "lib/stringinfo.h" +#include "storage/block.h" +#include "storage/relfilenode.h" + +/* + * Method table for resource managers. + * + * This struct must be kept in sync with the PG_RMGR definition in + * rmgr.c. + * + * rm_identify must return a name for the record based on xl_info (without + * reference to the rmid). For example, XLOG_BTREE_VACUUM would be named + * "VACUUM". rm_desc can then be called to obtain additional detail for the + * record, if available (e.g. the last block). + * + * rm_mask takes as input a page modified by the resource manager and masks + * out bits that shouldn't be flagged by wal_consistency_checking. + * + * RmgrTable[] is indexed by RmgrId values (see rmgrlist.h). + */ +typedef struct RmgrData +{ + const char *rm_name; + void (*rm_redo) (XLogReaderState *record); + void (*rm_desc) (StringInfo buf, XLogReaderState *record); + const char *(*rm_identify) (uint8 info); + void (*rm_startup) (void); + void (*rm_cleanup) (void); + void (*rm_mask) (char *pagedata, BlockNumber blkno); +} RmgrData; + +extern const RmgrData RmgrTable[]; + +#endif /* RMGR_INTERNAL_H */ diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index 4146753d47..2ad7e443cb 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -20,12 +20,8 @@ #define XLOG_INTERNAL_H #include "access/xlogdefs.h" -#include "access/xlogreader.h" #include "datatype/timestamp.h" -#include "lib/stringinfo.h" #include "pgtime.h" -#include "storage/block.h" -#include "storage/relfilenode.h" /* @@ -278,35 +274,6 @@ typedef enum RECOVERY_TARGET_ACTION_SHUTDOWN } RecoveryTargetAction; -/* - * Method table for resource managers. - * - * This struct must be kept in sync with the PG_RMGR definition in - * rmgr.c. - * - * rm_identify must return a name for the record based on xl_info (without - * reference to the rmid). For example, XLOG_BTREE_VACUUM would be named - * "VACUUM". rm_desc can then be called to obtain additional detail for the - * record, if available (e.g. the last block). - * - * rm_mask takes as input a page modified by the resource manager and masks - * out bits that shouldn't be flagged by wal_consistency_checking. - * - * RmgrTable[] is indexed by RmgrId values (see rmgrlist.h). - */ -typedef struct RmgrData -{ - const char *rm_name; - void (*rm_redo) (XLogReaderState *record); - void (*rm_desc) (StringInfo buf, XLogReaderState *record); - const char *(*rm_identify) (uint8 info); - void (*rm_startup) (void); - void (*rm_cleanup) (void); - void (*rm_mask) (char *pagedata, BlockNumber blkno); -} RmgrData; - -extern const RmgrData RmgrTable[]; - /* * Exported to support xlog switching from checkpointer */ -- 2.21.1 (Apple Git-122.3)