mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Remove unused smgrdounlinkfork() function.
smgrdounlinkfork() became dead code as the result of commit ece01aae47
,
but it was left in place just in case we want it someday. However no users
have appeared in 7 years, so it's time to remove this unused function.
Author: Kirk Jamison
Discussion: https://www.postgresql.org/message-id/D09B13F772D2274BB348A310EE3027C64E2067@g01jpexmbkw24
This commit is contained in:
@ -343,9 +343,6 @@ smgrcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
|
|||||||
*
|
*
|
||||||
* If isRedo is true, it is okay for the underlying file(s) to be gone
|
* If isRedo is true, it is okay for the underlying file(s) to be gone
|
||||||
* already.
|
* already.
|
||||||
*
|
|
||||||
* This is equivalent to calling smgrdounlinkfork for each fork, but
|
|
||||||
* it's significantly quicker so should be preferred when possible.
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
smgrdounlink(SMgrRelation reln, bool isRedo)
|
smgrdounlink(SMgrRelation reln, bool isRedo)
|
||||||
@ -472,58 +469,6 @@ smgrdounlinkall(SMgrRelation *rels, int nrels, bool isRedo)
|
|||||||
pfree(rnodes);
|
pfree(rnodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* smgrdounlinkfork() -- Immediately unlink one fork of a relation.
|
|
||||||
*
|
|
||||||
* The specified fork of the relation is removed from the store. This
|
|
||||||
* should not be used during transactional operations, since it can't be
|
|
||||||
* undone.
|
|
||||||
*
|
|
||||||
* If isRedo is true, it is okay for the underlying file to be gone
|
|
||||||
* already.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
smgrdounlinkfork(SMgrRelation reln, ForkNumber forknum, bool isRedo)
|
|
||||||
{
|
|
||||||
RelFileNodeBackend rnode = reln->smgr_rnode;
|
|
||||||
int which = reln->smgr_which;
|
|
||||||
|
|
||||||
/* Close the fork at smgr level */
|
|
||||||
smgrsw[which].smgr_close(reln, forknum);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get rid of any remaining buffers for the fork. bufmgr will just drop
|
|
||||||
* them without bothering to write the contents.
|
|
||||||
*/
|
|
||||||
DropRelFileNodeBuffers(rnode, forknum, 0);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* It'd be nice to tell the stats collector to forget it immediately, too.
|
|
||||||
* But we can't because we don't know the OID (and in cases involving
|
|
||||||
* relfilenode swaps, it's not always clear which table OID to forget,
|
|
||||||
* anyway).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Send a shared-inval message to force other backends to close any
|
|
||||||
* dangling smgr references they may have for this rel. We should do this
|
|
||||||
* before starting the actual unlinking, in case we fail partway through
|
|
||||||
* that step. Note that the sinval message will eventually come back to
|
|
||||||
* this backend, too, and thereby provide a backstop that we closed our
|
|
||||||
* own smgr rel.
|
|
||||||
*/
|
|
||||||
CacheInvalidateSmgr(rnode);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Delete the physical file(s).
|
|
||||||
*
|
|
||||||
* Note: smgr_unlink must treat deletion failure as a WARNING, not an
|
|
||||||
* ERROR, because we've already decided to commit or abort the current
|
|
||||||
* xact.
|
|
||||||
*/
|
|
||||||
smgrsw[which].smgr_unlink(rnode, forknum, isRedo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* smgrextend() -- Add a new block to a file.
|
* smgrextend() -- Add a new block to a file.
|
||||||
*
|
*
|
||||||
|
@ -90,7 +90,6 @@ extern void smgrclosenode(RelFileNodeBackend rnode);
|
|||||||
extern void smgrcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo);
|
extern void smgrcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo);
|
||||||
extern void smgrdounlink(SMgrRelation reln, bool isRedo);
|
extern void smgrdounlink(SMgrRelation reln, bool isRedo);
|
||||||
extern void smgrdounlinkall(SMgrRelation *rels, int nrels, bool isRedo);
|
extern void smgrdounlinkall(SMgrRelation *rels, int nrels, bool isRedo);
|
||||||
extern void smgrdounlinkfork(SMgrRelation reln, ForkNumber forknum, bool isRedo);
|
|
||||||
extern void smgrextend(SMgrRelation reln, ForkNumber forknum,
|
extern void smgrextend(SMgrRelation reln, ForkNumber forknum,
|
||||||
BlockNumber blocknum, char *buffer, bool skipFsync);
|
BlockNumber blocknum, char *buffer, bool skipFsync);
|
||||||
extern void smgrprefetch(SMgrRelation reln, ForkNumber forknum,
|
extern void smgrprefetch(SMgrRelation reln, ForkNumber forknum,
|
||||||
|
Reference in New Issue
Block a user