summaryrefslogtreecommitdiff
path: root/src/include/storage/bufmgr.h
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-08-23 12:10:18 +1200
committerThomas Munro <tmunro@postgresql.org>2023-08-23 12:33:24 +1200
commitf58af9f416f95b1b396aab55c5978f277fe13ac7 (patch)
treed7a2691430d3f120ff8290719dd2f3016e1001ce /src/include/storage/bufmgr.h
parentd8cd49e992eb0d0f3d447d6b41866ce1b573b01d (diff)
ExtendBufferedWhat -> BufferManagerRelation.
Commit 31966b15 invented a way for functions dealing with relation extension to accept a Relation in online code and an SMgrRelation in recovery code. It seems highly likely that future bufmgr.c interfaces will face the same problem, and need to do something similar. Generalize the names so that each interface doesn't have to re-invent the wheel. Back-patch to 16. Since extension AM authors might start using the constructor macros once 16 ships, we agreed to do the rename in 16 rather than waiting for 17. Reviewed-by: Peter Geoghegan <pg@bowt.ie> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA%2BhUKG%2B6tLD2BhpRWycEoti6LVLyQq457UL4ticP5xd8LqHySA%40mail.gmail.com
Diffstat (limited to 'src/include/storage/bufmgr.h')
-rw-r--r--src/include/storage/bufmgr.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index 0f5fb6be00e..b379c76e273 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -92,19 +92,19 @@ typedef enum ExtendBufferedFlags
} ExtendBufferedFlags;
/*
- * To identify the relation - either relation or smgr + relpersistence has to
- * be specified. Used via the EB_REL()/EB_SMGR() macros below. This allows us
- * to use the same function for both crash recovery and normal operation.
+ * Some functions identify relations either by relation or smgr +
+ * relpersistence. Used via the BMR_REL()/BMR_SMGR() macros below. This
+ * allows us to use the same function for both recovery and normal operation.
*/
-typedef struct ExtendBufferedWhat
+typedef struct BufferManagerRelation
{
Relation rel;
struct SMgrRelationData *smgr;
char relpersistence;
-} ExtendBufferedWhat;
+} BufferManagerRelation;
-#define EB_REL(p_rel) ((ExtendBufferedWhat){.rel = p_rel})
-#define EB_SMGR(p_smgr, p_relpersistence) ((ExtendBufferedWhat){.smgr = p_smgr, .relpersistence = p_relpersistence})
+#define BMR_REL(p_rel) ((BufferManagerRelation){.rel = p_rel})
+#define BMR_SMGR(p_smgr, p_relpersistence) ((BufferManagerRelation){.smgr = p_smgr, .relpersistence = p_relpersistence})
/* forward declared, to avoid having to expose buf_internals.h here */
@@ -185,18 +185,18 @@ extern void CheckBufferIsPinnedOnce(Buffer buffer);
extern Buffer ReleaseAndReadBuffer(Buffer buffer, Relation relation,
BlockNumber blockNum);
-extern Buffer ExtendBufferedRel(ExtendBufferedWhat eb,
+extern Buffer ExtendBufferedRel(BufferManagerRelation bmr,
ForkNumber forkNum,
BufferAccessStrategy strategy,
uint32 flags);
-extern BlockNumber ExtendBufferedRelBy(ExtendBufferedWhat eb,
+extern BlockNumber ExtendBufferedRelBy(BufferManagerRelation bmr,
ForkNumber fork,
BufferAccessStrategy strategy,
uint32 flags,
uint32 extend_by,
Buffer *buffers,
uint32 *extended_by);
-extern Buffer ExtendBufferedRelTo(ExtendBufferedWhat eb,
+extern Buffer ExtendBufferedRelTo(BufferManagerRelation bmr,
ForkNumber fork,
BufferAccessStrategy strategy,
uint32 flags,