Use function smgrclose() to replace the loop

From: Steven Niu <niushiji(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, Junwang Zhao <zhjwpku(at)gmail(dot)com>
Subject: Use function smgrclose() to replace the loop
Date: 2024-08-14 06:32:17
Message-ID: CABBtG=d1Kkmi67VdM=jGaYkQ0+WGbhZpxwa3ms0s1DB_J_9Jww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Kirill, Junwang,

I made this patch to address the refactor issue in our previous email
discussion.
https://www.postgresql.org/message-id/flat/CABBtG=cDTCBDCBK7McSy6bJR3s5xUTOg0vSFfuW8oLdUYyCscA(at)mail(dot)gmail(dot)com

That is, the for loop in function smgrdestroy() and smgrdounlinkall can be
replaced with smgrclose().

for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
smgrsw[reln->smgr_which].smgr_close(reln, forknum);
-->
smgrclose(rels[i]);

Please let me know if you have any questions.

Best Regards,
Steven from Highgo.com

Attachment Content-Type Size
0001-Use-function-smgrclose-to-replace-the-loop.patch application/octet-stream 1.1 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Steven Niu 2024-08-14 06:35:39 Re: [Patch] remove duplicated smgrclose
Previous Message Joel Jacobson 2024-08-14 06:30:55 Re: Optimize mul_var() for var1ndigits >= 8