aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-12-03 14:58:24 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-12-03 14:58:24 +0200
commit9cea52a5a354853a76b90c20d7d3bf87df45ebbf (patch)
tree68b06ffc07126c49866cdb77b320a93bded75f1d /src
parentfd223c7407c7067ac3ec7e586f9e3d7b5afd2b2e (diff)
downloadpostgresql-9cea52a5a354853a76b90c20d7d3bf87df45ebbf.tar.gz
postgresql-9cea52a5a354853a76b90c20d7d3bf87df45ebbf.zip
Remove misleading comments. Move _Clone and _DeClone functions before
the "END OF FORMAT CALLBACKS" comment, because they are format callbacks too.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_backup_custom.c73
1 files changed, 33 insertions, 40 deletions
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index f2969e2fac4..87c6fb6ec2a 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -597,8 +597,6 @@ _skipData(ArchiveHandle *AH)
* Mandatory.
*
* Called by the archiver to do integer & byte output to the archive.
- * These routines are only used to read & write headers & TOC.
- *
*/
static int
_WriteByte(ArchiveHandle *AH, const int i)
@@ -620,7 +618,6 @@ _WriteByte(ArchiveHandle *AH, const int i)
* Mandatory
*
* Called by the archiver to read bytes & integers from the archive.
- * These routines are only used to read & write headers & TOC.
* EOF should be treated as a fatal error.
*/
static int
@@ -642,8 +639,6 @@ _ReadByte(ArchiveHandle *AH)
* Mandatory.
*
* Called by the archiver to write a block of bytes to the archive.
- * These routines are only used to read & write headers & TOC.
- *
*/
static size_t
_WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
@@ -667,8 +662,6 @@ _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
* Mandatory.
*
* Called by the archiver to read a block of bytes from the archive
- * These routines are only used to read & write headers & TOC.
- *
*/
static size_t
_ReadBuf(ArchiveHandle *AH, void *buf, size_t len)
@@ -770,6 +763,39 @@ _ReopenArchive(ArchiveHandle *AH)
strerror(errno));
}
+/*
+ * Clone format-specific fields during parallel restoration.
+ */
+static void
+_Clone(ArchiveHandle *AH)
+{
+ lclContext *ctx = (lclContext *) AH->formatData;
+
+ AH->formatData = (lclContext *) malloc(sizeof(lclContext));
+ if (AH->formatData == NULL)
+ die_horribly(AH, modulename, "out of memory\n");
+ memcpy(AH->formatData, ctx, sizeof(lclContext));
+ ctx = (lclContext *) AH->formatData;
+
+ /* sanity check, shouldn't happen */
+ if (ctx->cs != NULL)
+ die_horribly(AH, modulename, "compressor active\n");
+
+ /*
+ * Note: we do not make a local lo_buf because we expect at most one BLOBS
+ * entry per archive, so no parallelism is possible. Likewise,
+ * TOC-entry-local state isn't an issue because any one TOC entry is
+ * touched by just one worker child.
+ */
+}
+
+static void
+_DeClone(ArchiveHandle *AH)
+{
+ lclContext *ctx = (lclContext *) AH->formatData;
+ free(ctx);
+}
+
/*--------------------------------------------------
* END OF FORMAT CALLBACKS
*--------------------------------------------------
@@ -889,36 +915,3 @@ _CustomReadFunc(ArchiveHandle *AH, char **buf, size_t *buflen)
}
return cnt;
}
-
-/*
- * Clone format-specific fields during parallel restoration.
- */
-static void
-_Clone(ArchiveHandle *AH)
-{
- lclContext *ctx = (lclContext *) AH->formatData;
-
- AH->formatData = (lclContext *) malloc(sizeof(lclContext));
- if (AH->formatData == NULL)
- die_horribly(AH, modulename, "out of memory\n");
- memcpy(AH->formatData, ctx, sizeof(lclContext));
- ctx = (lclContext *) AH->formatData;
-
- /* sanity check, shouldn't happen */
- if (ctx->cs != NULL)
- die_horribly(AH, modulename, "compressor active\n");
-
- /*
- * Note: we do not make a local lo_buf because we expect at most one BLOBS
- * entry per archive, so no parallelism is possible. Likewise,
- * TOC-entry-local state isn't an issue because any one TOC entry is
- * touched by just one worker child.
- */
-}
-
-static void
-_DeClone(ArchiveHandle *AH)
-{
- lclContext *ctx = (lclContext *) AH->formatData;
- free(ctx);
-}