diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-09-01 04:40:42 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-09-01 04:40:42 +0000 |
commit | fa1a8d6a97068295fe30ac646aec7493a6305bc2 (patch) | |
tree | 645f7cef3c78fbab4d6d7bbc7c9a61ad2893d273 /src/include/storage | |
parent | af74855a608da4cd7ef88ceb2241ec1c75537f39 (diff) | |
download | postgresql-fa1a8d6a97068295fe30ac646aec7493a6305bc2.tar.gz |
OK, folks, here is the pgindent output.
Diffstat (limited to 'src/include/storage')
27 files changed, 184 insertions, 198 deletions
diff --git a/src/include/storage/backendid.h b/src/include/storage/backendid.h index 25be9a4fdc..35a4130782 100644 --- a/src/include/storage/backendid.h +++ b/src/include/storage/backendid.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: backendid.h,v 1.4 1997/09/08 02:38:53 momjian Exp $ + * $Id: backendid.h,v 1.5 1998/09/01 04:38:06 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -29,4 +29,4 @@ typedef int32 BackendTag; /* unique backend identifier */ extern BackendId MyBackendId; /* backend id of this backend */ extern BackendTag MyBackendTag; /* backend tag of this backend */ -#endif /* BACKENDID_H */ +#endif /* BACKENDID_H */ diff --git a/src/include/storage/block.h b/src/include/storage/block.h index 17b9378688..1f31fadfee 100644 --- a/src/include/storage/block.h +++ b/src/include/storage/block.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: block.h,v 1.6 1998/06/15 18:40:00 momjian Exp $ + * $Id: block.h,v 1.7 1998/09/01 04:38:08 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -115,4 +115,4 @@ typedef BlockIdData *BlockId; /* block identifier */ (BlockNumber) (((blockId)->bi_hi << 16) | ((uint16) (blockId)->bi_lo)) \ ) -#endif /* BLOCK_H */ +#endif /* BLOCK_H */ diff --git a/src/include/storage/buf.h b/src/include/storage/buf.h index 86288cb345..9b19fa279b 100644 --- a/src/include/storage/buf.h +++ b/src/include/storage/buf.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: buf.h,v 1.3 1997/09/08 02:38:56 momjian Exp $ + * $Id: buf.h,v 1.4 1998/09/01 04:38:09 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -44,4 +44,4 @@ typedef long Buffer; */ #undef NO_BUFFERISVALID -#endif /* BUF_H */ +#endif /* BUF_H */ diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h index 03d249195d..61f567b6d3 100644 --- a/src/include/storage/buf_internals.h +++ b/src/include/storage/buf_internals.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: buf_internals.h,v 1.25 1998/08/01 15:26:34 vadim Exp $ + * $Id: buf_internals.h,v 1.26 1998/09/01 04:38:10 momjian Exp $ * * NOTE * If BUFFERPAGE0 is defined, then 0 will be used as a @@ -51,7 +51,7 @@ typedef long **BufferBlock; struct buftag { - LockRelId relId; + LockRelId relId; BlockNumber blockNum; /* blknum relative to begin of reln */ }; @@ -101,7 +101,7 @@ struct sbufdesc_unpadded unsigned refcount; #ifdef HAS_TEST_AND_SET slock_t io_in_progress_lock; -#endif /* HAS_TEST_AND_SET */ +#endif /* HAS_TEST_AND_SET */ char sb_dbname[NAMEDATALEN]; /* NOTE NO PADDING OF THE MEMBER HERE */ @@ -125,7 +125,7 @@ struct sbufdesc #ifdef HAS_TEST_AND_SET /* can afford a dedicated lock if test-and-set locks are available */ slock_t io_in_progress_lock; -#endif /* HAS_TEST_AND_SET */ +#endif /* HAS_TEST_AND_SET */ char sb_dbname[NAMEDATALEN]; /* name of db in which buf belongs */ @@ -173,7 +173,7 @@ typedef struct _bmtrace } bmtrace; -#endif /* BMTRACE */ +#endif /* BMTRACE */ /* @@ -209,8 +209,7 @@ extern long *LocalRefCount; extern BufferDesc *LocalBufferDescriptors; extern int NLocBuffer; -extern BufferDesc * -LocalBufferAlloc(Relation reln, BlockNumber blockNum, +extern BufferDesc *LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr); extern int WriteLocalBuffer(Buffer buffer, bool release); extern int FlushLocalBuffer(Buffer buffer, bool release); @@ -218,4 +217,4 @@ extern void InitLocalBuffer(void); extern void LocalBufferSync(void); extern void ResetLocalBufferPool(void); -#endif /* BUFMGR_INTERNALS_H */ +#endif /* BUFMGR_INTERNALS_H */ diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index 60acb86634..cfd4a73bc5 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: bufmgr.h,v 1.21 1998/08/19 02:03:57 momjian Exp $ + * $Id: bufmgr.h,v 1.22 1998/09/01 04:38:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -128,14 +128,12 @@ extern int ShowPinTrace; /* * prototypes for functions in bufmgr.c */ -extern Buffer -RelationGetBufferWithBuffer(Relation relation, +extern Buffer RelationGetBufferWithBuffer(Relation relation, BlockNumber blockNumber, Buffer buffer); extern Buffer ReadBuffer(Relation reln, BlockNumber blockNum); extern int WriteBuffer(Buffer buffer); extern int WriteNoReleaseBuffer(Buffer buffer); -extern Buffer -ReleaseAndReadBuffer(Buffer buffer, Relation relation, +extern Buffer ReleaseAndReadBuffer(Buffer buffer, Relation relation, BlockNumber blockNum); extern void InitBufferPool(IPCKey key); @@ -159,4 +157,4 @@ extern void BufferRefCountRestore(int *refcountsave); extern int SetBufferWriteMode(int mode); extern void SetBufferCommitInfoNeedsSave(Buffer buffer); -#endif /* !defined(BufMgrIncluded) */ +#endif /* !defined(BufMgrIncluded) */ diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 123192f914..a6c8b8e920 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: bufpage.h,v 1.19 1998/06/15 18:40:02 momjian Exp $ + * $Id: bufpage.h,v 1.20 1998/09/01 04:38:13 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -310,8 +310,7 @@ typedef enum */ extern void PageInit(Page page, Size pageSize, Size specialSize); -extern OffsetNumber -PageAddItem(Page page, Item item, Size size, +extern OffsetNumber PageAddItem(Page page, Item item, Size size, OffsetNumber offsetNumber, ItemIdFlags flags); extern Page PageGetTempPage(Page page, Size specialSize); extern void PageRestoreTempPage(Page tempPage, Page oldPage); @@ -321,4 +320,4 @@ extern void PageManagerModeSet(PageManagerMode mode); extern void PageIndexTupleDelete(Page page, OffsetNumber offset); -#endif /* BUFPAGE_H */ +#endif /* BUFPAGE_H */ diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h index e5404154a6..8e5cc0a4ac 100644 --- a/src/include/storage/fd.h +++ b/src/include/storage/fd.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: fd.h,v 1.10 1997/09/08 02:39:00 momjian Exp $ + * $Id: fd.h,v 1.11 1998/09/01 04:38:14 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -77,4 +77,4 @@ extern void FreeFile(FILE *); extern void closeAllVfds(void); extern int pg_fsync(int fd); -#endif /* FD_H */ +#endif /* FD_H */ diff --git a/src/include/storage/ipc.h b/src/include/storage/ipc.h index 3691eac675..4733b34bbc 100644 --- a/src/include/storage/ipc.h +++ b/src/include/storage/ipc.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: ipc.h,v 1.29 1998/06/27 15:47:47 momjian Exp $ + * $Id: ipc.h,v 1.30 1998/09/01 04:38:16 momjian Exp $ * * NOTES * This file is very architecture-specific. This stuff should actually @@ -73,12 +73,11 @@ typedef int IpcMemoryId; /* ipc.c */ extern void proc_exit(int code); extern void shmem_exit(int code); -extern int on_shmem_exit(void (*function) (), caddr_t arg); -extern int on_proc_exit(void (*function) (), caddr_t arg); +extern int on_shmem_exit(void (*function) (), caddr_t arg); +extern int on_proc_exit(void (*function) (), caddr_t arg); extern void on_exit_reset(void); -extern IpcSemaphoreId -IpcSemaphoreCreate(IpcSemaphoreKey semKey, +extern IpcSemaphoreId IpcSemaphoreCreate(IpcSemaphoreKey semKey, int semNum, int permission, int semStartValue, int removeOnExit, int *status); extern void IpcSemaphoreKill(IpcSemaphoreKey key); @@ -86,8 +85,7 @@ extern void IpcSemaphoreLock(IpcSemaphoreId semId, int sem, int lock); extern void IpcSemaphoreUnlock(IpcSemaphoreId semId, int sem, int lock); extern int IpcSemaphoreGetCount(IpcSemaphoreId semId, int sem); extern int IpcSemaphoreGetValue(IpcSemaphoreId semId, int sem); -extern IpcMemoryId -IpcMemoryCreate(IpcMemoryKey memKey, uint32 size, +extern IpcMemoryId IpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission); extern IpcMemoryId IpcMemoryIdGet(IpcMemoryKey memKey, uint32 size); extern char *IpcMemoryAttach(IpcMemoryId memId); @@ -155,7 +153,7 @@ typedef enum _LockId_ #define MAX_SPINS FIRSTFREELOCKID -#endif /* HAS_TEST_AND_SET */ +#endif /* HAS_TEST_AND_SET */ /* * the following are originally in ipci.h but the prototypes have circular @@ -204,4 +202,4 @@ extern IPCKey SystemPortAddressCreateIPCKey(SystemPortAddress address); extern void CreateSharedMemoryAndSemaphores(IPCKey key); extern void AttachSharedMemoryAndSemaphores(IPCKey key); -#endif /* IPC_H */ +#endif /* IPC_H */ diff --git a/src/include/storage/item.h b/src/include/storage/item.h index 6541a717f9..d3cf7bfdff 100644 --- a/src/include/storage/item.h +++ b/src/include/storage/item.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: item.h,v 1.3 1997/09/07 05:01:16 momjian Exp $ + * $Id: item.h,v 1.4 1998/09/01 04:38:17 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -15,4 +15,4 @@ typedef Pointer Item; -#endif /* ITEM_H */ +#endif /* ITEM_H */ diff --git a/src/include/storage/itemid.h b/src/include/storage/itemid.h index 5a3953c32e..1c37713f15 100644 --- a/src/include/storage/itemid.h +++ b/src/include/storage/itemid.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: itemid.h,v 1.6 1998/06/15 18:40:03 momjian Exp $ + * $Id: itemid.h,v 1.7 1998/09/01 04:38:18 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -75,4 +75,4 @@ typedef struct ItemIdData *ItemId; (bool) (((itemId)->lp_flags & LP_USED) != 0) \ ) -#endif /* ITEMID_H */ +#endif /* ITEMID_H */ diff --git a/src/include/storage/itempos.h b/src/include/storage/itempos.h index 332636ce95..6f022e1822 100644 --- a/src/include/storage/itempos.h +++ b/src/include/storage/itempos.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: itempos.h,v 1.5 1997/09/08 02:39:02 momjian Exp $ + * $Id: itempos.h,v 1.6 1998/09/01 04:38:19 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -41,4 +41,4 @@ typedef ItemSubpositionData *ItemSubposition; #define PSKIP(OBJP, LEN)\ { (OBJP)->op_cp += (LEN); (OBJP)->op_len -= (LEN); } -#endif /* ITEMPOS_H */ +#endif /* ITEMPOS_H */ diff --git a/src/include/storage/itemptr.h b/src/include/storage/itemptr.h index c6922a093f..253d9f2151 100644 --- a/src/include/storage/itemptr.h +++ b/src/include/storage/itemptr.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: itemptr.h,v 1.8 1998/06/15 18:40:03 momjian Exp $ + * $Id: itemptr.h,v 1.9 1998/09/01 04:38:20 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -123,4 +123,4 @@ typedef ItemPointerData *ItemPointer; extern bool ItemPointerEquals(ItemPointer pointer1, ItemPointer pointer2); -#endif /* ITEMPTR_H */ +#endif /* ITEMPTR_H */ diff --git a/src/include/storage/large_object.h b/src/include/storage/large_object.h index 3d35dba907..0918ab03df 100644 --- a/src/include/storage/large_object.h +++ b/src/include/storage/large_object.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: large_object.h,v 1.8 1998/07/21 04:17:30 momjian Exp $ + * $Id: large_object.h,v 1.9 1998/09/01 04:38:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -57,4 +57,4 @@ extern int inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes); /* added for buffer leak prevention [ PA ] */ extern void inv_cleanindex(LargeObjectDesc *obj_desc); -#endif /* LARGE_OBJECT_H */ +#endif /* LARGE_OBJECT_H */ diff --git a/src/include/storage/lmgr.h b/src/include/storage/lmgr.h index 0ee5334472..4082811bcc 100644 --- a/src/include/storage/lmgr.h +++ b/src/include/storage/lmgr.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: lmgr.h,v 1.14 1998/08/01 15:26:36 vadim Exp $ + * $Id: lmgr.h,v 1.15 1998/09/01 04:38:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -25,19 +25,21 @@ typedef struct LockRelId { Oid relId; /* a relation identifier */ Oid dbId; /* a database identifier */ -} LockRelId; +} LockRelId; #ifdef LowLevelLocking typedef struct LockInfoData { LockRelId lockRelId; - bool lockHeld[MAX_LOCKMODES]; /* on table level */ + bool lockHeld[MAX_LOCKMODES]; /* on table level */ } LockInfoData; + #else typedef struct LockInfoData { LockRelId lockRelId; } LockInfoData; + #endif typedef LockInfoData *LockInfo; @@ -52,22 +54,17 @@ extern void RelationSetLockForWrite(Relation relation); extern void RelationUnsetLockForWrite(Relation relation); /* used in vaccum.c */ -extern void -RelationSetLockForWritePage(Relation relation, +extern void RelationSetLockForWritePage(Relation relation, ItemPointer itemPointer); /* used in nbtpage.c, hashpage.c */ -extern void -RelationSetSingleWLockPage(Relation relation, +extern void RelationSetSingleWLockPage(Relation relation, ItemPointer itemPointer); -extern void -RelationUnsetSingleWLockPage(Relation relation, +extern void RelationUnsetSingleWLockPage(Relation relation, ItemPointer itemPointer); -extern void -RelationSetSingleRLockPage(Relation relation, +extern void RelationSetSingleRLockPage(Relation relation, ItemPointer itemPointer); -extern void -RelationUnsetSingleRLockPage(Relation relation, +extern void RelationUnsetSingleRLockPage(Relation relation, ItemPointer itemPointer); extern void RelationSetRIntentLock(Relation relation); extern void RelationUnsetRIntentLock(Relation relation); @@ -76,11 +73,10 @@ extern void RelationUnsetWIntentLock(Relation relation); /* single.c */ extern bool SingleLockReln(LockInfo lockinfo, LOCKMODE lockmode, int action); -extern bool -SingleLockPage(LockInfo lockinfo, ItemPointer tidPtr, +extern bool SingleLockPage(LockInfo lockinfo, ItemPointer tidPtr, LOCKMODE lockmode, int action); /* proc.c */ extern void InitProcGlobal(IPCKey key); -#endif /* LMGR_H */ +#endif /* LMGR_H */ diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h index e989e57b44..09292c4f74 100644 --- a/src/include/storage/lock.h +++ b/src/include/storage/lock.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: lock.h,v 1.17 1998/08/25 21:20:31 scrappy Exp $ + * $Id: lock.h,v 1.18 1998/09/01 04:38:24 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -53,7 +53,7 @@ typedef int LOCKMETHOD; * CreateSpinLocks() or the number of shared memory locations allocated * for lock table spin locks in the case of machines with TAS instructions. */ -#define MAX_LOCK_METHODS 3 +#define MAX_LOCK_METHODS 3 #define INVALID_TABLEID 0 @@ -70,7 +70,7 @@ typedef struct LTAG Oid relId; Oid dbId; ItemPointerData tupleId; - uint16 lockmethod; /* needed by user locks */ + uint16 lockmethod; /* needed by user locks */ } LOCKTAG; #define TAGSIZE (sizeof(LOCKTAG)) @@ -98,12 +98,12 @@ typedef struct LTAG */ typedef struct LOCKMETHODCTL { - LOCKMETHOD lockmethod; + LOCKMETHOD lockmethod; int numLockModes; int conflictTab[MAX_LOCKMODES]; int prio[MAX_LOCKMODES]; SPINLOCK masterLock; -} LOCKMETHODCTL; +} LOCKMETHODCTL; /* * lockHash -- hash table on lock Ids, @@ -115,8 +115,8 @@ typedef struct LOCKMETHODTABLE { HTAB *lockHash; HTAB *xidHash; - LOCKMETHODCTL *ctl; -} LOCKMETHODTABLE; + LOCKMETHODCTL *ctl; +} LOCKMETHODTABLE; /* ----------------------- * A transaction never conflicts with its own locks. Hence, if @@ -153,7 +153,7 @@ typedef struct XIDTAG int pid; TransactionId xid; #ifdef USE_XIDTAG_LOCKMETHOD - uint16 lockmethod; /* for debug or consistency checking */ + uint16 lockmethod; /* for debug or consistency checking */ #endif } XIDTAG; @@ -232,26 +232,27 @@ extern SPINLOCK LockMgrLock; extern void InitLocks(void); extern void LockDisable(int status); extern LOCKMETHOD LockMethodTableInit(char *tabName, MASK *conflictsP, - int *prioP, int numModes); + int *prioP, int numModes); extern LOCKMETHOD LockMethodTableRename(LOCKMETHOD lockmethod); extern bool LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag, - LOCKMODE lockmode); + LOCKMODE lockmode); extern int LockResolveConflicts(LOCKMETHOD lockmethod, LOCK *lock, - LOCKMODE lockmode, TransactionId xid, - XIDLookupEnt *xidentP); + LOCKMODE lockmode, TransactionId xid, + XIDLookupEnt *xidentP); extern bool LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag, - LOCKMODE lockmode); + LOCKMODE lockmode); extern void GrantLock(LOCK *lock, LOCKMODE lockmode); extern bool LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue); extern int LockShmemSize(void); extern bool LockingDisabled(void); extern bool DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, - bool skip_check); -ArrayType* LockOwners(LOCKMETHOD lockmethod, LOCKTAG *locktag); + bool skip_check); +ArrayType *LockOwners(LOCKMETHOD lockmethod, LOCKTAG *locktag); #ifdef DEADLOCK_DEBUG extern void DumpLocks(void); extern void DumpAllLocks(void); + #endif -#endif /* LOCK_H */ +#endif /* LOCK_H */ diff --git a/src/include/storage/multilev.h b/src/include/storage/multilev.h index 7d3a3c983a..a09a6077bd 100644 --- a/src/include/storage/multilev.h +++ b/src/include/storage/multilev.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: multilev.h,v 1.12 1998/08/01 15:26:38 vadim Exp $ + * $Id: multilev.h,v 1.13 1998/09/01 04:38:25 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -19,18 +19,18 @@ #ifdef LowLevelLocking /* DML locks */ -#define RowShareLock 1 /* SELECT FOR UPDATE */ -#define RowExclusiveLock 2 /* INSERT, UPDATE, DELETE */ -#define ShareLock 3 -#define ShareRowExclusiveLock 4 -#define ExclusiveLock 5 +#define RowShareLock 1 /* SELECT FOR UPDATE */ +#define RowExclusiveLock 2 /* INSERT, UPDATE, DELETE */ +#define ShareLock 3 +#define ShareRowExclusiveLock 4 +#define ExclusiveLock 5 /* DDL locks */ -#define ObjShareLock 6 -#define ObjExclusiveLock 7 +#define ObjShareLock 6 +#define ObjExclusiveLock 7 /* Special locks */ -#define ExtendLock 8 +#define ExtendLock 8 #else @@ -49,7 +49,7 @@ #define EXTEND_LOCK 5 -#endif /* !LowLevelLocking */ +#endif /* !LowLevelLocking */ #define SHORT_TERM 1 #define LONG_TERM 2 @@ -64,8 +64,10 @@ typedef int PG_LOCK_LEVEL; /* multi.c */ extern LOCKMETHOD MultiTableId; + #ifdef NOT_USED extern LOCKMETHOD ShortTermTableId; + #endif /* @@ -77,4 +79,4 @@ extern bool MultiLockTuple(LockInfo lockinfo, ItemPointer tidPtr, LOCKMODE lockm extern bool MultiLockPage(LockInfo lockinfo, ItemPointer tidPtr, LOCKMODE lockmode); extern bool MultiReleaseReln(LockInfo lockinfo, LOCKMODE lockmode); -#endif /* MULTILEV_H */ +#endif /* MULTILEV_H */ diff --git a/src/include/storage/off.h b/src/include/storage/off.h index 3dc72d6701..e073839fd4 100644 --- a/src/include/storage/off.h +++ b/src/include/storage/off.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: off.h,v 1.4 1997/09/08 02:39:06 momjian Exp $ + * $Id: off.h,v 1.5 1998/09/01 04:38:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -53,4 +53,4 @@ typedef uint16 OffsetNumber; #define OffsetNumberPrev(offsetNumber) \ ((OffsetNumber) (-1 + (offsetNumber))) -#endif /* OFF_H */ +#endif /* OFF_H */ diff --git a/src/include/storage/page.h b/src/include/storage/page.h index 17d29746c9..3e03c7c14e 100644 --- a/src/include/storage/page.h +++ b/src/include/storage/page.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: page.h,v 1.3 1997/09/07 05:01:30 momjian Exp $ + * $Id: page.h,v 1.4 1998/09/01 04:38:27 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -21,4 +21,4 @@ typedef Pointer Page; */ #define PageIsValid(page) PointerIsValid(page) -#endif /* PAGE_H */ +#endif /* PAGE_H */ diff --git a/src/include/storage/pagenum.h b/src/include/storage/pagenum.h index 95e2b4beb4..bd36d07dc2 100644 --- a/src/include/storage/pagenum.h +++ b/src/include/storage/pagenum.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pagenum.h,v 1.5 1997/09/08 02:39:06 momjian Exp $ + * $Id: pagenum.h,v 1.6 1998/09/01 04:38:29 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -28,4 +28,4 @@ typedef uint32 LogicalPageNumber; ((bool)((pageNumber) != InvalidLogicalPageNumber)) -#endif /* PAGENUM_H */ +#endif /* PAGENUM_H */ diff --git a/src/include/storage/pos.h b/src/include/storage/pos.h index 46965b9fbd..4e67fc29cf 100644 --- a/src/include/storage/pos.h +++ b/src/include/storage/pos.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pos.h,v 1.4 1997/09/08 02:39:07 momjian Exp $ + * $Id: pos.h,v 1.5 1998/09/01 04:38:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -59,4 +59,4 @@ typedef PositionIdData *PositionId; #define PositionIdGetOffsetNumber(positionId) \ ((OffsetNumber) *(positionId)) -#endif /* POS_H */ +#endif /* POS_H */ diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 50f7b03ef6..4a62fac18a 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: proc.h,v 1.14 1998/08/25 21:20:32 scrappy Exp $ + * $Id: proc.h,v 1.15 1998/09/01 04:38:31 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -45,11 +45,9 @@ typedef struct proc * this proc */ #ifdef LowLevelLocking - TransactionId xmin; /* minimal running XID as it was when - * we were starting our xact: vacuum - * must not remove tuples deleted by - * xid >= xmin ! - */ + TransactionId xmin; /* minimal running XID as it was when we + * were starting our xact: vacuum must not + * remove tuples deleted by xid >= xmin ! */ #endif LOCK *waitLock; /* Lock we're sleeping on */ @@ -106,11 +104,11 @@ extern bool ProcRemove(int pid); extern void ProcQueueInit(PROC_QUEUE *queue); extern int ProcSleep(PROC_QUEUE *queue, SPINLOCK spinlock, int token, - int prio, LOCK *lock, TransactionId xid); -extern int ProcLockWakeup(PROC_QUEUE *queue, LOCKMETHOD lockmethod, - LOCK *lock); + int prio, LOCK *lock, TransactionId xid); +extern int ProcLockWakeup(PROC_QUEUE *queue, LOCKMETHOD lockmethod, + LOCK *lock); extern void ProcAddLock(SHM_QUEUE *elem); extern void ProcReleaseSpins(PROC *proc); extern void ProcFreeAllSemaphores(void); -#endif /* PROC_H */ +#endif /* PROC_H */ diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index 37eb40a2bf..a475d21274 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.44 1998/08/22 04:24:21 momjian Exp $ + * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.45 1998/09/01 04:38:32 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -83,9 +83,9 @@ static __inline__ int tas(volatile slock_t *lock) { - register slock_t _res; + register slock_t _res; - __asm__(" ldq $0, %0 \n\ +__asm__(" ldq $0, %0 \n\ bne $0, already_set \n\ ldq_l $0, %0 \n\ bne $0, already_set \n\ @@ -97,11 +97,12 @@ tas(volatile slock_t *lock) jmp $31, end \n\ stqc_fail: or $31, 1, $0 \n\ already_set: bis $0, $0, %1 \n\ - end: nop " : "=m"(*lock), "=r"(_res) : : "0"); + end: nop ": "=m"(*lock), "=r"(_res): :"0"); return (int) _res; } -#endif /* __alpha */ + +#endif /* __alpha */ @@ -111,12 +112,13 @@ tas(volatile slock_t *lock) static __inline__ int tas(volatile slock_t *lock) { - register slock_t _res = 1; + register slock_t _res = 1; - __asm__("lock; xchgb %0,%1" : "=q"(_res), "=m"(*lock) : "0"(_res) ); +__asm__("lock; xchgb %0,%1": "=q"(_res), "=m"(*lock):"0"(_res)); return (int) _res; } -#endif /* i386 */ + +#endif /* i386 */ @@ -126,14 +128,15 @@ tas(volatile slock_t *lock) static __inline__ int tas(volatile slock_t *lock) { - register slock_t _res = 1; + register slock_t _res = 1; - __asm__("ldstub [%2], %0" \ - : "=r" (_res), "=m" (*lock) \ - : "r" (lock)); + __asm__("ldstub [%2], %0" \ +: "=r"(_res), "=m"(*lock) \ +: "r"(lock)); return (int) _res; } -#endif /* sparc */ + +#endif /* sparc */ @@ -151,21 +154,22 @@ tas(volatile slock_t *lock) { register _res; - __asm__(" movl $1, r0 - bbssi $0, (%1), 1f - clrl r0 - 1: movl r0, %0 " - : "=r"(_res) /* return value, in register */ - : "r"(lock) /* argument, 'lock pointer', in register */ - : "r0"); /* inline code uses this register */ + __asm__(" movl $1, r0 \ + bbssi $0, (%1), 1 f \ + clrl r0 \ +1: movl r0, %0 " +: "=r"(_res) /* return value, in register */ +: "r"(lock) /* argument, 'lock pointer', in register */ +: "r0"); /* inline code uses this register */ return (int) _res; } -#endif /* NEED_VAX_TAS_ASM */ + +#endif /* NEED_VAX_TAS_ASM */ -#else /* __GNUC__ */ +#else /* __GNUC__ */ /*************************************************************************** * All non gcc */ @@ -181,7 +185,7 @@ tas(volatile slock_t *lock) #define S_UNLOCK(lock) msem_unlock((lock), 0) #define S_INIT_LOCK(lock) msem_init((lock), MSEM_UNLOCKED) #define S_LOCK_FREE(lock) (!(lock)->msem_state) -#endif /* __alpha */ +#endif /* __alpha */ @@ -191,21 +195,21 @@ tas(volatile slock_t *lock) #if defined(USE_UNIVEL_CC) #define TAS(lock) tas(lock) -asm int +asm int tas(slock_t *s_lock) { -% mem s_lock - pushl %ebx - movl s_lock,%ebx - movl $255,%eax + %mem s_lock + pushl % ebx + movl s_lock, %ebx + movl $255, %eax lock - xchgb %al,(%ebx) - popl %ebx + xchgb % al, (%ebx) + popl % ebx } -#endif /* USE_UNIVEL_CC */ +#endif /* USE_UNIVEL_CC */ -#endif /* NEED_I386_TAS_ASM */ +#endif /* NEED_I386_TAS_ASM */ @@ -213,19 +217,19 @@ tas(slock_t *s_lock) #define S_LOCK(lock) \ { \ - slock_t res = 1; \ - while (res) { \ - __asm__("movqd 0, r0"); \ - __asm__("sbitd r0, %0" : "=m"(*lock)); \ - __asm__("sprb us, %0" : "=r" (res)); \ - res = ((res >> 5) & 1); \ - } \ + slock_t res = 1; \ + while (res) { \ + __asm__("movqd 0, r0"); \ + __asm__("sbitd r0, %0" : "=m"(*lock)); \ + __asm__("sprb us, %0" : "=r" (res)); \ + res = ((res >> 5) & 1); \ + } \ } -#endif /* NEED_NS32K_TAS_ASM */ +#endif /* NEED_NS32K_TAS_ASM */ -#endif /* defined(__GNUC__) */ +#endif /* defined(__GNUC__) */ @@ -248,7 +252,7 @@ static const slock_t clear_lock = #define S_UNLOCK(lock) (*(lock) = clear_lock) /* struct assignment */ #define S_LOCK_FREE(lock) ( *(int *) (((long) (lock) + 15) & ~15) != 0) -#endif /* __hpux */ +#endif /* __hpux */ #if defined(__sgi) @@ -265,7 +269,7 @@ static const slock_t clear_lock = #define S_UNLOCK(lock) release_lock(lock) #define S_INIT_LOCK(lock) init_lock(lock) #define S_LOCK_FREE(lock) (stat_lock(lock) == UNLOCKED) -#endif /* __sgi */ +#endif /* __sgi */ #if defined(_AIX) @@ -276,7 +280,7 @@ static const slock_t clear_lock = * (see storage/ipc.h). */ #define TAS(lock) cs((int *) (lock), 0, 1) -#endif /* _AIX */ +#endif /* _AIX */ #if defined (nextstep) @@ -290,7 +294,7 @@ static const slock_t clear_lock = #define S_INIT_LOCK(lock) mutex_init(lock) /* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */ #define S_LOCK_FREE(alock) ((alock)->lock == 0) -#endif /* nextstep */ +#endif /* nextstep */ @@ -301,29 +305,31 @@ static const slock_t clear_lock = #if !defined(S_LOCK) extern void s_lock(volatile slock_t *lock, const char *file, const int line); + #define S_LOCK(lock) \ - if (TAS((volatile slock_t *) lock)) {\ - s_lock((volatile slock_t *) lock, __FILE__, __LINE__); \ - } else -#endif /* S_LOCK */ + if (TAS((volatile slock_t *) lock)) {\ + s_lock((volatile slock_t *) lock, __FILE__, __LINE__); \ + } else +#endif /* S_LOCK */ #if !defined(S_LOCK_FREE) #define S_LOCK_FREE(lock) (*(lock) == 0) -#endif /* S_LOCK_FREE */ +#endif /* S_LOCK_FREE */ #if !defined(S_UNLOCK) #define S_UNLOCK(lock) (*(lock) = 0) -#endif /* S_UNLOCK */ +#endif /* S_UNLOCK */ #if !defined(S_INIT_LOCK) #define S_INIT_LOCK(lock) S_UNLOCK(lock) -#endif /* S_INIT_LOCK */ +#endif /* S_INIT_LOCK */ #if !defined(TAS) -int tas(volatile slock_t *lock); /* port/.../tas.s, or s_lock.c */ -#define TAS(lock) tas((volatile slock_t *) lock) -#endif /* TAS */ +int tas(volatile slock_t *lock); /* port/.../tas.s, or + * s_lock.c */ -#endif /* HAS_TEST_AND_SET */ -#endif /* S_LOCK_H */ +#define TAS(lock) tas((volatile slock_t *) lock) +#endif /* TAS */ +#endif /* HAS_TEST_AND_SET */ +#endif /* S_LOCK_H */ diff --git a/src/include/storage/shmem.h b/src/include/storage/shmem.h index 809b87cdb1..c8524eea5e 100644 --- a/src/include/storage/shmem.h +++ b/src/include/storage/shmem.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: shmem.h,v 1.13 1998/06/27 15:47:48 momjian Exp $ + * $Id: shmem.h,v 1.14 1998/09/01 04:38:33 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -64,13 +64,11 @@ extern void ShmemCreate(unsigned int key, unsigned int size); extern int InitShmem(unsigned int key, unsigned int size); extern long *ShmemAlloc(unsigned long size); extern int ShmemIsValid(unsigned long addr); -extern HTAB * -ShmemInitHash(char *name, long init_size, long max_size, +extern HTAB *ShmemInitHash(char *name, long init_size, long max_size, HASHCTL *infoP, int hash_flags); extern bool ShmemPIDLookup(int pid, SHMEM_OFFSET *locationPtr); extern SHMEM_OFFSET ShmemPIDDestroy(int pid); -extern long * -ShmemInitStruct(char *name, unsigned long size, +extern long *ShmemInitStruct(char *name, unsigned long size, bool *foundPtr); extern bool TransactionIdIsInProgress(TransactionId xid); @@ -79,7 +77,7 @@ typedef int TableID; /* size constants for the shmem index table */ /* max size of data structure string name */ -#define SHMEM_INDEX_KEYSIZE (50) +#define SHMEM_INDEX_KEYSIZE (50) /* data in shmem index table hash bucket */ #define SHMEM_INDEX_DATASIZE (sizeof(ShmemIndexEnt) - SHMEM_INDEX_KEYSIZE) /* maximum size of the shmem index table */ @@ -88,10 +86,10 @@ typedef int TableID; /* this is a hash bucket in the shmem index table */ typedef struct { - char key[SHMEM_INDEX_KEYSIZE]; /* string name */ + char key[SHMEM_INDEX_KEYSIZE]; /* string name */ unsigned long location; /* location in shared mem */ unsigned long size; /* numbytes allocated for the structure */ -} ShmemIndexEnt; +} ShmemIndexEnt; /* * prototypes for functions in shmqueue.c @@ -100,9 +98,8 @@ extern void SHMQueueInit(SHM_QUEUE *queue); extern void SHMQueueElemInit(SHM_QUEUE *queue); extern void SHMQueueDelete(SHM_QUEUE *queue); extern void SHMQueueInsertTL(SHM_QUEUE *queue, SHM_QUEUE *elem); -extern void -SHMQueueFirst(SHM_QUEUE *queue, Pointer *nextPtrPtr, +extern void SHMQueueFirst(SHM_QUEUE *queue, Pointer *nextPtrPtr, SHM_QUEUE *nextQueue); extern bool SHMQueueEmpty(SHM_QUEUE *queue); -#endif /* SHMEM_H */ +#endif /* SHMEM_H */ diff --git a/src/include/storage/sinval.h b/src/include/storage/sinval.h index 2b9939516f..bb825da999 100644 --- a/src/include/storage/sinval.h +++ b/src/include/storage/sinval.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: sinval.h,v 1.8 1998/02/26 04:43:34 momjian Exp $ + * $Id: sinval.h,v 1.9 1998/09/01 04:38:34 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -21,11 +21,10 @@ extern SPINLOCK SInvalLock; extern void CreateSharedInvalidationState(IPCKey key); extern void AttachSharedInvalidationState(IPCKey key); extern void InitSharedInvalidationState(void); -extern void -RegisterSharedInvalid(int cacheId, Index hashIndex, +extern void RegisterSharedInvalid(int cacheId, Index hashIndex, ItemPointer pointer); extern void InvalidateSharedInvalid(void (*invalFunction) (), void (*resetFunction) ()); -#endif /* SINVAL_H */ +#endif /* SINVAL_H */ diff --git a/src/include/storage/sinvaladt.h b/src/include/storage/sinvaladt.h index 93e861ebee..ff3e1ef05a 100644 --- a/src/include/storage/sinvaladt.h +++ b/src/include/storage/sinvaladt.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: sinvaladt.h,v 1.9 1998/08/25 21:31:20 scrappy Exp $ + * $Id: sinvaladt.h,v 1.10 1998/09/01 04:38:36 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -125,9 +125,8 @@ extern int SISegmentInit(bool killExistingSegment, IPCKey key); extern bool SISetDataEntry(SISeg *segP, SharedInvalidData *data); extern void SISetProcStateInvalid(SISeg *segP); extern bool SIDelDataEntry(SISeg *segP); -extern void -SIReadEntryData(SISeg *segP, int backendId, +extern void SIReadEntryData(SISeg *segP, int backendId, void (*invalFunction) (), void (*resetFunction) ()); extern void SIDelExpiredDataEntries(SISeg *segP); -#endif /* SINVALADT_H */ +#endif /* SINVALADT_H */ diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h index 0f7087d646..a2852ad846 100644 --- a/src/include/storage/smgr.h +++ b/src/include/storage/smgr.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: smgr.h,v 1.11 1998/02/26 04:43:36 momjian Exp $ + * $Id: smgr.h,v 1.12 1998/09/01 04:38:37 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -28,17 +28,13 @@ extern int smgrunlink(int16 which, Relation reln); extern int smgrextend(int16 which, Relation reln, char *buffer); extern int smgropen(int16 which, Relation reln); extern int smgrclose(int16 which, Relation reln); -extern int -smgrread(int16 which, Relation reln, BlockNumber blocknum, +extern int smgrread(int16 which, Relation reln, BlockNumber blocknum, char *buffer); -extern int -smgrwrite(int16 which, Relation reln, BlockNumber blocknum, +extern int smgrwrite(int16 which, Relation reln, BlockNumber blocknum, char *buffer); -extern int -smgrflush(int16 which, Relation reln, BlockNumber blocknum, +extern int smgrflush(int16 which, Relation reln, BlockNumber blocknum, char *buffer); -extern int -smgrblindwrt(int16 which, char *dbname, char *relname, Oid dbid, +extern int smgrblindwrt(int16 which, char *dbname, char *relname, Oid dbid, Oid relid, BlockNumber blkno, char *buffer); extern int smgrnblocks(int16 which, Relation reln); extern int smgrtruncate(int16 which, Relation reln, int nblocks); @@ -59,8 +55,7 @@ extern int mdclose(Relation reln); extern int mdread(Relation reln, BlockNumber blocknum, char *buffer); extern int mdwrite(Relation reln, BlockNumber blocknum, char *buffer); extern int mdflush(Relation reln, BlockNumber blocknum, char *buffer); -extern int -mdblindwrt(char *dbstr, char *relstr, Oid dbid, Oid relid, +extern int mdblindwrt(char *dbstr, char *relstr, Oid dbid, Oid relid, BlockNumber blkno, char *buffer); extern int mdnblocks(Relation reln); extern int mdtruncate(Relation reln, int nblocks); @@ -80,8 +75,7 @@ extern int mmclose(Relation reln); extern int mmread(Relation reln, BlockNumber blocknum, char *buffer); extern int mmwrite(Relation reln, BlockNumber blocknum, char *buffer); extern int mmflush(Relation reln, BlockNumber blocknum, char *buffer); -extern int -mmblindwrt(char *dbstr, char *relstr, Oid dbid, Oid relid, +extern int mmblindwrt(char *dbstr, char *relstr, Oid dbid, Oid relid, BlockNumber blkno, char *buffer); extern int mmnblocks(Relation reln); extern int mmcommit(void); @@ -94,4 +88,4 @@ extern int2 smgrin(char *s); extern bool smgreq(int2 a, int2 b); extern bool smgrne(int2 a, int2 b); -#endif /* SMGR_H */ +#endif /* SMGR_H */ diff --git a/src/include/storage/spin.h b/src/include/storage/spin.h index c94a74255f..f8d81709c3 100644 --- a/src/include/storage/spin.h +++ b/src/include/storage/spin.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: spin.h,v 1.6 1997/09/18 14:21:02 momjian Exp $ + * $Id: spin.h,v 1.7 1998/09/01 04:38:38 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -32,4 +32,4 @@ extern bool InitSpinLocks(int init, IPCKey key); extern void SpinAcquire(SPINLOCK lockid); extern void SpinRelease(SPINLOCK lockid); -#endif /* SPIN_H */ +#endif /* SPIN_H */ |