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

Commitb92f9f7

Browse files
committed
Split macros from visibilitymap.h into a separate header
That allows to include just visibilitymapdefs.h from file.c, and in turn,remove include of postgres.h from relcache.h.Reported-by: Andres FreundDiscussion:https://postgr.es/m/20210913232614.czafiubr435l6egi%40alap3.anarazel.deAuthor: Alexander KorotkovReviewed-by: Andres Freund, Tom Lane, Alvaro HerreraBackpatch-through: 13
1 parentad8a166 commitb92f9f7

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

‎src/bin/pg_upgrade/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include<linux/fs.h>
2020
#endif
2121

22-
#include"access/visibilitymap.h"
22+
#include"access/visibilitymapdefs.h"
2323
#include"common/file_perm.h"
2424
#include"pg_upgrade.h"
2525
#include"storage/bufpage.h"

‎src/include/access/visibilitymap.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,12 @@
1414
#ifndefVISIBILITYMAP_H
1515
#defineVISIBILITYMAP_H
1616

17+
#include"access/visibilitymapdefs.h"
1718
#include"access/xlogdefs.h"
1819
#include"storage/block.h"
1920
#include"storage/buf.h"
2021
#include"utils/relcache.h"
2122

22-
/* Number of bits for one heap page */
23-
#defineBITS_PER_HEAPBLOCK 2
24-
25-
/* Flags for bit map */
26-
#defineVISIBILITYMAP_ALL_VISIBLE0x01
27-
#defineVISIBILITYMAP_ALL_FROZEN0x02
28-
#defineVISIBILITYMAP_VALID_BITS0x03/* OR of all valid visibilitymap
29-
* flags bits */
30-
3123
/* Macros for visibilitymap test */
3224
#defineVM_ALL_VISIBLE(r,b,v) \
3325
((visibilitymap_get_status((r), (b), (v)) & VISIBILITYMAP_ALL_VISIBLE) != 0)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* visibilitymapdefs.h
4+
*macros for accessing contents of visibility map pages
5+
*
6+
*
7+
* Copyright (c) 2021, PostgreSQL Global Development Group
8+
*
9+
* src/include/access/visibilitymapdefs.h
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndefVISIBILITYMAPDEFS_H
14+
#defineVISIBILITYMAPDEFS_H
15+
16+
/* Number of bits for one heap page */
17+
#defineBITS_PER_HEAPBLOCK 2
18+
19+
/* Flags for bit map */
20+
#defineVISIBILITYMAP_ALL_VISIBLE0x01
21+
#defineVISIBILITYMAP_ALL_FROZEN0x02
22+
#defineVISIBILITYMAP_VALID_BITS0x03/* OR of all valid visibilitymap
23+
* flags bits */
24+
25+
#endif/* VISIBILITYMAPDEFS_H */

‎src/include/utils/relcache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#ifndefRELCACHE_H
1515
#defineRELCACHE_H
1616

17-
#include"postgres.h"
1817
#include"access/tupdesc.h"
1918
#include"nodes/bitmapset.h"
2019

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp