Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w1yQf-000ld0-2P for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 03:15:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w1yQe-0078Ax-2N for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 03:15:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w1yQe-00789F-1O for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 03:15:41 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w1yQc-00000000MDh-2MdV for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 03:15:40 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2a9296b3926so31972245ad.1 for ; Sun, 15 Mar 2026 20:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773630937; x=1774235737; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qybMBCzsLGtLRrrB3ppSHc3JqZmVkwSDcGo6ik4lJkY=; b=ItiuMkAGe6urVfDJDLhAZfi7QKlByu52Dv6JOPGMyIZUkYbLYceXDlsYLQuMxtCGCD /lNriVeLnO5UFvbvKrN6lRogsq4d6VwstYHJaaYYA7Cjd0dbkZkjGb4jZnRqZ+wGgm9R mRvpVMmZYar88VAysfy1o/mgI2/AQrw24dVSBrqkGZwcOqjRJBh+467iD/pFglfIt9k/ /mO2R0k0C/s4ZHJch69DZ9ITBa45sWEN7tI0XcLYIQ9/6TeC+sjbTZLXSy6cn3va9nS/ VNoEsVY8Ny7KAiBNGwsYUiBL4R0GcflfM6oqbrvsxtNziQViG+UfD7CAY8IRe/I7+5/e DInA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773630937; x=1774235737; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qybMBCzsLGtLRrrB3ppSHc3JqZmVkwSDcGo6ik4lJkY=; b=XjmMqKpHjHjWbYKN8UPeabAFfDD2iTzhfbrc5NTBmIvjd3gj0ttbpiBd9xo4/wnCYs HI6MkqkHJdmBpvrRB7ICWsgueulO6NwsCz+rZLjaSgJ2ODXF7dw9lBaNokPMeB+8L54b Usb1E0/5IGQmYmk9EXxRstj7JQO5Iwe2ZsAk9x0DjdLOz/pqaMDSnhC1no3y8qpgbcyY IYkd0pEB8gAA3PCBvM2u4aGoBXMezO0QXOonMluxnQsCy1CDvWCCoNkil1083iBFZkCi Q57ovWLwXkTbV/0PRPJVGDBO9lIgx/mt+sGEc15Po1Xiw3UwSFDpyyVux/plCOxZMpo1 fHBg== X-Gm-Message-State: AOJu0YxERK3QqzRGnEuL9WxI1XQXXDYvrprl4iH09WBH5WT7Ut4EfXbR HP7el4K/au3bk9/LimaELvvTchc9jg3WFy8M8KxQ8671Oa0Tye22MvNj65ioepMx X-Gm-Gg: ATEYQzyYosYU6xJGavyuAukJVqsSxJ9ZVyJwJlx1KVRAKqjtz/WhQc3IYvZtJ3ydt3m k/lG524BjmUXrQ1qU+juTqyVIJup0rFtOKPZDhjO8MouOFauTlnbz8gkjm7cU78BvQUUQL2PC26 wvuO4YE2Lf4ZnUjRw89OWXE/4qM2Tc1K2MXfCjFCVaD8wMEy/2qKISyINdV4gYYJ7BpGN8yI5h/ LoobCrpKnR74XIWM+oPJ4Z4WnbKzfzkMdy8TNlfKblLTDD9py63KpI9qEZWNtfrxXZziomTnt0K weEXWRraNZsQRc7yhabWMVCtfFkh5qYGHjyRt3nIBqQXyEWV3K7JpzprAS4dVoB3d90jUu9xFHi KoxokP8Tayxb6wnxfZD+eQ3hcknhgja0K7lNRs5MOLbTDK7oOCm5ehtXOV/6Z0+BpELmq8K43QB SJ93+erue8pr2lHxPmB8FvAYBpUQBGJ+9d6czAdU4hnw== X-Received: by 2002:a17:903:19e5:b0:2b0:445a:8c7b with SMTP id d9443c01a7336-2b0445a8fcemr59995855ad.15.1773630937274; Sun, 15 Mar 2026 20:15:37 -0700 (PDT) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aece56c23esm114159985ad.1.2026.03.15.20.15.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Mar 2026 20:15:36 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: Use SMgrRelation instead of SMgrRelationData * in pgaio_io_set_target_smgr() From: Chao Li In-Reply-To: Date: Mon, 16 Mar 2026 11:14:57 +0800 Cc: PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: <96EB95E4-9032-44A6-A397-153256AA5E4D@gmail.com> To: Japin Li X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Mar 16, 2026, at 10:31, Japin Li wrote: >=20 > On Mon, 16 Mar 2026 at 08:50, Chao Li wrote: >>> On Mar 14, 2026, at 11:07, Japin Li wrote: >>>=20 >>>=20 >>> Hi, Chao >>>=20 >>> On Fri, 13 Mar 2026 at 15:29, Chao Li = wrote: >>>>> On Mar 13, 2026, at 15:05, Japin Li wrote: >>>>>=20 >>>>>=20 >>>>> Hi, hackers >>>>>=20 >>>>> While reading smgr.h, I noticed an inconsistent type usage in >>>>> pgaio_io_set_target_smgr(). Currently the function is declared as: >>>>>=20 >>>>> extern void pgaio_io_set_target_smgr(PgAioHandle *ioh, >>>>> SMgrRelationData *smgr, >>>>> ForkNumber forknum, >>>>> BlockNumber blocknum, >>>>> int nblocks, >>>>>=20 >>>>> However, SMgrRelation is defined as "typedef SMgrRelationData * = SMgrRelation;", >>>>> and all other functions in the smgr subsystem use SMgrRelation as = the parameter >>>>> type. >>>>>=20 >>>>> 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. >>>>>=20 >>>>> This is purely a style/consistency cleanup with no functional = change. >>>>>=20 >>>>> Thoughts? Is this change acceptable? >>>>>=20 >>>>> --=20 >>>>> Regards, >>>>> Japin Li >>>>> ChengDu WenWu Information Technology Co., Ltd. >>>>>=20 >>>>> >>>>=20 >>>> pgaio_io_set_target_smgr doesn=E2=80=99t update smgr, so, instead = of =E2=80=9CSMgrRelation=E2=80=9D, I think it=E2=80=99s better to = change the type to "const SMgrRelationData *=E2=80=9D. >>>=20 >>> Thanks for the review! Makes sense =E2=80=94 I've updated the patch = to v2. >>>=20 >>> --=20 >>> Regards, >>> Japin Li >>> ChengDu WenWu Information Technology Co., Ltd. >>>=20 >>> >>=20 >> =E2=80=9Cconst SMgrRelation *=E2=80=9D will not work as you expected, = you have to do =E2=80=9Cconst SMgrRelationData *=E2=80=9D. We want to = protect the data the pointer pointing to from changing but the pointer = itself. >=20 > Thanks for pointing that out! I hadn't noticed the difference before. > Updated as you suggested. >=20 >>=20 >> Best regards, >> -- >> Chao Li (Evan) >> HighGo Software Co., Ltd. >> https://www.highgo.com/ >=20 > --=20 > Regards, > Japin Li > ChengDu WenWu Information Technology Co., Ltd. >=20 > V3 LGTM. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/