diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/storage/buf_internals.h | 11 | ||||
| -rw-r--r-- | src/include/storage/lwlock.h | 3 | ||||
| -rw-r--r-- | src/include/storage/proc.h | 5 | ||||
| -rw-r--r-- | src/include/storage/procarray.h | 36 | ||||
| -rw-r--r-- | src/include/storage/sinval.h | 17 | ||||
| -rw-r--r-- | src/include/storage/sinvaladt.h | 5 | ||||
| -rw-r--r-- | src/include/utils/tqual.h | 4 |
7 files changed, 51 insertions, 30 deletions
diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h index 17687510cd..2bd210dfb5 100644 --- a/src/include/storage/buf_internals.h +++ b/src/include/storage/buf_internals.h @@ -8,14 +8,13 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/buf_internals.h,v 1.77 2005/03/04 20:21:07 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/buf_internals.h,v 1.78 2005/05/19 21:35:47 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef BUFMGR_INTERNALS_H #define BUFMGR_INTERNALS_H -#include "storage/backendid.h" #include "storage/buf.h" #include "storage/lwlock.h" #include "storage/shmem.h" @@ -94,7 +93,7 @@ typedef struct buftag * BufferDesc -- shared descriptor/state data for a single shared buffer. * * Note: buf_hdr_lock must be held to examine or change the tag, flags, - * usage_count, refcount, or wait_backend_id fields. buf_id field never + * usage_count, refcount, or wait_backend_pid fields. buf_id field never * changes after initialization, so does not need locking. freeNext is * protected by the BufFreelistLock not buf_hdr_lock. The LWLocks can take * care of themselves. The buf_hdr_lock is *not* used to control access to @@ -108,8 +107,8 @@ typedef struct buftag * * We can't physically remove items from a disk page if another backend has * the buffer pinned. Hence, a backend may need to wait for all other pins - * to go away. This is signaled by storing its own backend ID into - * wait_backend_id and setting flag bit BM_PIN_COUNT_WAITER. At present, + * to go away. This is signaled by storing its own PID into + * wait_backend_pid and setting flag bit BM_PIN_COUNT_WAITER. At present, * there can be only one such waiter per buffer. * * We use this same struct for local buffer headers, but the lock fields @@ -121,7 +120,7 @@ typedef struct sbufdesc BufFlags flags; /* see bit definitions above */ uint16 usage_count; /* usage counter for clock sweep code */ unsigned refcount; /* # of backends holding pins on buffer */ - BackendId wait_backend_id; /* backend ID of pin-count waiter */ + int wait_backend_pid; /* backend PID of pin-count waiter */ slock_t buf_hdr_lock; /* protects the above fields */ diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 18215f4838..eb45f3e39a 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/lwlock.h,v 1.18 2005/04/28 21:47:18 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/lwlock.h,v 1.19 2005/05/19 21:35:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -30,6 +30,7 @@ typedef enum LWLockId LockMgrLock, OidGenLock, XidGenLock, + ProcArrayLock, SInvalLock, FreeSpaceLock, MMCacheLock, diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 8d514fce94..f771d71933 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.77 2004/12/31 22:03:42 pgsql Exp $ + * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.78 2005/05/19 21:35:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -15,7 +15,6 @@ #define _PROC_H_ #include "access/xlog.h" -#include "storage/backendid.h" #include "storage/lock.h" #include "storage/pg_sema.h" @@ -137,7 +136,7 @@ extern bool LockWaitCancel(void); extern void ProcWaitForSignal(void); extern void ProcCancelWaitForSignal(void); -extern void ProcSendSignal(BackendId procId); +extern void ProcSendSignal(int pid); extern bool enable_sig_alarm(int delayms, bool is_statement_timeout); extern bool disable_sig_alarm(bool is_statement_timeout); diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h new file mode 100644 index 0000000000..437ac306e0 --- /dev/null +++ b/src/include/storage/procarray.h @@ -0,0 +1,36 @@ +/*------------------------------------------------------------------------- + * + * procarray.h + * POSTGRES process array definitions. + * + * + * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * $PostgreSQL: pgsql/src/include/storage/procarray.h,v 1.1 2005/05/19 21:35:47 tgl Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef PROCARRAY_H +#define PROCARRAY_H + +extern int ProcArrayShmemSize(int maxBackends); +extern void CreateSharedProcArray(int maxBackends); +extern void ProcArrayAddMyself(void); +extern void ProcArrayRemoveMyself(void); + +extern bool TransactionIdIsInProgress(TransactionId xid); +extern TransactionId GetOldestXmin(bool allDbs); + +/* Use "struct PGPROC", not PGPROC, to avoid including proc.h here */ +extern struct PGPROC *BackendPidGetProc(int pid); +extern bool IsBackendPid(int pid); +extern bool DatabaseHasActiveBackends(Oid databaseId, bool ignoreMyself); + +extern int CountActiveBackends(void); +extern int CountEmptyBackendSlots(void); + +extern void XidCacheRemoveRunningXids(TransactionId xid, + int nxids, TransactionId *xids); + +#endif /* PROCARRAY_H */ diff --git a/src/include/storage/sinval.h b/src/include/storage/sinval.h index 092b722048..0f4c0f68f3 100644 --- a/src/include/storage/sinval.h +++ b/src/include/storage/sinval.h @@ -7,14 +7,13 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/sinval.h,v 1.40 2005/01/10 21:57:19 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/sinval.h,v 1.41 2005/05/19 21:35:47 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef SINVAL_H #define SINVAL_H -#include "storage/backendid.h" #include "storage/itemptr.h" #include "storage/relfilenode.h" @@ -87,24 +86,12 @@ typedef union extern int SInvalShmemSize(int maxBackends); extern void CreateSharedInvalidationState(int maxBackends); extern void InitBackendSharedInvalidationState(void); + extern void SendSharedInvalidMessage(SharedInvalidationMessage *msg); extern void ReceiveSharedInvalidMessages( void (*invalFunction) (SharedInvalidationMessage *msg), void (*resetFunction) (void)); -extern bool DatabaseHasActiveBackends(Oid databaseId, bool ignoreMyself); -extern bool TransactionIdIsInProgress(TransactionId xid); -extern bool IsBackendPid(int pid); -extern TransactionId GetOldestXmin(bool allDbs); -extern int CountActiveBackends(void); -extern int CountEmptyBackendSlots(void); - -/* Use "struct PGPROC", not PGPROC, to avoid including proc.h here */ -extern struct PGPROC *BackendIdGetProc(BackendId procId); - -extern void XidCacheRemoveRunningXids(TransactionId xid, - int nxids, TransactionId *xids); - /* signal handler for catchup events (SIGUSR1) */ extern void CatchupInterruptHandler(SIGNAL_ARGS); diff --git a/src/include/storage/sinvaladt.h b/src/include/storage/sinvaladt.h index 7fce6070da..0be6a38650 100644 --- a/src/include/storage/sinvaladt.h +++ b/src/include/storage/sinvaladt.h @@ -7,16 +7,16 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/sinvaladt.h,v 1.37 2004/12/31 22:03:42 pgsql Exp $ + * $PostgreSQL: pgsql/src/include/storage/sinvaladt.h,v 1.38 2005/05/19 21:35:47 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef SINVALADT_H #define SINVALADT_H -#include "storage/shmem.h" #include "storage/sinval.h" + /* * The shared cache invalidation manager is responsible for transmitting * invalidation messages between backends. Any message sent by any backend @@ -71,7 +71,6 @@ typedef struct ProcState /* nextMsgNum is -1 in an inactive ProcState array entry. */ int nextMsgNum; /* next message number to read, or -1 */ bool resetState; /* true, if backend has to reset its state */ - SHMEM_OFFSET procStruct; /* location of backend's PGPROC struct */ } ProcState; /* Shared cache invalidation memory segment */ diff --git a/src/include/utils/tqual.h b/src/include/utils/tqual.h index e553cfedf8..f12ae2233f 100644 --- a/src/include/utils/tqual.h +++ b/src/include/utils/tqual.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/tqual.h,v 1.56 2005/03/20 23:40:34 neilc Exp $ + * $PostgreSQL: pgsql/src/include/utils/tqual.h,v 1.57 2005/05/19 21:35:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -133,7 +133,7 @@ extern Snapshot CopySnapshot(Snapshot snapshot); extern void FreeSnapshot(Snapshot snapshot); extern void FreeXactSnapshot(void); -/* in sinval.c; declared here to avoid including tqual.h in sinval.h: */ +/* in procarray.c; declared here to avoid including tqual.h in procarray.h: */ extern Snapshot GetSnapshotData(Snapshot snapshot, bool serializable); #endif /* TQUAL_H */ |
