This is an automated email from the ASF dual-hosted git repository.

reshke pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/cbdb-postgres-merge by this 
push:
     new ccf44dbf934 Remove some users of relfilenode.h (#1471)
ccf44dbf934 is described below

commit ccf44dbf934409c7e61fddf4c0aa8a9f376c0b89
Author: reshke <[email protected]>
AuthorDate: Sat Dec 6 12:45:16 2025 +0500

    Remove some users of relfilenode.h (#1471)
    
    * Remove some users of relfilelocator.h
    
    as per https://git.postgresql.org/cgit/postgresql.git/commit/?h=b0a55e43299c
---
 src/backend/access/rmgrdesc/bitmapdesc.c    |  1 -
 src/backend/cdb/cdbappendonlystoragewrite.c |  4 ++--
 src/backend/commands/dirtablecmds.c         |  8 ++++----
 src/backend/storage/file/ufile.c            | 18 +++++++++---------
 src/include/catalog/catalog.h               |  1 -
 src/include/catalog/storage_xlog.h          |  1 -
 src/include/cdb/cdbappendonlyxlog.h         |  1 -
 src/include/cdb/cdbbufferedappend.h         |  2 +-
 src/include/cdb/cdbbufferedread.h           |  3 ++-
 src/include/storage/bufmgr.h                |  1 -
 src/include/storage/relfilelocator.h        |  2 +-
 src/include/storage/smgr.h                  |  1 -
 src/include/storage/ufile.h                 |  6 +++---
 src/include/utils/datumstreamblock.h        |  1 -
 src/include/utils/rel.h                     |  1 -
 15 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/src/backend/access/rmgrdesc/bitmapdesc.c 
b/src/backend/access/rmgrdesc/bitmapdesc.c
index a23c44cee87..97f33b688ad 100644
--- a/src/backend/access/rmgrdesc/bitmapdesc.c
+++ b/src/backend/access/rmgrdesc/bitmapdesc.c
@@ -17,7 +17,6 @@
 #include "access/bitmap.h"
 #include "access/bitmap_xlog.h"
 #include "access/xlogreader.h"
-#include "storage/relfilenode.h"
 
 static void
 out_target(StringInfo buf, RelFileLocator *node)
diff --git a/src/backend/cdb/cdbappendonlystoragewrite.c 
b/src/backend/cdb/cdbappendonlystoragewrite.c
index 88920aa3154..c60ea359d3b 100755
--- a/src/backend/cdb/cdbappendonlystoragewrite.c
+++ b/src/backend/cdb/cdbappendonlystoragewrite.c
@@ -409,7 +409,7 @@ AppendOnlyStorageWrite_FlushAndCloseFile(
         * is not enqueued for an AO segment file that is written to disk on
         * primary.  Temp tables are not crash safe, no need to fsync them.
         */
-       if (!RelFileNodeBackendIsTemp(storageWrite->relFileNode) &&
+       if (!RelFileLocatorBackendIsTemp(storageWrite->relFileNode) &&
                FileSync(storageWrite->file, WAIT_EVENT_DATA_FILE_SYNC) != 0)
                ereport(ERROR,
                                (errcode_for_file_access(),
@@ -422,7 +422,7 @@ AppendOnlyStorageWrite_FlushAndCloseFile(
        storageWrite->file = -1;
        storageWrite->formatVersion = -1;
 
-       MemSet(&storageWrite->relFileNode, 0, sizeof(RelFileNode));
+       MemSet(&storageWrite->relFileNode, 0, sizeof(RelFileLocator));
        storageWrite->segmentFileNum = 0;
 }
 
diff --git a/src/backend/commands/dirtablecmds.c 
b/src/backend/commands/dirtablecmds.c
index bd2f6ba503d..39b0828f444 100644
--- a/src/backend/commands/dirtablecmds.c
+++ b/src/backend/commands/dirtablecmds.c
@@ -138,16 +138,16 @@ CreateDirectoryTable(CreateDirectoryTableStmt *stmt, Oid 
relId)
        {
                Form_pg_class pg_class_tuple = NULL;
                HeapTuple       class_tuple = NULL;
-               RelFileNode relFileNode = {0};
+               RelFileLocator relFileNode = {0};
 
                class_tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relId));
                if (!HeapTupleIsValid(class_tuple))
                        elog(ERROR, "cache lookup failed for relation %u", 
relId);
                pg_class_tuple = (Form_pg_class) GETSTRUCT(class_tuple);
 
-               relFileNode.spcNode = spcId;
-               relFileNode.dbNode = MyDatabaseId;
-               relFileNode.relNode = pg_class_tuple->relfilenode;
+               relFileNode.spcOid = spcId;
+               relFileNode.dbOid = MyDatabaseId;
+               relFileNode.relNumber = pg_class_tuple->relfilenode;
 
                dirTablePath = UFileFormatPathName(&relFileNode);
                ReleaseSysCache(class_tuple);
diff --git a/src/backend/storage/file/ufile.c b/src/backend/storage/file/ufile.c
index 0c1ba28b995..dee5fb63ba0 100644
--- a/src/backend/storage/file/ufile.c
+++ b/src/backend/storage/file/ufile.c
@@ -40,7 +40,7 @@
 #include "storage/ufile.h"
 #include "storage/fd.h"
 #include "storage/lwlock.h"
-#include "storage/relfilenode.h"
+#include "storage/relfilelocator.h"
 #include "utils/elog.h"
 #include "utils/wait_event.h"
 
@@ -59,7 +59,7 @@ static int localFileRead(UFile *file, char *buffer, int 
amount);
 static int localFileWrite(UFile *file, char *buffer, int amount);
 static off_t localFileSize(UFile *file);
 static void localFileUnlink(Oid spcId, const char *fileName);
-static char *localFormatPathName(RelFileNode *relFileNode);
+static char *localFormatPathName(RelFileLocator *relFileNode);
 static bool localEnsurePath(Oid spcId, const char *PathName);
 static bool localFileExists(Oid spcId, const char *fileName);
 static const char *localFileName(UFile *file);
@@ -307,15 +307,15 @@ localFileUnlink(Oid spcId, const char *fileName)
 }
 
 static char *
-localFormatPathName(RelFileNode *relFileNode)
+localFormatPathName(RelFileLocator *relFileNode)
 {
-       if (relFileNode->spcNode == DEFAULTTABLESPACE_OID)
+       if (relFileNode->spcOid == DEFAULTTABLESPACE_OID)
                return psprintf("base/%u/%u_dirtable",
-                                               relFileNode->dbNode, 
relFileNode->relNode);
+                                               relFileNode->dbOid, 
relFileNode->relNumber);
        else
                return psprintf("pg_tblspc/%u/%s/%u/%u_dirtable",
-                                               relFileNode->spcNode, 
GP_TABLESPACE_VERSION_DIRECTORY,
-                                               relFileNode->dbNode, 
relFileNode->relNode);
+                                               relFileNode->spcOid, 
GP_TABLESPACE_VERSION_DIRECTORY,
+                                               relFileNode->dbOid, 
relFileNode->relNumber);
 }
 
 bool
@@ -440,11 +440,11 @@ UFileUnlink(Oid spcId, const char *fileName)
 }
 
 char *
-UFileFormatPathName(RelFileNode *relFileNode)
+UFileFormatPathName(RelFileLocator *relFileNode)
 {
        FileAm *fileAm;
 
-       fileAm = GetTablespaceFileHandler(relFileNode->spcNode);
+       fileAm = GetTablespaceFileHandler(relFileNode->spcOid);
 
        return fileAm->formatPathName(relFileNode);
 }
diff --git a/src/include/catalog/catalog.h b/src/include/catalog/catalog.h
index 903c1dcfe70..04e177dcf3e 100644
--- a/src/include/catalog/catalog.h
+++ b/src/include/catalog/catalog.h
@@ -15,7 +15,6 @@
 #define CATALOG_H
 
 #include "catalog/pg_class.h"
-#include "storage/relfilenode.h"
 #include "storage/relfilelocator.h"
 #include "utils/relcache.h"
 
diff --git a/src/include/catalog/storage_xlog.h 
b/src/include/catalog/storage_xlog.h
index 9748cc6347b..74db5f02988 100644
--- a/src/include/catalog/storage_xlog.h
+++ b/src/include/catalog/storage_xlog.h
@@ -17,7 +17,6 @@
 #include "access/xlogreader.h"
 #include "lib/stringinfo.h"
 #include "storage/block.h"
-#include "storage/relfilenode.h"
 #include "storage/smgr.h"
 #include "storage/relfilelocator.h"
 
diff --git a/src/include/cdb/cdbappendonlyxlog.h 
b/src/include/cdb/cdbappendonlyxlog.h
index c87720f6f7d..3d715cc175d 100644
--- a/src/include/cdb/cdbappendonlyxlog.h
+++ b/src/include/cdb/cdbappendonlyxlog.h
@@ -18,7 +18,6 @@
 #include "access/xlogreader.h"
 #include "lib/stringinfo.h"
 #include "storage/fd.h"
-#include "storage/relfilenode.h"
 #include "storage/smgr.h"
 
 
diff --git a/src/include/cdb/cdbbufferedappend.h 
b/src/include/cdb/cdbbufferedappend.h
index c8f80e82eda..d8bcbfedfd2 100644
--- a/src/include/cdb/cdbbufferedappend.h
+++ b/src/include/cdb/cdbbufferedappend.h
@@ -19,7 +19,7 @@
 #define CDBBUFFEREDAPPEND_H
 
 #include "storage/fd.h"
-#include "storage/relfilenode.h"
+#include "storage/relfilelocator.h"
 
 typedef struct BufferedAppend
 {
diff --git a/src/include/cdb/cdbbufferedread.h 
b/src/include/cdb/cdbbufferedread.h
index 080ac391e8c..b0048e7144e 100644
--- a/src/include/cdb/cdbbufferedread.h
+++ b/src/include/cdb/cdbbufferedread.h
@@ -19,7 +19,8 @@
 #define CDBBUFFEREDREAD_H
 
 #include "storage/fd.h"
-#include "storage/relfilenode.h"
+#include "storage/relfilelocator.h"
+
 typedef struct BufferedRead
 {
        /*
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index 1e01e0902e5..c42970d35b2 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -17,7 +17,6 @@
 #include "storage/block.h"
 #include "storage/buf.h"
 #include "storage/bufpage.h"
-#include "storage/relfilenode.h"
 #include "storage/smgr.h"
 #include "storage/relfilelocator.h"
 #include "utils/relcache.h"
diff --git a/src/include/storage/relfilelocator.h 
b/src/include/storage/relfilelocator.h
index 937de9cac62..f49854e0319 100644
--- a/src/include/storage/relfilelocator.h
+++ b/src/include/storage/relfilelocator.h
@@ -64,7 +64,7 @@ typedef struct RelFileLocator
 /*
  * Augmenting a relfilenode with a SMGR implementation identifier provides a
  * way to make optimal decisions in smgr and md layer. This is purposefully
- * kept out of RelFileNode for performance concerns where RelFileNode used in
+ * kept out of RelFileLocator for performance concerns where RelFileLocator 
used in
  * a hotpath for BufferTag hashing. The isTempRelation flag is necessary to
  * support file-system removal of temporary relations on a two-phase
  * commit/abort.
diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h
index 06497c67007..6c6d2ce3d97 100644
--- a/src/include/storage/smgr.h
+++ b/src/include/storage/smgr.h
@@ -19,7 +19,6 @@
 #include "lib/ilist.h"
 #include "storage/block.h"
 #include "storage/relfilelocator.h"
-#include "storage/relfilenode.h"
 #include "storage/dbdirnode.h"
 #include "storage/fd.h"
 #include "utils/relcache.h"
diff --git a/src/include/storage/ufile.h b/src/include/storage/ufile.h
index e34d66350ca..202f71582e9 100644
--- a/src/include/storage/ufile.h
+++ b/src/include/storage/ufile.h
@@ -28,7 +28,7 @@
 #ifndef UFILE_H
 #define UFILE_H
 
-#include "storage/relfilenode.h"
+#include "storage/relfilelocator.h"
 
 #define UFILE_ERROR_SIZE       1024
 
@@ -44,7 +44,7 @@ typedef struct FileAm
        int (*write) (struct UFile *file, char *buffer, int amount);
        int64_t (*size) (struct UFile *file);
        void (*unlink) (Oid spcId, const char *fileName);
-       char* (*formatPathName) (RelFileNode *relFileNode);
+       char* (*formatPathName) (RelFileLocator *relFileLocator);
        bool (*ensurePath) (Oid spcId, const char *pathName);
        bool (*exists) (Oid spcId, const char *fileName);
        const char *(*name) (struct UFile *file);
@@ -72,7 +72,7 @@ extern off_t UFileSize(UFile *file);
 extern const char *UFileName(UFile *file);
 
 extern void UFileUnlink(Oid spcId, const char *fileName);
-extern char* UFileFormatPathName(RelFileNode *relFileNode);
+extern char* UFileFormatPathName(RelFileLocator *relFileNode);
 extern bool UFileEnsurePath(Oid spcId, const char *pathName);
 extern bool UFileExists(Oid spcId, const char *fileName);
 
diff --git a/src/include/utils/datumstreamblock.h 
b/src/include/utils/datumstreamblock.h
index 96f6ecb1fe5..1215405a60d 100755
--- a/src/include/utils/datumstreamblock.h
+++ b/src/include/utils/datumstreamblock.h
@@ -16,7 +16,6 @@
 #define DATUMSTREAMBLOCK_H
 
 #include "catalog/pg_attribute.h"
-#include "storage/relfilenode.h"
 #include "utils/guc.h"
 
 typedef enum DatumStreamVersion
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index a6e5412c7c5..b318593402c 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -29,7 +29,6 @@
 #include "partitioning/partdefs.h"
 #include "rewrite/prs2lock.h"
 #include "storage/block.h"
-#include "storage/relfilenode.h"
 #include "storage/relfilelocator.h"
 #include "storage/smgr.h"
 #include "utils/fmgroids.h"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to