Hi, hackers

While reading smgr.h, I noticed an inconsistent type usage in
pgaio_io_set_target_smgr(). Currently the function is declared as:

    extern void pgaio_io_set_target_smgr(PgAioHandle *ioh,
                                         SMgrRelationData *smgr,
                                         ForkNumber forknum,
                                         BlockNumber blocknum,
                                         int nblocks,

However, SMgrRelation is defined as "typedef SMgrRelationData * SMgrRelation;",
and all other functions in the smgr subsystem use SMgrRelation as the parameter
type.

To keep the code consistent with the rest of the smgr API, this patch changes
the parameter from SMgrRelationData * to SMgrRelation in both the definition
and declaration.

This is purely a style/consistency cleanup with no functional change.

Thoughts? Is this change acceptable?

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.

>From 7027e058a38ea866087ad04aac3e95a0177af740 Mon Sep 17 00:00:00 2001
From: Japin Li <[email protected]>
Date: Fri, 13 Mar 2026 14:55:21 +0800
Subject: [PATCH v1] Use SMgrRelation instead of SMgrRelationData * in
 pgaio_io_set_target_smgr

To keep API consistency with the rest of the smgr subsystem, change the
parameter type from SMgrRelationData * to SMgrRelation in both the
declaration and definition of pgaio_io_set_target_smgr().
---
 src/backend/storage/smgr/smgr.c | 2 +-
 src/include/storage/smgr.h      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c
index 5391640d861..e5822fa8d92 100644
--- a/src/backend/storage/smgr/smgr.c
+++ b/src/backend/storage/smgr/smgr.c
@@ -1036,7 +1036,7 @@ ProcessBarrierSmgrRelease(void)
  */
 void
 pgaio_io_set_target_smgr(PgAioHandle *ioh,
-						 SMgrRelationData *smgr,
+						 SMgrRelation smgr,
 						 ForkNumber forknum,
 						 BlockNumber blocknum,
 						 int nblocks,
diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h
index 09bd42fcf4b..e2fc7ba1bcb 100644
--- a/src/include/storage/smgr.h
+++ b/src/include/storage/smgr.h
@@ -135,7 +135,7 @@ smgrwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
 }
 
 extern void pgaio_io_set_target_smgr(PgAioHandle *ioh,
-									 SMgrRelationData *smgr,
+									 SMgrRelation smgr,
 									 ForkNumber forknum,
 									 BlockNumber blocknum,
 									 int nblocks,
-- 
2.43.0

Reply via email to