The patch I sent to -patches a little while ago wasn't applied: it
authorBruce Momjian <[email protected]>
Mon, 15 Apr 2002 23:47:12 +0000 (23:47 +0000)
committerBruce Momjian <[email protected]>
Mon, 15 Apr 2002 23:47:12 +0000 (23:47 +0000)
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

src/backend/storage/buffer/bufmgr.c
src/include/storage/buf.h
src/include/storage/bufmgr.h

index 3f99f38e9e17377eaa460ae268e81b308d2e1d96..fc52ff31babb5a79092de3edda45c211d074cc59 100644 (file)
@@ -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;
index fe71f6711e67f455595caad38bd91a895917247a..fc5daea7f806e5a994db2a3d0e6d56dd343cd13c 100644 (file)
@@ -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 */
index 9c379ff902d94ec2de65eac99731669738da6b8d..1ee4b0410c7d2e35768c5c79eb2ad12bfbbbc740 100644 (file)
@@ -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
  */