Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0901b7c

Browse files
Steven NiuCommitfest Bot
Steven Niu
authored and
Commitfest Bot
committed
remove duplicated smgrclose
Remove redundant `smgrclose` calls after `smgrdounlinkall`. The `smgrdounlinkall` now handles all necessary cleanup, making additional closes unnecessary. Author: Steven Niu <niushiji@gmail.com> Reviewed-by: Junwang Zhao Discussion: https://www.postgresql.org/message-id/flat/CABBtG=cDTCBDCBK7McSy6bJR3s5xUTOg0vSFfuW8oLdUYyCscA@mail.gmail.com
1 parent 0dca5d6 commit 0901b7c

File tree

3 files changed

+0
-6
lines changed

3 files changed

+0
-6
lines changed

src/backend/catalog/storage.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -727,9 +727,6 @@ smgrDoPendingDeletes(bool isCommit)
727727
{
728728
smgrdounlinkall(srels, nrels, false);
729729

730-
for (int i = 0; i < nrels; i++)
731-
smgrclose(srels[i]);
732-
733730
pfree(srels);
734731
}
735732
}

src/backend/storage/smgr/md.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,8 +1606,6 @@ DropRelationFiles(RelFileLocator *delrels, int ndelrels, bool isRedo)
16061606

16071607
smgrdounlinkall(srels, ndelrels, isRedo);
16081608

1609-
for (i = 0; i < ndelrels; i++)
1610-
smgrclose(srels[i]);
16111609
pfree(srels);
16121610
}
16131611

src/backend/utils/cache/relcache.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3802,7 +3802,6 @@ RelationSetNewRelfilenumber(Relation relation, char persistence)
38023802
*/
38033803
srel = smgropen(relation->rd_locator, relation->rd_backend);
38043804
smgrdounlinkall(&srel, 1, false);
3805-
smgrclose(srel);
38063805
}
38073806
else
38083807
{

0 commit comments

Comments
 (0)