Reduce xlog.h inclusion footprint
authorAlvaro Herrera <[email protected]>
Wed, 12 Oct 2022 07:44:40 +0000 (09:44 +0200)
committerAlvaro Herrera <[email protected]>
Wed, 12 Oct 2022 07:47:11 +0000 (09:47 +0200)
This file needs xlogreader.h only for the XLogReaderState typedef; but
we can dodge that by forward-declaring it.  Many files use xlog.h for
reasons other than reading WAL, and it's not good to force all those
files to include xlogreader.h, so take it out.

Surprisingly, there is no fallout in core code from making this change.
Perhaps external code will have to start including xlogreader.h.

src/include/access/xlog.h

index dce265098e3acb2947a6bc2627c2f833630b6684..1fbd48fbda2630db337cf4ca6ca247f49bae1908 100644 (file)
@@ -13,7 +13,6 @@
 
 #include "access/xlogbackup.h"
 #include "access/xlogdefs.h"
-#include "access/xlogreader.h"
 #include "datatype/timestamp.h"
 #include "lib/stringinfo.h"
 #include "nodes/pg_list.h"
@@ -192,6 +191,7 @@ typedef enum WALAvailability
 } WALAvailability;
 
 struct XLogRecData;
+struct XLogReaderState;
 
 extern XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata,
                                   XLogRecPtr fpw_lsn,
@@ -209,8 +209,8 @@ extern XLogSegNo XLogGetLastRemovedSegno(void);
 extern void XLogSetAsyncXactLSN(XLogRecPtr asyncXactLSN);
 extern void XLogSetReplicationSlotMinimumLSN(XLogRecPtr lsn);
 
-extern void xlog_redo(XLogReaderState *record);
-extern void xlog_desc(StringInfo buf, XLogReaderState *record);
+extern void xlog_redo(struct XLogReaderState *record);
+extern void xlog_desc(StringInfo buf, struct XLogReaderState *record);
 extern const char *xlog_identify(uint8 info);
 
 extern void issue_xlog_fsync(int fd, XLogSegNo segno, TimeLineID tli);