@@ -335,59 +335,6 @@ smgrcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
335
335
smgrsw [reln -> smgr_which ].smgr_create (reln , forknum , isRedo );
336
336
}
337
337
338
- /*
339
- * smgrdounlink() -- Immediately unlink all forks of a relation.
340
- *
341
- * All forks of the relation are removed from the store. This should
342
- * not be used during transactional operations, since it can't be undone.
343
- *
344
- * If isRedo is true, it is okay for the underlying file(s) to be gone
345
- * already.
346
- */
347
- void
348
- smgrdounlink (SMgrRelation reln , bool isRedo )
349
- {
350
- RelFileNodeBackend rnode = reln -> smgr_rnode ;
351
- int which = reln -> smgr_which ;
352
- ForkNumber forknum ;
353
-
354
- /* Close the forks at smgr level */
355
- for (forknum = 0 ; forknum <= MAX_FORKNUM ; forknum ++ )
356
- smgrsw [which ].smgr_close (reln , forknum );
357
-
358
- /*
359
- * Get rid of any remaining buffers for the relation. bufmgr will just
360
- * drop them without bothering to write the contents.
361
- */
362
- DropRelFileNodesAllBuffers (& rnode , 1 );
363
-
364
- /*
365
- * It'd be nice to tell the stats collector to forget it immediately, too.
366
- * But we can't because we don't know the OID (and in cases involving
367
- * relfilenode swaps, it's not always clear which table OID to forget,
368
- * anyway).
369
- */
370
-
371
- /*
372
- * Send a shared-inval message to force other backends to close any
373
- * dangling smgr references they may have for this rel. We should do this
374
- * before starting the actual unlinking, in case we fail partway through
375
- * that step. Note that the sinval message will eventually come back to
376
- * this backend, too, and thereby provide a backstop that we closed our
377
- * own smgr rel.
378
- */
379
- CacheInvalidateSmgr (rnode );
380
-
381
- /*
382
- * Delete the physical file(s).
383
- *
384
- * Note: smgr_unlink must treat deletion failure as a WARNING, not an
385
- * ERROR, because we've already decided to commit or abort the current
386
- * xact.
387
- */
388
- smgrsw [which ].smgr_unlink (rnode , InvalidForkNumber , isRedo );
389
- }
390
-
391
338
/*
392
339
* smgrdosyncall() -- Immediately sync all forks of all given relations
393
340
*
@@ -432,9 +379,6 @@ smgrdosyncall(SMgrRelation *rels, int nrels)
432
379
*
433
380
* If isRedo is true, it is okay for the underlying file(s) to be gone
434
381
* already.
435
- *
436
- * This is equivalent to calling smgrdounlink for each relation, but it's
437
- * significantly quicker so should be preferred when possible.
438
382
*/
439
383
void
440
384
smgrdounlinkall (SMgrRelation * rels , int nrels , bool isRedo )
0 commit comments