Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33a94ba

Browse files
committed
Remove unused smgrdounlinkfork() function.
smgrdounlinkfork() became dead code as the result of commitece01aa,but it was left in place just in case we want it someday. However no usershave appeared in 7 years, so it's time to remove this unused function.Author: Kirk JamisonDiscussion:https://www.postgresql.org/message-id/D09B13F772D2274BB348A310EE3027C64E2067@g01jpexmbkw24
1 parentf9f2fda commit33a94ba

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

‎src/backend/storage/smgr/smgr.c

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,6 @@ smgrcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
343343
*
344344
*If isRedo is true, it is okay for the underlying file(s) to be gone
345345
*already.
346-
*
347-
*This is equivalent to calling smgrdounlinkfork for each fork, but
348-
*it's significantly quicker so should be preferred when possible.
349346
*/
350347
void
351348
smgrdounlink(SMgrRelationreln,boolisRedo)
@@ -472,58 +469,6 @@ smgrdounlinkall(SMgrRelation *rels, int nrels, bool isRedo)
472469
pfree(rnodes);
473470
}
474471

475-
/*
476-
*smgrdounlinkfork() -- Immediately unlink one fork of a relation.
477-
*
478-
*The specified fork of the relation is removed from the store. This
479-
*should not be used during transactional operations, since it can't be
480-
*undone.
481-
*
482-
*If isRedo is true, it is okay for the underlying file to be gone
483-
*already.
484-
*/
485-
void
486-
smgrdounlinkfork(SMgrRelationreln,ForkNumberforknum,boolisRedo)
487-
{
488-
RelFileNodeBackendrnode=reln->smgr_rnode;
489-
intwhich=reln->smgr_which;
490-
491-
/* Close the fork at smgr level */
492-
smgrsw[which].smgr_close(reln,forknum);
493-
494-
/*
495-
* Get rid of any remaining buffers for the fork. bufmgr will just drop
496-
* them without bothering to write the contents.
497-
*/
498-
DropRelFileNodeBuffers(rnode,forknum,0);
499-
500-
/*
501-
* It'd be nice to tell the stats collector to forget it immediately, too.
502-
* But we can't because we don't know the OID (and in cases involving
503-
* relfilenode swaps, it's not always clear which table OID to forget,
504-
* anyway).
505-
*/
506-
507-
/*
508-
* Send a shared-inval message to force other backends to close any
509-
* dangling smgr references they may have for this rel. We should do this
510-
* before starting the actual unlinking, in case we fail partway through
511-
* that step. Note that the sinval message will eventually come back to
512-
* this backend, too, and thereby provide a backstop that we closed our
513-
* own smgr rel.
514-
*/
515-
CacheInvalidateSmgr(rnode);
516-
517-
/*
518-
* Delete the physical file(s).
519-
*
520-
* Note: smgr_unlink must treat deletion failure as a WARNING, not an
521-
* ERROR, because we've already decided to commit or abort the current
522-
* xact.
523-
*/
524-
smgrsw[which].smgr_unlink(rnode,forknum,isRedo);
525-
}
526-
527472
/*
528473
*smgrextend() -- Add a new block to a file.
529474
*

‎src/include/storage/smgr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ extern void smgrclosenode(RelFileNodeBackend rnode);
9090
externvoidsmgrcreate(SMgrRelationreln,ForkNumberforknum,boolisRedo);
9191
externvoidsmgrdounlink(SMgrRelationreln,boolisRedo);
9292
externvoidsmgrdounlinkall(SMgrRelation*rels,intnrels,boolisRedo);
93-
externvoidsmgrdounlinkfork(SMgrRelationreln,ForkNumberforknum,boolisRedo);
9493
externvoidsmgrextend(SMgrRelationreln,ForkNumberforknum,
9594
BlockNumberblocknum,char*buffer,boolskipFsync);
9695
externvoidsmgrprefetch(SMgrRelationreln,ForkNumberforknum,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp