move XLogPageHeader structs to xlog_utils

This commit is contained in:
anastasia
2021-06-04 15:10:25 +03:00
committed by lubennikovaav
parent d85d67a6f1
commit c31a5e2c8f
2 changed files with 19 additions and 21 deletions

View File

@@ -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,

View File

@@ -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 */
}