diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-04-15 23:47:12 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-04-15 23:47:12 +0000 |
commit | 171824087c6cb42ad550f07f7e6a71b859339f7e (patch) | |
tree | abf6e0e67c4d16f045036ef4a0fdfb7fa99186bf /src | |
parent | 33d1bb76c697e9563a681fce5a963121dee7c322 (diff) | |
download | postgresql-171824087c6cb42ad550f07f7e6a71b859339f7e.tar.gz postgresql-171824087c6cb42ad550f07f7e6a71b859339f7e.zip |
The patch I sent to -patches a little while ago wasn't applied: it
was in the thread "make BufferGetBlockNumber() a macro". Tom
objected to the original patch, so I prepared a new one which
doesn't change BufferGetBlockNumber() into a macro, it just
cleans up some comments and fixes an assertion. The patch
is attached.
Neil Conway
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/buffer/bufmgr.c | 4 | ||||
-rw-r--r-- | src/include/storage/buf.h | 10 | ||||
-rw-r--r-- | src/include/storage/bufmgr.h | 10 |
3 files changed, 4 insertions, 20 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index b84fd4d7b75..7546fc37468 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.122 2002/03/06 06:10:02 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.123 2002/04/15 23:47:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1026,7 +1026,7 @@ BufmgrCommit(void) BlockNumber BufferGetBlockNumber(Buffer buffer) { - Assert(BufferIsValid(buffer)); + Assert(BufferIsPinned(buffer)); if (BufferIsLocal(buffer)) return LocalBufferDescriptors[-buffer - 1].tag.blockNum; diff --git a/src/include/storage/buf.h b/src/include/storage/buf.h index 9037587b46d..860845db57c 100644 --- a/src/include/storage/buf.h +++ b/src/include/storage/buf.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: buf.h,v 1.12 2001/11/05 17:46:35 momjian Exp $ + * $Id: buf.h,v 1.13 2002/04/15 23:47:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -36,12 +36,4 @@ typedef int Buffer; */ #define BufferIsLocal(buffer) ((buffer) < 0) -/* - * If NO_BUFFERISVALID is defined, all error checking using BufferIsValid() - * are suppressed. Decision-making using BufferIsValid is not affected. - * This should be set only if one is sure there will be no errors. - * - plai 9/10/90 - */ -#undef NO_BUFFERISVALID - #endif /* BUF_H */ diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index 2bdae7a3a5a..6069814edb1 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: bufmgr.h,v 1.57 2001/11/10 23:51:14 tgl Exp $ + * $Id: bufmgr.h,v 1.58 2002/04/15 23:47:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -44,13 +44,6 @@ extern long *LocalRefCount; #define BUFFER_LOCK_SHARE 1 #define BUFFER_LOCK_EXCLUSIVE 2 - -/********************************************************************** - - the rest is function defns in the bufmgr that are externally callable - - **********************************************************************/ - /* * These routines are beaten on quite heavily, hence the macroization. */ @@ -150,7 +143,6 @@ extern long *LocalRefCount; BufferBlockPointers[(buffer) - 1] \ ) - /* * prototypes for functions in bufmgr.c */ |