Re: Use SMgrRelation instead of SMgrRelationData * in pgaio_io_set_target_smgr() - Mailing list pgsql-hackers

From Chao Li
Subject Re: Use SMgrRelation instead of SMgrRelationData * in pgaio_io_set_target_smgr()
Date
Msg-id 96EB95E4-9032-44A6-A397-153256AA5E4D@gmail.com
Whole thread Raw
In response to Use SMgrRelation instead of SMgrRelationData * in pgaio_io_set_target_smgr()  (Japin Li <japinli@hotmail.com>)
Responses Re: Use SMgrRelation instead of SMgrRelationData * in pgaio_io_set_target_smgr()
List pgsql-hackers

> On Mar 13, 2026, at 15:05, Japin Li <japinli@hotmail.com> wrote:
>
>
> 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.
>
> <v1-0001-Use-SMgrRelation-instead-of-SMgrRelationData-in-p.patch>

pgaio_io_set_target_smgr doesn’t update smgr, so, instead of “SMgrRelation”,  I think it’s better to change the type to
"constSMgrRelationData *”. 

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/







pgsql-hackers by date:

Previous
From: "Jonathan Gonzalez V."
Date:
Subject: Re: [oauth] Stabilize the libpq-oauth ABI (and allow alternative implementations?)
Next
From: Chao Li
Date:
Subject: Re: [PATCH] Support automatic sequence replication