1
1
diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c
2
- index 715428029b3..81f3218540a 100644
2
+ index 3fb9451643..3d528fd007 100644
3
3
--- a/src/backend/backup/basebackup.c
4
4
+++ b/src/backend/backup/basebackup.c
5
- @@ -197 ,6 +197 ,13 @@ static const struct exclude_list_item excludeFiles[] =
5
+ @@ -199 ,6 +199 ,13 @@ static const struct exclude_list_item excludeFiles[] =
6
6
{"postmaster.pid", false},
7
7
{"postmaster.opts", false},
8
8
@@ -16,7 +16,7 @@ index 715428029b3..81f3218540a 100644
16
16
/* end of list */
17
17
{NULL, false}
18
18
};
19
- @@ -212 ,6 +219 ,11 @@ static const struct exclude_list_item noChecksumFiles[] = {
19
+ @@ -214 ,6 +221 ,11 @@ static const struct exclude_list_item noChecksumFiles[] = {
20
20
{"pg_filenode.map", false},
21
21
{"pg_internal.init", true},
22
22
{"PG_VERSION", false},
@@ -29,7 +29,7 @@ index 715428029b3..81f3218540a 100644
29
29
{"config_exec_params", true},
30
30
#endif
31
31
diff --git a/src/backend/storage/file/copydir.c b/src/backend/storage/file/copydir.c
32
- index 658fd95ba95..eee38eba176 100644
32
+ index e04bc3941a..996b5de616 100644
33
33
--- a/src/backend/storage/file/copydir.c
34
34
+++ b/src/backend/storage/file/copydir.c
35
35
@@ -27,6 +27,8 @@
@@ -41,7 +41,7 @@ index 658fd95ba95..eee38eba176 100644
41
41
/*
42
42
* copydir: copy a directory
43
43
*
44
- @@ -78 ,6 +80 ,9 @@ copydir(char *fromdir, char *todir, bool recurse)
44
+ @@ -75 ,6 +77 ,9 @@ copydir(const char *fromdir, const char *todir, bool recurse)
45
45
}
46
46
FreeDir(xldir);
47
47
@@ -52,7 +52,7 @@ index 658fd95ba95..eee38eba176 100644
52
52
* Be paranoid here and fsync all files to ensure the copy is really done.
53
53
* But if fsync is disabled, we're done.
54
54
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
55
- index 3deac496eed..07c4ee2ba03 100644
55
+ index 352958e1fe..9dc6bf29f4 100644
56
56
--- a/src/backend/storage/smgr/md.c
57
57
+++ b/src/backend/storage/smgr/md.c
58
58
@@ -87,6 +87,8 @@ typedef struct _MdfdVec
@@ -64,7 +64,7 @@ index 3deac496eed..07c4ee2ba03 100644
64
64
65
65
/* Populate a file tag describing an md.c segment file. */
66
66
#define INIT_MD_FILETAG(a,xx_rlocator,xx_forknum,xx_segno) \
67
- @@ -484 ,6 +486 ,9 @@ mdextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
67
+ @@ -498 ,6 +500 ,9 @@ mdextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
68
68
register_dirty_segment(reln, forknum, v);
69
69
70
70
Assert(_mdnblocks(reln, forknum, v) <= ((BlockNumber) RELSEG_SIZE));
@@ -74,7 +74,7 @@ index 3deac496eed..07c4ee2ba03 100644
74
74
}
75
75
76
76
/*
77
- @@ -773 ,6 +778 ,9 @@ mdwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
77
+ @@ -787 ,6 +792 ,9 @@ mdwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
78
78
79
79
if (!skipFsync && !SmgrIsTemp(reln))
80
80
register_dirty_segment(reln, forknum, v);
@@ -85,7 +85,7 @@ index 3deac496eed..07c4ee2ba03 100644
85
85
86
86
/*
87
87
diff --git a/src/backend/storage/sync/sync.c b/src/backend/storage/sync/sync.c
88
- index 9d6a9e91090..990d0722229 100644
88
+ index 768d1dbfc4..17cbc6bb2a 100644
89
89
--- a/src/backend/storage/sync/sync.c
90
90
+++ b/src/backend/storage/sync/sync.c
91
91
@@ -81,6 +81,8 @@ static MemoryContext pendingOpsCxt; /* context for the above */
@@ -108,7 +108,7 @@ index 9d6a9e91090..990d0722229 100644
108
108
sync_in_progress = false;
109
109
}
110
110
diff --git a/src/bin/pg_checksums/pg_checksums.c b/src/bin/pg_checksums/pg_checksums.c
111
- index 324ccf77834..e82cae5f325 100644
111
+ index aa21007497..96fe58ee3e 100644
112
112
--- a/src/bin/pg_checksums/pg_checksums.c
113
113
+++ b/src/bin/pg_checksums/pg_checksums.c
114
114
@@ -118,6 +118,11 @@ static const struct exclude_list_item skip[] = {
@@ -124,7 +124,7 @@ index 324ccf77834..e82cae5f325 100644
124
124
{"config_exec_params", true},
125
125
#endif
126
126
diff --git a/src/bin/pg_resetwal/pg_resetwal.c b/src/bin/pg_resetwal/pg_resetwal.c
127
- index d4772a29650..3318f64359d 100644
127
+ index e7ef2b8bd0..ca7f8cdbc2 100644
128
128
--- a/src/bin/pg_resetwal/pg_resetwal.c
129
129
+++ b/src/bin/pg_resetwal/pg_resetwal.c
130
130
@@ -85,6 +85,7 @@ static void RewriteControlFile(void);
@@ -143,7 +143,7 @@ index d4772a29650..3318f64359d 100644
143
143
WriteEmptyXLOG();
144
144
145
145
printf(_("Write-ahead log reset\n"));
146
- @@ -1036 ,6 +1038 ,41 @@ KillExistingArchiveStatus(void)
146
+ @@ -1029 ,6 +1031 ,41 @@ KillExistingArchiveStatus(void)
147
147
pg_fatal("could not close directory \"%s\": %m", ARCHSTATDIR);
148
148
}
149
149
@@ -186,7 +186,7 @@ index d4772a29650..3318f64359d 100644
186
186
/*
187
187
* Write an empty XLOG file, containing only the checkpoint record
188
188
diff --git a/src/bin/pg_rewind/filemap.c b/src/bin/pg_rewind/filemap.c
189
- index 269ed6446e6..6318a8c1f55 100644
189
+ index bd5c598e20..a568156c5f 100644
190
190
--- a/src/bin/pg_rewind/filemap.c
191
191
+++ b/src/bin/pg_rewind/filemap.c
192
192
@@ -157,6 +157,10 @@ static const struct exclude_list_item excludeFiles[] =
@@ -200,21 +200,55 @@ index 269ed6446e6..6318a8c1f55 100644
200
200
/* end of list */
201
201
{NULL, false}
202
202
};
203
- diff --git a/src/include/port/pg_crc32c .h b/src/include/port/pg_crc32c .h
204
- index d7668651ba8..33994a27f5f 100644
205
- --- a/src/include/port/pg_crc32c .h
206
- +++ b/src/include/port/pg_crc32c .h
207
- @@ -69,7 +69 ,7 @@ extern pg_crc32c pg_comp_crc32c_armv8(pg_crc32c crc, const void *data, size_t le
208
- #define FIN_CRC32C(crc) ((crc) ^= 0xFFFFFFFF)
203
+ diff --git a/src/include/storage/checksum .h b/src/include/storage/checksum .h
204
+ index 4afd25a0af..c2afee20b5 100644
205
+ --- a/src/include/storage/checksum .h
206
+ +++ b/src/include/storage/checksum .h
207
+ @@ -14,6 +14 ,7 @@
208
+ #define CHECKSUM_H
209
209
210
- extern pg_crc32c pg_comp_crc32c_sb8(pg_crc32c crc, const void *data, size_t len);
211
- - extern pg_crc32c (*pg_comp_crc32c) (pg_crc32c crc, const void *data, size_t len);
212
- + extern PGDLLIMPORT pg_crc32c (*pg_comp_crc32c) (pg_crc32c crc, const void *data, size_t len);
210
+ #include "storage/block.h"
211
+ + #include "port/pg_crc32c.h"
213
212
214
- #ifdef USE_SSE42_CRC32C_WITH_RUNTIME_CHECK
215
- extern pg_crc32c pg_comp_crc32c_sse42(pg_crc32c crc, const void *data, size_t len);
213
+ /*
214
+ * Compute the checksum for a Postgres page. The page must be aligned on a
215
+ @@ -21,4 +22,18 @@
216
+ */
217
+ extern uint16 pg_checksum_page(char *page, BlockNumber blkno);
218
+
219
+ + #ifdef WIN32
220
+ + /*
221
+ + * Wrapper function for COMP_CRC32C macro. Was added to avoid
222
+ + * FRONTEND macro use for pg_comp_crc32c pointer in windows build.
223
+ + */
224
+ + extern void
225
+ + comp_crc32c(pg_crc32c *crc, const void *data, size_t len);
226
+ +
227
+ + #define COMP_CRC32C_COMMON(crc, data, len) \
228
+ + comp_crc32c(&(crc), data, len)
229
+ + #else
230
+ + #define COMP_CRC32C_COMMON COMP_CRC32C
231
+ + #endif /* WIN32 */
232
+ +
233
+ #endif /* CHECKSUM_H */
234
+ diff --git a/src/include/storage/checksum_impl.h b/src/include/storage/checksum_impl.h
235
+ index 7b157161a2..a69425f6cc 100644
236
+ --- a/src/include/storage/checksum_impl.h
237
+ +++ b/src/include/storage/checksum_impl.h
238
+ @@ -213,3 +213,11 @@ pg_checksum_page(char *page, BlockNumber blkno)
239
+ */
240
+ return (uint16) ((checksum % 65535) + 1);
241
+ }
242
+ +
243
+ + #ifdef WIN32
244
+ + void
245
+ + comp_crc32c(pg_crc32c *crc, const void *data, size_t len)
246
+ + {
247
+ + COMP_CRC32C(*crc, data, len);
248
+ + }
249
+ + #endif
216
250
diff --git a/src/include/storage/copydir.h b/src/include/storage/copydir.h
217
- index 50a26edeb06..af1602f5154 100644
251
+ index a8be5b21e0..020874f96c 100644
218
252
--- a/src/include/storage/copydir.h
219
253
+++ b/src/include/storage/copydir.h
220
254
@@ -13,6 +13,9 @@
@@ -224,11 +258,11 @@ index 50a26edeb06..af1602f5154 100644
224
258
+ typedef void (*copydir_hook_type) (const char *path);
225
259
+ extern PGDLLIMPORT copydir_hook_type copydir_hook;
226
260
+
227
- extern void copydir(char *fromdir, char *todir, bool recurse);
228
- extern void copy_file(char *fromfile, char *tofile);
261
+ extern void copydir(const char *fromdir, const char *todir, bool recurse);
262
+ extern void copy_file(const char *fromfile, const char *tofile);
229
263
230
264
diff --git a/src/include/storage/md.h b/src/include/storage/md.h
231
- index 10aa1b0109b..1415675824e 100644
265
+ index 8f32af9ef3..f8b427ceca 100644
232
266
--- a/src/include/storage/md.h
233
267
+++ b/src/include/storage/md.h
234
268
@@ -19,6 +19,13 @@
@@ -246,7 +280,7 @@ index 10aa1b0109b..1415675824e 100644
246
280
extern void mdinit(void);
247
281
extern void mdopen(SMgrRelation reln);
248
282
diff --git a/src/include/storage/sync.h b/src/include/storage/sync.h
249
- index 049af878dec..7689d49a24e 100644
283
+ index cfbcfa6797..2a432440db 100644
250
284
--- a/src/include/storage/sync.h
251
285
+++ b/src/include/storage/sync.h
252
286
@@ -55,6 +55,9 @@ typedef struct FileTag
0 commit comments