PostgreSQL Source Code  git master
filemap.h File Reference
#include "storage/relfilenode.h"
#include "storage/block.h"
#include "datapagemap.h"
Include dependency graph for filemap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  file_entry_t
 
struct  filemap_t
 

Typedefs

typedef struct file_entry_t file_entry_t
 
typedef struct filemap_t filemap_t
 

Enumerations

enum  file_action_t {
  FILE_ACTION_CREATE, FILE_ACTION_COPY, FILE_ACTION_COPY_TAIL, FILE_ACTION_NONE,
  FILE_ACTION_TRUNCATE, FILE_ACTION_REMOVE
}
 
enum  file_type_t { FILE_TYPE_REGULAR, FILE_TYPE_DIRECTORY, FILE_TYPE_SYMLINK }
 

Functions

void filemap_create (void)
 
void calculate_totals (void)
 
void print_filemap (void)
 
void process_source_file (const char *path, file_type_t type, size_t newsize, const char *link_target)
 
void process_target_file (const char *path, file_type_t type, size_t newsize, const char *link_target)
 
void process_block_change (ForkNumber forknum, RelFileNode rnode, BlockNumber blkno)
 
void filemap_finalize (void)
 

Variables

filemap_tfilemap
 

Typedef Documentation

◆ file_entry_t

◆ filemap_t

Enumeration Type Documentation

◆ file_action_t

Enumerator
FILE_ACTION_CREATE 
FILE_ACTION_COPY 
FILE_ACTION_COPY_TAIL 
FILE_ACTION_NONE 
FILE_ACTION_TRUNCATE 
FILE_ACTION_REMOVE 

Definition at line 24 of file filemap.h.

25 {
26  FILE_ACTION_CREATE, /* create local directory or symbolic link */
27  FILE_ACTION_COPY, /* copy whole file, overwriting if exists */
28  FILE_ACTION_COPY_TAIL, /* copy tail from 'oldsize' to 'newsize' */
29  FILE_ACTION_NONE, /* no action (we might still copy modified
30  * blocks based on the parsed WAL) */
31  FILE_ACTION_TRUNCATE, /* truncate local file to 'newsize' bytes */
32  FILE_ACTION_REMOVE /* remove local file / directory / symlink */
file_action_t
Definition: filemap.h:24

◆ file_type_t

Enumerator
FILE_TYPE_REGULAR 
FILE_TYPE_DIRECTORY 
FILE_TYPE_SYMLINK 

Definition at line 35 of file filemap.h.

Function Documentation

◆ calculate_totals()

void calculate_totals ( void  )

Definition at line 599 of file filemap.c.

References file_entry_t::action, filemap_t::array, datapagemap::bitmapsize, datapagemap_iterate(), datapagemap_next(), filemap_t::fetch_size, FILE_ACTION_COPY, FILE_ACTION_COPY_TAIL, FILE_TYPE_REGULAR, filemap, i, filemap_t::narray, file_entry_t::newsize, file_entry_t::oldsize, file_entry_t::pagemap, pg_free(), filemap_t::total_size, and file_entry_t::type.

Referenced by main().

600 {
601  file_entry_t *entry;
602  int i;
603  filemap_t *map = filemap;
604 
605  map->total_size = 0;
606  map->fetch_size = 0;
607 
608  for (i = 0; i < map->narray; i++)
609  {
610  entry = map->array[i];
611 
612  if (entry->type != FILE_TYPE_REGULAR)
613  continue;
614 
615  map->total_size += entry->newsize;
616 
617  if (entry->action == FILE_ACTION_COPY)
618  {
619  map->fetch_size += entry->newsize;
620  continue;
621  }
622 
623  if (entry->action == FILE_ACTION_COPY_TAIL)
624  map->fetch_size += (entry->newsize - entry->oldsize);
625 
626  if (entry->pagemap.bitmapsize > 0)
627  {
629  BlockNumber blk;
630 
631  iter = datapagemap_iterate(&entry->pagemap);
632  while (datapagemap_next(iter, &blk))
633  map->fetch_size += BLCKSZ;
634 
635  pg_free(iter);
636  }
637  }
638 }
file_entry_t ** array
Definition: filemap.h:79
size_t newsize
Definition: filemap.h:51
uint32 BlockNumber
Definition: block.h:31
datapagemap_t pagemap
Definition: filemap.h:54
int narray
Definition: filemap.h:80
uint64 fetch_size
Definition: filemap.h:87
file_type_t type
Definition: filemap.h:45
bool datapagemap_next(datapagemap_iterator_t *iter, BlockNumber *blkno)
Definition: datapagemap.c:87
file_action_t action
Definition: filemap.h:47
filemap_t * filemap
Definition: filemap.c:25
size_t oldsize
Definition: filemap.h:50
uint64 total_size
Definition: filemap.h:86
int bitmapsize
Definition: datapagemap.h:19
datapagemap_iterator_t * datapagemap_iterate(datapagemap_t *map)
Definition: datapagemap.c:75
void pg_free(void *ptr)
Definition: fe_memutils.c:105
int i
Definition: filemap.h:42

◆ filemap_create()

void filemap_create ( void  )

Definition at line 115 of file filemap.c.

References filemap_t::array, Assert, filemap_t::first, filemap_t::last, filemap_t::narray, filemap_t::nlist, and pg_malloc().

Referenced by main().

116 {
117  filemap_t *map;
118 
119  map = pg_malloc(sizeof(filemap_t));
120  map->first = map->last = NULL;
121  map->nlist = 0;
122  map->array = NULL;
123  map->narray = 0;
124 
125  Assert(filemap == NULL);
126  filemap = map;
127 }
file_entry_t * first
Definition: filemap.h:68
file_entry_t ** array
Definition: filemap.h:79
void * pg_malloc(size_t size)
Definition: fe_memutils.c:47
int narray
Definition: filemap.h:80
int nlist
Definition: filemap.h:70
filemap_t * filemap
Definition: filemap.c:25
#define Assert(condition)
Definition: c.h:699
file_entry_t * last
Definition: filemap.h:69

◆ filemap_finalize()

void filemap_finalize ( void  )

Definition at line 563 of file filemap.c.

References filemap_t::array, filemap, filemap_list_to_array(), final_filemap_cmp(), filemap_t::narray, and qsort.

Referenced by main().

564 {
565  filemap_t *map = filemap;
566 
568  qsort(map->array, map->narray, sizeof(file_entry_t *),
570 }
static int final_filemap_cmp(const void *a, const void *b)
Definition: filemap.c:794
file_entry_t ** array
Definition: filemap.h:79
int narray
Definition: filemap.h:80
filemap_t * filemap
Definition: filemap.c:25
static void filemap_list_to_array(filemap_t *map)
Definition: filemap.c:539
Definition: filemap.h:42
#define qsort(a, b, c, d)
Definition: port.h:421

◆ print_filemap()

void print_filemap ( void  )

Definition at line 641 of file filemap.c.

References file_entry_t::action, action_to_str(), filemap_t::array, datapagemap::bitmapsize, datapagemap_print(), FILE_ACTION_NONE, filemap, i, filemap_t::narray, file_entry_t::pagemap, file_entry_t::path, PG_DEBUG, and pg_log().

Referenced by main().

642 {
643  filemap_t *map = filemap;
644  file_entry_t *entry;
645  int i;
646 
647  for (i = 0; i < map->narray; i++)
648  {
649  entry = map->array[i];
650  if (entry->action != FILE_ACTION_NONE ||
651  entry->pagemap.bitmapsize > 0)
652  {
654  /*------
655  translator: first %s is a file path, second is a keyword such as COPY */
656  "%s (%s)\n", entry->path,
657  action_to_str(entry->action));
658 
659  if (entry->pagemap.bitmapsize > 0)
660  datapagemap_print(&entry->pagemap);
661  }
662  }
663  fflush(stdout);
664 }
file_entry_t ** array
Definition: filemap.h:79
datapagemap_t pagemap
Definition: filemap.h:54
int narray
Definition: filemap.h:80
file_action_t action
Definition: filemap.h:47
filemap_t * filemap
Definition: filemap.c:25
static const char * action_to_str(file_action_t action)
Definition: filemap.c:573
void pg_log(eLogType type, const char *fmt,...)
Definition: logging.c:69
void datapagemap_print(datapagemap_t *map)
Definition: datapagemap.c:117
int bitmapsize
Definition: datapagemap.h:19
char * path
Definition: filemap.h:44
int i
Definition: filemap.h:42

◆ process_block_change()

void process_block_change ( ForkNumber  forknum,
RelFileNode  rnode,
BlockNumber  blkno 
)

Definition at line 418 of file filemap.c.

References file_entry_t::action, filemap_t::array, Assert, datapagemap_add(), datasegpath(), FILE_ACTION_COPY, FILE_ACTION_COPY_TAIL, FILE_ACTION_CREATE, FILE_ACTION_NONE, FILE_ACTION_REMOVE, FILE_ACTION_TRUNCATE, filemap, file_entry_t::isrelfile, filemap_t::narray, file_entry_t::pagemap, file_entry_t::path, path_cmp(), pfree(), and pg_fatal().

Referenced by extractPageInfo().

419 {
420  char *path;
421  file_entry_t key;
422  file_entry_t *key_ptr;
423  file_entry_t *entry;
424  BlockNumber blkno_inseg;
425  int segno;
426  filemap_t *map = filemap;
427  file_entry_t **e;
428 
429  Assert(map->array);
430 
431  segno = blkno / RELSEG_SIZE;
432  blkno_inseg = blkno % RELSEG_SIZE;
433 
434  path = datasegpath(rnode, forknum, segno);
435 
436  key.path = (char *) path;
437  key_ptr = &key;
438 
439  e = bsearch(&key_ptr, map->array, map->narray, sizeof(file_entry_t *),
440  path_cmp);
441  if (e)
442  entry = *e;
443  else
444  entry = NULL;
445  pfree(path);
446 
447  if (entry)
448  {
449  Assert(entry->isrelfile);
450 
451  switch (entry->action)
452  {
453  case FILE_ACTION_NONE:
455  /* skip if we're truncating away the modified block anyway */
456  if ((blkno_inseg + 1) * BLCKSZ <= entry->newsize)
457  datapagemap_add(&entry->pagemap, blkno_inseg);
458  break;
459 
461 
462  /*
463  * skip the modified block if it is part of the "tail" that
464  * we're copying anyway.
465  */
466  if ((blkno_inseg + 1) * BLCKSZ <= entry->oldsize)
467  datapagemap_add(&entry->pagemap, blkno_inseg);
468  break;
469 
470  case FILE_ACTION_COPY:
471  case FILE_ACTION_REMOVE:
472  break;
473 
474  case FILE_ACTION_CREATE:
475  pg_fatal("unexpected page modification for directory or symbolic link \"%s\"\n", entry->path);
476  }
477  }
478  else
479  {
480  /*
481  * If we don't have any record of this file in the file map, it means
482  * that it's a relation that doesn't exist in the source system, and
483  * it was subsequently removed in the target system, too. We can
484  * safely ignore it.
485  */
486  }
487 }
void datapagemap_add(datapagemap_t *map, BlockNumber blkno)
Definition: datapagemap.c:32
file_entry_t ** array
Definition: filemap.h:79
uint32 BlockNumber
Definition: block.h:31
void pg_fatal(const char *fmt,...)
Definition: logging.c:83
datapagemap_t pagemap
Definition: filemap.h:54
int narray
Definition: filemap.h:80
static char * datasegpath(RelFileNode rnode, ForkNumber forknum, BlockNumber segno)
Definition: filemap.c:758
bool isrelfile
Definition: filemap.h:52
void pfree(void *pointer)
Definition: mcxt.c:1031
file_action_t action
Definition: filemap.h:47
filemap_t * filemap
Definition: filemap.c:25
#define Assert(condition)
Definition: c.h:699
char * path
Definition: filemap.h:44
e
Definition: preproc-init.c:82
Definition: filemap.h:42
static int path_cmp(const void *a, const void *b)
Definition: filemap.c:775

◆ process_source_file()

void process_source_file ( const char *  path,
file_type_t  type,
size_t  newsize,
const char *  link_target 
)

Definition at line 137 of file filemap.c.

References file_entry_t::action, generate_unaccent_rules::action, Assert, datapagemap::bitmap, datapagemap::bitmapsize, check_file_excluded(), datadir_target, FILE_ACTION_COPY, FILE_ACTION_COPY_TAIL, FILE_ACTION_CREATE, FILE_ACTION_NONE, FILE_ACTION_TRUNCATE, FILE_TYPE_DIRECTORY, FILE_TYPE_REGULAR, FILE_TYPE_SYMLINK, filemap, isRelDataFile(), file_entry_t::isrelfile, file_entry_t::link_target, lstat, MAXPGPATH, file_entry_t::newsize, file_entry_t::next, file_entry_t::oldsize, file_entry_t::pagemap, file_entry_t::path, pg_fatal(), pg_malloc(), pg_str_endswith(), pg_strdup(), PG_TEMP_FILE_PREFIX, PG_TEMP_FILES_DIR, pgwin32_is_junction(), S_ISDIR, S_ISREG, snprintf(), stat, strerror(), file_entry_t::type, and generate_unaccent_rules::type.

Referenced by fetchSourceFileList(), and libpqProcessFileList().

139 {
140  bool exists;
141  char localpath[MAXPGPATH];
142  struct stat statbuf;
143  filemap_t *map = filemap;
145  size_t oldsize = 0;
146  file_entry_t *entry;
147 
148  Assert(map->array == NULL);
149 
150  /* ignore any path matching the exclusion filters */
151  if (check_file_excluded(path, "source"))
152  return;
153 
154  /*
155  * Pretend that pg_wal is a directory, even if it's really a symlink. We
156  * don't want to mess with the symlink itself, nor complain if it's a
157  * symlink in source but not in target or vice versa.
158  */
159  if (strcmp(path, "pg_wal") == 0 && type == FILE_TYPE_SYMLINK)
161 
162  /*
163  * Skip temporary files, .../pgsql_tmp/... and .../pgsql_tmp.* in source.
164  * This has the effect that all temporary files in the destination will be
165  * removed.
166  */
167  if (strstr(path, "/" PG_TEMP_FILE_PREFIX) != NULL)
168  return;
169  if (strstr(path, "/" PG_TEMP_FILES_DIR "/") != NULL)
170  return;
171 
172  /*
173  * sanity check: a filename that looks like a data file better be a
174  * regular file
175  */
176  if (type != FILE_TYPE_REGULAR && isRelDataFile(path))
177  pg_fatal("data file \"%s\" in source is not a regular file\n", path);
178 
179  snprintf(localpath, sizeof(localpath), "%s/%s", datadir_target, path);
180 
181  /* Does the corresponding file exist in the target data dir? */
182  if (lstat(localpath, &statbuf) < 0)
183  {
184  if (errno != ENOENT)
185  pg_fatal("could not stat file \"%s\": %s\n",
186  localpath, strerror(errno));
187 
188  exists = false;
189  }
190  else
191  exists = true;
192 
193  switch (type)
194  {
195  case FILE_TYPE_DIRECTORY:
196  if (exists && !S_ISDIR(statbuf.st_mode) && strcmp(path, "pg_wal") != 0)
197  {
198  /* it's a directory in source, but not in target. Strange.. */
199  pg_fatal("\"%s\" is not a directory\n", localpath);
200  }
201 
202  if (!exists)
203  action = FILE_ACTION_CREATE;
204  else
205  action = FILE_ACTION_NONE;
206  oldsize = 0;
207  break;
208 
209  case FILE_TYPE_SYMLINK:
210  if (exists &&
211 #ifndef WIN32
212  !S_ISLNK(statbuf.st_mode)
213 #else
214  !pgwin32_is_junction(localpath)
215 #endif
216  )
217  {
218  /*
219  * It's a symbolic link in source, but not in target.
220  * Strange..
221  */
222  pg_fatal("\"%s\" is not a symbolic link\n", localpath);
223  }
224 
225  if (!exists)
226  action = FILE_ACTION_CREATE;
227  else
228  action = FILE_ACTION_NONE;
229  oldsize = 0;
230  break;
231 
232  case FILE_TYPE_REGULAR:
233  if (exists && !S_ISREG(statbuf.st_mode))
234  pg_fatal("\"%s\" is not a regular file\n", localpath);
235 
236  if (!exists || !isRelDataFile(path))
237  {
238  /*
239  * File exists in source, but not in target. Or it's a
240  * non-data file that we have no special processing for. Copy
241  * it in toto.
242  *
243  * An exception: PG_VERSIONs should be identical, but avoid
244  * overwriting it for paranoia.
245  */
246  if (pg_str_endswith(path, "PG_VERSION"))
247  {
248  action = FILE_ACTION_NONE;
249  oldsize = statbuf.st_size;
250  }
251  else
252  {
253  action = FILE_ACTION_COPY;
254  oldsize = 0;
255  }
256  }
257  else
258  {
259  /*
260  * It's a data file that exists in both.
261  *
262  * If it's larger in target, we can truncate it. There will
263  * also be a WAL record of the truncation in the source
264  * system, so WAL replay would eventually truncate the target
265  * too, but we might as well do it now.
266  *
267  * If it's smaller in the target, it means that it has been
268  * truncated in the target, or enlarged in the source, or
269  * both. If it was truncated in the target, we need to copy
270  * the missing tail from the source system. If it was enlarged
271  * in the source system, there will be WAL records in the
272  * source system for the new blocks, so we wouldn't need to
273  * copy them here. But we don't know which scenario we're
274  * dealing with, and there's no harm in copying the missing
275  * blocks now, so do it now.
276  *
277  * If it's the same size, do nothing here. Any blocks modified
278  * in the target will be copied based on parsing the target
279  * system's WAL, and any blocks modified in the source will be
280  * updated after rewinding, when the source system's WAL is
281  * replayed.
282  */
283  oldsize = statbuf.st_size;
284  if (oldsize < newsize)
285  action = FILE_ACTION_COPY_TAIL;
286  else if (oldsize > newsize)
287  action = FILE_ACTION_TRUNCATE;
288  else
289  action = FILE_ACTION_NONE;
290  }
291  break;
292  }
293 
294  /* Create a new entry for this file */
295  entry = pg_malloc(sizeof(file_entry_t));
296  entry->path = pg_strdup(path);
297  entry->type = type;
298  entry->action = action;
299  entry->oldsize = oldsize;
300  entry->newsize = newsize;
301  entry->link_target = link_target ? pg_strdup(link_target) : NULL;
302  entry->next = NULL;
303  entry->pagemap.bitmap = NULL;
304  entry->pagemap.bitmapsize = 0;
305  entry->isrelfile = isRelDataFile(path);
306 
307  if (map->last)
308  {
309  map->last->next = entry;
310  map->last = entry;
311  }
312  else
313  map->first = map->last = entry;
314  map->nlist++;
315 }
char * datadir_target
Definition: pg_rewind.c:51
bool pg_str_endswith(const char *str, const char *end)
Definition: string.c:31
void * pg_malloc(size_t size)
Definition: fe_memutils.c:47
size_t newsize
Definition: filemap.h:51
int snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3
#define PG_TEMP_FILE_PREFIX
Definition: fd.h:145
char * bitmap
Definition: datapagemap.h:18
void pg_fatal(const char *fmt,...)
Definition: logging.c:83
datapagemap_t pagemap
Definition: filemap.h:54
file_type_t type
Definition: filemap.h:45
bool isrelfile
Definition: filemap.h:52
#define MAXPGPATH
file_action_t action
Definition: filemap.h:47
char * link_target
Definition: filemap.h:57
struct file_entry_t * next
Definition: filemap.h:59
filemap_t * filemap
Definition: filemap.c:25
size_t oldsize
Definition: filemap.h:50
char * pg_strdup(const char *in)
Definition: fe_memutils.c:85
#define S_ISREG(m)
Definition: win32_port.h:310
#define stat(a, b)
Definition: win32_port.h:266
int bitmapsize
Definition: datapagemap.h:19
#define PG_TEMP_FILES_DIR
Definition: fd.h:144
#define Assert(condition)
Definition: c.h:699
file_action_t
Definition: filemap.h:24
static bool isRelDataFile(const char *path)
Definition: filemap.c:675
char * path
Definition: filemap.h:44
#define S_ISDIR(m)
Definition: win32_port.h:307
#define lstat(path, sb)
Definition: win32_port.h:255
const char * strerror(int errnum)
Definition: strerror.c:19
Definition: filemap.h:42
static bool check_file_excluded(const char *path, const char *type)
Definition: filemap.c:493
bool pgwin32_is_junction(const char *path)

◆ process_target_file()

void process_target_file ( const char *  path,
file_type_t  type,
size_t  newsize,
const char *  link_target 
)

Definition at line 325 of file filemap.c.

References file_entry_t::action, filemap_t::array, Assert, datapagemap::bitmap, datapagemap::bitmapsize, check_file_excluded(), datadir_target, FILE_ACTION_REMOVE, FILE_TYPE_DIRECTORY, FILE_TYPE_SYMLINK, filemap, filemap_list_to_array(), filemap_t::first, isRelDataFile(), file_entry_t::isrelfile, filemap_t::last, file_entry_t::link_target, lstat, MAXPGPATH, filemap_t::narray, file_entry_t::newsize, file_entry_t::next, filemap_t::nlist, file_entry_t::oldsize, file_entry_t::pagemap, file_entry_t::path, path_cmp(), pg_fatal(), pg_malloc(), pg_strdup(), qsort, snprintf(), stat, strerror(), file_entry_t::type, and generate_unaccent_rules::type.

Referenced by main().

327 {
328  bool exists;
329  char localpath[MAXPGPATH];
330  struct stat statbuf;
331  file_entry_t key;
332  file_entry_t *key_ptr;
333  filemap_t *map = filemap;
334  file_entry_t *entry;
335 
336  /*
337  * Ignore any path matching the exclusion filters. This is not actually
338  * mandatory for target files, but this does not hurt and let's be
339  * consistent with the source processing.
340  */
341  if (check_file_excluded(path, "target"))
342  return;
343 
344  snprintf(localpath, sizeof(localpath), "%s/%s", datadir_target, path);
345  if (lstat(localpath, &statbuf) < 0)
346  {
347  if (errno != ENOENT)
348  pg_fatal("could not stat file \"%s\": %s\n",
349  localpath, strerror(errno));
350 
351  exists = false;
352  }
353 
354  if (map->array == NULL)
355  {
356  /* on first call, initialize lookup array */
357  if (map->nlist == 0)
358  {
359  /* should not happen */
360  pg_fatal("source file list is empty\n");
361  }
362 
364 
365  Assert(map->array != NULL);
366 
367  qsort(map->array, map->narray, sizeof(file_entry_t *), path_cmp);
368  }
369 
370  /*
371  * Like in process_source_file, pretend that xlog is always a directory.
372  */
373  if (strcmp(path, "pg_wal") == 0 && type == FILE_TYPE_SYMLINK)
375 
376  key.path = (char *) path;
377  key_ptr = &key;
378  exists = (bsearch(&key_ptr, map->array, map->narray, sizeof(file_entry_t *),
379  path_cmp) != NULL);
380 
381  /* Remove any file or folder that doesn't exist in the source system. */
382  if (!exists)
383  {
384  entry = pg_malloc(sizeof(file_entry_t));
385  entry->path = pg_strdup(path);
386  entry->type = type;
387  entry->action = FILE_ACTION_REMOVE;
388  entry->oldsize = oldsize;
389  entry->newsize = 0;
390  entry->link_target = link_target ? pg_strdup(link_target) : NULL;
391  entry->next = NULL;
392  entry->pagemap.bitmap = NULL;
393  entry->pagemap.bitmapsize = 0;
394  entry->isrelfile = isRelDataFile(path);
395 
396  if (map->last == NULL)
397  map->first = entry;
398  else
399  map->last->next = entry;
400  map->last = entry;
401  map->nlist++;
402  }
403  else
404  {
405  /*
406  * We already handled all files that exist in the source system in
407  * process_source_file().
408  */
409  }
410 }
char * datadir_target
Definition: pg_rewind.c:51
file_entry_t * first
Definition: filemap.h:68
file_entry_t ** array
Definition: filemap.h:79
void * pg_malloc(size_t size)
Definition: fe_memutils.c:47
size_t newsize
Definition: filemap.h:51
int snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3
char * bitmap
Definition: datapagemap.h:18
void pg_fatal(const char *fmt,...)
Definition: logging.c:83
datapagemap_t pagemap
Definition: filemap.h:54
int narray
Definition: filemap.h:80
file_type_t type
Definition: filemap.h:45
bool isrelfile
Definition: filemap.h:52
int nlist
Definition: filemap.h:70
#define MAXPGPATH
file_action_t action
Definition: filemap.h:47
char * link_target
Definition: filemap.h:57
struct file_entry_t * next
Definition: filemap.h:59
filemap_t * filemap
Definition: filemap.c:25
size_t oldsize
Definition: filemap.h:50
char * pg_strdup(const char *in)
Definition: fe_memutils.c:85
#define stat(a, b)
Definition: win32_port.h:266
int bitmapsize
Definition: datapagemap.h:19
#define Assert(condition)
Definition: c.h:699
static bool isRelDataFile(const char *path)
Definition: filemap.c:675
char * path
Definition: filemap.h:44
static void filemap_list_to_array(filemap_t *map)
Definition: filemap.c:539
#define lstat(path, sb)
Definition: win32_port.h:255
file_entry_t * last
Definition: filemap.h:69
const char * strerror(int errnum)
Definition: strerror.c:19
Definition: filemap.h:42
static int path_cmp(const void *a, const void *b)
Definition: filemap.c:775
static bool check_file_excluded(const char *path, const char *type)
Definition: filemap.c:493
#define qsort(a, b, c, d)
Definition: port.h:421

Variable Documentation

◆ filemap