@@ -72,7 +72,7 @@ typedef struct
7272RelFileLocator rlocator ;/* identifies the relation and block */
7373ForkNumber forkno ;
7474BlockNumber block ;
75- Page page ;/* page content */
75+ const char * page ;/* page content */
7676uint32 rdata_len ;/* total length of data in rdata chain */
7777XLogRecData * rdata_head ;/* head of the chain of data registered with
7878 * this block */
@@ -138,7 +138,7 @@ static XLogRecData *XLogRecordAssemble(RmgrId rmid, uint8 info,
138138XLogRecPtr RedoRecPtr ,bool doPageWrites ,
139139XLogRecPtr * fpw_lsn ,int * num_fpi ,
140140bool * topxid_included );
141- static bool XLogCompressBackupBlock (char * page ,uint16 hole_offset ,
141+ static bool XLogCompressBackupBlock (const char * page ,uint16 hole_offset ,
142142uint16 hole_length ,char * dest ,uint16 * dlen );
143143
144144/*
@@ -307,7 +307,7 @@ XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags)
307307 */
308308void
309309XLogRegisterBlock (uint8 block_id ,RelFileLocator * rlocator ,ForkNumber forknum ,
310- BlockNumber blknum ,Page page ,uint8 flags )
310+ BlockNumber blknum ,const char * page ,uint8 flags )
311311{
312312registered_buffer * regbuf ;
313313
@@ -361,7 +361,7 @@ XLogRegisterBlock(uint8 block_id, RelFileLocator *rlocator, ForkNumber forknum,
361361 * XLogRecGetData().
362362 */
363363void
364- XLogRegisterData (char * data ,uint32 len )
364+ XLogRegisterData (const char * data ,uint32 len )
365365{
366366XLogRecData * rdata ;
367367
@@ -402,7 +402,7 @@ XLogRegisterData(char *data, uint32 len)
402402 * limited)
403403 */
404404void
405- XLogRegisterBufData (uint8 block_id ,char * data ,uint32 len )
405+ XLogRegisterBufData (uint8 block_id ,const char * data ,uint32 len )
406406{
407407registered_buffer * regbuf ;
408408XLogRecData * rdata ;
@@ -648,7 +648,7 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
648648
649649if (include_image )
650650{
651- Page page = regbuf -> page ;
651+ const char * page = regbuf -> page ;
652652uint16 compressed_len = 0 ;
653653
654654/*
@@ -941,23 +941,23 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
941941 * the length of compressed block image.
942942 */
943943static bool
944- XLogCompressBackupBlock (char * page ,uint16 hole_offset ,uint16 hole_length ,
944+ XLogCompressBackupBlock (const char * page ,uint16 hole_offset ,uint16 hole_length ,
945945char * dest ,uint16 * dlen )
946946{
947947int32 orig_len = BLCKSZ - hole_length ;
948948int32 len = -1 ;
949949int32 extra_bytes = 0 ;
950- char * source ;
950+ const char * source ;
951951PGAlignedBlock tmp ;
952952
953953if (hole_length != 0 )
954954{
955955/* must skip the hole */
956- source = tmp .data ;
957- memcpy (source ,page ,hole_offset );
958- memcpy (source + hole_offset ,
956+ memcpy (tmp .data ,page ,hole_offset );
957+ memcpy (tmp .data + hole_offset ,
959958page + (hole_offset + hole_length ),
960959BLCKSZ - (hole_length + hole_offset ));
960+ source = tmp .data ;
961961
962962/*
963963 * Extra data needs to be stored in WAL record for the compressed