Commit 54aabaa8 authored by Bruce Momjian's avatar Bruce Momjian

Rename BindingTable to ShmemIndex.

parent 7487a826
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.17 1998/01/07 21:04:46 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.18 1998/06/27 15:47:43 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -277,14 +277,14 @@ BufferShmemSize() ...@@ -277,14 +277,14 @@ BufferShmemSize()
nbuckets = 1 << (int) my_log2((NBuffers - 1) / DEF_FFACTOR + 1); nbuckets = 1 << (int) my_log2((NBuffers - 1) / DEF_FFACTOR + 1);
nsegs = 1 << (int) my_log2((nbuckets - 1) / DEF_SEGSIZE + 1); nsegs = 1 << (int) my_log2((nbuckets - 1) / DEF_SEGSIZE + 1);
/* size of shmem binding table */ /* size of shmem index table */
size += MAXALIGN(my_log2(BTABLE_SIZE) * sizeof(void *)); /* HTAB->dir */ size += MAXALIGN(my_log2(SHMEM_INDEX_SIZE) * sizeof(void *)); /* HTAB->dir */
size += MAXALIGN(sizeof(HHDR)); /* HTAB->hctl */ size += MAXALIGN(sizeof(HHDR)); /* HTAB->hctl */
size += MAXALIGN(DEF_SEGSIZE * sizeof(SEGMENT)); size += MAXALIGN(DEF_SEGSIZE * sizeof(SEGMENT));
size += BUCKET_ALLOC_INCR * size += BUCKET_ALLOC_INCR *
(MAXALIGN(sizeof(BUCKET_INDEX)) + (MAXALIGN(sizeof(BUCKET_INDEX)) +
MAXALIGN(BTABLE_KEYSIZE) + MAXALIGN(SHMEM_INDEX_KEYSIZE) +
MAXALIGN(BTABLE_DATASIZE)); MAXALIGN(SHMEM_INDEX_DATASIZE));
/* size of buffer descriptors */ /* size of buffer descriptors */
size += MAXALIGN((NBuffers + 1) * sizeof(BufferDesc)); size += MAXALIGN((NBuffers + 1) * sizeof(BufferDesc));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.14 1998/06/27 04:53:35 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.15 1998/06/27 15:47:44 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -83,7 +83,7 @@ CreateSharedMemoryAndSemaphores(IPCKey key) ...@@ -83,7 +83,7 @@ CreateSharedMemoryAndSemaphores(IPCKey key)
IPCKeyGetBufferMemoryKey(key), size); IPCKeyGetBufferMemoryKey(key), size);
} }
ShmemCreate(IPCKeyGetBufferMemoryKey(key), size); ShmemCreate(IPCKeyGetBufferMemoryKey(key), size);
ShmemBindingTableReset(); ShmemIndexReset();
InitShmem(key, size); InitShmem(key, size);
InitBufferPool(key); InitBufferPool(key);
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.13 1998/06/23 16:04:46 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.14 1998/06/27 15:47:45 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -53,7 +53,7 @@ bool ...@@ -53,7 +53,7 @@ bool
InitSpinLocks(int init, IPCKey key) InitSpinLocks(int init, IPCKey key)
{ {
extern SPINLOCK ShmemLock; extern SPINLOCK ShmemLock;
extern SPINLOCK BindingLock; extern SPINLOCK ShmemIndexLock;
extern SPINLOCK BufMgrLock; extern SPINLOCK BufMgrLock;
extern SPINLOCK LockMgrLock; extern SPINLOCK LockMgrLock;
extern SPINLOCK ProcStructLock; extern SPINLOCK ProcStructLock;
...@@ -66,7 +66,7 @@ InitSpinLocks(int init, IPCKey key) ...@@ -66,7 +66,7 @@ InitSpinLocks(int init, IPCKey key)
/* These six spinlocks have fixed location is shmem */ /* These six spinlocks have fixed location is shmem */
ShmemLock = (SPINLOCK) SHMEMLOCKID; ShmemLock = (SPINLOCK) SHMEMLOCKID;
BindingLock = (SPINLOCK) BINDINGLOCKID; ShmemIndexLock = (SPINLOCK) SHMEMINDEXLOCKID;
BufMgrLock = (SPINLOCK) BUFMGRLOCKID; BufMgrLock = (SPINLOCK) BUFMGRLOCKID;
LockMgrLock = (SPINLOCK) LOCKMGRLOCKID; LockMgrLock = (SPINLOCK) LOCKMGRLOCKID;
ProcStructLock = (SPINLOCK) PROCSTRUCTLOCKID; ProcStructLock = (SPINLOCK) PROCSTRUCTLOCKID;
...@@ -265,7 +265,7 @@ AttachSpinLocks(IPCKey key) ...@@ -265,7 +265,7 @@ AttachSpinLocks(IPCKey key)
* InitSpinLocks -- Spinlock bootstrapping * InitSpinLocks -- Spinlock bootstrapping
* *
* We need several spinlocks for bootstrapping: * We need several spinlocks for bootstrapping:
* BindingLock (for the shmem binding table) and * ShmemIndexLock (for the shmem index table) and
* ShmemLock (for the shmem allocator), BufMgrLock (for buffer * ShmemLock (for the shmem allocator), BufMgrLock (for buffer
* pool exclusive access), LockMgrLock (for the lock table), and * pool exclusive access), LockMgrLock (for the lock table), and
* ProcStructLock (a spin lock for the shared process structure). * ProcStructLock (a spin lock for the shared process structure).
...@@ -277,7 +277,7 @@ bool ...@@ -277,7 +277,7 @@ bool
InitSpinLocks(int init, IPCKey key) InitSpinLocks(int init, IPCKey key)
{ {
extern SPINLOCK ShmemLock; extern SPINLOCK ShmemLock;
extern SPINLOCK BindingLock; extern SPINLOCK ShmemIndexLock;
extern SPINLOCK BufMgrLock; extern SPINLOCK BufMgrLock;
extern SPINLOCK LockMgrLock; extern SPINLOCK LockMgrLock;
extern SPINLOCK ProcStructLock; extern SPINLOCK ProcStructLock;
...@@ -305,7 +305,7 @@ InitSpinLocks(int init, IPCKey key) ...@@ -305,7 +305,7 @@ InitSpinLocks(int init, IPCKey key)
/* These five (or six) spinlocks have fixed location is shmem */ /* These five (or six) spinlocks have fixed location is shmem */
ShmemLock = (SPINLOCK) SHMEMLOCKID; ShmemLock = (SPINLOCK) SHMEMLOCKID;
BindingLock = (SPINLOCK) BINDINGLOCKID; ShmemIndexLock = (SPINLOCK) SHMEMINDEXLOCKID;
BufMgrLock = (SPINLOCK) BUFMGRLOCKID; BufMgrLock = (SPINLOCK) BUFMGRLOCKID;
LockMgrLock = (SPINLOCK) LOCKMGRLOCKID; LockMgrLock = (SPINLOCK) LOCKMGRLOCKID;
ProcStructLock = (SPINLOCK) PROCSTRUCTLOCKID; ProcStructLock = (SPINLOCK) PROCSTRUCTLOCKID;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.29 1998/06/27 04:53:37 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.30 1998/06/27 15:47:46 momjian Exp $
* *
* NOTES * NOTES
* Outside modules can create a lock table and acquire/release * Outside modules can create a lock table and acquire/release
...@@ -216,9 +216,9 @@ LockTypeInit(LOCKTAB *ltable, ...@@ -216,9 +216,9 @@ LockTypeInit(LOCKTAB *ltable,
* LockTableInit -- initialize a lock table structure * LockTableInit -- initialize a lock table structure
* *
* Notes: * Notes:
* (a) a lock table has four separate entries in the binding * (a) a lock table has four separate entries in the shmem index
* table. This is because every shared hash table and spinlock * table. This is because every shared hash table and spinlock
* has its name stored in the binding table at its creation. It * has its name stored in the shmem index at its creation. It
* is wasteful, in this case, but not much space is involved. * is wasteful, in this case, but not much space is involved.
* *
*/ */
...@@ -242,7 +242,7 @@ LockTableInit(char *tabName, ...@@ -242,7 +242,7 @@ LockTableInit(char *tabName,
return (INVALID_TABLEID); return (INVALID_TABLEID);
} }
/* allocate a string for the binding table lookup */ /* allocate a string for the shmem index table lookup */
shmemName = (char *) palloc((unsigned) (strlen(tabName) + 32)); shmemName = (char *) palloc((unsigned) (strlen(tabName) + 32));
if (!shmemName) if (!shmemName)
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.37 1998/06/27 04:53:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.38 1998/06/27 15:47:46 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
* This is so that we can support more backends. (system-wide semaphore * This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95 * sets run out pretty fast.) -ay 4/95
* *
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.37 1998/06/27 04:53:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.38 1998/06/27 15:47:46 momjian Exp $
*/ */
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
...@@ -184,7 +184,7 @@ InitProcess(IPCKey key) ...@@ -184,7 +184,7 @@ InitProcess(IPCKey key)
{ {
/* /*
* have to allocate one. We can't use the normal binding table * have to allocate one. We can't use the normal shmem index table
* mechanism because the proc structure is stored by PID instead * mechanism because the proc structure is stored by PID instead
* of by a global name (need to look it up by PID when we cleanup * of by a global name (need to look it up by PID when we cleanup
* dead processes). * dead processes).
...@@ -261,7 +261,7 @@ InitProcess(IPCKey key) ...@@ -261,7 +261,7 @@ InitProcess(IPCKey key)
MemSet(MyProc->sLocks, 0, MAX_SPINS * sizeof(*MyProc->sLocks)); MemSet(MyProc->sLocks, 0, MAX_SPINS * sizeof(*MyProc->sLocks));
/* ------------------------- /* -------------------------
* Install ourselves in the binding table. The name to * Install ourselves in the shmem index table. The name to
* use is determined by the OS-assigned process id. That * use is determined by the OS-assigned process id. That
* allows the cleanup process to find us after any untimely * allows the cleanup process to find us after any untimely
* exit. * exit.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: ipc.h,v 1.28 1998/06/27 13:24:21 momjian Exp $ * $Id: ipc.h,v 1.29 1998/06/27 15:47:47 momjian Exp $
* *
* NOTES * NOTES
* This file is very architecture-specific. This stuff should actually * This file is very architecture-specific. This stuff should actually
...@@ -109,7 +109,7 @@ typedef enum _LockId_ ...@@ -109,7 +109,7 @@ typedef enum _LockId_
LOCKLOCKID, LOCKLOCKID,
OIDGENLOCKID, OIDGENLOCKID,
SHMEMLOCKID, SHMEMLOCKID,
BINDINGLOCKID, SHMEMINDEXLOCKID,
LOCKMGRLOCKID, LOCKMGRLOCKID,
SINVALLOCKID, SINVALLOCKID,
...@@ -139,7 +139,7 @@ typedef struct slock ...@@ -139,7 +139,7 @@ typedef struct slock
typedef enum _LockId_ typedef enum _LockId_
{ {
SHMEMLOCKID, SHMEMLOCKID,
BINDINGLOCKID, SHMEMINDEXLOCKID,
BUFMGRLOCKID, BUFMGRLOCKID,
LOCKMGRLOCKID, LOCKMGRLOCKID,
SINVALLOCKID, SINVALLOCKID,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: shmem.h,v 1.12 1998/06/25 14:24:35 momjian Exp $ * $Id: shmem.h,v 1.13 1998/06/27 15:47:48 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -49,7 +49,7 @@ extern SHMEM_OFFSET ShmemBase; ...@@ -49,7 +49,7 @@ extern SHMEM_OFFSET ShmemBase;
extern SPINLOCK ShmemLock; extern SPINLOCK ShmemLock;
extern SPINLOCK BindingLock; extern SPINLOCK ShmemIndexLock;
/* shmemqueue.c */ /* shmemqueue.c */
typedef struct SHM_QUEUE typedef struct SHM_QUEUE
...@@ -59,7 +59,7 @@ typedef struct SHM_QUEUE ...@@ -59,7 +59,7 @@ typedef struct SHM_QUEUE
} SHM_QUEUE; } SHM_QUEUE;
/* shmem.c */ /* shmem.c */
extern void ShmemBindingTableReset(void); extern void ShmemIndexReset(void);
extern void ShmemCreate(unsigned int key, unsigned int size); extern void ShmemCreate(unsigned int key, unsigned int size);
extern int InitShmem(unsigned int key, unsigned int size); extern int InitShmem(unsigned int key, unsigned int size);
extern long *ShmemAlloc(unsigned long size); extern long *ShmemAlloc(unsigned long size);
...@@ -77,21 +77,21 @@ extern bool TransactionIdIsInProgress(TransactionId xid); ...@@ -77,21 +77,21 @@ extern bool TransactionIdIsInProgress(TransactionId xid);
typedef int TableID; typedef int TableID;
/* size constants for the binding table */ /* size constants for the shmem index table */
/* max size of data structure string name */ /* max size of data structure string name */
#define BTABLE_KEYSIZE (50) #define SHMEM_INDEX_KEYSIZE (50)
/* data in binding table hash bucket */ /* data in shmem index table hash bucket */
#define BTABLE_DATASIZE (sizeof(BindingEnt) - BTABLE_KEYSIZE) #define SHMEM_INDEX_DATASIZE (sizeof(ShmemIndexEnt) - SHMEM_INDEX_KEYSIZE)
/* maximum size of the binding table */ /* maximum size of the shmem index table */
#define BTABLE_SIZE (100) #define SHMEM_INDEX_SIZE (100)
/* this is a hash bucket in the binding table */ /* this is a hash bucket in the shmem index table */
typedef struct typedef struct
{ {
char key[BTABLE_KEYSIZE]; /* string name */ char key[SHMEM_INDEX_KEYSIZE]; /* string name */
unsigned long location; /* location in shared mem */ unsigned long location; /* location in shared mem */
unsigned long size; /* numbytes allocated for the structure */ unsigned long size; /* numbytes allocated for the structure */
} BindingEnt; } ShmemIndexEnt;
/* /*
* prototypes for functions in shmqueue.c * prototypes for functions in shmqueue.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment