summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/page.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pg_upgrade/page.c')
-rw-r--r--contrib/pg_upgrade/page.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/contrib/pg_upgrade/page.c b/contrib/pg_upgrade/page.c
index cc0ef54a8ad..1c0d912db01 100644
--- a/contrib/pg_upgrade/page.c
+++ b/contrib/pg_upgrade/page.c
@@ -15,9 +15,9 @@
#ifdef PAGE_CONVERSION
-static const char *getPageVersion(migratorContext *ctx,
+static const char *getPageVersion(
uint16 *version, const char *pathName);
-static pageCnvCtx *loadConverterPlugin(migratorContext *ctx,
+static pageCnvCtx *loadConverterPlugin(
uint16 newPageVersion, uint16 oldPageVersion);
@@ -37,7 +37,7 @@ static pageCnvCtx *loadConverterPlugin(migratorContext *ctx,
* string.
*/
const char *
-setupPageConverter(migratorContext *ctx, pageCnvCtx **result)
+setupPageConverter(pageCnvCtx **result)
{
uint16 oldPageVersion;
uint16 newPageVersion;
@@ -46,15 +46,15 @@ setupPageConverter(migratorContext *ctx, pageCnvCtx **result)
char dstName[MAXPGPATH];
char srcName[MAXPGPATH];
- snprintf(dstName, sizeof(dstName), "%s/global/%u", ctx->new.pgdata,
- ctx->new.pg_database_oid);
- snprintf(srcName, sizeof(srcName), "%s/global/%u", ctx->old.pgdata,
- ctx->old.pg_database_oid);
+ snprintf(dstName, sizeof(dstName), "%s/global/%u", new_cluster.pgdata,
+ new_cluster.pg_database_oid);
+ snprintf(srcName, sizeof(srcName), "%s/global/%u", old_cluster.pgdata,
+ old_cluster.pg_database_oid);
- if ((msg = getPageVersion(ctx, &oldPageVersion, srcName)) != NULL)
+ if ((msg = getPageVersion(&oldPageVersion, srcName)) != NULL)
return msg;
- if ((msg = getPageVersion(ctx, &newPageVersion, dstName)) != NULL)
+ if ((msg = getPageVersion(&newPageVersion, dstName)) != NULL)
return msg;
/*
@@ -73,7 +73,7 @@ setupPageConverter(migratorContext *ctx, pageCnvCtx **result)
* layout.
*/
- if ((converter = loadConverterPlugin(ctx, newPageVersion, oldPageVersion)) == NULL)
+ if ((converter = loadConverterPlugin(newPageVersion, oldPageVersion)) == NULL)
return "can't find plugin to convert from old page layout to new page layout";
else
{
@@ -93,7 +93,7 @@ setupPageConverter(migratorContext *ctx, pageCnvCtx **result)
* of a null-terminated string).
*/
static const char *
-getPageVersion(migratorContext *ctx, uint16 *version, const char *pathName)
+getPageVersion(uint16 *version, const char *pathName)
{
int relfd;
PageHeaderData page;
@@ -128,7 +128,7 @@ getPageVersion(migratorContext *ctx, uint16 *version, const char *pathName)
* is not found, this function returns NULL.
*/
static pageCnvCtx *
-loadConverterPlugin(migratorContext *ctx, uint16 newPageVersion, uint16 oldPageVersion)
+loadConverterPlugin(uint16 newPageVersion, uint16 oldPageVersion)
{
char pluginName[MAXPGPATH];
void *plugin;
@@ -151,7 +151,7 @@ loadConverterPlugin(migratorContext *ctx, uint16 newPageVersion, uint16 oldPageV
return NULL;
else
{
- pageCnvCtx *result = (pageCnvCtx *) pg_malloc(ctx, sizeof(*result));
+ pageCnvCtx *result = (pageCnvCtx *) pg_malloc(sizeof(*result));
result->old.PageVersion = oldPageVersion;
result->new.PageVersion = newPageVersion;