Skip to content

Commit 25dcc9d

Browse files
committed
Make XLogReaderInvalReadState static
This function is only used by xlogreader.c itself, so there's no need to export it. It was introduced by commit 3b02ea4 with the apparent intention that it could be used externally, but I couldn't find any external code calling it. I (Álvaro) couldn't resist the urge to sort nearby function prototypes properly while at it. Author: Antonin Houska Discussion: https://postgr.es/m/14984.1554998742@spoje.net
1 parent fe66125 commit 25dcc9d

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/backend/access/transam/xlogreader.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@
3030
#include "utils/memutils.h"
3131
#endif
3232

33-
static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
3433

34+
static void report_invalid_record(XLogReaderState *state, const char *fmt,...)
35+
pg_attribute_printf(2, 3);
36+
static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
37+
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
38+
int reqLen);
39+
static void XLogReaderInvalReadState(XLogReaderState *state);
3540
static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
3641
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
3742
static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
3843
XLogRecPtr recptr);
39-
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
40-
int reqLen);
41-
static void report_invalid_record(XLogReaderState *state, const char *fmt,...) pg_attribute_printf(2, 3);
42-
4344
static void ResetDecoder(XLogReaderState *state);
4445

4546
/* size of the buffer allocated for error message. */
@@ -621,7 +622,7 @@ ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr, int reqLen)
621622
/*
622623
* Invalidate the xlogreader's read state to force a re-read.
623624
*/
624-
void
625+
static void
625626
XLogReaderInvalReadState(XLogReaderState *state)
626627
{
627628
state->readSegNo = 0;

src/include/access/xlogreader.h

-4
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,9 @@ extern struct XLogRecord *XLogReadRecord(XLogReaderState *state,
216216
extern bool XLogReaderValidatePageHeader(XLogReaderState *state,
217217
XLogRecPtr recptr, char *phdr);
218218

219-
/* Invalidate read state */
220-
extern void XLogReaderInvalReadState(XLogReaderState *state);
221-
222219
#ifdef FRONTEND
223220
extern XLogRecPtr XLogFindNextRecord(XLogReaderState *state, XLogRecPtr RecPtr);
224221
#endif /* FRONTEND */
225-
226222
/* Functions for decoding an XLogRecord */
227223

228224
extern bool DecodeXLogRecord(XLogReaderState *state, XLogRecord *record,

0 commit comments

Comments
 (0)