Add some more use of Page/PageData rather than char *
Discussion: https://www.postgresql.org/message-id/flat/692ee0da-49da-4d32-8dca-da224cc2800e@eisentraut.org
This commit is contained in:
parent
4f4a1d853a
commit
443a8e4ae3
@ -72,7 +72,7 @@ typedef struct
|
||||
RelFileLocator rlocator; /* identifies the relation and block */
|
||||
ForkNumber forkno;
|
||||
BlockNumber block;
|
||||
const char *page; /* page content */
|
||||
const PageData *page; /* page content */
|
||||
uint32 rdata_len; /* total length of data in rdata chain */
|
||||
XLogRecData *rdata_head; /* head of the chain of data registered with
|
||||
* this block */
|
||||
@ -138,8 +138,8 @@ static XLogRecData *XLogRecordAssemble(RmgrId rmid, uint8 info,
|
||||
XLogRecPtr RedoRecPtr, bool doPageWrites,
|
||||
XLogRecPtr *fpw_lsn, int *num_fpi,
|
||||
bool *topxid_included);
|
||||
static bool XLogCompressBackupBlock(const char *page, uint16 hole_offset,
|
||||
uint16 hole_length, char *dest, uint16 *dlen);
|
||||
static bool XLogCompressBackupBlock(const PageData *page, uint16 hole_offset,
|
||||
uint16 hole_length, void *dest, uint16 *dlen);
|
||||
|
||||
/*
|
||||
* Begin constructing a WAL record. This must be called before the
|
||||
@ -307,7 +307,7 @@ XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags)
|
||||
*/
|
||||
void
|
||||
XLogRegisterBlock(uint8 block_id, RelFileLocator *rlocator, ForkNumber forknum,
|
||||
BlockNumber blknum, const char *page, uint8 flags)
|
||||
BlockNumber blknum, const PageData *page, uint8 flags)
|
||||
{
|
||||
registered_buffer *regbuf;
|
||||
|
||||
@ -648,7 +648,7 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
|
||||
|
||||
if (include_image)
|
||||
{
|
||||
const char *page = regbuf->page;
|
||||
const PageData *page = regbuf->page;
|
||||
uint16 compressed_len = 0;
|
||||
|
||||
/*
|
||||
@ -941,13 +941,13 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
|
||||
* the length of compressed block image.
|
||||
*/
|
||||
static bool
|
||||
XLogCompressBackupBlock(const char *page, uint16 hole_offset, uint16 hole_length,
|
||||
char *dest, uint16 *dlen)
|
||||
XLogCompressBackupBlock(const PageData *page, uint16 hole_offset, uint16 hole_length,
|
||||
void *dest, uint16 *dlen)
|
||||
{
|
||||
int32 orig_len = BLCKSZ - hole_length;
|
||||
int32 len = -1;
|
||||
int32 extra_bytes = 0;
|
||||
const char *source;
|
||||
const void *source;
|
||||
PGAlignedBlock tmp;
|
||||
|
||||
if (hole_length != 0)
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "access/xlogdefs.h"
|
||||
#include "storage/block.h"
|
||||
#include "storage/buf.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include "storage/relfilelocator.h"
|
||||
#include "utils/relcache.h"
|
||||
|
||||
@ -47,16 +48,16 @@ extern void XLogEnsureRecordSpace(int max_block_id, int ndatas);
|
||||
extern void XLogRegisterData(const char *data, uint32 len);
|
||||
extern void XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags);
|
||||
extern void XLogRegisterBlock(uint8 block_id, RelFileLocator *rlocator,
|
||||
ForkNumber forknum, BlockNumber blknum, const char *page,
|
||||
ForkNumber forknum, BlockNumber blknum, const PageData *page,
|
||||
uint8 flags);
|
||||
extern void XLogRegisterBufData(uint8 block_id, const char *data, uint32 len);
|
||||
extern void XLogResetInsertion(void);
|
||||
extern bool XLogCheckBufferNeedsBackup(Buffer buffer);
|
||||
|
||||
extern XLogRecPtr log_newpage(RelFileLocator *rlocator, ForkNumber forknum,
|
||||
BlockNumber blkno, char *page, bool page_std);
|
||||
BlockNumber blkno, Page page, bool page_std);
|
||||
extern void log_newpages(RelFileLocator *rlocator, ForkNumber forknum, int num_pages,
|
||||
BlockNumber *blknos, char **pages, bool page_std);
|
||||
BlockNumber *blknos, Page *pages, bool page_std);
|
||||
extern XLogRecPtr log_newpage_buffer(Buffer buffer, bool page_std);
|
||||
extern void log_newpage_range(Relation rel, ForkNumber forknum,
|
||||
BlockNumber startblk, BlockNumber endblk, bool page_std);
|
||||
|
Loading…
x
Reference in New Issue
Block a user