diff options
author | Tom Lane | 2017-09-18 20:36:28 +0000 |
---|---|---|
committer | Tom Lane | 2017-09-18 20:36:28 +0000 |
commit | eb5c404b17752ca566947f12cb702438dcccdcb1 (patch) | |
tree | a81c6221cc1376d3b911d2b20e9e86e5d737a189 /contrib/pgstattuple/pgstattuple.c | |
parent | 66917bfaa7bb0b6bae52a5fe631a8b6443203f55 (diff) |
Minor code-cleanliness improvements for btree.
Make the btree page-flags test macros (P_ISLEAF and friends) return clean
boolean values, rather than values that might not fit in a bool. Use them
in a few places that were randomly referencing the flag bits directly.
In passing, change access/nbtree/'s only direct use of BUFFER_LOCK_SHARE to
BT_READ. (Some think we should go the other way, but as long as we have
BT_READ/BT_WRITE, let's use them consistently.)
Masahiko Sawada, reviewed by Doug Doole
Discussion: https://postgr.es/m/CAD21AoBmWPeN=WBB5Jvyz_Nt3rmW1ebUyAnk3ZbJP3RMXALJog@mail.gmail.com
Diffstat (limited to 'contrib/pgstattuple/pgstattuple.c')
-rw-r--r-- | contrib/pgstattuple/pgstattuple.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/pgstattuple/pgstattuple.c b/contrib/pgstattuple/pgstattuple.c index 7a91cc3468f..7ca1bb24d2f 100644 --- a/contrib/pgstattuple/pgstattuple.c +++ b/contrib/pgstattuple/pgstattuple.c @@ -416,7 +416,7 @@ pgstat_btree_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno, BTPageOpaque opaque; opaque = (BTPageOpaque) PageGetSpecialPointer(page); - if (opaque->btpo_flags & (BTP_DELETED | BTP_HALF_DEAD)) + if (P_IGNORE(opaque)) { /* recyclable page */ stat->free_space += BLCKSZ; |