@@ -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 */
350347void
351348smgrdounlink (SMgrRelation reln , bool isRedo )
@@ -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 (SMgrRelation reln , ForkNumber forknum , bool isRedo )
487- {
488- RelFileNodeBackend rnode = reln -> smgr_rnode ;
489- int which = 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 *
0 commit comments