|
7 | 7 | * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California
|
9 | 9 | *
|
10 |
| - * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.111 2008/01/01 19:45:58 momjian Exp $ |
| 10 | + * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.112 2008/06/08 22:00:48 alvherre Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
14 | 14 | #ifndefBUFMGR_H
|
15 | 15 | #defineBUFMGR_H
|
16 | 16 |
|
17 | 17 | #include"storage/buf.h"
|
| 18 | +#include"storage/bufpage.h" |
18 | 19 | #include"utils/rel.h"
|
19 | 20 |
|
20 | 21 | typedefvoid*Block;
|
@@ -114,6 +115,29 @@ extern PGDLLIMPORT int32 *LocalRefCount;
|
114 | 115 | (Block) (BufferBlocks + ((Size) ((buffer) - 1)) * BLCKSZ) \
|
115 | 116 | )
|
116 | 117 |
|
| 118 | +/* |
| 119 | + * BufferGetPageSize |
| 120 | + *Returns the page size within a buffer. |
| 121 | + * |
| 122 | + * Notes: |
| 123 | + *Assumes buffer is valid. |
| 124 | + * |
| 125 | + *The buffer can be a raw disk block and need not contain a valid |
| 126 | + *(formatted) disk page. |
| 127 | + */ |
| 128 | +/* XXX should dig out of buffer descriptor */ |
| 129 | +#defineBufferGetPageSize(buffer) \ |
| 130 | +( \ |
| 131 | +AssertMacro(BufferIsValid(buffer)), \ |
| 132 | +(Size)BLCKSZ \ |
| 133 | +) |
| 134 | + |
| 135 | +/* |
| 136 | + * BufferGetPage |
| 137 | + *Returns the page associated with a buffer. |
| 138 | + */ |
| 139 | +#defineBufferGetPage(buffer) ((Page)BufferGetBlock(buffer)) |
| 140 | + |
117 | 141 | /*
|
118 | 142 | * prototypes for functions in bufmgr.c
|
119 | 143 | */
|
|