Move BufferGetPageSize and BufferGetPage from bufpage.h to bufmgr.h. It is
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Sun, 8 Jun 2008 22:00:48 +0000 (22:00 +0000)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Sun, 8 Jun 2008 22:00:48 +0000 (22:00 +0000)
more logical that way, and also it reduces the amount of unnecessary includes
in bufpage.h, which is widely used.

Zdenek Kotala.

My previous patch to bufpage.h should also have credited him as author, but I
forgot (sorry about that).

src/backend/access/gin/ginentrypage.c
src/backend/access/heap/heapam.c
src/backend/access/heap/hio.c
src/backend/access/heap/pruneheap.c
src/backend/access/heap/rewriteheap.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xlogutils.c
src/backend/commands/analyze.c
src/backend/storage/buffer/bufmgr.c
src/include/storage/bufmgr.h
src/include/storage/bufpage.h

index 8630a6881a2d92b7d162c794bee5078ec0894371..5ee5024a94082e4ef444a0378224cea6d3a478c2 100644 (file)
  */
 
 #include "postgres.h"
+
 #include "access/gin.h"
 #include "access/tuptoaster.h"
+#include "storage/bufmgr.h"
 
 /*
  * forms tuple for entry tree. On leaf page, Index tuple has
index c1afff3742173a9479f95c74b9189d999f910311..6c20b48cc4806892a756c87c80caf46b3f33b197 100644 (file)
@@ -52,6 +52,7 @@
 #include "catalog/namespace.h"
 #include "miscadmin.h"
 #include "pgstat.h"
+#include "storage/bufmgr.h"
 #include "storage/lmgr.h"
 #include "storage/procarray.h"
 #include "storage/smgr.h"
index 4da44db398ed472105f7a4ca0e997e4f9f322cef..18103dd1d904bc3899f749e37f40b2603222ae28 100644 (file)
@@ -16,7 +16,7 @@
 #include "postgres.h"
 
 #include "access/hio.h"
-#include "storage/bufpage.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
 #include "storage/lmgr.h"
 
index 1b95ab67b9f3774b1ab6916bfc30af9eaec9edb1..50e61b3771c1368a6b40636fe7f9bde32dd9f425 100644 (file)
@@ -19,7 +19,7 @@
 #include "access/transam.h"
 #include "miscadmin.h"
 #include "pgstat.h"
-#include "storage/bufpage.h"
+#include "storage/bufmgr.h"
 #include "storage/off.h"
 #include "utils/inval.h"
 #include "utils/tqual.h"
index 775c4e23bdcb647ba80ddc0e2187981fbb5c9338..22cd90d1a683510c6186db3ea28fcf0e6129ae0a 100644 (file)
 #include "access/rewriteheap.h"
 #include "access/transam.h"
 #include "access/tuptoaster.h"
+#include "storage/bufmgr.h"
 #include "storage/smgr.h"
 #include "utils/memutils.h"
 
index 58f16be591b2a057b486d87715781f23722bf9b2..0ceb9f579e4ee00c57a7b2679898943ade59ed86 100644 (file)
@@ -38,7 +38,7 @@
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "postmaster/bgwriter.h"
-#include "storage/bufpage.h"
+#include "storage/bufmgr.h"
 #include "storage/fd.h"
 #include "storage/ipc.h"
 #include "storage/pmsignal.h"
index 1561d4ce2e6e4dc3f12f8864ba4d3d56323aa3ba..ef441872b571235a68c40a857a02ca86dedcf87c 100644 (file)
@@ -18,7 +18,7 @@
 #include "postgres.h"
 
 #include "access/xlogutils.h"
-#include "storage/bufpage.h"
+#include "storage/bufmgr.h"
 #include "storage/smgr.h"
 #include "utils/hsearch.h"
 
index c4d61a6100190ef7ab61bf5905159711fae5be3a..1b2945ebd47cc2729b7f9fe7aaf38c4b180db531 100644 (file)
@@ -33,6 +33,7 @@
 #include "parser/parse_relation.h"
 #include "pgstat.h"
 #include "postmaster/autovacuum.h"
+#include "storage/bufmgr.h"
 #include "storage/proc.h"
 #include "storage/procarray.h"
 #include "utils/acl.h"
index f098d1a307691bcdd06e9019abd24ad08febda39..10ebdf44cdee71150a655684e207d594ece96e16 100644 (file)
@@ -36,7 +36,7 @@
 #include "miscadmin.h"
 #include "postmaster/bgwriter.h"
 #include "storage/buf_internals.h"
-#include "storage/bufpage.h"
+#include "storage/bufmgr.h"
 #include "storage/ipc.h"
 #include "storage/proc.h"
 #include "storage/smgr.h"
index 8ec57f2e934a0d863e19fa29c8cb3452b1bc2caa..153f28def477a87df602aba9d0a7d47538eebe47 100644 (file)
@@ -15,6 +15,7 @@
 #define BUFMGR_H
 
 #include "storage/buf.h"
+#include "storage/bufpage.h"
 #include "utils/rel.h"
 
 typedef void *Block;
@@ -114,6 +115,29 @@ extern PGDLLIMPORT int32 *LocalRefCount;
                (Block) (BufferBlocks + ((Size) ((buffer) - 1)) * BLCKSZ) \
 )
 
+/*
+ * BufferGetPageSize
+ *             Returns the page size within a buffer.
+ *
+ * Notes:
+ *             Assumes buffer is valid.
+ *
+ *             The buffer can be a raw disk block and need not contain a valid
+ *             (formatted) disk page.
+ */
+/* XXX should dig out of buffer descriptor */
+#define BufferGetPageSize(buffer) \
+( \
+       AssertMacro(BufferIsValid(buffer)), \
+       (Size)BLCKSZ \
+)
+
+/*
+ * BufferGetPage
+ *             Returns the page associated with a buffer.
+ */
+#define BufferGetPage(buffer) ((Page)BufferGetBlock(buffer))
+
 /*
  * prototypes for functions in bufmgr.c
  */
index a665c7cf6c3f6fc8db9e85efe27f79ffb64a2b99..cabc48f68b6c3c9f70e0e92eeff51cd1042a53a8 100644 (file)
@@ -15,7 +15,6 @@
 #define BUFPAGE_H
 
 #include "access/xlogdefs.h"
-#include "storage/bufmgr.h"
 #include "storage/item.h"
 #include "storage/off.h"
 
@@ -290,29 +289,6 @@ typedef PageHeaderData *PageHeader;
        (Item)(((char *)(page)) + ItemIdGetOffset(itemId)) \
 )
 
-/*
- * BufferGetPageSize
- *             Returns the page size within a buffer.
- *
- * Notes:
- *             Assumes buffer is valid.
- *
- *             The buffer can be a raw disk block and need not contain a valid
- *             (formatted) disk page.
- */
-/* XXX should dig out of buffer descriptor */
-#define BufferGetPageSize(buffer) \
-( \
-       AssertMacro(BufferIsValid(buffer)), \
-       (Size)BLCKSZ \
-)
-
-/*
- * BufferGetPage
- *             Returns the page associated with a buffer.
- */
-#define BufferGetPage(buffer) ((Page)BufferGetBlock(buffer))
-
 /*
  * PageGetMaxOffsetNumber
  *             Returns the maximum offset number used by the given page.