aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/tablespace.c')
-rw-r--r--src/backend/commands/tablespace.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index 616308bc2d3..3c9af5776a0 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -354,20 +354,15 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
/* Record the filesystem change in XLOG */
{
xl_tblspc_create_rec xlrec;
- XLogRecData rdata[2];
xlrec.ts_id = tablespaceoid;
- rdata[0].data = (char *) &xlrec;
- rdata[0].len = offsetof(xl_tblspc_create_rec, ts_path);
- rdata[0].buffer = InvalidBuffer;
- rdata[0].next = &(rdata[1]);
- rdata[1].data = (char *) location;
- rdata[1].len = strlen(location) + 1;
- rdata[1].buffer = InvalidBuffer;
- rdata[1].next = NULL;
+ XLogBeginInsert();
+ XLogRegisterData((char *) &xlrec,
+ offsetof(xl_tblspc_create_rec, ts_path));
+ XLogRegisterData((char *) location, strlen(location) + 1);
- (void) XLogInsert(RM_TBLSPC_ID, XLOG_TBLSPC_CREATE, rdata);
+ (void) XLogInsert(RM_TBLSPC_ID, XLOG_TBLSPC_CREATE);
}
/*
@@ -515,15 +510,13 @@ DropTableSpace(DropTableSpaceStmt *stmt)
/* Record the filesystem change in XLOG */
{
xl_tblspc_drop_rec xlrec;
- XLogRecData rdata[1];
xlrec.ts_id = tablespaceoid;
- rdata[0].data = (char *) &xlrec;
- rdata[0].len = sizeof(xl_tblspc_drop_rec);
- rdata[0].buffer = InvalidBuffer;
- rdata[0].next = NULL;
- (void) XLogInsert(RM_TBLSPC_ID, XLOG_TBLSPC_DROP, rdata);
+ XLogBeginInsert();
+ XLogRegisterData((char *) &xlrec, sizeof(xl_tblspc_drop_rec));
+
+ (void) XLogInsert(RM_TBLSPC_ID, XLOG_TBLSPC_DROP);
}
/*
@@ -1408,12 +1401,12 @@ get_tablespace_name(Oid spc_oid)
* TABLESPACE resource manager's routines
*/
void
-tblspc_redo(XLogRecPtr lsn, XLogRecord *record)
+tblspc_redo(XLogReaderState *record)
{
- uint8 info = record->xl_info & ~XLR_INFO_MASK;
+ uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
/* Backup blocks are not used in tblspc records */
- Assert(!(record->xl_info & XLR_BKP_BLOCK_MASK));
+ Assert(!XLogRecHasAnyBlockRefs(record));
if (info == XLOG_TBLSPC_CREATE)
{