summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAlvaro Herrera2008-06-08 22:00:48 +0000
committerAlvaro Herrera2008-06-08 22:00:48 +0000
commitcc87402d6e40994a53adeba0e11efb1bafcd6451 (patch)
tree542e562625509f71dde5d5dde1bad40fe13a32ee /src/include
parent2071865caaf742a65b9166a9bd4bed3b784d90f0 (diff)
Move BufferGetPageSize and BufferGetPage from bufpage.h to bufmgr.h. It is
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).
Diffstat (limited to 'src/include')
-rw-r--r--src/include/storage/bufmgr.h26
-rw-r--r--src/include/storage/bufpage.h26
2 files changed, 26 insertions, 26 deletions
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index 6ad711b071e..d503d56eba7 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.111 2008/01/01 19:45:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.112 2008/06/08 22:00:48 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,6 +15,7 @@
#define BUFMGR_H
#include "storage/buf.h"
+#include "storage/bufpage.h"
#include "utils/rel.h"
typedef void *Block;
@@ -115,6 +116,29 @@ extern PGDLLIMPORT int32 *LocalRefCount;
)
/*
+ * 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
*/
extern Buffer ReadBuffer(Relation reln, BlockNumber blockNum);
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index 0565ba201a5..a52fb62a9fb 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/bufpage.h,v 1.80 2008/06/06 22:35:22 alvherre Exp $
+ * $PostgreSQL: pgsql/src/include/storage/bufpage.h,v 1.81 2008/06/08 22:00:48 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,7 +15,6 @@
#define BUFPAGE_H
#include "access/xlogdefs.h"
-#include "storage/bufmgr.h"
#include "storage/item.h"
#include "storage/off.h"
@@ -291,29 +290,6 @@ typedef PageHeaderData *PageHeader;
)
/*
- * 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.
* Since offset numbers are 1-based, this is also the number