* Type for array used to sort SMgrRelations
*
* FlushRelationsAllBuffers shares the same comparator function with
- * DropRelFileLocatorsAllBuffers. Pointer to this struct and RelFileLocator must be
+ * DropRelationsAllBuffers. Pointer to this struct and RelFileLocator must be
* compatible.
*/
typedef struct SMgrSortArray
BufferAccessStrategy strategy,
bool *foundPtr);
static void FlushBuffer(BufferDesc *buf, SMgrRelation reln);
-static void FindAndDropRelFileLocatorBuffers(RelFileLocator rlocator,
- ForkNumber forkNum,
- BlockNumber nForkBlock,
- BlockNumber firstDelBlock);
+static void FindAndDropRelationBuffers(RelFileLocator rlocator,
+ ForkNumber forkNum,
+ BlockNumber nForkBlock,
+ BlockNumber firstDelBlock);
static void RelationCopyStorageUsingBuffer(Relation src, Relation dst,
ForkNumber forkNum,
bool isunlogged);
}
/* ---------------------------------------------------------------------
- * DropRelFileLocatorBuffers
+ * DropRelationBuffers
*
* This function removes from the buffer pool all the pages of the
* specified relation forks that have block numbers >= firstDelBlock.
* --------------------------------------------------------------------
*/
void
-DropRelFileLocatorBuffers(SMgrRelation smgr_reln, ForkNumber *forkNum,
- int nforks, BlockNumber *firstDelBlock)
+DropRelationBuffers(SMgrRelation smgr_reln, ForkNumber *forkNum,
+ int nforks, BlockNumber *firstDelBlock)
{
int i;
int j;
if (rlocator.backend == MyBackendId)
{
for (j = 0; j < nforks; j++)
- DropRelFileLocatorLocalBuffers(rlocator.locator, forkNum[j],
- firstDelBlock[j]);
+ DropRelationLocalBuffers(rlocator.locator, forkNum[j],
+ firstDelBlock[j]);
}
return;
}
nBlocksToInvalidate < BUF_DROP_FULL_SCAN_THRESHOLD)
{
for (j = 0; j < nforks; j++)
- FindAndDropRelFileLocatorBuffers(rlocator.locator, forkNum[j],
- nForkBlock[j], firstDelBlock[j]);
+ FindAndDropRelationBuffers(rlocator.locator, forkNum[j],
+ nForkBlock[j], firstDelBlock[j]);
return;
}
}
/* ---------------------------------------------------------------------
- * DropRelFileLocatorsAllBuffers
+ * DropRelationsAllBuffers
*
* This function removes from the buffer pool all the pages of all
* forks of the specified relations. It's equivalent to calling
- * DropRelFileLocatorBuffers once per fork per relation with
- * firstDelBlock = 0.
- * --------------------------------------------------------------------
+ * DropRelationBuffers once per fork per relation with firstDelBlock = 0.
+ * --------------------------------------------------------------------
*/
void
-DropRelFileLocatorsAllBuffers(SMgrRelation *smgr_reln, int nlocators)
+DropRelationsAllBuffers(SMgrRelation *smgr_reln, int nlocators)
{
int i;
int j;
if (RelFileLocatorBackendIsTemp(smgr_reln[i]->smgr_rlocator))
{
if (smgr_reln[i]->smgr_rlocator.backend == MyBackendId)
- DropRelFileLocatorAllLocalBuffers(smgr_reln[i]->smgr_rlocator.locator);
+ DropRelationAllLocalBuffers(smgr_reln[i]->smgr_rlocator.locator);
}
else
rels[n++] = smgr_reln[i];
/*
* We can avoid scanning the entire buffer pool if we know the exact size
- * of each of the given relation forks. See DropRelFileLocatorBuffers.
+ * of each of the given relation forks. See DropRelationBuffers.
*/
for (i = 0; i < n && cached; i++)
{
continue;
/* drop all the buffers for a particular relation fork */
- FindAndDropRelFileLocatorBuffers(rels[i]->smgr_rlocator.locator,
- j, block[i][j], 0);
+ FindAndDropRelationBuffers(rels[i]->smgr_rlocator.locator,
+ j, block[i][j], 0);
}
}
uint32 buf_state;
/*
- * As in DropRelFileLocatorBuffers, an unlocked precheck should be
+ * As in DropRelationBuffers, an unlocked precheck should be
* safe and saves some cycles.
*/
}
/* ---------------------------------------------------------------------
- * FindAndDropRelFileLocatorBuffers
+ * FindAndDropRelationBuffers
*
* This function performs look up in BufMapping table and removes from the
* buffer pool all the pages of the specified relation fork that has block
* --------------------------------------------------------------------
*/
static void
-FindAndDropRelFileLocatorBuffers(RelFileLocator rlocator, ForkNumber forkNum,
- BlockNumber nForkBlock,
- BlockNumber firstDelBlock)
+FindAndDropRelationBuffers(RelFileLocator rlocator, ForkNumber forkNum,
+ BlockNumber nForkBlock,
+ BlockNumber firstDelBlock)
{
BlockNumber curBlock;
* bothering to write them out first. This is used when we destroy a
* database, to avoid trying to flush data to disk when the directory
* tree no longer exists. Implementation is pretty similar to
- * DropRelFileLocatorBuffers() which is for destroying just one relation.
+ * DropRelationBuffers() which is for destroying just one relation.
* --------------------------------------------------------------------
*/
void
uint32 buf_state;
/*
- * As in DropRelFileLocatorBuffers, an unlocked precheck should be
+ * As in DropRelationBuffers, an unlocked precheck should be
* safe and saves some cycles.
*/
if (bufHdr->tag.rlocator.dbOid != dbid)
bufHdr = GetBufferDescriptor(i);
/*
- * As in DropRelFileLocatorBuffers, an unlocked precheck should be
+ * As in DropRelationBuffers, an unlocked precheck should be
* safe and saves some cycles.
*/
if (!RelFileLocatorEquals(bufHdr->tag.rlocator, rel->rd_locator))
/*
* Save the bsearch overhead for low number of relations to sync. See
- * DropRelFileLocatorsAllBuffers for details.
+ * DropRelationsAllBuffers for details.
*/
use_bsearch = nrels > RELS_BSEARCH_THRESHOLD;
uint32 buf_state;
/*
- * As in DropRelFileLocatorBuffers, an unlocked precheck should be
+ * As in DropRelationBuffers, an unlocked precheck should be
* safe and saves some cycles.
*/
bufHdr = GetBufferDescriptor(i);
/*
- * As in DropRelFileLocatorBuffers, an unlocked precheck should be
+ * As in DropRelationBuffers, an unlocked precheck should be
* safe and saves some cycles.
*/
if (bufHdr->tag.rlocator.dbOid != dbid)
}
/*
- * DropRelFileLocatorLocalBuffers
+ * DropRelationLocalBuffers
* This function removes from the buffer pool all the pages of the
* specified relation that have block numbers >= firstDelBlock.
* (In particular, with firstDelBlock = 0, all pages are removed.)
* out first. Therefore, this is NOT rollback-able, and so should be
* used only with extreme caution!
*
- * See DropRelFileLocatorBuffers in bufmgr.c for more notes.
+ * See DropRelationBuffers in bufmgr.c for more notes.
*/
void
-DropRelFileLocatorLocalBuffers(RelFileLocator rlocator, ForkNumber forkNum,
- BlockNumber firstDelBlock)
+DropRelationLocalBuffers(RelFileLocator rlocator, ForkNumber forkNum,
+ BlockNumber firstDelBlock)
{
int i;
}
/*
- * DropRelFileLocatorAllLocalBuffers
+ * DropRelationAllLocalBuffers
* This function removes from the buffer pool all pages of all forks
* of the specified relation.
*
- * See DropRelFileLocatorsAllBuffers in bufmgr.c for more notes.
+ * See DropRelationsAllBuffers in bufmgr.c for more notes.
*/
void
-DropRelFileLocatorAllLocalBuffers(RelFileLocator rlocator)
+DropRelationAllLocalBuffers(RelFileLocator rlocator)
{
int i;
{
/*
* We shouldn't be holding any remaining pins; if we are, and assertions
- * aren't enabled, we'll fail later in DropRelFileLocatorBuffers while
+ * aren't enabled, we'll fail later in DropRelationBuffers while
* trying to drop the temp rels.
*/
CheckForLocalBufferLeaks();