Skip to content

Commit 05b033e

Browse files
committed
fix compatibility fixes for backport to v11.
bring back checkpoint hook.
1 parent b2f5131 commit 05b033e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

ptrack.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#if PG_VERSION_NUM >= 120000
4747
#include "storage/md.h"
4848
#endif
49+
#include "storage/smgr.h"
4950
#include "storage/reinit.h"
5051
#include "utils/builtins.h"
5152
#include "utils/guc.h"
@@ -64,9 +65,7 @@ int ptrack_map_size_tmp;
6465
static copydir_hook_type prev_copydir_hook = NULL;
6566
static mdwrite_hook_type prev_mdwrite_hook = NULL;
6667
static mdextend_hook_type prev_mdextend_hook = NULL;
67-
#if PG_VERSION_NUM >= 120000
6868
static ProcessSyncRequests_hook_type prev_ProcessSyncRequests_hook = NULL;
69-
#endif
7069

7170
void _PG_init(void);
7271
void _PG_fini(void);
@@ -76,9 +75,8 @@ static void ptrack_mdwrite_hook(RelFileNodeBackend smgr_rnode,
7675
ForkNumber forkno, BlockNumber blkno);
7776
static void ptrack_mdextend_hook(RelFileNodeBackend smgr_rnode,
7877
ForkNumber forkno, BlockNumber blkno);
79-
#if PG_VERSION_NUM >= 120000
8078
static void ptrack_ProcessSyncRequests_hook(void);
81-
#endif
79+
8280
static void ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid);
8381
static int ptrack_filelist_getnext(PtScanCtx * ctx);
8482

@@ -120,10 +118,8 @@ _PG_init(void)
120118
mdwrite_hook = ptrack_mdwrite_hook;
121119
prev_mdextend_hook = mdextend_hook;
122120
mdextend_hook = ptrack_mdextend_hook;
123-
#if PG_VERSION_NUM >= 120000
124121
prev_ProcessSyncRequests_hook = ProcessSyncRequests_hook;
125122
ProcessSyncRequests_hook = ptrack_ProcessSyncRequests_hook;
126-
#endif
127123
}
128124

129125
/*
@@ -136,9 +132,7 @@ _PG_fini(void)
136132
copydir_hook = prev_copydir_hook;
137133
mdwrite_hook = prev_mdwrite_hook;
138134
mdextend_hook = prev_mdextend_hook;
139-
#if PG_VERSION_NUM >= 120000
140135
ProcessSyncRequests_hook = prev_ProcessSyncRequests_hook;
141-
#endif
142136
}
143137

144138
/*
@@ -218,7 +212,6 @@ ptrack_mdextend_hook(RelFileNodeBackend smgr_rnode,
218212
prev_mdextend_hook(smgr_rnode, forknum, blocknum);
219213
}
220214

221-
#if PG_VERSION_NUM >= 120000
222215
static void
223216
ptrack_ProcessSyncRequests_hook()
224217
{
@@ -227,7 +220,6 @@ ptrack_ProcessSyncRequests_hook()
227220
if (prev_ProcessSyncRequests_hook)
228221
prev_ProcessSyncRequests_hook();
229222
}
230-
#endif
231223

232224
/*
233225
* Recursively walk through the path and add all data files to filelist.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy