diff options
Diffstat (limited to 'src/include/storage')
-rw-r--r-- | src/include/storage/buf_internals.h | 13 | ||||
-rw-r--r-- | src/include/storage/bufmgr.h | 16 | ||||
-rw-r--r-- | src/include/storage/bufpage.h | 3 | ||||
-rw-r--r-- | src/include/storage/itemid.h | 8 |
4 files changed, 35 insertions, 5 deletions
diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h index 12bf6604da1..86512e50bf8 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.39 2000/10/18 05:50:16 vadim Exp $ + * $Id: buf_internals.h,v 1.40 2000/10/20 11:01:21 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -121,10 +121,19 @@ typedef struct sbufdesc * * Why we keep relId here? To re-use file descriptors. On rollback * WAL uses dummy relId - bad (more blind writes - open/close calls), - * but allowable. Obviously we should have another cache in file manager. + * but allowable. Obviously we should have another cache in file manager + * - fd is not relcache deal. */ LockRelId relId; BufferBlindId blind; /* was used to support blind write */ + + /* + * When we can't delete item from page (someone else has buffer pinned) + * we mark buffer for cleanup by specifying appropriate for buffer + * content cleanup function. Buffer will be cleaned up from release + * buffer functions. + */ + void (*CleanupFunc)(Buffer); } BufferDesc; /* diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index 1a06953f513..551f98e75f9 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: bufmgr.h,v 1.40 2000/08/07 20:15:50 tgl Exp $ + * $Id: bufmgr.h,v 1.41 2000/10/20 11:01:21 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -44,6 +44,17 @@ extern int ShowPinTrace; #define BUFFER_LOCK_SHARE 1 #define BUFFER_LOCK_EXCLUSIVE 2 +#define UnlockAndReleaseBuffer(buffer) \ +( \ + LockBuffer(buffer, BUFFER_LOCK_UNLOCK), \ + ReleaseBuffer(buffer) \ +) + +#define UnlockAndWriteBuffer(buffer) \ +( \ + LockBuffer(buffer, BUFFER_LOCK_UNLOCK), \ + WriteBuffer(buffer) \ +) /* * BufferIsValid @@ -163,4 +174,7 @@ extern void UnlockBuffers(void); extern void LockBuffer(Buffer buffer, int mode); extern void AbortBufferIO(void); +extern bool BufferIsUpdatable(Buffer buffer); +extern void MarkBufferForCleanup(Buffer buffer, void (*CleanupFunc)(Buffer)); + #endif diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h index 58ba61f68d8..85e51122f9c 100644 --- a/src/include/storage/bufpage.h +++ b/src/include/storage/bufpage.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: bufpage.h,v 1.32 2000/09/07 09:58:36 vadim Exp $ + * $Id: bufpage.h,v 1.33 2000/10/20 11:01:21 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -20,6 +20,7 @@ #include "storage/itemid.h" #include "storage/off.h" #include "storage/page.h" +#include "access/xlog.h" /* * a postgres disk page is an abstraction layered on top of a postgres diff --git a/src/include/storage/itemid.h b/src/include/storage/itemid.h index 0b330ce56fe..a915f701684 100644 --- a/src/include/storage/itemid.h +++ b/src/include/storage/itemid.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: itemid.h,v 1.12 2000/09/07 09:58:36 vadim Exp $ + * $Id: itemid.h,v 1.13 2000/10/20 11:01:21 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -41,6 +41,12 @@ typedef ItemIdData *ItemId; #endif /* + * This bit may be passed to PageAddItem together with + * LP_USED & LP_DELETED bits to specify overwrite mode + */ +#define OverwritePageMode 0x10 + +/* * Item offsets, lengths, and flags are represented by these types when * they're not actually stored in an ItemIdData. */ |