PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | BLOCKREFTABLE_MAGIC 0x652b137b |
Typedefs | |
typedef struct BlockRefTable | BlockRefTable |
typedef struct BlockRefTableEntry | BlockRefTableEntry |
typedef struct BlockRefTableReader | BlockRefTableReader |
typedef struct BlockRefTableWriter | BlockRefTableWriter |
typedef int(* | io_callback_fn) (void *callback_arg, void *data, int length) |
typedef void(* | report_error_fn) (void *callback_arg, char *msg,...) pg_attribute_printf(2 |
typedef void(*) BlockRefTable | CreateEmptyBlockRefTable) (void) |
#define BLOCKREFTABLE_MAGIC 0x652b137b |
Definition at line 30 of file blkreftable.h.
typedef struct BlockRefTable BlockRefTable |
Definition at line 1 of file blkreftable.h.
typedef struct BlockRefTableEntry BlockRefTableEntry |
Definition at line 1 of file blkreftable.h.
typedef struct BlockRefTableReader BlockRefTableReader |
Definition at line 1 of file blkreftable.h.
typedef struct BlockRefTableWriter BlockRefTableWriter |
Definition at line 1 of file blkreftable.h.
|
extern |
typedef int(* io_callback_fn) (void *callback_arg, void *data, int length) |
Definition at line 46 of file blkreftable.h.
typedef void(* report_error_fn) (void *callback_arg, char *msg,...) pg_attribute_printf(2 |
Definition at line 47 of file blkreftable.h.
int BlockRefTableEntryGetBlocks | ( | BlockRefTableEntry * | entry, |
BlockNumber | start_blkno, | ||
BlockNumber | stop_blkno, | ||
BlockNumber * | blocks, | ||
int | nblocks | ||
) |
Definition at line 369 of file blkreftable.c.
References Assert, BLOCKS_PER_CHUNK, BLOCKS_PER_ENTRY, BlockRefTableEntry::chunk_data, BlockRefTableEntry::chunk_usage, i, MAX_ENTRIES_PER_CHUNK, and BlockRefTableEntry::nchunks.
Referenced by GetFileBackupMethod().
void BlockRefTableEntryMarkBlockModified | ( | BlockRefTableEntry * | entry, |
ForkNumber | forknum, | ||
BlockNumber | blknum | ||
) |
Definition at line 965 of file blkreftable.c.
References Assert, BLOCKS_PER_CHUNK, BLOCKS_PER_ENTRY, chunk, BlockRefTableEntry::chunk_data, BlockRefTableEntry::chunk_size, BlockRefTableEntry::chunk_usage, i, INITIAL_ENTRIES_PER_CHUNK, j, Max, MAX_ENTRIES_PER_CHUNK, BlockRefTableEntry::nchunks, palloc(), palloc0(), pfree(), and repalloc().
Referenced by BlockRefTableMarkBlockModified().
void BlockRefTableEntrySetLimitBlock | ( | BlockRefTableEntry * | entry, |
BlockNumber | limit_block | ||
) |
Definition at line 894 of file blkreftable.c.
References Assert, BLOCKS_PER_CHUNK, BLOCKS_PER_ENTRY, BlockRefTableEntry::chunk_data, BlockRefTableEntry::chunk_usage, i, if(), j, BlockRefTableEntry::limit_block, MAX_ENTRIES_PER_CHUNK, and BlockRefTableEntry::nchunks.
Referenced by BlockRefTableSetLimitBlock().
void BlockRefTableFreeEntry | ( | BlockRefTableEntry * | entry | ) |
Definition at line 1122 of file blkreftable.c.
References BlockRefTableEntry::chunk_data, BlockRefTableEntry::chunk_size, BlockRefTableEntry::chunk_usage, and pfree().
BlockRefTableEntry* BlockRefTableGetEntry | ( | BlockRefTable * | brtab, |
const RelFileLocator * | rlocator, | ||
ForkNumber | forknum, | ||
BlockNumber * | limit_block | ||
) |
Definition at line 340 of file blkreftable.c.
References Assert, BlockRefTable::hash, sort-test::key, and BlockRefTableEntry::limit_block.
Referenced by GetFileBackupMethod().
void BlockRefTableMarkBlockModified | ( | BlockRefTable * | brtab, |
const RelFileLocator * | rlocator, | ||
ForkNumber | forknum, | ||
BlockNumber | blknum | ||
) |
Definition at line 297 of file blkreftable.c.
References BlockRefTableEntryMarkBlockModified(), BlockRefTableEntry::chunk_data, BlockRefTableEntry::chunk_size, BlockRefTableEntry::chunk_usage, BlockRefTable::hash, InvalidBlockNumber, sort-test::key, BlockRefTableEntry::limit_block, BlockRefTable::mcxt, MemoryContextSwitchTo(), and BlockRefTableEntry::nchunks.
Referenced by PrepareForIncrementalBackup(), and SummarizeWAL().
unsigned BlockRefTableReaderGetBlocks | ( | BlockRefTableReader * | reader, |
BlockNumber * | blocks, | ||
int | nblocks | ||
) |
Definition at line 689 of file blkreftable.c.
References Assert, BlockRefTableRead(), BLOCKS_PER_CHUNK, BLOCKS_PER_ENTRY, BlockRefTableReader::chunk_data, BlockRefTableReader::chunk_position, BlockRefTableReader::chunk_size, BlockRefTableReader::consumed_chunks, MAX_ENTRIES_PER_CHUNK, and BlockRefTableReader::total_chunks.
Referenced by dump_one_relation(), pg_wal_summary_contents(), and PrepareForIncrementalBackup().
bool BlockRefTableReaderNextRelation | ( | BlockRefTableReader * | reader, |
RelFileLocator * | rlocator, | ||
ForkNumber * | forknum, | ||
BlockNumber * | limit_block | ||
) |
Definition at line 613 of file blkreftable.c.
References Assert, BlockRefTableRead(), BlockRefTableReader::buffer, BlockRefTableReader::chunk_size, BlockRefTableReader::consumed_chunks, BlockRefTableBuffer::crc, EQ_CRC32C, BlockRefTableReader::error_callback, BlockRefTableReader::error_callback_arg, BlockRefTableReader::error_filename, FIN_CRC32C, BlockRefTableSerializedEntry::forknum, BlockRefTableSerializedEntry::limit_block, BlockRefTableSerializedEntry::nchunks, palloc(), pfree(), BlockRefTableSerializedEntry::rlocator, and BlockRefTableReader::total_chunks.
Referenced by main(), pg_wal_summary_contents(), and PrepareForIncrementalBackup().
void BlockRefTableSetLimitBlock | ( | BlockRefTable * | brtab, |
const RelFileLocator * | rlocator, | ||
ForkNumber | forknum, | ||
BlockNumber | limit_block | ||
) |
Definition at line 262 of file blkreftable.c.
References BlockRefTableEntrySetLimitBlock(), BlockRefTableEntry::chunk_data, BlockRefTableEntry::chunk_size, BlockRefTableEntry::chunk_usage, BlockRefTable::hash, sort-test::key, BlockRefTableEntry::limit_block, and BlockRefTableEntry::nchunks.
Referenced by PrepareForIncrementalBackup(), SummarizeDbaseRecord(), SummarizeSmgrRecord(), and SummarizeXactRecord().
void BlockRefTableWriteEntry | ( | BlockRefTableWriter * | writer, |
BlockRefTableEntry * | entry | ||
) |
Definition at line 817 of file blkreftable.c.
References BlockRefTableWrite(), BlockRefTableWriter::buffer, BlockRefTableEntry::chunk_data, BlockRefTableEntry::chunk_usage, BlockRefTableKey::forknum, BlockRefTableSerializedEntry::forknum, j, BlockRefTableEntry::key, BlockRefTableEntry::limit_block, BlockRefTableSerializedEntry::limit_block, BlockRefTableEntry::nchunks, BlockRefTableSerializedEntry::nchunks, BlockRefTableKey::rlocator, and BlockRefTableSerializedEntry::rlocator.
BlockRefTableEntry* CreateBlockRefTableEntry | ( | RelFileLocator | rlocator, |
ForkNumber | forknum | ||
) |
Definition at line 875 of file blkreftable.c.
References BlockRefTableKey::forknum, InvalidBlockNumber, BlockRefTableEntry::key, BlockRefTableEntry::limit_block, palloc0(), and BlockRefTableKey::rlocator.
BlockRefTableReader* CreateBlockRefTableReader | ( | io_callback_fn | read_callback, |
void * | read_callback_arg, | ||
char * | error_filename, | ||
report_error_fn | error_callback, | ||
void * | error_callback_arg | ||
) |
Definition at line 577 of file blkreftable.c.
References BLOCKREFTABLE_MAGIC, BlockRefTableRead(), BlockRefTableReader::buffer, BlockRefTableBuffer::crc, BlockRefTableReader::error_callback, BlockRefTableReader::error_callback_arg, BlockRefTableReader::error_filename, INIT_CRC32C, BlockRefTableBuffer::io_callback, BlockRefTableBuffer::io_callback_arg, and palloc0().
Referenced by main(), pg_wal_summary_contents(), and PrepareForIncrementalBackup().
BlockRefTableWriter* CreateBlockRefTableWriter | ( | io_callback_fn | write_callback, |
void * | write_callback_arg | ||
) |
Definition at line 790 of file blkreftable.c.
References BLOCKREFTABLE_MAGIC, BlockRefTableWrite(), BlockRefTableWriter::buffer, BlockRefTableBuffer::crc, INIT_CRC32C, BlockRefTableBuffer::io_callback, BlockRefTableBuffer::io_callback_arg, and palloc0().
void DestroyBlockRefTableReader | ( | BlockRefTableReader * | reader | ) |
Definition at line 773 of file blkreftable.c.
References BlockRefTableReader::chunk_size, and pfree().
Referenced by main(), pg_wal_summary_contents(), and PrepareForIncrementalBackup().
void DestroyBlockRefTableWriter | ( | BlockRefTableWriter * | writer | ) |
Definition at line 855 of file blkreftable.c.
References BlockRefTableFileTerminate(), BlockRefTableWriter::buffer, and pfree().
void WriteBlockRefTable | ( | BlockRefTable * | brtab, |
io_callback_fn | write_callback, | ||
void * | write_callback_arg | ||
) |
Definition at line 474 of file blkreftable.c.
References Assert, BLOCKREFTABLE_MAGIC, BlockRefTableComparator(), BlockRefTableFileTerminate(), BlockRefTableWrite(), BlockRefTableEntry::chunk_data, BlockRefTableEntry::chunk_usage, BlockRefTableBuffer::crc, BlockRefTableKey::forknum, BlockRefTableSerializedEntry::forknum, BlockRefTable::hash, i, INIT_CRC32C, BlockRefTableBuffer::io_callback, BlockRefTableBuffer::io_callback_arg, j, BlockRefTableEntry::key, sort-test::key, BlockRefTableEntry::limit_block, BlockRefTableSerializedEntry::limit_block, BlockRefTableEntry::nchunks, BlockRefTableSerializedEntry::nchunks, palloc(), qsort, BlockRefTableKey::rlocator, and BlockRefTableSerializedEntry::rlocator.
Referenced by SummarizeWAL().