diff options
Diffstat (limited to 'src/backend/access/transam/multixact.c')
-rw-r--r-- | src/backend/access/transam/multixact.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c index 3c20bb37e4c..fff9f837330 100644 --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -720,7 +720,6 @@ MultiXactIdCreateFromMembers(int nmembers, MultiXactMember *members) { MultiXactId multi; MultiXactOffset offset; - XLogRecData rdata[2]; xl_multixact_create xlrec; debug_elog3(DEBUG2, "Create: %s", @@ -796,17 +795,11 @@ MultiXactIdCreateFromMembers(int nmembers, MultiXactMember *members) * the status flags in one XLogRecData, then all the xids in another one? * Not clear that it's worth the trouble though. */ - rdata[0].data = (char *) (&xlrec); - rdata[0].len = SizeOfMultiXactCreate; - rdata[0].buffer = InvalidBuffer; - rdata[0].next = &(rdata[1]); + XLogBeginInsert(); + XLogRegisterData((char *) (&xlrec), SizeOfMultiXactCreate); + XLogRegisterData((char *) members, nmembers * sizeof(MultiXactMember)); - rdata[1].data = (char *) members; - rdata[1].len = nmembers * sizeof(MultiXactMember); - rdata[1].buffer = InvalidBuffer; - rdata[1].next = NULL; - - (void) XLogInsert(RM_MULTIXACT_ID, XLOG_MULTIXACT_CREATE_ID, rdata); + (void) XLogInsert(RM_MULTIXACT_ID, XLOG_MULTIXACT_CREATE_ID); /* Now enter the information into the OFFSETs and MEMBERs logs */ RecordNewMultiXact(multi, offset, nmembers, members); @@ -2705,25 +2698,21 @@ MultiXactOffsetPrecedes(MultiXactOffset offset1, MultiXactOffset offset2) static void WriteMZeroPageXlogRec(int pageno, uint8 info) { - XLogRecData rdata; - - rdata.data = (char *) (&pageno); - rdata.len = sizeof(int); - rdata.buffer = InvalidBuffer; - rdata.next = NULL; - (void) XLogInsert(RM_MULTIXACT_ID, info, &rdata); + XLogBeginInsert(); + XLogRegisterData((char *) (&pageno), sizeof(int)); + (void) XLogInsert(RM_MULTIXACT_ID, info); } /* * MULTIXACT resource manager's routines */ void -multixact_redo(XLogRecPtr lsn, XLogRecord *record) +multixact_redo(XLogReaderState *record) { - uint8 info = record->xl_info & ~XLR_INFO_MASK; + uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK; /* Backup blocks are not used in multixact records */ - Assert(!(record->xl_info & XLR_BKP_BLOCK_MASK)); + Assert(!XLogRecHasAnyBlockRefs(record)); if (info == XLOG_MULTIXACT_ZERO_OFF_PAGE) { @@ -2775,7 +2764,7 @@ multixact_redo(XLogRecPtr lsn, XLogRecord *record) * should be unnecessary, since any XID found here ought to have other * evidence in the XLOG, but let's be safe. */ - max_xid = record->xl_xid; + max_xid = XLogRecGetXid(record); for (i = 0; i < xlrec->nmembers; i++) { if (TransactionIdPrecedes(max_xid, xlrec->members[i].xid)) |