diff --git a/pageserver/src/waldecoder.rs b/pageserver/src/waldecoder.rs index fb686fe996..a3d17a0f9c 100644 --- a/pageserver/src/waldecoder.rs +++ b/pageserver/src/waldecoder.rs @@ -19,27 +19,6 @@ pub type MultiXactId = TransactionId; pub type MultiXactOffset = u32; pub type MultiXactStatus = u32; -// From PostgreSQL headers - -#[repr(C)] -#[derive(Debug)] -pub struct XLogPageHeaderData { - xlp_magic: u16, /* magic value for correctness checks */ - xlp_info: u16, /* flag bits, see below */ - xlp_tli: u32, /* TimeLineID of first record on page */ - xlp_pageaddr: u64, /* XLOG address of this page */ - xlp_rem_len: u32, /* total len of remaining data for record */ -} - -#[repr(C)] -#[derive(Debug)] -pub struct XLogLongPageHeaderData { - std: XLogPageHeaderData, /* standard header fields */ - xlp_sysid: u64, /* system identifier from pg_control */ - xlp_seg_size: u32, /* just as a cross-check */ - xlp_xlog_blcksz: u32, /* just as a cross-check */ -} - #[allow(dead_code)] pub struct WalStreamDecoder { lsn: Lsn, diff --git a/postgres_ffi/src/xlog_utils.rs b/postgres_ffi/src/xlog_utils.rs index 4a0266b077..22f8232f24 100644 --- a/postgres_ffi/src/xlog_utils.rs +++ b/postgres_ffi/src/xlog_utils.rs @@ -292,3 +292,22 @@ impl XLogRecord { self.xl_info == pg_constants::XLOG_SWITCH && self.xl_rmid == pg_constants::RM_XLOG_ID } } + +#[repr(C)] +#[derive(Debug)] +pub struct XLogPageHeaderData { + pub xlp_magic: u16, /* magic value for correctness checks */ + pub xlp_info: u16, /* flag bits, see below */ + pub xlp_tli: u32, /* TimeLineID of first record on page */ + pub xlp_pageaddr: u64, /* XLOG address of this page */ + pub xlp_rem_len: u32, /* total len of remaining data for record */ +} + +#[repr(C)] +#[derive(Debug)] +pub struct XLogLongPageHeaderData { + pub std: XLogPageHeaderData, /* standard header fields */ + pub xlp_sysid: u64, /* system identifier from pg_control */ + pub xlp_seg_size: u32, /* just as a cross-check */ + pub xlp_xlog_blcksz: u32, /* just as a cross-check */ +}