]> granicus.if.org Git - postgresql/commitdiff
Flip argument order in XLogSegNoOffsetToRecPtr
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 9 Jul 2018 18:28:21 +0000 (14:28 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 9 Jul 2018 18:33:27 +0000 (14:33 -0400)
Commit fc49e24fa69a added an input argument after the existing output
argument.  Flip those.

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20180708182345.imdgovmkffgtihhk@alvherre.pgsql

src/backend/access/transam/xlog.c
src/backend/access/transam/xlogreader.c
src/backend/replication/logical/reorderbuffer.c
src/bin/pg_basebackup/pg_receivewal.c
src/bin/pg_resetwal/pg_resetwal.c
src/bin/pg_rewind/parsexlog.c
src/bin/pg_waldump/pg_waldump.c
src/include/access/xlog_internal.h

index 4aaa8fb748f3b7a14ae61c93700de7fc06bc762c..56c68775dfbfbc1a139c69900c7e4ca7e96b6fe7 100644 (file)
@@ -1971,7 +1971,7 @@ XLogBytePosToRecPtr(uint64 bytepos)
                seg_offset += fullpages * XLOG_BLCKSZ + bytesleft + SizeOfXLogShortPHD;
        }
 
-       XLogSegNoOffsetToRecPtr(fullsegs, seg_offset, result, wal_segment_size);
+       XLogSegNoOffsetToRecPtr(fullsegs, seg_offset, wal_segment_size, result);
 
        return result;
 }
@@ -2017,7 +2017,7 @@ XLogBytePosToEndRecPtr(uint64 bytepos)
                        seg_offset += fullpages * XLOG_BLCKSZ + bytesleft + SizeOfXLogShortPHD;
        }
 
-       XLogSegNoOffsetToRecPtr(fullsegs, seg_offset, result, wal_segment_size);
+       XLogSegNoOffsetToRecPtr(fullsegs, seg_offset, wal_segment_size, result);
 
        return result;
 }
index dd96cef8f0102f04cef20e7a08714f4d5265088d..4c633c6c49886d9be07ea942028412fc84eb493b 100644 (file)
@@ -747,7 +747,7 @@ XLogReaderValidatePageHeader(XLogReaderState *state, XLogRecPtr recptr,
        XLByteToSeg(recptr, segno, state->wal_segment_size);
        offset = XLogSegmentOffset(recptr, state->wal_segment_size);
 
-       XLogSegNoOffsetToRecPtr(segno, offset, recaddr, state->wal_segment_size);
+       XLogSegNoOffsetToRecPtr(segno, offset, state->wal_segment_size, recaddr);
 
        if (hdr->xlp_magic != XLOG_PAGE_MAGIC)
        {
index d3ec13705104f6fd8235449ef4f845a32142d0fe..9b55b94227b09686281e347ada53cf9f78563b6d 100644 (file)
@@ -2782,7 +2782,7 @@ ReorderBufferSerializedPath(char *path, ReplicationSlot *slot, TransactionId xid
 {
        XLogRecPtr      recptr;
 
-       XLogSegNoOffsetToRecPtr(segno, 0, recptr, wal_segment_size);
+       XLogSegNoOffsetToRecPtr(segno, 0, wal_segment_size, recptr);
 
        snprintf(path, MAXPGPATH, "pg_replslot/%s/xid-%u-lsn-%X-%X.snap",
                         NameStr(MyReplicationSlot->data.name),
index 071b32d19da791b7e917df8a2dc705282f47f56b..ed9d7f6378a57c963383b0366505d1d0707dc0c1 100644 (file)
@@ -352,7 +352,7 @@ FindStreamingStart(uint32 *tli)
                if (!high_ispartial)
                        high_segno++;
 
-               XLogSegNoOffsetToRecPtr(high_segno, 0, high_ptr, WalSegSz);
+               XLogSegNoOffsetToRecPtr(high_segno, 0, WalSegSz, high_ptr);
 
                *tli = high_tli;
                return high_ptr;
index 8cff5356925647fa58e30cd5c4f60aa47ba2845d..d63a3a27f60c4acb8144f7ae24fc091c4ee7f5a4 100644 (file)
@@ -933,8 +933,8 @@ RewriteControlFile(void)
         * Adjust fields as needed to force an empty XLOG starting at
         * newXlogSegNo.
         */
-       XLogSegNoOffsetToRecPtr(newXlogSegNo, SizeOfXLogLongPHD,
-                                                       ControlFile.checkPointCopy.redo, WalSegSz);
+       XLogSegNoOffsetToRecPtr(newXlogSegNo, SizeOfXLogLongPHD, WalSegSz,
+                                                       ControlFile.checkPointCopy.redo);
        ControlFile.checkPointCopy.time = (pg_time_t) time(NULL);
 
        ControlFile.state = DB_SHUTDOWNED;
index b4c1f827a62b279150941aa6dd1233b1df168346..1689279767f1a055c48dd2274705911d301069b2 100644 (file)
@@ -248,7 +248,7 @@ SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
        XLogSegNo       targetSegNo;
 
        XLByteToSeg(targetPagePtr, targetSegNo, WalSegSz);
-       XLogSegNoOffsetToRecPtr(targetSegNo + 1, 0, targetSegEnd, WalSegSz);
+       XLogSegNoOffsetToRecPtr(targetSegNo + 1, 0, WalSegSz, targetSegEnd);
        targetPageOff = XLogSegmentOffset(targetPagePtr, WalSegSz);
 
        /*
index 5c4f38e59713acb84b8c671ea96f6c98005bd64a..d41b831b1804d3014394a000c94cbee2217fa518 100644 (file)
@@ -1039,7 +1039,7 @@ main(int argc, char **argv)
                XLogFromFileName(fname, &private.timeline, &segno, WalSegSz);
 
                if (XLogRecPtrIsInvalid(private.startptr))
-                       XLogSegNoOffsetToRecPtr(segno, 0, private.startptr, WalSegSz);
+                       XLogSegNoOffsetToRecPtr(segno, 0, WalSegSz, private.startptr);
                else if (!XLByteInSeg(private.startptr, segno, WalSegSz))
                {
                        fprintf(stderr,
@@ -1053,7 +1053,7 @@ main(int argc, char **argv)
 
                /* no second file specified, set end position */
                if (!(optind + 1 < argc) && XLogRecPtrIsInvalid(private.endptr))
-                       XLogSegNoOffsetToRecPtr(segno + 1, 0, private.endptr, WalSegSz);
+                       XLogSegNoOffsetToRecPtr(segno + 1, 0, WalSegSz, private.endptr);
 
                /* parse ENDSEG if passed */
                if (optind + 1 < argc)
@@ -1076,8 +1076,8 @@ main(int argc, char **argv)
                                                        argv[optind + 1], argv[optind]);
 
                        if (XLogRecPtrIsInvalid(private.endptr))
-                               XLogSegNoOffsetToRecPtr(endsegno + 1, 0, private.endptr,
-                                                                               WalSegSz);
+                               XLogSegNoOffsetToRecPtr(endsegno + 1, 0, WalSegSz,
+                                                                               private.endptr);
 
                        /* set segno to endsegno for check of --end */
                        segno = endsegno;
index 7c766836dbaeb270da2ba3fcdc8b3bbb50704c0e..30610b3ea966b13b38441ad58794fb11a713e479 100644 (file)
@@ -101,7 +101,7 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader;
 #define XLogSegmentsPerXLogId(wal_segsz_bytes) \
        (UINT64CONST(0x100000000) / (wal_segsz_bytes))
 
-#define XLogSegNoOffsetToRecPtr(segno, offset, dest, wal_segsz_bytes) \
+#define XLogSegNoOffsetToRecPtr(segno, offset, wal_segsz_bytes, dest) \
                (dest) = (segno) * (wal_segsz_bytes) + (offset)
 
 #define XLogSegmentOffset(xlogptr, wal_segsz_bytes)    \