mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Make functions static where possible, enclose unused functions in #ifdef NOT_USED.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.8 1996/11/27 15:15:54 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.9 1997/08/19 21:29:59 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains the high level access-method interface to the
|
||||
@@ -26,6 +26,12 @@
|
||||
#include <storage/spin.h>
|
||||
#include <commands/vacuum.h>
|
||||
|
||||
static int RecoveryCheckingEnabled(void);
|
||||
static void TransRecover(Relation logRelation);
|
||||
static bool TransactionLogTest(TransactionId transactionId, XidStatus status);
|
||||
static void TransactionLogUpdate(TransactionId transactionId,
|
||||
XidStatus status);
|
||||
|
||||
/* ----------------
|
||||
* global variables holding pointers to relations used
|
||||
* by the transaction system. These are initialized by
|
||||
@@ -95,17 +101,19 @@ extern bool BuildingBtree;
|
||||
* recovery checking accessors
|
||||
* ----------------
|
||||
*/
|
||||
int
|
||||
static int
|
||||
RecoveryCheckingEnabled(void)
|
||||
{
|
||||
return RecoveryCheckingEnableState;
|
||||
}
|
||||
|
||||
void
|
||||
#ifdef NOT_USED
|
||||
static void
|
||||
SetRecoveryCheckingEnabled(bool state)
|
||||
{
|
||||
RecoveryCheckingEnableState = (state == true);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* postgres log/time access method interface
|
||||
@@ -124,7 +132,7 @@ SetRecoveryCheckingEnabled(bool state)
|
||||
* --------------------------------
|
||||
*/
|
||||
|
||||
bool /* true/false: does transaction id have specified status? */
|
||||
static bool /* true/false: does transaction id have specified status? */
|
||||
TransactionLogTest(TransactionId transactionId, /* transaction id to test */
|
||||
XidStatus status) /* transaction status */
|
||||
{
|
||||
@@ -186,7 +194,7 @@ TransactionLogTest(TransactionId transactionId, /* transaction id to test */
|
||||
* TransactionLogUpdate
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
TransactionLogUpdate(TransactionId transactionId, /* trans id to update */
|
||||
XidStatus status) /* new trans status */
|
||||
{
|
||||
@@ -371,7 +379,7 @@ TransactionIdGetCommitTime(TransactionId transactionId) /* transaction id to tes
|
||||
* passed a flag on the command line.
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
TransRecover(Relation logRelation)
|
||||
{
|
||||
#if 0
|
||||
@@ -664,6 +672,7 @@ TransactionIdAbort(TransactionId transactionId)
|
||||
TransactionLogUpdate(transactionId, XID_ABORT);
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
TransactionIdSetInProgress(TransactionId transactionId)
|
||||
{
|
||||
@@ -672,3 +681,4 @@ TransactionIdSetInProgress(TransactionId transactionId)
|
||||
|
||||
TransactionLogUpdate(transactionId, XID_INPROGRESS);
|
||||
}
|
||||
#endif
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.8 1997/08/12 22:51:57 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.9 1997/08/19 21:30:12 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains support functions for the high
|
||||
@@ -23,6 +23,15 @@
|
||||
#include <access/xact.h>
|
||||
#include <storage/lmgr.h>
|
||||
|
||||
static AbsoluteTime TransBlockGetCommitTime(Block tblock,
|
||||
TransactionId transactionId);
|
||||
static XidStatus TransBlockGetXidStatus(Block tblock,
|
||||
TransactionId transactionId);
|
||||
static void TransBlockSetCommitTime(Block tblock,
|
||||
TransactionId transactionId, AbsoluteTime commitTime);
|
||||
static void TransBlockSetXidStatus(Block tblock,
|
||||
TransactionId transactionId, XidStatus xstatus);
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* general support routines
|
||||
* ----------------------------------------------------------------
|
||||
@@ -93,7 +102,8 @@ TransComputeBlockNumber(Relation relation, /* relation to test */
|
||||
* --------------------------------
|
||||
*/
|
||||
|
||||
XidStatus
|
||||
#ifdef NOT_USED
|
||||
static XidStatus
|
||||
TransBlockGetLastTransactionIdStatus(Block tblock,
|
||||
TransactionId baseXid,
|
||||
TransactionId *returnXidP)
|
||||
@@ -159,6 +169,7 @@ TransBlockGetLastTransactionIdStatus(Block tblock,
|
||||
*/
|
||||
return xstatus;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* --------------------------------
|
||||
* TransBlockGetXidStatus
|
||||
@@ -167,7 +178,7 @@ TransBlockGetLastTransactionIdStatus(Block tblock,
|
||||
* --------------------------------
|
||||
*/
|
||||
|
||||
XidStatus
|
||||
static XidStatus
|
||||
TransBlockGetXidStatus(Block tblock,
|
||||
TransactionId transactionId)
|
||||
{
|
||||
@@ -218,7 +229,7 @@ TransBlockGetXidStatus(Block tblock,
|
||||
* This sets the status of the desired transaction
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
TransBlockSetXidStatus(Block tblock,
|
||||
TransactionId transactionId,
|
||||
XidStatus xstatus)
|
||||
@@ -279,7 +290,7 @@ TransBlockSetXidStatus(Block tblock,
|
||||
* specified transaction id in the trans block.
|
||||
* --------------------------------
|
||||
*/
|
||||
AbsoluteTime
|
||||
static AbsoluteTime
|
||||
TransBlockGetCommitTime(Block tblock,
|
||||
TransactionId transactionId)
|
||||
{
|
||||
@@ -320,7 +331,7 @@ TransBlockGetCommitTime(Block tblock,
|
||||
* This sets the commit time of the specified transaction
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
TransBlockSetCommitTime(Block tblock,
|
||||
TransactionId transactionId,
|
||||
AbsoluteTime commitTime)
|
||||
@@ -590,6 +601,7 @@ TransBlockNumberSetCommitTime(Relation relation,
|
||||
* TransGetLastRecordedTransaction
|
||||
* --------------------------------
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
TransGetLastRecordedTransaction(Relation relation,
|
||||
TransactionId xid, /* return: transaction id */
|
||||
@@ -651,3 +663,4 @@ TransGetLastRecordedTransaction(Relation relation,
|
||||
*/
|
||||
RelationUnsetLockForRead(relation);
|
||||
}
|
||||
#endif
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.8 1997/08/12 22:51:58 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.9 1997/08/19 21:30:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -20,6 +20,13 @@
|
||||
#include <access/heapam.h>
|
||||
#include <catalog/catname.h>
|
||||
|
||||
static void GetNewObjectIdBlock(Oid *oid_return, int oid_block_size);
|
||||
static void VariableRelationGetNextOid(Oid *oid_return);
|
||||
static void VariableRelationGetNextXid(TransactionId *xidP);
|
||||
static void VariableRelationPutLastXid(TransactionId xid);
|
||||
static void VariableRelationPutNextOid(Oid *oidP);
|
||||
static void VariableRelationGetLastXid(TransactionId *xidP);
|
||||
|
||||
/* ---------------------
|
||||
* spin lock for oid generation
|
||||
* ---------------------
|
||||
@@ -35,7 +42,7 @@ int OidGenLockId;
|
||||
* VariableRelationGetNextXid
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
VariableRelationGetNextXid(TransactionId *xidP)
|
||||
{
|
||||
Buffer buf;
|
||||
@@ -77,7 +84,7 @@ VariableRelationGetNextXid(TransactionId *xidP)
|
||||
* VariableRelationGetLastXid
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
VariableRelationGetLastXid(TransactionId *xidP)
|
||||
{
|
||||
Buffer buf;
|
||||
@@ -166,7 +173,7 @@ VariableRelationPutNextXid(TransactionId xid)
|
||||
* VariableRelationPutLastXid
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
VariableRelationPutLastXid(TransactionId xid)
|
||||
{
|
||||
Buffer buf;
|
||||
@@ -209,7 +216,7 @@ VariableRelationPutLastXid(TransactionId xid)
|
||||
* VariableRelationGetNextOid
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
VariableRelationGetNextOid(Oid *oid_return)
|
||||
{
|
||||
Buffer buf;
|
||||
@@ -277,7 +284,7 @@ VariableRelationGetNextOid(Oid *oid_return)
|
||||
* VariableRelationPutNextOid
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
VariableRelationPutNextOid(Oid *oidP)
|
||||
{
|
||||
Buffer buf;
|
||||
@@ -484,7 +491,7 @@ UpdateLastCommittedXid(TransactionId xid)
|
||||
* id assignments should use this
|
||||
* ----------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
GetNewObjectIdBlock(Oid *oid_return, /* place to return the new object id */
|
||||
int oid_block_size) /* number of oids desired */
|
||||
{
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.11 1997/08/12 22:52:01 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.12 1997/08/19 21:30:19 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Transaction aborts can now occur two ways:
|
||||
@@ -151,6 +151,21 @@
|
||||
#include <commands/async.h>
|
||||
#include <commands/sequence.h>
|
||||
|
||||
static void AbortTransaction(void);
|
||||
static void AtAbort_Cache(void);
|
||||
static void AtAbort_Locks(void);
|
||||
static void AtAbort_Memory(void);
|
||||
static void AtCommit_Cache(void);
|
||||
static void AtCommit_Locks(void);
|
||||
static void AtCommit_Memory(void);
|
||||
static void AtStart_Cache(void);
|
||||
static void AtStart_Locks(void);
|
||||
static void AtStart_Memory(void);
|
||||
static void CommitTransaction(void);
|
||||
static void RecordTransactionAbort(void);
|
||||
static void RecordTransactionCommit(void);
|
||||
static void StartTransaction(void);
|
||||
|
||||
/* ----------------
|
||||
* global variables holding the current transaction state.
|
||||
*
|
||||
@@ -232,11 +247,13 @@ TransactionFlushEnabled(void)
|
||||
return TransactionFlushState;
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
SetTransactionFlushEnabled(bool state)
|
||||
{
|
||||
TransactionFlushState = (state == true);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* --------------------------------
|
||||
* IsTransactionState
|
||||
@@ -420,12 +437,13 @@ CommandIdIsCurrentCommandId(CommandId cid)
|
||||
* ClearCommandIdCounterOverflowFlag
|
||||
* --------------------------------
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
ClearCommandIdCounterOverflowFlag()
|
||||
{
|
||||
CommandIdCounterOverflowFlag = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* --------------------------------
|
||||
* CommandCounterIncrement
|
||||
@@ -464,7 +482,7 @@ InitializeTransactionSystem()
|
||||
* AtStart_Cache
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AtStart_Cache()
|
||||
{
|
||||
DiscardInvalid();
|
||||
@@ -474,7 +492,7 @@ AtStart_Cache()
|
||||
* AtStart_Locks
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AtStart_Locks()
|
||||
{
|
||||
/*
|
||||
@@ -489,7 +507,7 @@ AtStart_Locks()
|
||||
* AtStart_Memory
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AtStart_Memory()
|
||||
{
|
||||
Portal portal;
|
||||
@@ -526,7 +544,7 @@ AtStart_Memory()
|
||||
* -cim 3/18/90
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
RecordTransactionCommit()
|
||||
{
|
||||
TransactionId xid;
|
||||
@@ -569,7 +587,7 @@ RecordTransactionCommit()
|
||||
* AtCommit_Cache
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AtCommit_Cache()
|
||||
{
|
||||
/* ----------------
|
||||
@@ -586,7 +604,7 @@ AtCommit_Cache()
|
||||
* AtCommit_Locks
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AtCommit_Locks()
|
||||
{
|
||||
/* ----------------
|
||||
@@ -602,7 +620,7 @@ AtCommit_Locks()
|
||||
* AtCommit_Memory
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AtCommit_Memory()
|
||||
{
|
||||
/* ----------------
|
||||
@@ -624,7 +642,7 @@ AtCommit_Memory()
|
||||
* RecordTransactionAbort
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
RecordTransactionAbort()
|
||||
{
|
||||
TransactionId xid;
|
||||
@@ -655,7 +673,7 @@ RecordTransactionAbort()
|
||||
* AtAbort_Cache
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AtAbort_Cache()
|
||||
{
|
||||
RegisterInvalid(false);
|
||||
@@ -665,7 +683,7 @@ AtAbort_Cache()
|
||||
* AtAbort_Locks
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AtAbort_Locks()
|
||||
{
|
||||
/* ----------------
|
||||
@@ -682,7 +700,7 @@ AtAbort_Locks()
|
||||
* AtAbort_Memory
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AtAbort_Memory()
|
||||
{
|
||||
/* ----------------
|
||||
@@ -704,7 +722,7 @@ AtAbort_Memory()
|
||||
*
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
StartTransaction()
|
||||
{
|
||||
TransactionState s = CurrentTransactionState;
|
||||
@@ -788,7 +806,7 @@ CurrentXactInProgress()
|
||||
*
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
CommitTransaction()
|
||||
{
|
||||
TransactionState s = CurrentTransactionState;
|
||||
@@ -847,7 +865,7 @@ CommitTransaction()
|
||||
*
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
AbortTransaction()
|
||||
{
|
||||
TransactionState s = CurrentTransactionState;
|
||||
@@ -1245,7 +1263,8 @@ EndTransactionBlock(void)
|
||||
* AbortTransactionBlock
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
#ifdef NOT_USED
|
||||
static void
|
||||
AbortTransactionBlock(void)
|
||||
{
|
||||
TransactionState s = CurrentTransactionState;
|
||||
@@ -1288,6 +1307,7 @@ AbortTransactionBlock(void)
|
||||
AbortTransaction();
|
||||
s->blockState = TBLOCK_ENDABORT;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* --------------------------------
|
||||
* UserAbortTransactionBlock
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.6 1997/08/12 22:52:02 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.7 1997/08/19 21:30:20 momjian Exp $
|
||||
*
|
||||
* OLD COMMENTS
|
||||
* XXX WARNING
|
||||
@@ -132,6 +132,7 @@ xideq(TransactionId xid1, TransactionId xid2)
|
||||
* TransactionIdIncrement
|
||||
* ----------------------------------------------------------------
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
void
|
||||
TransactionIdIncrement(TransactionId *transactionId)
|
||||
{
|
||||
@@ -141,6 +142,7 @@ TransactionIdIncrement(TransactionId *transactionId)
|
||||
elog(FATAL, "TransactionIdIncrement: exhausted XID's");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* TransactionIdAdd
|
||||
|
Reference in New Issue
Block a user