Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc87402

Browse files
committed
Move BufferGetPageSize and BufferGetPage from bufpage.h to bufmgr.h. It is
more logical that way, and also it reduces the amount of unnecessary includesin bufpage.h, which is widely used.Zdenek Kotala.My previous patch to bufpage.h should also have credited him as author, but Iforgot (sorry about that).
1 parent2071865 commitcc87402

File tree

11 files changed

+45
-40
lines changed

11 files changed

+45
-40
lines changed

‎src/backend/access/gin/ginentrypage.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
*$PostgreSQL: pgsql/src/backend/access/gin/ginentrypage.c,v 1.14 2008/05/12 16:06:09 alvherre Exp $
11+
*$PostgreSQL: pgsql/src/backend/access/gin/ginentrypage.c,v 1.15 2008/06/08 22:00:46 alvherre Exp $
1212
*-------------------------------------------------------------------------
1313
*/
1414

1515
#include"postgres.h"
16+
1617
#include"access/gin.h"
1718
#include"access/tuptoaster.h"
19+
#include"storage/bufmgr.h"
1820

1921
/*
2022
* forms tuple for entry tree. On leaf page, Index tuple has

‎src/backend/access/heap/heapam.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.257 2008/05/12 16:06:09 alvherre Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.258 2008/06/08 22:00:47 alvherre Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -52,6 +52,7 @@
5252
#include"catalog/namespace.h"
5353
#include"miscadmin.h"
5454
#include"pgstat.h"
55+
#include"storage/bufmgr.h"
5556
#include"storage/lmgr.h"
5657
#include"storage/procarray.h"
5758
#include"storage/smgr.h"

‎src/backend/access/heap/hio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/heap/hio.c,v 1.70 2008/05/12 16:06:09 alvherre Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/heap/hio.c,v 1.71 2008/06/08 22:00:47 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
1515

1616
#include"postgres.h"
1717

1818
#include"access/hio.h"
19-
#include"storage/bufpage.h"
19+
#include"storage/bufmgr.h"
2020
#include"storage/freespace.h"
2121
#include"storage/lmgr.h"
2222

‎src/backend/access/heap/pruneheap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/heap/pruneheap.c,v 1.12 2008/05/13 15:44:08 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/heap/pruneheap.c,v 1.13 2008/06/08 22:00:47 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -19,7 +19,7 @@
1919
#include"access/transam.h"
2020
#include"miscadmin.h"
2121
#include"pgstat.h"
22-
#include"storage/bufpage.h"
22+
#include"storage/bufmgr.h"
2323
#include"storage/off.h"
2424
#include"utils/inval.h"
2525
#include"utils/tqual.h"

‎src/backend/access/heap/rewriteheap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
* Portions Copyright (c) 1994-5, Regents of the University of California
9797
*
9898
* IDENTIFICATION
99-
* $PostgreSQL: pgsql/src/backend/access/heap/rewriteheap.c,v 1.12 2008/05/12 16:06:09 alvherre Exp $
99+
* $PostgreSQL: pgsql/src/backend/access/heap/rewriteheap.c,v 1.13 2008/06/08 22:00:47 alvherre Exp $
100100
*
101101
*-------------------------------------------------------------------------
102102
*/
@@ -106,6 +106,7 @@
106106
#include"access/rewriteheap.h"
107107
#include"access/transam.h"
108108
#include"access/tuptoaster.h"
109+
#include"storage/bufmgr.h"
109110
#include"storage/smgr.h"
110111
#include"utils/memutils.h"
111112

‎src/backend/access/transam/xlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.312 2008/05/28 15:22:05 mha Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.313 2008/06/0822:00:47 alvherre Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -38,7 +38,7 @@
3838
#include"miscadmin.h"
3939
#include"pgstat.h"
4040
#include"postmaster/bgwriter.h"
41-
#include"storage/bufpage.h"
41+
#include"storage/bufmgr.h"
4242
#include"storage/fd.h"
4343
#include"storage/ipc.h"
4444
#include"storage/pmsignal.h"

‎src/backend/access/transam/xlogutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/backend/access/transam/xlogutils.c,v 1.53 2008/05/12 16:06:09 alvherre Exp $
14+
* $PostgreSQL: pgsql/src/backend/access/transam/xlogutils.c,v 1.54 2008/06/08 22:00:47 alvherre Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
1818
#include"postgres.h"
1919

2020
#include"access/xlogutils.h"
21-
#include"storage/bufpage.h"
21+
#include"storage/bufmgr.h"
2222
#include"storage/smgr.h"
2323
#include"utils/hsearch.h"
2424

‎src/backend/commands/analyze.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.121 2008/05/12 16:06:09 alvherre Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.122 2008/06/08 22:00:47 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -33,6 +33,7 @@
3333
#include"parser/parse_relation.h"
3434
#include"pgstat.h"
3535
#include"postmaster/autovacuum.h"
36+
#include"storage/bufmgr.h"
3637
#include"storage/proc.h"
3738
#include"storage/procarray.h"
3839
#include"utils/acl.h"

‎src/backend/storage/buffer/bufmgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.230 2008/05/12 16:06:09 alvherre Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.231 2008/06/08 22:00:47 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -36,7 +36,7 @@
3636
#include"miscadmin.h"
3737
#include"postmaster/bgwriter.h"
3838
#include"storage/buf_internals.h"
39-
#include"storage/bufpage.h"
39+
#include"storage/bufmgr.h"
4040
#include"storage/ipc.h"
4141
#include"storage/proc.h"
4242
#include"storage/smgr.h"

‎src/include/storage/bufmgr.h

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
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 $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#ifndefBUFMGR_H
1515
#defineBUFMGR_H
1616

1717
#include"storage/buf.h"
18+
#include"storage/bufpage.h"
1819
#include"utils/rel.h"
1920

2021
typedefvoid*Block;
@@ -114,6 +115,29 @@ extern PGDLLIMPORT int32 *LocalRefCount;
114115
(Block) (BufferBlocks + ((Size) ((buffer) - 1)) * BLCKSZ) \
115116
)
116117

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+
117141
/*
118142
* prototypes for functions in bufmgr.c
119143
*/

‎src/include/storage/bufpage.h

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/storage/bufpage.h,v 1.80 2008/06/06 22:35:22 alvherre Exp $
10+
* $PostgreSQL: pgsql/src/include/storage/bufpage.h,v 1.81 2008/06/08 22:00:48 alvherre Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#ifndefBUFPAGE_H
1515
#defineBUFPAGE_H
1616

1717
#include"access/xlogdefs.h"
18-
#include"storage/bufmgr.h"
1918
#include"storage/item.h"
2019
#include"storage/off.h"
2120

@@ -290,29 +289,6 @@ typedef PageHeaderData *PageHeader;
290289
(Item)(((char *)(page)) + ItemIdGetOffset(itemId)) \
291290
)
292291

293-
/*
294-
* BufferGetPageSize
295-
*Returns the page size within a buffer.
296-
*
297-
* Notes:
298-
*Assumes buffer is valid.
299-
*
300-
*The buffer can be a raw disk block and need not contain a valid
301-
*(formatted) disk page.
302-
*/
303-
/* XXX should dig out of buffer descriptor */
304-
#defineBufferGetPageSize(buffer) \
305-
( \
306-
AssertMacro(BufferIsValid(buffer)), \
307-
(Size)BLCKSZ \
308-
)
309-
310-
/*
311-
* BufferGetPage
312-
*Returns the page associated with a buffer.
313-
*/
314-
#defineBufferGetPage(buffer) ((Page)BufferGetBlock(buffer))
315-
316292
/*
317293
* PageGetMaxOffsetNumber
318294
*Returns the maximum offset number used by the given page.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp