summaryrefslogtreecommitdiff
path: root/src/include/storage/bufmgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/storage/bufmgr.h')
-rw-r--r--src/include/storage/bufmgr.h42
1 files changed, 9 insertions, 33 deletions
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index 86040610e77..b514b4696d1 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -48,19 +48,6 @@ typedef enum
* replay; otherwise same as RBM_NORMAL */
} ReadBufferMode;
-/*
- * Forced choice for whether BufferGetPage() must check snapshot age
- *
- * A scan must test for old snapshot, unless the test would be redundant (for
- * example, to tests already made at a lower level on all code paths).
- * Positioning for DML or vacuuming does not need this sort of test.
- */
-typedef enum
-{
- BGP_NO_SNAPSHOT_TEST, /* Not used for scan, or is redundant */
- BGP_TEST_FOR_OLD_SNAPSHOT /* Test for old snapshot is needed */
-} BufferGetPageAgeTest;
-
/* forward declared, to avoid having to expose buf_internals.h here */
struct WritebackContext;
@@ -178,6 +165,15 @@ extern PGDLLIMPORT int32 *LocalRefCount;
)
/*
+ * BufferGetPage
+ * Returns the page associated with a buffer.
+ *
+ * When this is called as part of a scan, there may be a need for a nearby
+ * call to TestForOldSnapshot(). See the definition of that for details.
+ */
+#define BufferGetPage(buffer) ((Page)BufferGetBlock(buffer))
+
+/*
* prototypes for functions in bufmgr.c
*/
extern bool ComputeIoConcurrency(int io_concurrency, double *target);
@@ -261,26 +257,6 @@ extern void FreeAccessStrategy(BufferAccessStrategy strategy);
#ifndef FRONTEND
-/*
- * BufferGetPage
- * Returns the page associated with a buffer.
- *
- * For call sites where the check is not needed (which is the vast majority of
- * them), the snapshot and relation parameters can, and generally should, be
- * NULL.
- */
-static inline Page
-BufferGetPage(Buffer buffer, Snapshot snapshot, Relation relation,
- BufferGetPageAgeTest agetest)
-{
- Page page = (Page) BufferGetBlock(buffer);
-
- if (agetest == BGP_TEST_FOR_OLD_SNAPSHOT)
- TestForOldSnapshot(snapshot, relation, page);
-
- return page;
-}
-
#endif /* FRONTEND */
#endif /* BUFMGR_H */