summaryrefslogtreecommitdiff
path: root/src/bin/pg_rewind/filemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_rewind/filemap.c')
-rw-r--r--src/bin/pg_rewind/filemap.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/bin/pg_rewind/filemap.c b/src/bin/pg_rewind/filemap.c
index 62529310415..269ed6446e6 100644
--- a/src/bin/pg_rewind/filemap.c
+++ b/src/bin/pg_rewind/filemap.c
@@ -56,7 +56,7 @@ static uint32 hash_string_pointer(const char *s);
static filehash_hash *filehash;
static bool isRelDataFile(const char *path);
-static char *datasegpath(RelFileNode rnode, ForkNumber forknum,
+static char *datasegpath(RelFileLocator rlocator, ForkNumber forknum,
BlockNumber segno);
static file_entry_t *insert_filehash_entry(const char *path);
@@ -288,7 +288,7 @@ process_target_file(const char *path, file_type_t type, size_t size,
* hash table!
*/
void
-process_target_wal_block_change(ForkNumber forknum, RelFileNode rnode,
+process_target_wal_block_change(ForkNumber forknum, RelFileLocator rlocator,
BlockNumber blkno)
{
char *path;
@@ -299,7 +299,7 @@ process_target_wal_block_change(ForkNumber forknum, RelFileNode rnode,
segno = blkno / RELSEG_SIZE;
blkno_inseg = blkno % RELSEG_SIZE;
- path = datasegpath(rnode, forknum, segno);
+ path = datasegpath(rlocator, forknum, segno);
entry = lookup_filehash_entry(path);
pfree(path);
@@ -508,7 +508,7 @@ print_filemap(filemap_t *filemap)
static bool
isRelDataFile(const char *path)
{
- RelFileNode rnode;
+ RelFileLocator rlocator;
unsigned int segNo;
int nmatch;
bool matched;
@@ -532,32 +532,32 @@ isRelDataFile(const char *path)
*
*----
*/
- rnode.spcNode = InvalidOid;
- rnode.dbNode = InvalidOid;
- rnode.relNode = InvalidOid;
+ rlocator.spcOid = InvalidOid;
+ rlocator.dbOid = InvalidOid;
+ rlocator.relNumber = InvalidRelFileNumber;
segNo = 0;
matched = false;
- nmatch = sscanf(path, "global/%u.%u", &rnode.relNode, &segNo);
+ nmatch = sscanf(path, "global/%u.%u", &rlocator.relNumber, &segNo);
if (nmatch == 1 || nmatch == 2)
{
- rnode.spcNode = GLOBALTABLESPACE_OID;
- rnode.dbNode = 0;
+ rlocator.spcOid = GLOBALTABLESPACE_OID;
+ rlocator.dbOid = 0;
matched = true;
}
else
{
nmatch = sscanf(path, "base/%u/%u.%u",
- &rnode.dbNode, &rnode.relNode, &segNo);
+ &rlocator.dbOid, &rlocator.relNumber, &segNo);
if (nmatch == 2 || nmatch == 3)
{
- rnode.spcNode = DEFAULTTABLESPACE_OID;
+ rlocator.spcOid = DEFAULTTABLESPACE_OID;
matched = true;
}
else
{
nmatch = sscanf(path, "pg_tblspc/%u/" TABLESPACE_VERSION_DIRECTORY "/%u/%u.%u",
- &rnode.spcNode, &rnode.dbNode, &rnode.relNode,
+ &rlocator.spcOid, &rlocator.dbOid, &rlocator.relNumber,
&segNo);
if (nmatch == 3 || nmatch == 4)
matched = true;
@@ -567,12 +567,12 @@ isRelDataFile(const char *path)
/*
* The sscanf tests above can match files that have extra characters at
* the end. To eliminate such cases, cross-check that GetRelationPath
- * creates the exact same filename, when passed the RelFileNode
+ * creates the exact same filename, when passed the RelFileLocator
* information we extracted from the filename.
*/
if (matched)
{
- char *check_path = datasegpath(rnode, MAIN_FORKNUM, segNo);
+ char *check_path = datasegpath(rlocator, MAIN_FORKNUM, segNo);
if (strcmp(check_path, path) != 0)
matched = false;
@@ -589,12 +589,12 @@ isRelDataFile(const char *path)
* The returned path is palloc'd
*/
static char *
-datasegpath(RelFileNode rnode, ForkNumber forknum, BlockNumber segno)
+datasegpath(RelFileLocator rlocator, ForkNumber forknum, BlockNumber segno)
{
char *path;
char *segpath;
- path = relpathperm(rnode, forknum);
+ path = relpathperm(rlocator, forknum);
if (segno > 0)
{
segpath = psprintf("%s.%u", path, segno);