47#define MAX_PENDING_WRITES XLR_MAX_BLOCK_ID
106 state->forknum = forknum;
107 state->use_wal = use_wal;
214 elog(
DEBUG1,
"flushed relation because a checkpoint occurred concurrently");
257 bool page_std =
true;
259 for (
int i = 0;
i < npending;
i++)
261 blknos[
i] = pending_writes[
i].
blkno;
270 if (!pending_writes[
i].page_std)
274 npending, blknos, pages, page_std);
277 for (
int i = 0;
i < npending;
i++)
284 if (blkno >= bulkstate->
relsize)
293 while (blkno > bulkstate->
relsize)
void PageSetChecksumInplace(Page page, BlockNumber blkno)
static void smgr_bulk_flush(BulkWriteState *bulkstate)
BulkWriteState * smgr_bulk_start_rel(Relation rel, ForkNumber forknum)
static const PGIOAlignedBlock zero_buffer
void smgr_bulk_write(BulkWriteState *bulkstate, BlockNumber blocknum, BulkWriteBuffer buf, bool page_std)
BulkWriteBuffer smgr_bulk_get_buf(BulkWriteState *bulkstate)
BulkWriteState * smgr_bulk_start_smgr(SMgrRelation smgr, ForkNumber forknum, bool use_wal)
#define MAX_PENDING_WRITES
void smgr_bulk_finish(BulkWriteState *bulkstate)
struct PendingWrite PendingWrite
static int buffer_cmp(const void *a, const void *b)
#define Assert(condition)
void pfree(void *pointer)
void * MemoryContextAllocAligned(MemoryContext context, Size size, Size alignto, int flags)
MemoryContext CurrentMemoryContext
#define qsort(a, b, c, d)
#define DELAY_CHKPT_START
static SMgrRelation RelationGetSmgr(Relation rel)
#define RelationNeedsWAL(relation)
BlockNumber smgrnblocks(SMgrRelation reln, ForkNumber forknum)
void smgrimmedsync(SMgrRelation reln, ForkNumber forknum)
void smgrextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void *buffer, bool skipFsync)
void smgrregistersync(SMgrRelation reln, ForkNumber forknum)
static void smgrwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void *buffer, bool skipFsync)
XLogRecPtr start_RedoRecPtr
PendingWrite pending_writes[MAX_PENDING_WRITES]
RelFileLocatorBackend smgr_rlocator
XLogRecPtr GetRedoRecPtr(void)
void log_newpages(RelFileLocator *rlocator, ForkNumber forknum, int num_pages, BlockNumber *blknos, Page *pages, bool page_std)