46 #define MAX_PENDING_WRITES XLR_MAX_BLOCK_ID
105 state->forknum = forknum;
106 state->use_wal = use_wal;
109 state->pages_written = 0;
213 elog(
DEBUG1,
"flushed relation because a checkpoint occurred concurrently");
256 bool page_std =
true;
258 for (
int i = 0;
i < npending;
i++)
260 blknos[
i] = pending_writes[
i].
blkno;
269 if (!pending_writes[
i].page_std)
273 npending, blknos, pages, page_std);
276 for (
int i = 0;
i < npending;
i++)
void PageSetChecksumInplace(Page page, BlockNumber blkno)
static void smgr_bulk_flush(BulkWriteState *bulkstate)
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)
#define MAX_PENDING_WRITES
BulkWriteState * smgr_bulk_start_smgr(SMgrRelation smgr, ForkNumber forknum, bool use_wal)
void smgr_bulk_finish(BulkWriteState *bulkstate)
struct PendingWrite PendingWrite
static int buffer_cmp(const void *a, const void *b)
BulkWriteState * smgr_bulk_start_rel(Relation rel, ForkNumber forknum)
#define Assert(condition)
void * MemoryContextAllocAligned(MemoryContext context, Size size, Size alignto, int flags)
void pfree(void *pointer)
MemoryContext CurrentMemoryContext
#define qsort(a, b, c, d)
#define DELAY_CHKPT_START
static SMgrRelation RelationGetSmgr(Relation rel)
#define RelationNeedsWAL(relation)
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)
BlockNumber pages_written
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)