@@ -189,6 +189,7 @@ pgFileInit(const char *rel_path)
189189 // May be add?
190190 // pg_atomic_clear_flag(file->lock);
191191 file -> excluded = false;
192+ file -> is_datafile = false;
192193 return file ;
193194}
194195
@@ -627,22 +628,14 @@ dir_check_file(pgFile *file, bool backup_logs)
627628 {
628629 if (strcmp (file -> name , "pg_internal.init" ) == 0 )
629630 return CHECK_FALSE ;
630- /* Do not backup ptrack2.x temp map files */
631- // else if (strcmp(file->name, "ptrack.map") == 0)
632- // return CHECK_FALSE;
633- else if (strcmp (file -> name , "ptrack.map.mmap" ) == 0 )
634- return CHECK_FALSE ;
635- else if (strcmp (file -> name , "ptrack.map.tmp" ) == 0 )
636- return CHECK_FALSE ;
637631 /* Do not backup temp files */
638632 else if (file -> name [0 ] == 't' && isdigit (file -> name [1 ]))
639633 return CHECK_FALSE ;
634+ /* if filename starts with digits, it can be either datafile or fork */
640635 else if (isdigit (file -> name [0 ]))
641636 {
642637 set_forkname (file );
643-
644- if (file -> forkName == ptrack ) /* Compatibility with left-overs from ptrack1 */
645- return CHECK_FALSE ;
638+ file -> is_datafile = file -> forkName == none ;
646639 }
647640 }
648641
@@ -1633,7 +1626,7 @@ is_forkname(char *name, size_t *pos, const char *forkname)
16331626#define SEGNOCHARS 5 /* when BLCKSZ == (1<<15) */
16341627
16351628/* Set forkName if possible */
1636- bool
1629+ void
16371630set_forkname (pgFile * file )
16381631{
16391632 size_t i = 0 ;
@@ -1643,16 +1636,15 @@ set_forkname(pgFile *file)
16431636 /* pretend it is not relation file */
16441637 file -> relOid = 0 ;
16451638 file -> forkName = none ;
1646- file -> is_datafile = false;
16471639
16481640 for (i = 0 ; isdigit (file -> name [i ]); i ++ )
16491641 {
16501642 if (i == 0 && file -> name [i ] == '0' )
1651- return false ;
1643+ return ;
16521644 oid = oid * 10 + file -> name [i ] - '0' ;
16531645 }
16541646 if (i == 0 || i > OIDCHARS || oid > UINT32_MAX )
1655- return false ;
1647+ return ;
16561648
16571649 /* usual fork name */
16581650 /* /^\d+_(vm|fsm|init|ptrack)$/ */
@@ -1673,22 +1665,21 @@ set_forkname(pgFile *file)
16731665 for (i ++ ; isdigit (file -> name [i ]); i ++ )
16741666 {
16751667 if (i == start && file -> name [i ] == '0' )
1676- return false ;
1668+ return ;
16771669 segno = segno * 10 + file -> name [i ] - '0' ;
16781670 }
16791671 if (i - start > SEGNOCHARS || segno > MAXSEGNO )
1680- return false ;
1672+ return ;
16811673 }
16821674
16831675 /* If there are excess characters, it is not relation file */
16841676 if (file -> name [i ] != 0 )
16851677 {
16861678 file -> forkName = none ;
1687- return false ;
1679+ return ;
16881680 }
16891681
16901682 file -> relOid = oid ;
16911683 file -> segno = segno ;
1692- file -> is_datafile = file -> forkName == none ;
1693- return true;
1684+ return ;
16941685}
0 commit comments