summaryrefslogtreecommitdiff
path: root/src/backend/storage/lmgr
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1997-09-08 02:41:22 +0000
committerBruce Momjian <bruce@momjian.us>1997-09-08 02:41:22 +0000
commit319dbfa7364721d3343af03a7ce063c2a2c9d385 (patch)
treea2146fe02c49ce1e497b7c287dfcaa367a703ae4 /src/backend/storage/lmgr
parenta90f12fd9d6886da4f0734288496361a304d3882 (diff)
downloadpostgresql-319dbfa7364721d3343af03a7ce063c2a2c9d385.tar.gz
Another PGINDENT run that changes variable indenting and case label indenting. Also static variable indenting.
Diffstat (limited to 'src/backend/storage/lmgr')
-rw-r--r--src/backend/storage/lmgr/lmgr.c34
-rw-r--r--src/backend/storage/lmgr/lock.c166
-rw-r--r--src/backend/storage/lmgr/multi.c206
-rw-r--r--src/backend/storage/lmgr/proc.c96
-rw-r--r--src/backend/storage/lmgr/single.c6
5 files changed, 254 insertions, 254 deletions
diff --git a/src/backend/storage/lmgr/lmgr.c b/src/backend/storage/lmgr/lmgr.c
index 555303fa14..495a11f76a 100644
--- a/src/backend/storage/lmgr/lmgr.c
+++ b/src/backend/storage/lmgr/lmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.6 1997/09/07 04:48:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.7 1997/09/08 02:29:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -48,7 +48,7 @@
#include "storage/bufmgr.h"
#include "access/transam.h" /* for AmiTransactionId */
-static void LRelIdAssign(LRelId * lRelId, Oid dbId, Oid relId);
+static void LRelIdAssign(LRelId * lRelId, Oid dbId, Oid relId);
/* ----------------
*
@@ -67,9 +67,9 @@ static void LRelIdAssign(LRelId * lRelId, Oid dbId, Oid relId);
#define TupleLevelLockLimit 10
-extern Oid MyDatabaseId;
+extern Oid MyDatabaseId;
-static LRelId VariableRelationLRelId = {
+static LRelId VariableRelationLRelId = {
RelOid_pg_variable,
InvalidOid
};
@@ -93,7 +93,7 @@ elog(NOTICE, "RelationGetLRelId(%s) invalid lockInfo", \
LRelId
RelationGetLRelId(Relation relation)
{
- LockInfo linfo;
+ LockInfo linfo;
/* ----------------
* sanity checks
@@ -199,11 +199,11 @@ LRelIdContainsMyDatabaseId(LRelId lRelId)
void
RelationInitLockInfo(Relation relation)
{
- LockInfo info;
- char *relname;
- Oid relationid;
- bool processingVariable;
- extern Oid MyDatabaseId; /* XXX use include */
+ LockInfo info;
+ char *relname;
+ Oid relationid;
+ bool processingVariable;
+ extern Oid MyDatabaseId; /* XXX use include */
extern GlobalMemory CacheCxt;
/* ----------------
@@ -228,7 +228,7 @@ RelationInitLockInfo(Relation relation)
*/
if (!PointerIsValid(info))
{
- MemoryContext oldcxt;
+ MemoryContext oldcxt;
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
info = (LockInfo) palloc(sizeof(LockInfoData));
@@ -366,7 +366,7 @@ elog(DEBUG, "RelationSetLockForRead(%s[%d,%d]) called", \
void
RelationSetLockForRead(Relation relation)
{
- LockInfo linfo;
+ LockInfo linfo;
/* ----------------
* sanity checks
@@ -416,7 +416,7 @@ elog(DEBUG, "RelationUnsetLockForRead(%s[%d,%d]) called", \
void
RelationUnsetLockForRead(Relation relation)
{
- LockInfo linfo;
+ LockInfo linfo;
/* ----------------
* sanity check
@@ -462,7 +462,7 @@ elog(DEBUG, "RelationSetLockForWrite(%s[%d,%d]) called", \
void
RelationSetLockForWrite(Relation relation)
{
- LockInfo linfo;
+ LockInfo linfo;
/* ----------------
* sanity checks
@@ -512,7 +512,7 @@ elog(DEBUG, "RelationUnsetLockForWrite(%s[%d,%d]) called", \
void
RelationUnsetLockForWrite(Relation relation)
{
- LockInfo linfo;
+ LockInfo linfo;
/* ----------------
* sanity checks
@@ -560,8 +560,8 @@ elog(DEBUG, "RelationSetLockForTupleRead(%s[%d,%d], 0x%x) called", \
void
RelationSetLockForTupleRead(Relation relation, ItemPointer itemPointer)
{
- LockInfo linfo;
- TransactionId curXact;
+ LockInfo linfo;
+ TransactionId curXact;
/* ----------------
* sanity checks
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index 7e592945f1..3bcef3549c 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.12 1997/09/07 04:48:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.13 1997/09/08 02:29:15 momjian Exp $
*
* NOTES
* Outside modules can create a lock table and acquire/release
@@ -63,9 +63,9 @@ WaitOnLock(LOCKTAB * ltable, LockTableId tableId, LOCK * lock,
#else /* LOCK_MGR_DEBUG */
-int lockDebug = 0;
-unsigned int lock_debug_oid_min = BootstrapObjectIdData;
-static char *lock_types[] = {
+int lockDebug = 0;
+unsigned int lock_debug_oid_min = BootstrapObjectIdData;
+static char *lock_types[] = {
"NONE",
"WRITE",
"READ",
@@ -127,19 +127,19 @@ static char *lock_types[] = {
#endif /* LOCK_MGR_DEBUG */
-SPINLOCK LockMgrLock; /* in Shmem or created in
+SPINLOCK LockMgrLock; /* in Shmem or created in
* CreateSpinlocks() */
/* This is to simplify/speed up some bit arithmetic */
-static MASK BITS_OFF[MAX_LOCKTYPES];
-static MASK BITS_ON[MAX_LOCKTYPES];
+static MASK BITS_OFF[MAX_LOCKTYPES];
+static MASK BITS_ON[MAX_LOCKTYPES];
/* -----------------
* XXX Want to move this to this file
* -----------------
*/
-static bool LockingIsDisabled;
+static bool LockingIsDisabled;
/* -------------------
* map from tableId to the lock table structure
@@ -151,7 +151,7 @@ static LOCKTAB *AllTables[MAX_TABLES];
* no zero-th table
* -------------------
*/
-static int NumTables = 1;
+static int NumTables = 1;
/* -------------------
* InitLocks -- Init the lock module. Create a private data
@@ -161,8 +161,8 @@ static int NumTables = 1;
void
InitLocks()
{
- int i;
- int bit;
+ int i;
+ int bit;
bit = 1;
/* -------------------
@@ -199,7 +199,7 @@ LockTypeInit(LOCKTAB * ltable,
int *prioP,
int ntypes)
{
- int i;
+ int i;
ltable->ctl->nLockTypes = ntypes;
ntypes++;
@@ -226,12 +226,12 @@ LockTabInit(char *tabName,
int *prioP,
int ntypes)
{
- LOCKTAB *ltable;
- char *shmemName;
- HASHCTL info;
- int hash_flags;
- bool found;
- int status = TRUE;
+ LOCKTAB *ltable;
+ char *shmemName;
+ HASHCTL info;
+ int hash_flags;
+ bool found;
+ int status = TRUE;
if (ntypes > MAX_LOCKTYPES)
{
@@ -378,7 +378,7 @@ LockTabInit(char *tabName,
LockTableId
LockTabRename(LockTableId tableId)
{
- LockTableId newTableId;
+ LockTableId newTableId;
if (NumTables >= MAX_TABLES)
{
@@ -454,18 +454,18 @@ LockTabRename(LockTableId tableId)
bool
LockAcquire(LockTableId tableId, LOCKTAG * lockName, LOCKT lockt)
{
- XIDLookupEnt *result,
- item;
- HTAB *xidTable;
- bool found;
- LOCK *lock = NULL;
- SPINLOCK masterLock;
- LOCKTAB *ltable;
- int status;
- TransactionId myXid;
+ XIDLookupEnt *result,
+ item;
+ HTAB *xidTable;
+ bool found;
+ LOCK *lock = NULL;
+ SPINLOCK masterLock;
+ LOCKTAB *ltable;
+ int status;
+ TransactionId myXid;
#ifdef USER_LOCKS
- int is_user_lock;
+ int is_user_lock;
is_user_lock = (tableId == 0);
if (is_user_lock)
@@ -661,15 +661,15 @@ LockResolveConflicts(LOCKTAB * ltable,
LOCKT lockt,
TransactionId xid)
{
- XIDLookupEnt *result,
- item;
- int *myHolders;
- int nLockTypes;
- HTAB *xidTable;
- bool found;
- int bitmask;
- int i,
- tmpMask;
+ XIDLookupEnt *result,
+ item;
+ int *myHolders;
+ int nLockTypes;
+ HTAB *xidTable;
+ bool found;
+ int bitmask;
+ int i,
+ tmpMask;
nLockTypes = ltable->ctl->nLockTypes;
xidTable = ltable->xidHash;
@@ -772,9 +772,9 @@ LockResolveConflicts(LOCKTAB * ltable,
static int
WaitOnLock(LOCKTAB * ltable, LockTableId tableId, LOCK * lock, LOCKT lockt)
{
- PROC_QUEUE *waitQueue = &(lock->waitProcs);
+ PROC_QUEUE *waitQueue = &(lock->waitProcs);
- int prio = ltable->ctl->prio[lockt];
+ int prio = ltable->ctl->prio[lockt];
/*
* the waitqueue is ordered by priority. I insert myself according to
@@ -821,17 +821,17 @@ WaitOnLock(LOCKTAB * ltable, LockTableId tableId, LOCK * lock, LOCKT lockt)
bool
LockRelease(LockTableId tableId, LOCKTAG * lockName, LOCKT lockt)
{
- LOCK *lock = NULL;
- SPINLOCK masterLock;
- bool found;
- LOCKTAB *ltable;
- XIDLookupEnt *result,
- item;
- HTAB *xidTable;
- bool wakeupNeeded = true;
+ LOCK *lock = NULL;
+ SPINLOCK masterLock;
+ bool found;
+ LOCKTAB *ltable;
+ XIDLookupEnt *result,
+ item;
+ HTAB *xidTable;
+ bool wakeupNeeded = true;
#ifdef USER_LOCKS
- int is_user_lock;
+ int is_user_lock;
is_user_lock = (tableId == 0);
if (is_user_lock)
@@ -1125,23 +1125,23 @@ GrantLock(LOCK * lock, LOCKT lockt)
bool
LockReleaseAll(LockTableId tableId, SHM_QUEUE * lockQueue)
{
- PROC_QUEUE *waitQueue;
- int done;
- XIDLookupEnt *xidLook = NULL;
- XIDLookupEnt *tmp = NULL;
- SHMEM_OFFSET end = MAKE_OFFSET(lockQueue);
- SPINLOCK masterLock;
- LOCKTAB *ltable;
- int i,
- nLockTypes;
- LOCK *lock;
- bool found;
+ PROC_QUEUE *waitQueue;
+ int done;
+ XIDLookupEnt *xidLook = NULL;
+ XIDLookupEnt *tmp = NULL;
+ SHMEM_OFFSET end = MAKE_OFFSET(lockQueue);
+ SPINLOCK masterLock;
+ LOCKTAB *ltable;
+ int i,
+ nLockTypes;
+ LOCK *lock;
+ bool found;
#ifdef USER_LOCKS
- int is_user_lock_table,
- my_pid,
- count,
- nskip;
+ int is_user_lock_table,
+ my_pid,
+ count,
+ nskip;
is_user_lock_table = (tableId == 0);
my_pid = getpid();
@@ -1359,11 +1359,11 @@ next_item:
int
LockShmemSize()
{
- int size = 0;
- int nLockBuckets,
- nLockSegs;
- int nXidBuckets,
- nXidSegs;
+ int size = 0;
+ int nLockBuckets,
+ nLockSegs;
+ int nXidBuckets,
+ nXidSegs;
nLockBuckets = 1 << (int) my_log2((NLOCKENTS - 1) / DEF_FFACTOR + 1);
nLockSegs = 1 << (int) my_log2((nLockBuckets - 1) / DEF_SEGSIZE + 1);
@@ -1409,20 +1409,20 @@ LockingDisabled()
void
DumpLocks()
{
- SHMEM_OFFSET location;
- PROC *proc;
- SHM_QUEUE *lockQueue;
- int done;
- XIDLookupEnt *xidLook = NULL;
- XIDLookupEnt *tmp = NULL;
- SHMEM_OFFSET end;
- SPINLOCK masterLock;
- int nLockTypes;
- LOCK *lock;
- int pid,
- count;
- int tableId = 1;
- LOCKTAB *ltable;
+ SHMEM_OFFSET location;
+ PROC *proc;
+ SHM_QUEUE *lockQueue;
+ int done;
+ XIDLookupEnt *xidLook = NULL;
+ XIDLookupEnt *tmp = NULL;
+ SHMEM_OFFSET end;
+ SPINLOCK masterLock;
+ int nLockTypes;
+ LOCK *lock;
+ int pid,
+ count;
+ int tableId = 1;
+ LOCKTAB *ltable;
pid = getpid();
ShmemPIDLookup(pid, &location);
diff --git a/src/backend/storage/lmgr/multi.c b/src/backend/storage/lmgr/multi.c
index d5466fce04..529c889b16 100644
--- a/src/backend/storage/lmgr/multi.c
+++ b/src/backend/storage/lmgr/multi.c
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.5 1997/09/07 04:49:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.6 1997/09/08 02:29:16 momjian Exp $
*
* NOTES:
* (1) The lock.c module assumes that the caller here is doing
@@ -43,7 +43,7 @@ MultiRelease(LockTableId tableId, LOCKTAG * tag, LOCKT lockt,
* WRITE conflict between the tuple's intent lock and the relation's
* write lock.
*/
-static int MultiConflicts[] = {
+static int MultiConflicts[] = {
(int) NULL,
/* All reads and writes at any level conflict with a write lock */
(1 << WRITE_LOCK) | (1 << WRITE_INTENT) | (1 << READ_LOCK) | (1 << READ_INTENT),
@@ -65,7 +65,7 @@ static int MultiConflicts[] = {
* write locks have higher priority than read locks and extend locks. May
* want to treat INTENT locks differently.
*/
-static int MultiPrios[] = {
+static int MultiPrios[] = {
(int) NULL,
2,
1,
@@ -78,8 +78,8 @@ static int MultiPrios[] = {
* Lock table identifier for this lock table. The multi-level
* lock table is ONE lock table, not three.
*/
-LockTableId MultiTableId = (LockTableId) NULL;
-LockTableId ShortTermTableId = (LockTableId) NULL;
+LockTableId MultiTableId = (LockTableId) NULL;
+LockTableId ShortTermTableId = (LockTableId) NULL;
/*
* Create the lock table described by MultiConflicts and Multiprio.
@@ -87,7 +87,7 @@ LockTableId ShortTermTableId = (LockTableId) NULL;
LockTableId
InitMultiLevelLockm()
{
- int tableId;
+ int tableId;
/* -----------------------
* If we're already initialized just return the table id.
@@ -122,7 +122,7 @@ InitMultiLevelLockm()
bool
MultiLockReln(LockInfo linfo, LOCKT lockt)
{
- LOCKTAG tag;
+ LOCKTAG tag;
/*
* LOCKTAG has two bytes of padding, unfortunately. The hash function
@@ -145,7 +145,7 @@ MultiLockReln(LockInfo linfo, LOCKT lockt)
bool
MultiLockTuple(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt)
{
- LOCKTAG tag;
+ LOCKTAG tag;
/*
* LOCKTAG has two bytes of padding, unfortunately. The hash function
@@ -167,7 +167,7 @@ MultiLockTuple(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt)
bool
MultiLockPage(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt)
{
- LOCKTAG tag;
+ LOCKTAG tag;
/*
* LOCKTAG has two bytes of padding, unfortunately. The hash function
@@ -197,18 +197,18 @@ MultiLockPage(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt)
* Returns: TRUE if lock is set, FALSE if not
* Side Effects:
*/
-static bool
+static bool
MultiAcquire(LockTableId tableId,
LOCKTAG * tag,
LOCKT lockt,
LOCK_LEVEL level)
{
- LOCKT locks[N_LEVELS];
- int i,
- status;
- LOCKTAG xxTag,
- *tmpTag = &xxTag;
- int retStatus = TRUE;
+ LOCKT locks[N_LEVELS];
+ int i,
+ status;
+ LOCKTAG xxTag,
+ *tmpTag = &xxTag;
+ int retStatus = TRUE;
/*
* Three levels implemented. If we set a low level (e.g. Tuple) lock,
@@ -221,24 +221,24 @@ MultiAcquire(LockTableId tableId,
*/
switch (level)
{
- case RELN_LEVEL:
- locks[0] = lockt;
- locks[1] = NO_LOCK;
- locks[2] = NO_LOCK;
- break;
- case PAGE_LEVEL:
- locks[0] = lockt + INTENT;
- locks[1] = lockt;
- locks[2] = NO_LOCK;
- break;
- case TUPLE_LEVEL:
- locks[0] = lockt + INTENT;
- locks[1] = lockt + INTENT;
- locks[2] = lockt;
- break;
- default:
- elog(WARN, "MultiAcquire: bad lock level");
- return (FALSE);
+ case RELN_LEVEL:
+ locks[0] = lockt;
+ locks[1] = NO_LOCK;
+ locks[2] = NO_LOCK;
+ break;
+ case PAGE_LEVEL:
+ locks[0] = lockt + INTENT;
+ locks[1] = lockt;
+ locks[2] = NO_LOCK;
+ break;
+ case TUPLE_LEVEL:
+ locks[0] = lockt + INTENT;
+ locks[1] = lockt + INTENT;
+ locks[2] = lockt;
+ break;
+ default:
+ elog(WARN, "MultiAcquire: bad lock level");
+ return (FALSE);
}
/*
@@ -257,30 +257,30 @@ MultiAcquire(LockTableId tableId,
{
switch (i)
{
- case RELN_LEVEL:
- /* -------------
- * Set the block # and offset to invalid
- * -------------
- */
- BlockIdSet(&(tmpTag->tupleId.ip_blkid), InvalidBlockNumber);
- tmpTag->tupleId.ip_posid = InvalidOffsetNumber;
- break;
- case PAGE_LEVEL:
- /* -------------
- * Copy the block #, set the offset to invalid
- * -------------
- */
- BlockIdCopy(&(tmpTag->tupleId.ip_blkid),
- &(tag->tupleId.ip_blkid));
- tmpTag->tupleId.ip_posid = InvalidOffsetNumber;
- break;
- case TUPLE_LEVEL:
- /* --------------
- * Copy the entire tuple id.
- * --------------
- */
- ItemPointerCopy(&tmpTag->tupleId, &tag->tupleId);
- break;
+ case RELN_LEVEL:
+ /* -------------
+ * Set the block # and offset to invalid
+ * -------------
+ */
+ BlockIdSet(&(tmpTag->tupleId.ip_blkid), InvalidBlockNumber);
+ tmpTag->tupleId.ip_posid = InvalidOffsetNumber;
+ break;
+ case PAGE_LEVEL:
+ /* -------------
+ * Copy the block #, set the offset to invalid
+ * -------------
+ */
+ BlockIdCopy(&(tmpTag->tupleId.ip_blkid),
+ &(tag->tupleId.ip_blkid));
+ tmpTag->tupleId.ip_posid = InvalidOffsetNumber;
+ break;
+ case TUPLE_LEVEL:
+ /* --------------
+ * Copy the entire tuple id.
+ * --------------
+ */
+ ItemPointerCopy(&tmpTag->tupleId, &tag->tupleId);
+ break;
}
status = LockAcquire(tableId, tmpTag, locks[i]);
@@ -311,7 +311,7 @@ MultiAcquire(LockTableId tableId,
bool
MultiReleasePage(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt)
{
- LOCKTAG tag;
+ LOCKTAG tag;
/* ------------------
* LOCKTAG has two bytes of padding, unfortunately. The
@@ -337,7 +337,7 @@ MultiReleasePage(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt)
bool
MultiReleaseReln(LockInfo linfo, LOCKT lockt)
{
- LOCKTAG tag;
+ LOCKTAG tag;
/* ------------------
* LOCKTAG has two bytes of padding, unfortunately. The
@@ -357,40 +357,40 @@ MultiReleaseReln(LockInfo linfo, LOCKT lockt)
*
* Returns: TRUE if successful, FALSE otherwise.
*/
-static bool
+static bool
MultiRelease(LockTableId tableId,
LOCKTAG * tag,
LOCKT lockt,
LOCK_LEVEL level)
{
- LOCKT locks[N_LEVELS];
- int i,
- status;
- LOCKTAG xxTag,
- *tmpTag = &xxTag;
+ LOCKT locks[N_LEVELS];
+ int i,
+ status;
+ LOCKTAG xxTag,
+ *tmpTag = &xxTag;
/*
* same level scheme as MultiAcquire().
*/
switch (level)
{
- case RELN_LEVEL:
- locks[0] = lockt;
- locks[1] = NO_LOCK;
- locks[2] = NO_LOCK;
- break;
- case PAGE_LEVEL:
- locks[0] = lockt + INTENT;
- locks[1] = lockt;
- locks[2] = NO_LOCK;
- break;
- case TUPLE_LEVEL:
- locks[0] = lockt + INTENT;
- locks[1] = lockt + INTENT;
- locks[2] = lockt;
- break;
- default:
- elog(WARN, "MultiRelease: bad lockt");
+ case RELN_LEVEL:
+ locks[0] = lockt;
+ locks[1] = NO_LOCK;
+ locks[2] = NO_LOCK;
+ break;
+ case PAGE_LEVEL:
+ locks[0] = lockt + INTENT;
+ locks[1] = lockt;
+ locks[2] = NO_LOCK;
+ break;
+ case TUPLE_LEVEL:
+ locks[0] = lockt + INTENT;
+ locks[1] = lockt + INTENT;
+ locks[2] = lockt;
+ break;
+ default:
+ elog(WARN, "MultiRelease: bad lockt");
}
/*
@@ -411,26 +411,26 @@ MultiRelease(LockTableId tableId,
{
switch (i)
{
- case RELN_LEVEL:
- /* -------------
- * Set the block # and offset to invalid
- * -------------
- */
- BlockIdSet(&(tmpTag->tupleId.ip_blkid), InvalidBlockNumber);
- tmpTag->tupleId.ip_posid = InvalidOffsetNumber;
- break;
- case PAGE_LEVEL:
- /* -------------
- * Copy the block #, set the offset to invalid
- * -------------
- */
- BlockIdCopy(&(tmpTag->tupleId.ip_blkid),
- &(tag->tupleId.ip_blkid));
- tmpTag->tupleId.ip_posid = InvalidOffsetNumber;
- break;
- case TUPLE_LEVEL:
- ItemPointerCopy(&tmpTag->tupleId, &tag->tupleId);
- break;
+ case RELN_LEVEL:
+ /* -------------
+ * Set the block # and offset to invalid
+ * -------------
+ */
+ BlockIdSet(&(tmpTag->tupleId.ip_blkid), InvalidBlockNumber);
+ tmpTag->tupleId.ip_posid = InvalidOffsetNumber;
+ break;
+ case PAGE_LEVEL:
+ /* -------------
+ * Copy the block #, set the offset to invalid
+ * -------------
+ */
+ BlockIdCopy(&(tmpTag->tupleId.ip_blkid),
+ &(tag->tupleId.ip_blkid));
+ tmpTag->tupleId.ip_posid = InvalidOffsetNumber;
+ break;
+ case TUPLE_LEVEL:
+ ItemPointerCopy(&tmpTag->tupleId, &tag->tupleId);
+ break;
}
status = LockRelease(tableId, tmpTag, locks[i]);
if (!status)
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index e3872091df..ddcb4ac724 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.19 1997/09/07 04:49:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.20 1997/09/08 02:29:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -46,7 +46,7 @@
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
*
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.19 1997/09/07 04:49:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.20 1997/09/08 02:29:17 momjian Exp $
*/
#include <sys/time.h>
#include <unistd.h>
@@ -76,8 +76,8 @@
#include "storage/spin.h"
#include "storage/proc.h"
-static void HandleDeadLock(int sig);
-static PROC *ProcWakeup(PROC * proc, int errType);
+static void HandleDeadLock(int sig);
+static PROC *ProcWakeup(PROC * proc, int errType);
/*
* timeout (in seconds) for resolving possible deadlock
@@ -93,21 +93,21 @@ static PROC *ProcWakeup(PROC * proc, int errType);
* memory. -mer 17 July 1991
* --------------------
*/
-SPINLOCK ProcStructLock;
+SPINLOCK ProcStructLock;
/*
* For cleanup routines. Don't cleanup if the initialization
* has not happened.
*/
-static bool ProcInitialized = FALSE;
+static bool ProcInitialized = FALSE;
static PROC_HDR *ProcGlobal = NULL;
-PROC *MyProc = NULL;
+PROC *MyProc = NULL;
-static void ProcKill(int exitStatus, int pid);
-static void ProcGetNewSemKeyAndNum(IPCKey * key, int *semNum);
-static void ProcFreeSem(IpcSemaphoreKey semKey, int semNum);
+static void ProcKill(int exitStatus, int pid);
+static void ProcGetNewSemKeyAndNum(IPCKey * key, int *semNum);
+static void ProcFreeSem(IpcSemaphoreKey semKey, int semNum);
/*
* InitProcGlobal -
@@ -120,7 +120,7 @@ static void ProcFreeSem(IpcSemaphoreKey semKey, int semNum);
void
InitProcGlobal(IPCKey key)
{
- bool found = false;
+ bool found = false;
/* attach to the free list */
ProcGlobal = (PROC_HDR *)
@@ -132,7 +132,7 @@ InitProcGlobal(IPCKey key)
*/
if (!found)
{
- int i;
+ int i;
ProcGlobal->numProcs = 0;
ProcGlobal->freeProcs = INVALID_OFFSET;
@@ -150,11 +150,11 @@ InitProcGlobal(IPCKey key)
void
InitProcess(IPCKey key)
{
- bool found = false;
- int pid;
- int semstat;
- unsigned long location,
- myOffset;
+ bool found = false;
+ int pid;
+ int semstat;
+ unsigned long location,
+ myOffset;
/* ------------------
* Routine called if deadlock timer goes off. See ProcSleep()
@@ -223,10 +223,10 @@ InitProcess(IPCKey key)
if (IsUnderPostmaster)
{
- IPCKey semKey;
- int semNum;
- int semId;
- union semun semun;
+ IPCKey semKey;
+ int semNum;
+ int semId;
+ union semun semun;
ProcGetNewSemKeyAndNum(&semKey, &semNum);
@@ -318,8 +318,8 @@ ProcReleaseLocks()
bool
ProcRemove(int pid)
{
- SHMEM_OFFSET location;
- PROC *proc;
+ SHMEM_OFFSET location;
+ PROC *proc;
location = INVALID_OFFSET;
@@ -347,8 +347,8 @@ ProcRemove(int pid)
static void
ProcKill(int exitStatus, int pid)
{
- PROC *proc;
- SHMEM_OFFSET location;
+ PROC *proc;
+ SHMEM_OFFSET location;
/* --------------------
* If this is a FATAL exit the postmaster will have to kill all the
@@ -417,11 +417,11 @@ ProcKill(int exitStatus, int pid)
* Side Effects: Initializes the queue if we allocated one
*/
#ifdef NOT_USED
-PROC_QUEUE *
+PROC_QUEUE *
ProcQueueAlloc(char *name)
{
- bool found;
- PROC_QUEUE *queue = (PROC_QUEUE *)
+ bool found;
+ PROC_QUEUE *queue = (PROC_QUEUE *)
ShmemInitStruct(name, (unsigned) sizeof(PROC_QUEUE), &found);
if (!queue)
@@ -468,10 +468,10 @@ ProcSleep(PROC_QUEUE * queue,
int prio,
LOCK * lock)
{
- int i;
- PROC *proc;
+ int i;
+ PROC *proc;
struct itimerval timeval,
- dummy;
+ dummy;
proc = (PROC *) MAKE_PTR(queue->links.prev);
for (i = 0; i < queue->size; i++)
@@ -555,10 +555,10 @@ ProcSleep(PROC_QUEUE * queue,
* remove the process from the wait queue and set its links invalid.
* RETURN: the next process in the wait queue.
*/
-static PROC *
+static PROC *
ProcWakeup(PROC * proc, int errType)
{
- PROC *retProc;
+ PROC *retProc;
/* assume that spinlock has been acquired */
@@ -599,8 +599,8 @@ ProcGetId()
int
ProcLockWakeup(PROC_QUEUE * queue, char *ltable, char *lock)
{
- PROC *proc;
- int count;
+ PROC *proc;
+ int count;
if (!queue->size)
return (STATUS_NOT_FOUND);
@@ -659,8 +659,8 @@ ProcAddLock(SHM_QUEUE * elem)
static void
HandleDeadLock(int sig)
{
- LOCK *lock;
- int size;
+ LOCK *lock;
+ int size;
LockLockTable();
@@ -743,7 +743,7 @@ HandleDeadLock(int sig)
void
ProcReleaseSpins(PROC * proc)
{
- int i;
+ int i;
if (!proc)
proc = MyProc;
@@ -774,9 +774,9 @@ ProcReleaseSpins(PROC * proc)
static void
ProcGetNewSemKeyAndNum(IPCKey * key, int *semNum)
{
- int i;
- int32 *freeSemMap = ProcGlobal->freeSemMap;
- unsigned int fullmask;
+ int i;
+ int32 *freeSemMap = ProcGlobal->freeSemMap;
+ unsigned int fullmask;
/*
* we hold ProcStructLock when entering this routine. We scan through
@@ -785,8 +785,8 @@ ProcGetNewSemKeyAndNum(IPCKey * key, int *semNum)
fullmask = ~0 >> (32 - PROC_NSEMS_PER_SET);
for (i = 0; i < MAX_PROC_SEMS / PROC_NSEMS_PER_SET; i++)
{
- int mask = 1;
- int j;
+ int mask = 1;
+ int j;
if (freeSemMap[i] == fullmask)
continue; /* none free for this set */
@@ -821,9 +821,9 @@ ProcGetNewSemKeyAndNum(IPCKey * key, int *semNum)
static void
ProcFreeSem(IpcSemaphoreKey semKey, int semNum)
{
- int mask;
- int i;
- int32 *freeSemMap = ProcGlobal->freeSemMap;
+ int mask;
+ int i;
+ int32 *freeSemMap = ProcGlobal->freeSemMap;
i = semKey - ProcGlobal->currKey;
mask = ~(1 << semNum);
@@ -841,8 +841,8 @@ ProcFreeSem(IpcSemaphoreKey semKey, int semNum)
void
ProcFreeAllSemaphores()
{
- int i;
- int32 *freeSemMap = ProcGlobal->freeSemMap;
+ int i;
+ int32 *freeSemMap = ProcGlobal->freeSemMap;
for (i = 0; i < MAX_PROC_SEMS / PROC_NSEMS_PER_SET; i++)
{
diff --git a/src/backend/storage/lmgr/single.c b/src/backend/storage/lmgr/single.c
index 8022036843..9e33b36617 100644
--- a/src/backend/storage/lmgr/single.c
+++ b/src/backend/storage/lmgr/single.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/single.c,v 1.3 1997/09/07 04:49:04 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/single.c,v 1.4 1997/09/08 02:29:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -34,7 +34,7 @@
bool
SingleLockReln(LockInfo linfo, LOCKT lockt, int action)
{
- LOCKTAG tag;
+ LOCKTAG tag;
/*
* LOCKTAG has two bytes of padding, unfortunately. The hash function
@@ -66,7 +66,7 @@ SingleLockPage(LockInfo linfo,
LOCKT lockt,
int action)
{
- LOCKTAG tag;
+ LOCKTAG tag;
/*
* LOCKTAG has two bytes of padding, unfortunately. The hash function