Definition at line 88 of file reconstruct.c.
102{
114
115
118
119
120
121
122
124
125
126
127
128
132
133
134
135
136
137
140
141
142
143
144
145
146
147
148
149
151 {
153
157
158
159
160
161
163 }
164
165 while (1)
166 {
169
170
171
172
173
175 break;
177
178
179
180
181
185 {
189 }
191
192
193
194
195
197 {
201
202
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
229 {
231 {
234 }
235 }
236
237
238
239
240
241
243 {
245
250 {
253 }
254 }
255
256
257 break;
258 }
259
260
261
262
263
265 {
267
270 {
273
274
275
276
277
278
280 }
281 }
282 }
283
284
285
286
287
288
291 {
293
297 {
298 char *path =
psprintf(
"%s/backup_manifest",
300
301
302
303
304
305 pg_log_warning(
"manifest file \"%s\" contains no entry for file \"%s\"",
306 path,
309 }
311 {
313 *checksum_payload =
pg_malloc(*checksum_length);
315 *checksum_length);
317 }
318 }
319
320
322
323
324
325
326
327
328
329
330
331
332
333
336 &checksum_ctx, copy_method,
dry_run);
337 else if (
sidx == 0 &&
source[0]->header_length != 0)
338 {
339 pg_fatal(
"full backup contains unexpected incremental file \"%s\"",
341 }
342 else
343 {
346 &checksum_ctx, copy_method,
349 }
350
351
353 {
356 *checksum_payload);
357 }
358
359
360
361
363 {
365
367 continue;
374 }
378}
#define Assert(condition)
int pg_checksum_final(pg_checksum_context *context, uint8 *output)
int pg_checksum_init(pg_checksum_context *context, pg_checksum_type type)
#define PG_CHECKSUM_MAX_LENGTH
void copy_file(const char *fromfile, const char *tofile)
void * pg_malloc(size_t size)
void * pg_malloc0(size_t size)
void pfree(void *pointer)
static rewind_source * source
#define pg_log_warning(...)
char * psprintf(const char *fmt,...)
static rfile * make_rfile(char *filename, bool missing_ok)
static rfile * make_incremental_rfile(char *filename)
static void debug_reconstruction(int n_source, rfile **sources, bool dry_run)
static void write_reconstructed_file(char *input_filename, char *output_filename, unsigned block_length, rfile **sourcemap, off_t *offsetmap, pg_checksum_context *checksum_ctx, CopyMethod copy_method, bool debug, bool dry_run)
static unsigned find_reconstructed_block_length(rfile *s)
pg_checksum_type checksum_type
BlockNumber * relative_block_numbers
unsigned truncation_block_length
References Assert, b, manifest_file::checksum_length, manifest_file::checksum_payload, manifest_file::checksum_type, CHECKSUM_TYPE_NONE, close, copy_file(), debug, debug_reconstruction(), dry_run, fb(), rfile::fd, rfile::filename, filename, find_reconstructed_block_length(), fstat, rfile::header_length, i, input_filename, make_incremental_rfile(), make_rfile(), MAXPGPATH, rfile::num_blocks, output_filename, pfree(), pg_checksum_final(), pg_checksum_init(), PG_CHECKSUM_MAX_LENGTH, pg_fatal, pg_free(), pg_log_warning, pg_malloc(), pg_malloc0(), psprintf(), rfile::relative_block_numbers, snprintf, source, rfile::truncation_block_length, and write_reconstructed_file().
Referenced by process_directory_recursively().