mirror of
https://github.com/postgres/postgres.git
synced 2025-05-12 16:21:30 +03:00
Rename PageData to GenericXLogPageData
In the PostgreSQL C type naming schema, the type PageData should be what the pointer of type Page points to. But in this case it's actually an unrelated type local to generic_xlog.c. Rename that to a more specific name. This makes room to possible add a PageData type with the mentioned meaning, but this is not done here. Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://www.postgresql.org/message-id/flat/001d457e-c118-4219-8132-e1846c2ae3c9%40eisentraut.org
This commit is contained in:
parent
9428c001f6
commit
ddbba3aac8
@ -55,7 +55,7 @@ typedef struct
|
|||||||
char *image; /* copy of page image for modification, do not
|
char *image; /* copy of page image for modification, do not
|
||||||
* do it in-place to have aligned memory chunk */
|
* do it in-place to have aligned memory chunk */
|
||||||
char delta[MAX_DELTA_SIZE]; /* delta between page images */
|
char delta[MAX_DELTA_SIZE]; /* delta between page images */
|
||||||
} PageData;
|
} GenericXLogPageData;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* State of generic xlog record construction. Must be allocated at an I/O
|
* State of generic xlog record construction. Must be allocated at an I/O
|
||||||
@ -66,17 +66,17 @@ struct GenericXLogState
|
|||||||
/* Page images (properly aligned, must be first) */
|
/* Page images (properly aligned, must be first) */
|
||||||
PGIOAlignedBlock images[MAX_GENERIC_XLOG_PAGES];
|
PGIOAlignedBlock images[MAX_GENERIC_XLOG_PAGES];
|
||||||
/* Info about each page, see above */
|
/* Info about each page, see above */
|
||||||
PageData pages[MAX_GENERIC_XLOG_PAGES];
|
GenericXLogPageData pages[MAX_GENERIC_XLOG_PAGES];
|
||||||
bool isLogged;
|
bool isLogged;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void writeFragment(PageData *pageData, OffsetNumber offset,
|
static void writeFragment(GenericXLogPageData *pageData, OffsetNumber offset,
|
||||||
OffsetNumber length, const char *data);
|
OffsetNumber length, const char *data);
|
||||||
static void computeRegionDelta(PageData *pageData,
|
static void computeRegionDelta(GenericXLogPageData *pageData,
|
||||||
const char *curpage, const char *targetpage,
|
const char *curpage, const char *targetpage,
|
||||||
int targetStart, int targetEnd,
|
int targetStart, int targetEnd,
|
||||||
int validStart, int validEnd);
|
int validStart, int validEnd);
|
||||||
static void computeDelta(PageData *pageData, Page curpage, Page targetpage);
|
static void computeDelta(GenericXLogPageData *pageData, Page curpage, Page targetpage);
|
||||||
static void applyPageRedo(Page page, const char *delta, Size deltaSize);
|
static void applyPageRedo(Page page, const char *delta, Size deltaSize);
|
||||||
|
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ static void applyPageRedo(Page page, const char *delta, Size deltaSize);
|
|||||||
* actual data (of length length).
|
* actual data (of length length).
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
writeFragment(PageData *pageData, OffsetNumber offset, OffsetNumber length,
|
writeFragment(GenericXLogPageData *pageData, OffsetNumber offset, OffsetNumber length,
|
||||||
const char *data)
|
const char *data)
|
||||||
{
|
{
|
||||||
char *ptr = pageData->delta + pageData->deltaLen;
|
char *ptr = pageData->delta + pageData->deltaLen;
|
||||||
@ -118,7 +118,7 @@ writeFragment(PageData *pageData, OffsetNumber offset, OffsetNumber length,
|
|||||||
* about the data-matching loops.
|
* about the data-matching loops.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
computeRegionDelta(PageData *pageData,
|
computeRegionDelta(GenericXLogPageData *pageData,
|
||||||
const char *curpage, const char *targetpage,
|
const char *curpage, const char *targetpage,
|
||||||
int targetStart, int targetEnd,
|
int targetStart, int targetEnd,
|
||||||
int validStart, int validEnd)
|
int validStart, int validEnd)
|
||||||
@ -225,7 +225,7 @@ computeRegionDelta(PageData *pageData,
|
|||||||
* and store it in pageData's delta field.
|
* and store it in pageData's delta field.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
computeDelta(PageData *pageData, Page curpage, Page targetpage)
|
computeDelta(GenericXLogPageData *pageData, Page curpage, Page targetpage)
|
||||||
{
|
{
|
||||||
int targetLower = ((PageHeader) targetpage)->pd_lower,
|
int targetLower = ((PageHeader) targetpage)->pd_lower,
|
||||||
targetUpper = ((PageHeader) targetpage)->pd_upper,
|
targetUpper = ((PageHeader) targetpage)->pd_upper,
|
||||||
@ -303,7 +303,7 @@ GenericXLogRegisterBuffer(GenericXLogState *state, Buffer buffer, int flags)
|
|||||||
/* Search array for existing entry or first unused slot */
|
/* Search array for existing entry or first unused slot */
|
||||||
for (block_id = 0; block_id < MAX_GENERIC_XLOG_PAGES; block_id++)
|
for (block_id = 0; block_id < MAX_GENERIC_XLOG_PAGES; block_id++)
|
||||||
{
|
{
|
||||||
PageData *page = &state->pages[block_id];
|
GenericXLogPageData *page = &state->pages[block_id];
|
||||||
|
|
||||||
if (BufferIsInvalid(page->buffer))
|
if (BufferIsInvalid(page->buffer))
|
||||||
{
|
{
|
||||||
@ -352,7 +352,7 @@ GenericXLogFinish(GenericXLogState *state)
|
|||||||
*/
|
*/
|
||||||
for (i = 0; i < MAX_GENERIC_XLOG_PAGES; i++)
|
for (i = 0; i < MAX_GENERIC_XLOG_PAGES; i++)
|
||||||
{
|
{
|
||||||
PageData *pageData = &state->pages[i];
|
GenericXLogPageData *pageData = &state->pages[i];
|
||||||
Page page;
|
Page page;
|
||||||
PageHeader pageHeader;
|
PageHeader pageHeader;
|
||||||
|
|
||||||
@ -401,7 +401,7 @@ GenericXLogFinish(GenericXLogState *state)
|
|||||||
/* Set LSN */
|
/* Set LSN */
|
||||||
for (i = 0; i < MAX_GENERIC_XLOG_PAGES; i++)
|
for (i = 0; i < MAX_GENERIC_XLOG_PAGES; i++)
|
||||||
{
|
{
|
||||||
PageData *pageData = &state->pages[i];
|
GenericXLogPageData *pageData = &state->pages[i];
|
||||||
|
|
||||||
if (BufferIsInvalid(pageData->buffer))
|
if (BufferIsInvalid(pageData->buffer))
|
||||||
continue;
|
continue;
|
||||||
@ -415,7 +415,7 @@ GenericXLogFinish(GenericXLogState *state)
|
|||||||
START_CRIT_SECTION();
|
START_CRIT_SECTION();
|
||||||
for (i = 0; i < MAX_GENERIC_XLOG_PAGES; i++)
|
for (i = 0; i < MAX_GENERIC_XLOG_PAGES; i++)
|
||||||
{
|
{
|
||||||
PageData *pageData = &state->pages[i];
|
GenericXLogPageData *pageData = &state->pages[i];
|
||||||
|
|
||||||
if (BufferIsInvalid(pageData->buffer))
|
if (BufferIsInvalid(pageData->buffer))
|
||||||
continue;
|
continue;
|
||||||
|
@ -1003,6 +1003,7 @@ GenerationBlock
|
|||||||
GenerationContext
|
GenerationContext
|
||||||
GenerationPointer
|
GenerationPointer
|
||||||
GenericCosts
|
GenericCosts
|
||||||
|
GenericXLogPageData
|
||||||
GenericXLogState
|
GenericXLogState
|
||||||
GeqoPrivateData
|
GeqoPrivateData
|
||||||
GetForeignJoinPaths_function
|
GetForeignJoinPaths_function
|
||||||
@ -1975,7 +1976,6 @@ PX_Combo
|
|||||||
PX_HMAC
|
PX_HMAC
|
||||||
PX_MD
|
PX_MD
|
||||||
Page
|
Page
|
||||||
PageData
|
|
||||||
PageGistNSN
|
PageGistNSN
|
||||||
PageHeader
|
PageHeader
|
||||||
PageHeaderData
|
PageHeaderData
|
||||||
|
Loading…
x
Reference in New Issue
Block a user