From 2076db2aea766c4c828dccc34ae35f614129000d Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 6 Nov 2014 13:52:08 +0200 Subject: Move the backup-block logic from XLogInsert to a new file, xloginsert.c. xlog.c is huge, this makes it a little bit smaller, which is nice. Functions related to putting together the WAL record are in xloginsert.c, and the lower level stuff for managing WAL buffers and such are in xlog.c. Also move the definition of XLogRecord to a separate header file. This causes churn in the #includes of all the files that write WAL records, and redo routines, but it avoids pulling in xlog.h into most places. Reviewed by Michael Paquier, Alvaro Herrera, Andres Freund and Amit Kapila. --- src/include/access/xlogutils.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/include/access/xlogutils.h') diff --git a/src/include/access/xlogutils.h b/src/include/access/xlogutils.h index ad579083ab..8d90696723 100644 --- a/src/include/access/xlogutils.h +++ b/src/include/access/xlogutils.h @@ -11,7 +11,7 @@ #ifndef XLOG_UTILS_H #define XLOG_UTILS_H -#include "access/xlog.h" +#include "access/xlogrecord.h" #include "storage/bufmgr.h" @@ -47,6 +47,12 @@ extern Buffer XLogReadBuffer(RelFileNode rnode, BlockNumber blkno, bool init); extern Buffer XLogReadBufferExtended(RelFileNode rnode, ForkNumber forknum, BlockNumber blkno, ReadBufferMode mode); +extern Buffer RestoreBackupBlock(XLogRecPtr lsn, XLogRecord *record, + int block_index, + bool get_cleanup_lock, bool keep_buffer); +extern Buffer RestoreBackupBlockContents(XLogRecPtr lsn, BkpBlock bkpb, + char *blk, bool get_cleanup_lock, bool keep_buffer); + extern Relation CreateFakeRelcacheEntry(RelFileNode rnode); extern void FreeFakeRelcacheEntry(Relation fakerel); -- cgit v1.2.1