diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-11-30 01:39:08 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-11-30 01:39:08 +0000 |
commit | 680b7357ce850c28d06997be793aee18f72434ba (patch) | |
tree | 79c9ab2ef4ac257301510d9ca6bc37b8c6dfba8b /src/include/storage/buf_internals.h | |
parent | 9f20852f878dbacc0412d909d48fcbd779d7779e (diff) | |
download | postgresql-680b7357ce850c28d06997be793aee18f72434ba.tar.gz postgresql-680b7357ce850c28d06997be793aee18f72434ba.zip |
Rearrange bufmgr header files so that buf_internals.h need not be
included by everything that includes bufmgr.h --- it's supposed to be
internals, after all, not part of the API! This fixes the conflict
against FreeBSD headers reported by Rosenman, by making it unnecessary
for s_lock.h to be included by plperl.c.
Diffstat (limited to 'src/include/storage/buf_internals.h')
-rw-r--r-- | src/include/storage/buf_internals.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h index ae417118878..41fce0780f0 100644 --- a/src/include/storage/buf_internals.h +++ b/src/include/storage/buf_internals.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: buf_internals.h,v 1.44 2000/11/28 23:27:57 tgl Exp $ + * $Id: buf_internals.h,v 1.45 2000/11/30 01:39:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -18,14 +18,17 @@ #include "storage/lmgr.h" #include "storage/s_lock.h" + /* Buf Mgr constants */ /* in bufmgr.c */ -extern int NBuffers; extern int Data_Descriptors; extern int Free_List_Descriptor; extern int Lookup_List_Descriptor; extern int Num_Descriptors; +extern int ShowPinTrace; + + /* * Flags for buffer descriptors */ @@ -40,9 +43,6 @@ extern int Num_Descriptors; typedef bits16 BufFlags; -/* long * so alignment will be correct */ -typedef long **BufferBlock; - typedef struct buftag { RelFileNode rnode; @@ -63,7 +63,7 @@ typedef struct buftag ) /* - * We don't need in this data any more but it allows more user + * We don't need this data any more but it allows more user * friendly error messages. Feel free to get rid of it * (and change a lot of places -:)) */ @@ -73,9 +73,6 @@ typedef struct bufblindid char relname[NAMEDATALEN]; /* name of reln */ } BufferBlindId; -#define BAD_BUFFER_ID(bid) ((bid) < 1 || (bid) > NBuffers) -#define INVALID_DESCRIPTOR (-3) - /* * BufferDesc -- shared buffer cache metadata for a single * shared buffer descriptor. @@ -123,6 +120,8 @@ typedef struct sbufdesc void (*CleanupFunc)(Buffer); } BufferDesc; +#define BufferDescriptorGetBuffer(bdesc) ((bdesc)->buf_id + 1) + /* * Each backend has its own BufferLocks[] array holding flag bits * showing what locks it has set on each buffer. @@ -182,8 +181,6 @@ extern bool BufTableInsert(BufferDesc *buf); /* bufmgr.c */ extern BufferDesc *BufferDescriptors; -extern BufferBlock BufferBlocks; -extern long *PrivateRefCount; extern bits8 *BufferLocks; extern BufferTag *BufferTagLastDirtied; extern BufferBlindId *BufferBlindLastDirtied; @@ -192,15 +189,12 @@ extern bool *BufferDirtiedByMe; extern SPINLOCK BufMgrLock; /* localbuf.c */ -extern long *LocalRefCount; extern BufferDesc *LocalBufferDescriptors; -extern int NLocBuffer; extern BufferDesc *LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr); extern int WriteLocalBuffer(Buffer buffer, bool release); extern int FlushLocalBuffer(Buffer buffer, bool sync, bool release); -extern void InitLocalBuffer(void); extern void LocalBufferSync(void); extern void ResetLocalBufferPool(void); |