1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-25 12:03:53 +03:00

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).
This commit is contained in:
Alvaro Herrera
2008-06-08 22:00:48 +00:00
parent 2071865caa
commit cc87402d6e
11 changed files with 45 additions and 40 deletions

View File

@@ -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"
@@ -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.