public inbox for [email protected]  
help / color / mirror / Atom feed
From: Japin Li <[email protected]>
Subject: [PATCH v2] Use SMgrRelation instead of SMgrRelationData * in pgaio_io_set_target_smgr
Date: Fri, 13 Mar 2026 14:55:21 +0800

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().

This commit also adds the const qualifier to the SMgrRelation since the
function only reads the relation and never modifies it, marking the parameter
as const is more accurate and improves code clarity and safety.
---
 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..abf6b219abf 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,
+						 const SMgrRelation smgr,
 						 ForkNumber forknum,
 						 BlockNumber blocknum,
 						 int nblocks,
diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h
index 09bd42fcf4b..2f982deb6df 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,
+									 const SMgrRelation smgr,
 									 ForkNumber forknum,
 									 BlockNumber blocknum,
 									 int nblocks,
-- 
2.43.0


--=-=-=--





view thread (8+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [PATCH v2] Use SMgrRelation instead of SMgrRelationData * in pgaio_io_set_target_smgr
  In-Reply-To: <no-message-id-723636@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox