mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Remove un-needed braces around single statements.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_table.c,v 1.10 1998/01/07 21:04:47 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_table.c,v 1.11 1998/06/15 19:29:09 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -91,9 +91,7 @@ BufTableLookup(BufferTag *tagPtr)
|
||||
return (NULL);
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
return (&(BufferDescriptors[result->id]));
|
||||
}
|
||||
|
||||
@@ -111,9 +109,7 @@ BufTableDelete(BufferDesc *buf)
|
||||
* BM_DELETED keeps us from removing buffer twice.
|
||||
*/
|
||||
if (buf->flags & BM_DELETED)
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
buf->flags |= BM_DELETED;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.37 1998/04/24 14:42:16 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.38 1998/06/15 19:29:09 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -137,9 +137,7 @@ RelationGetBufferWithBuffer(Relation relation,
|
||||
bufHdr = &LocalBufferDescriptors[-buffer - 1];
|
||||
if (bufHdr->tag.relId.relId == relation->rd_id &&
|
||||
bufHdr->tag.blockNum == blockNumber)
|
||||
{
|
||||
return (buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
return (ReadBuffer(relation, blockNumber));
|
||||
@@ -258,9 +256,7 @@ ReadBufferWithBufferLock(Relation reln,
|
||||
}
|
||||
|
||||
if (!bufHdr)
|
||||
{
|
||||
return (InvalidBuffer);
|
||||
}
|
||||
|
||||
/* if its already in the buffer pool, we're done */
|
||||
if (found)
|
||||
@@ -534,9 +530,7 @@ BufferAlloc(Relation reln,
|
||||
buf->tag.blockNum, buf->sb_relname);
|
||||
}
|
||||
else
|
||||
{
|
||||
buf->flags &= ~BM_DIRTY;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -607,9 +601,7 @@ BufferAlloc(Relation reln,
|
||||
{
|
||||
WaitIO(buf2, BufMgrLock);
|
||||
if (buf2->flags & BM_IO_ERROR)
|
||||
{
|
||||
*foundPtr = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
SpinRelease(BufMgrLock);
|
||||
@@ -697,9 +689,7 @@ WriteBuffer(Buffer buffer)
|
||||
BufferDesc *bufHdr;
|
||||
|
||||
if (WriteMode == BUFFER_FLUSH_WRITE)
|
||||
{
|
||||
return (FlushBuffer(buffer, TRUE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -852,9 +842,7 @@ FlushBuffer(Buffer buffer, bool release)
|
||||
bufHdr->tag.blockNum, bufHdr->sb_relname);
|
||||
}
|
||||
else
|
||||
{
|
||||
bufHdr->flags &= ~BM_DIRTY;
|
||||
}
|
||||
if (release)
|
||||
UnpinBuffer(bufHdr);
|
||||
SpinRelease(BufMgrLock);
|
||||
@@ -877,9 +865,7 @@ WriteNoReleaseBuffer(Buffer buffer)
|
||||
BufferDesc *bufHdr;
|
||||
|
||||
if (WriteMode == BUFFER_FLUSH_WRITE)
|
||||
{
|
||||
return (FlushBuffer(buffer, FALSE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1205,9 +1191,7 @@ ResetBufferPool()
|
||||
if (BufferIsValid(i))
|
||||
{
|
||||
while (PrivateRefCount[i - 1] > 0)
|
||||
{
|
||||
ReleaseBuffer(i);
|
||||
}
|
||||
}
|
||||
LastRefCount[i - 1] = 0;
|
||||
}
|
||||
@@ -1418,9 +1402,7 @@ ReleaseRelationBuffers(Relation rdesc)
|
||||
buf = &LocalBufferDescriptors[i];
|
||||
if ((buf->flags & BM_DIRTY) &&
|
||||
(buf->tag.relId.relId == rdesc->rd_id))
|
||||
{
|
||||
buf->flags &= ~BM_DIRTY;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1472,9 +1454,7 @@ DropBuffers(Oid dbid)
|
||||
{
|
||||
buf = &BufferDescriptors[i - 1];
|
||||
if ((buf->tag.relId.dbId == dbid) && (buf->flags & BM_DIRTY))
|
||||
{
|
||||
buf->flags &= ~BM_DIRTY;
|
||||
}
|
||||
}
|
||||
SpinRelease(BufMgrLock);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/freelist.c,v 1.10 1998/06/15 18:39:28 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/freelist.c,v 1.11 1998/06/15 19:29:10 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -105,9 +105,7 @@ PinBuffer(BufferDesc *buf)
|
||||
buf->flags &= ~BM_FREE;
|
||||
}
|
||||
else
|
||||
{
|
||||
NotInQueue(buf);
|
||||
}
|
||||
|
||||
b = BufferDescriptorGetBuffer(buf) - 1;
|
||||
Assert(PrivateRefCount[b] >= 0);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Id: fd.c,v 1.31 1998/04/05 21:04:27 momjian Exp $
|
||||
* $Id: fd.c,v 1.32 1998/06/15 19:29:11 momjian Exp $
|
||||
*
|
||||
* NOTES:
|
||||
*
|
||||
@@ -533,9 +533,7 @@ FileInvalidate(File file)
|
||||
{
|
||||
Assert(file > 0);
|
||||
if (!FileIsNotOpen(file))
|
||||
{
|
||||
LruDelete(file);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -583,9 +581,7 @@ tryAgain:
|
||||
Insert(file);
|
||||
|
||||
if (fileName == NULL)
|
||||
{
|
||||
elog(ERROR, "fileNameOpenFile: NULL fname");
|
||||
}
|
||||
vfdP->fileName = malloc(strlen(fileName) + 1);
|
||||
strcpy(vfdP->fileName, fileName);
|
||||
|
||||
@@ -709,9 +705,7 @@ FileRead(File file, char *buffer, int amount)
|
||||
FileAccess(file);
|
||||
returnCode = read(VfdCache[file].fd, buffer, amount);
|
||||
if (returnCode > 0)
|
||||
{
|
||||
VfdCache[file].seekPos += returnCode;
|
||||
}
|
||||
|
||||
return returnCode;
|
||||
}
|
||||
@@ -815,9 +809,7 @@ FileSync(File file)
|
||||
*/
|
||||
|
||||
if (VfdCache[file].fd < 0 || !(VfdCache[file].fdstate & FD_DIRTY))
|
||||
{
|
||||
returnCode = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
returnCode = fsync(VfdCache[file].fd);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.21 1998/05/29 17:00:10 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.22 1998/06/15 19:29:13 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -310,9 +310,7 @@ IpcSemaphoreCreate(IpcSemaphoreKey semKey,
|
||||
exitpg(3);
|
||||
}
|
||||
for (i = 0; i < semNum; i++)
|
||||
{
|
||||
array[i] = semStartValue;
|
||||
}
|
||||
semun.array = array;
|
||||
errStatus = semctl(semId, 0, SETALL, semun);
|
||||
if (errStatus == -1)
|
||||
@@ -513,9 +511,7 @@ IpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission)
|
||||
shmid = PrivateMemoryCreate(memKey, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
shmid = shmget(memKey, size, IPC_CREAT | permission);
|
||||
}
|
||||
|
||||
if (shmid < 0)
|
||||
{
|
||||
@@ -564,9 +560,7 @@ static void
|
||||
IpcMemoryDetach(int status, char *shmaddr)
|
||||
{
|
||||
if (shmdt(shmaddr) < 0)
|
||||
{
|
||||
elog(NOTICE, "IpcMemoryDetach: shmdt(0x%x): %m", shmaddr);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@@ -582,13 +576,9 @@ IpcMemoryAttach(IpcMemoryId memId)
|
||||
char *memAddress;
|
||||
|
||||
if (UsePrivateMemory)
|
||||
{
|
||||
memAddress = (char *) PrivateMemoryAttach(memId);
|
||||
}
|
||||
else
|
||||
{
|
||||
memAddress = (char *) shmat(memId, 0, 0);
|
||||
}
|
||||
|
||||
/* if ( *memAddress == -1) { XXX ??? */
|
||||
if (memAddress == (char *) -1)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.19 1998/05/26 17:29:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.20 1998/06/15 19:29:14 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -189,18 +189,14 @@ InitShmem(unsigned int key, unsigned int size)
|
||||
* allocator and binding table.
|
||||
*/
|
||||
if (!InitSpinLocks(ShmemBootstrap, IPCKeyGetSpinLockSemaphoreKey(key)))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* We have just allocated additional space for two spinlocks. Now
|
||||
* setup the global free space count
|
||||
*/
|
||||
if (ShmemBootstrap)
|
||||
{
|
||||
*ShmemFreeStart = currFreeSpace;
|
||||
}
|
||||
|
||||
/* if ShmemFreeStart is NULL, then the allocator won't work */
|
||||
Assert(*ShmemFreeStart);
|
||||
@@ -256,9 +252,7 @@ InitShmem(unsigned int key, unsigned int size)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert(!ShmemBootstrap);
|
||||
}
|
||||
/* now release the lock acquired in ShmemHashInit */
|
||||
SpinRelease(BindingLock);
|
||||
|
||||
@@ -303,16 +297,12 @@ ShmemAlloc(unsigned long size)
|
||||
*ShmemFreeStart += size;
|
||||
}
|
||||
else
|
||||
{
|
||||
newSpace = NULL;
|
||||
}
|
||||
|
||||
SpinRelease(ShmemLock);
|
||||
|
||||
if (!newSpace)
|
||||
{
|
||||
elog(NOTICE, "ShmemAlloc: out of memory ");
|
||||
}
|
||||
return (newSpace);
|
||||
}
|
||||
|
||||
@@ -420,13 +410,9 @@ ShmemPIDLookup(int pid, SHMEM_OFFSET *locationPtr)
|
||||
}
|
||||
|
||||
if (found)
|
||||
{
|
||||
*locationPtr = result->location;
|
||||
}
|
||||
else
|
||||
{
|
||||
result->location = *locationPtr;
|
||||
}
|
||||
|
||||
SpinRelease(BindingLock);
|
||||
return (TRUE);
|
||||
@@ -473,9 +459,7 @@ ShmemPIDDestroy(int pid)
|
||||
if (found)
|
||||
return (location);
|
||||
else
|
||||
{
|
||||
return (INVALID_OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.9 1997/09/08 02:28:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.10 1998/06/15 19:29:15 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -49,9 +49,7 @@ CreateSharedInvalidationState(IPCKey key)
|
||||
status = SISegmentInit(true, IPCKeyGetSIBufferMemoryBlock(key));
|
||||
|
||||
if (status == -1)
|
||||
{
|
||||
elog(FATAL, "CreateSharedInvalidationState: failed segment init");
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@@ -73,9 +71,7 @@ AttachSharedInvalidationState(IPCKey key)
|
||||
status = SISegmentInit(false, IPCKeyGetSIBufferMemoryBlock(key));
|
||||
|
||||
if (status == -1)
|
||||
{
|
||||
elog(FATAL, "AttachSharedInvalidationState: failed segment init");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -126,13 +122,9 @@ RegisterSharedInvalid(int cacheId, /* XXX */
|
||||
newInvalid.hashIndex = hashIndex;
|
||||
|
||||
if (ItemPointerIsValid(pointer))
|
||||
{
|
||||
ItemPointerCopy(pointer, &newInvalid.pointerData);
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemPointerSetInvalid(&newInvalid.pointerData);
|
||||
}
|
||||
|
||||
SpinAcquire(SInvalLock);
|
||||
if (!SISetDataEntry(shmInvalBuffer, &newInvalid))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.8 1997/09/08 21:47:15 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.9 1998/06/15 19:29:15 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -133,9 +133,7 @@ SIAssignBackendId(SISeg *segInOutP, BackendTag backendTag)
|
||||
(segInOutP->procState[index].limit <
|
||||
stateP->limit ||
|
||||
stateP->tag < backendTag)))
|
||||
{
|
||||
stateP = &segInOutP->procState[index];
|
||||
}
|
||||
}
|
||||
|
||||
/* verify that all "procState" entries checked for matching tags */
|
||||
@@ -664,9 +662,7 @@ SIReadEntryData(SISeg *segP,
|
||||
}
|
||||
/* check whether we can remove dead messages */
|
||||
if (i > MAXNUMMESSAGES)
|
||||
{
|
||||
elog(FATAL, "SIReadEntryData: Invalid segment state");
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
@@ -696,9 +692,7 @@ SIDelExpiredDataEntries(SISeg *segP)
|
||||
{
|
||||
/* this adjusts also the state limits! */
|
||||
if (!SIDelDataEntry(segP))
|
||||
{
|
||||
elog(FATAL, "SIDelExpiredDataEntries: Invalid segment state");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -779,13 +773,9 @@ SISegmentGet(int key, /* the corresponding key for the segment */
|
||||
IpcMemoryId shmid;
|
||||
|
||||
if (create)
|
||||
{
|
||||
shmid = IpcMemoryCreate(key, size, IPCProtection);
|
||||
}
|
||||
else
|
||||
{
|
||||
shmid = IpcMemoryIdGet(key, size);
|
||||
}
|
||||
return (shmid);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.10 1997/09/22 04:20:53 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.11 1998/06/15 19:29:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -157,9 +157,7 @@ SpinRelease(SPINLOCK lockid)
|
||||
S_UNLOCK(&(slckP->shlock));
|
||||
}
|
||||
else
|
||||
{
|
||||
S_UNLOCK(&(slckP->shlock));
|
||||
}
|
||||
S_UNLOCK(&(slckP->exlock));
|
||||
S_UNLOCK(&(slckP->locklock));
|
||||
#ifdef LOCKDEBUG
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.29 1998/04/27 04:06:41 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.30 1998/06/15 19:29:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -527,9 +527,7 @@ inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes)
|
||||
|
||||
/* either append or replace a block, as required */
|
||||
if (!HeapTupleIsValid(htup))
|
||||
{
|
||||
tuplen = inv_wrnew(obj_desc, buf, nbytes - nwritten);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (obj_desc->offset > obj_desc->highbyte)
|
||||
@@ -734,9 +732,7 @@ inv_wrnew(LargeObjectDesc *obj_desc, char *buf, int nbytes)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nwritten = nbytes;
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert a new file system block tuple, index it, and write it out.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.11 1998/01/07 21:05:28 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.12 1998/06/15 19:29:19 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -119,9 +119,7 @@ RelationGetLRelId(Relation relation)
|
||||
*/
|
||||
if (strcmp(RelationGetRelationName(relation)->data,
|
||||
VariableRelationName) == 0)
|
||||
{
|
||||
return (VariableRelationLRelId);
|
||||
}
|
||||
|
||||
return (linfo->lRelId);
|
||||
}
|
||||
@@ -519,9 +517,7 @@ RelationUnsetLockForWrite(Relation relation)
|
||||
*/
|
||||
Assert(RelationIsValid(relation));
|
||||
if (LockingDisabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
linfo = (LockInfo) relation->lockInfo;
|
||||
|
||||
@@ -598,9 +594,7 @@ RelationSetLockForTupleRead(Relation relation, ItemPointer itemPointer)
|
||||
curXact = GetCurrentTransactionId();
|
||||
if ((linfo->flags & ReadRelationLock) &&
|
||||
TransactionIdEquals(curXact, linfo->transactionIdData))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* If we don't already have a tuple lock this transaction
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.26 1998/02/26 04:36:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.27 1998/06/15 19:29:20 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Outside modules can create a lock table and acquire/release
|
||||
@@ -383,13 +383,9 @@ LockTabRename(LockTableId tableId)
|
||||
LockTableId newTableId;
|
||||
|
||||
if (NumTables >= MAX_TABLES)
|
||||
{
|
||||
return (INVALID_TABLEID);
|
||||
}
|
||||
if (AllTables[tableId] == INVALID_TABLEID)
|
||||
{
|
||||
return (INVALID_TABLEID);
|
||||
}
|
||||
|
||||
/* other modules refer to the lock table by a tableId */
|
||||
newTableId = NumTables;
|
||||
@@ -493,9 +489,7 @@ LockAcquire(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
|
||||
}
|
||||
|
||||
if (LockingIsDisabled)
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
LOCK_PRINT("Acquire", lockName, lockt);
|
||||
masterLock = ltable->ctl->masterLock;
|
||||
@@ -606,9 +600,7 @@ LockAcquire(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
|
||||
status = LockResolveConflicts(ltable, lock, lockt, myXid);
|
||||
|
||||
if (status == STATUS_OK)
|
||||
{
|
||||
GrantLock(lock, lockt);
|
||||
}
|
||||
else if (status == STATUS_FOUND)
|
||||
{
|
||||
#ifdef USER_LOCKS
|
||||
@@ -757,9 +749,7 @@ LockResolveConflicts(LOCKTAB *ltable,
|
||||
for (i = 1; i <= nLockTypes; i++, tmpMask <<= 1)
|
||||
{
|
||||
if (lock->activeHolders[i] != myHolders[i])
|
||||
{
|
||||
bitmask |= tmpMask;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------
|
||||
@@ -873,9 +863,7 @@ LockRelease(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
|
||||
}
|
||||
|
||||
if (LockingIsDisabled)
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
LOCK_PRINT("Release", lockName, lockt);
|
||||
|
||||
@@ -997,13 +985,9 @@ LockRelease(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
|
||||
SpinRelease(masterLock);
|
||||
#ifdef USER_LOCKS
|
||||
if ((is_user_lock) && (result))
|
||||
{
|
||||
elog(NOTICE, "LockRelease: you don't have a lock on this tag");
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(NOTICE, "LockRelease: find xid, table corrupted");
|
||||
}
|
||||
#else
|
||||
elog(NOTICE, "LockReplace: xid table corrupted");
|
||||
#endif
|
||||
@@ -1027,13 +1011,9 @@ LockRelease(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
|
||||
{
|
||||
#ifdef USER_LOCKS
|
||||
if (result->queue.prev == INVALID_OFFSET)
|
||||
{
|
||||
elog(NOTICE, "LockRelease: xid.prev == INVALID_OFFSET");
|
||||
}
|
||||
if (result->queue.next == INVALID_OFFSET)
|
||||
{
|
||||
elog(NOTICE, "LockRelease: xid.next == INVALID_OFFSET");
|
||||
}
|
||||
#endif
|
||||
if (result->queue.next != INVALID_OFFSET)
|
||||
SHMQueueDelete(&result->queue);
|
||||
@@ -1165,9 +1145,7 @@ LockReleaseAll(LockTableId tableId, SHM_QUEUE *lockQueue)
|
||||
elog(NOTICE, "LockReleaseAll: tableId=%d, pid=%d", tableId, MyProcPid);
|
||||
#endif
|
||||
if (is_user_lock_table)
|
||||
{
|
||||
tableId = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
Assert(tableId < NumTables);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.11 1998/01/23 19:53:40 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.12 1998/06/15 19:29:21 momjian Exp $
|
||||
*
|
||||
* NOTES:
|
||||
* (1) The lock.c module assumes that the caller here is doing
|
||||
@@ -99,9 +99,7 @@ InitMultiLevelLockm()
|
||||
tableId = LockTabInit("LockTable", MultiConflicts, MultiPrios, 5);
|
||||
MultiTableId = tableId;
|
||||
if (!(MultiTableId))
|
||||
{
|
||||
elog(ERROR, "InitMultiLockm: couldnt initialize lock table");
|
||||
}
|
||||
/* -----------------------
|
||||
* No short term lock table for now. -Jeff 15 July 1991
|
||||
*
|
||||
@@ -434,9 +432,7 @@ MultiRelease(LockTableId tableId,
|
||||
}
|
||||
status = LockRelease(tableId, tmpTag, locks[i]);
|
||||
if (!status)
|
||||
{
|
||||
elog(ERROR, "MultiRelease: couldn't release after error");
|
||||
}
|
||||
}
|
||||
}
|
||||
/* shouldn't reach here */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.34 1998/02/26 04:36:12 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.35 1998/06/15 19:29:21 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.34 1998/02/26 04:36:12 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.35 1998/06/15 19:29:21 momjian Exp $
|
||||
*/
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
@@ -239,9 +239,7 @@ InitProcess(IPCKey key)
|
||||
MyProc->sem.semKey = semKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
MyProc->sem.semId = -1;
|
||||
}
|
||||
|
||||
/* ----------------------
|
||||
* Release the lock.
|
||||
@@ -271,9 +269,7 @@ InitProcess(IPCKey key)
|
||||
*/
|
||||
location = MAKE_OFFSET(MyProc);
|
||||
if ((!ShmemPIDLookup(MyProcPid, &location)) || (location != MAKE_OFFSET(MyProc)))
|
||||
{
|
||||
elog(FATAL, "InitProc: ShmemPID table broken");
|
||||
}
|
||||
|
||||
MyProc->errType = NO_ERROR;
|
||||
SHMQueueElemInit(&(MyProc->links));
|
||||
@@ -353,12 +349,9 @@ ProcKill(int exitStatus, int pid)
|
||||
|
||||
proc = (PROC *) MAKE_PTR(location);
|
||||
|
||||
if (proc != MyProc)
|
||||
{
|
||||
Assert(pid != MyProcPid);
|
||||
}
|
||||
else
|
||||
MyProc = NULL;
|
||||
Assert(proc == MyProc || pid != MyProcPid);
|
||||
|
||||
MyProc = NULL;
|
||||
|
||||
/* ---------------
|
||||
* Assume one lock table.
|
||||
@@ -408,13 +401,9 @@ ProcQueueAlloc(char *name)
|
||||
ShmemInitStruct(name, (unsigned) sizeof(PROC_QUEUE), &found);
|
||||
|
||||
if (!queue)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
ProcQueueInit(queue);
|
||||
}
|
||||
return (queue);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.17 1998/04/24 14:42:27 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.18 1998/06/15 19:29:21 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -161,9 +161,7 @@ PageAddItem(Page page,
|
||||
upper = ((PageHeader) page)->pd_upper - alignedSize;
|
||||
|
||||
if (lower > upper)
|
||||
{
|
||||
return (InvalidOffsetNumber);
|
||||
}
|
||||
|
||||
itemId = &((PageHeader) page)->pd_linp[offsetNumber - 1];
|
||||
(*itemId).lp_off = upper;
|
||||
@@ -342,9 +340,7 @@ PageGetFreeSpace(Page page)
|
||||
space = ((PageHeader) page)->pd_upper - ((PageHeader) page)->pd_lower;
|
||||
|
||||
if (space < sizeof(ItemIdData))
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
space -= sizeof(ItemIdData);/* XXX not always true */
|
||||
|
||||
return (space);
|
||||
@@ -464,8 +460,6 @@ PageIndexTupleDeleteAdjustLinePointers(PageHeader phdr,
|
||||
for (i = PageGetMaxOffsetNumber((Page) phdr) - 1; i >= 0; i--)
|
||||
{
|
||||
if (phdr->pd_linp[i].lp_off <= offset)
|
||||
{
|
||||
phdr->pd_linp[i].lp_off += size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.30 1998/03/20 04:22:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.31 1998/06/15 19:29:23 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -227,9 +227,7 @@ mdunlink(Relation reln)
|
||||
#else
|
||||
v = &Md_fdvec[fd];
|
||||
if (v != (MdfdVec *) NULL)
|
||||
{
|
||||
FileUnlink(v->mdfd_vfd);
|
||||
}
|
||||
#endif
|
||||
MemoryContextSwitchTo(oldcxt);
|
||||
|
||||
@@ -416,21 +414,15 @@ mdread(Relation reln, BlockNumber blocknum, char *buffer)
|
||||
#endif
|
||||
|
||||
if (FileSeek(v->mdfd_vfd, seekpos, SEEK_SET) != seekpos)
|
||||
{
|
||||
return (SM_FAIL);
|
||||
}
|
||||
|
||||
status = SM_SUCCESS;
|
||||
if ((nbytes = FileRead(v->mdfd_vfd, buffer, BLCKSZ)) != BLCKSZ)
|
||||
{
|
||||
if (nbytes == 0)
|
||||
{
|
||||
MemSet(buffer, 0, BLCKSZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
status = SM_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return (status);
|
||||
@@ -461,9 +453,7 @@ mdwrite(Relation reln, BlockNumber blocknum, char *buffer)
|
||||
#endif
|
||||
|
||||
if (FileSeek(v->mdfd_vfd, seekpos, SEEK_SET) != seekpos)
|
||||
{
|
||||
return (SM_FAIL);
|
||||
}
|
||||
|
||||
status = SM_SUCCESS;
|
||||
if (FileWrite(v->mdfd_vfd, buffer, BLCKSZ) != BLCKSZ)
|
||||
@@ -500,9 +490,7 @@ mdflush(Relation reln, BlockNumber blocknum, char *buffer)
|
||||
#endif
|
||||
|
||||
if (FileSeek(v->mdfd_vfd, seekpos, SEEK_SET) != seekpos)
|
||||
{
|
||||
return (SM_FAIL);
|
||||
}
|
||||
|
||||
/* write and sync the block */
|
||||
status = SM_SUCCESS;
|
||||
@@ -705,9 +693,7 @@ mdnblocks(Relation reln)
|
||||
v = v->mdfd_chain;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ((segno * RELSEG_SIZE) + nblocks);
|
||||
}
|
||||
}
|
||||
#else
|
||||
return (_mdnblocks(v->mdfd_vfd, BLCKSZ));
|
||||
@@ -805,9 +791,7 @@ mdabort()
|
||||
v = &Md_fdvec[i];
|
||||
if (v != (MdfdVec *) NULL)
|
||||
#endif
|
||||
{
|
||||
v->mdfd_flags &= ~MDFD_DIRTY;
|
||||
}
|
||||
}
|
||||
|
||||
return (SM_SUCCESS);
|
||||
|
||||
Reference in New Issue
Block a user