From 1a0226d18e6fa273210bc75defa13b76566527e3 Mon Sep 17 00:00:00 2001
From: Japin Li <japinli@hotmail.com>
Date: Fri, 13 Mar 2026 14:55:21 +0800
Subject: [PATCH v3] Add the const qualifier to the SMgrRelationData parameter

This commit 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..a1fe42381f6 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 SMgrRelationData *smgr,
 						 ForkNumber forknum,
 						 BlockNumber blocknum,
 						 int nblocks,
diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h
index 09bd42fcf4b..4e071bf0d73 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 SMgrRelationData *smgr,
 									 ForkNumber forknum,
 									 BlockNumber blocknum,
 									 int nblocks,
-- 
2.43.0

