PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | SMgrRelationData |
Macros | |
#define | SmgrIsTemp(smgr) RelFileLocatorBackendIsTemp((smgr)->smgr_rlocator) |
Typedefs | |
typedef struct SMgrRelationData | SMgrRelationData |
typedef SMgrRelationData * | SMgrRelation |
#define SmgrIsTemp | ( | smgr | ) | RelFileLocatorBackendIsTemp((smgr)->smgr_rlocator) |
typedef SMgrRelationData* SMgrRelation |
typedef struct SMgrRelationData SMgrRelationData |
void AtEOXact_SMgr | ( | void | ) |
Definition at line 739 of file smgr.c.
References Assert(), dlist_mutable_iter::cur, dlist_container, dlist_foreach_modify, SMgrRelationData::smgr_owner, smgrclose(), and unowned_relns.
Referenced by AbortTransaction(), AutoVacLauncherMain(), BackgroundWriterMain(), CheckpointerMain(), CommitTransaction(), PrepareTransaction(), and WalWriterMain().
bool ProcessBarrierSmgrRelease | ( | void | ) |
Definition at line 763 of file smgr.c.
References smgrreleaseall().
Referenced by ProcessProcSignalBarrier().
void smgrclearowner | ( | SMgrRelation * | owner, |
SMgrRelation | reln | ||
) |
Definition at line 231 of file smgr.c.
References dlist_push_tail(), SMgrRelationData::node, SMgrRelationData::smgr_owner, and unowned_relns.
Referenced by FreeFakeRelcacheEntry().
void smgrclose | ( | SMgrRelation | reln | ) |
Definition at line 260 of file smgr.c.
References dlist_delete(), elog(), ERROR, HASH_REMOVE, hash_search(), MAX_FORKNUM, SMgrRelationData::node, f_smgr::smgr_close, SMgrRelationData::smgr_owner, SMgrRelationData::smgr_rlocator, SMgrRelationData::smgr_which, SMgrRelationHash, and smgrsw.
Referenced by AtEOXact_SMgr(), DropRelationFiles(), fill_seq_with_data(), heapam_relation_copy_data(), heapam_relation_set_new_filelocator(), index_copy_data(), RelationCloseSmgr(), RelationSetNewRelfilenumber(), ScanSourceDatabasePgClass(), smgrcloseall(), smgrcloserellocator(), and smgrDoPendingDeletes().
void smgrcloseall | ( | void | ) |
Definition at line 327 of file smgr.c.
References hash_seq_init(), hash_seq_search(), smgrclose(), and SMgrRelationHash.
Referenced by BackgroundWriterMain(), CheckpointerMain(), RelationCacheInvalidate(), RequestCheckpoint(), WalWriterMain(), and XLogDropDatabase().
void smgrcloserellocator | ( | RelFileLocatorBackend | rlocator | ) |
Definition at line 351 of file smgr.c.
References HASH_FIND, hash_search(), smgrclose(), and SMgrRelationHash.
Referenced by CreateAndCopyRelationData(), and LocalExecuteInvalidationMessage().
void smgrcreate | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
bool | isRedo | ||
) |
Definition at line 374 of file smgr.c.
References f_smgr::smgr_create, SMgrRelationData::smgr_which, and smgrsw.
Referenced by CreateAndCopyRelationData(), ExtendBufferedRelTo(), fill_seq_with_data(), heapam_relation_copy_data(), heapam_relation_set_new_filelocator(), index_build(), index_copy_data(), RelationCreateStorage(), smgr_redo(), and XLogReadBufferExtended().
void smgrdosyncall | ( | SMgrRelation * | rels, |
int | nrels | ||
) |
Definition at line 389 of file smgr.c.
References FlushRelationsAllBuffers(), i, MAX_FORKNUM, f_smgr::smgr_immedsync, SMgrRelationData::smgr_which, and smgrsw.
Referenced by smgrDoPendingSyncs().
void smgrdounlinkall | ( | SMgrRelation * | rels, |
int | nrels, | ||
bool | isRedo | ||
) |
Definition at line 425 of file smgr.c.
References CacheInvalidateSmgr(), DropRelationsAllBuffers(), i, MAX_FORKNUM, palloc(), pfree(), SMgrRelationData::smgr_rlocator, SMgrRelationData::smgr_which, and smgrsw.
Referenced by DropRelationFiles(), RelationSetNewRelfilenumber(), and smgrDoPendingDeletes().
bool smgrexists | ( | SMgrRelation | reln, |
ForkNumber | forknum | ||
) |
Definition at line 251 of file smgr.c.
References f_smgr::smgr_exists, SMgrRelationData::smgr_which, and smgrsw.
Referenced by autoprewarm_database_main(), bt_index_check_internal(), CreateAndCopyRelationData(), DropRelationsAllBuffers(), ExtendBufferedRelTo(), FreeSpaceMapPrepareTruncateRel(), fsm_readbuf(), heapam_relation_copy_data(), index_build(), index_copy_data(), pg_prewarm(), RelationTruncate(), smgr_redo(), smgrDoPendingSyncs(), visibilitymap_prepare_truncate(), vm_readbuf(), and XLogPrefetcherNextBlock().
void smgrextend | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum, | ||
const void * | buffer, | ||
bool | skipFsync | ||
) |
Definition at line 498 of file smgr.c.
References InvalidBlockNumber, SMgrRelationData::smgr_cached_nblocks, f_smgr::smgr_extend, SMgrRelationData::smgr_which, and smgrsw.
Referenced by _bt_blwritepage(), _hash_alloc_buckets(), end_heap_rewrite(), gist_indexsortbuild(), gist_indexsortbuild_flush_ready_pages(), raw_heap_insert(), RelationCopyStorage(), and RelationCopyStorageUsingBuffer().
void smgrimmedsync | ( | SMgrRelation | reln, |
ForkNumber | forknum | ||
) |
Definition at line 721 of file smgr.c.
References f_smgr::smgr_immedsync, SMgrRelationData::smgr_which, and smgrsw.
Referenced by _bt_load(), end_heap_rewrite(), gist_indexsortbuild(), and RelationCopyStorage().
void smgrinit | ( | void | ) |
Definition at line 115 of file smgr.c.
References i, NSmgr, on_proc_exit(), f_smgr::smgr_init, smgrshutdown(), and smgrsw.
Referenced by BaseInit().
BlockNumber smgrnblocks | ( | SMgrRelation | reln, |
ForkNumber | forknum | ||
) |
Definition at line 609 of file smgr.c.
References InvalidBlockNumber, SMgrRelationData::smgr_cached_nblocks, f_smgr::smgr_nblocks, SMgrRelationData::smgr_which, smgrnblocks_cached(), and smgrsw.
Referenced by ExtendBufferedRelLocal(), ExtendBufferedRelShared(), ExtendBufferedRelTo(), FreeSpaceMapPrepareTruncateRel(), fsm_readbuf(), gistBuildCallback(), RelationCopyStorage(), RelationCopyStorageUsingBuffer(), RelationGetNumberOfBlocksInFork(), ScanSourceDatabasePgClass(), smgrDoPendingSyncs(), table_block_relation_size(), visibilitymap_prepare_truncate(), vm_readbuf(), XLogPrefetcherNextBlock(), and XLogReadBufferExtended().
BlockNumber smgrnblocks_cached | ( | SMgrRelation | reln, |
ForkNumber | forknum | ||
) |
Definition at line 633 of file smgr.c.
References InRecovery, InvalidBlockNumber, and SMgrRelationData::smgr_cached_nblocks.
Referenced by DropRelationBuffers(), DropRelationsAllBuffers(), and smgrnblocks().
SMgrRelation smgropen | ( | RelFileLocator | rlocator, |
BackendId | backend | ||
) |
Definition at line 150 of file smgr.c.
References RelFileLocatorBackend::backend, dlist_init(), dlist_push_tail(), HASHCTL::entrysize, HASH_BLOBS, hash_create(), HASH_ELEM, HASH_ENTER, hash_search(), i, InvalidBlockNumber, HASHCTL::keysize, RelFileLocatorBackend::locator, MAX_FORKNUM, SMgrRelationData::node, SMgrRelationData::smgr_cached_nblocks, f_smgr::smgr_open, SMgrRelationData::smgr_owner, SMgrRelationData::smgr_targblock, SMgrRelationData::smgr_which, SMgrRelationHash, smgrsw, and unowned_relns.
Referenced by CreateAndCopyRelationData(), DropRelationFiles(), fill_seq_with_data(), FlushBuffer(), GetLocalVictimBuffer(), heapam_relation_copy_data(), index_copy_data(), IssuePendingWritebacks(), mdsyncfiletag(), ReadBufferWithoutRelcache(), RelationCopyStorageUsingBuffer(), RelationCreateStorage(), RelationGetSmgr(), RelationSetNewRelfilenumber(), ScanSourceDatabasePgClass(), smgr_redo(), smgrDoPendingDeletes(), smgrDoPendingSyncs(), XLogPrefetcherNextBlock(), and XLogReadBufferExtended().
bool smgrprefetch | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum | ||
) |
Definition at line 548 of file smgr.c.
References f_smgr::smgr_prefetch, SMgrRelationData::smgr_which, and smgrsw.
Referenced by PrefetchLocalBuffer(), and PrefetchSharedBuffer().
void smgrread | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum, | ||
void * | buffer | ||
) |
Definition at line 562 of file smgr.c.
References f_smgr::smgr_read, SMgrRelationData::smgr_which, and smgrsw.
Referenced by pg_prewarm(), ReadBuffer_common(), and RelationCopyStorage().
void smgrrelease | ( | SMgrRelation | reln | ) |
Definition at line 292 of file smgr.c.
References InvalidBlockNumber, MAX_FORKNUM, SMgrRelationData::smgr_cached_nblocks, f_smgr::smgr_close, SMgrRelationData::smgr_targblock, SMgrRelationData::smgr_which, and smgrsw.
Referenced by smgrreleaseall().
void smgrreleaseall | ( | void | ) |
Definition at line 308 of file smgr.c.
References hash_seq_init(), hash_seq_search(), SMgrRelationHash, and smgrrelease().
Referenced by ProcessBarrierSmgrRelease().
void smgrsetowner | ( | SMgrRelation * | owner, |
SMgrRelation | reln | ||
) |
Definition at line 202 of file smgr.c.
References Assert(), dlist_delete(), SMgrRelationData::node, and SMgrRelationData::smgr_owner.
Referenced by RelationGetSmgr().
void smgrtruncate | ( | SMgrRelation | reln, |
ForkNumber * | forknum, | ||
int | nforks, | ||
BlockNumber * | nblocks | ||
) |
Definition at line 656 of file smgr.c.
References CacheInvalidateSmgr(), DropRelationBuffers(), i, InvalidBlockNumber, SMgrRelationData::smgr_cached_nblocks, SMgrRelationData::smgr_rlocator, f_smgr::smgr_truncate, SMgrRelationData::smgr_which, and smgrsw.
Referenced by pg_truncate_visibility_map(), RelationTruncate(), and smgr_redo().
void smgrwrite | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum, | ||
const void * | buffer, | ||
bool | skipFsync | ||
) |
Definition at line 584 of file smgr.c.
References SMgrRelationData::smgr_which, f_smgr::smgr_write, and smgrsw.
Referenced by _bt_blwritepage(), FlushBuffer(), FlushRelationBuffers(), GetLocalVictimBuffer(), and gist_indexsortbuild().
void smgrwriteback | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum, | ||
BlockNumber | nblocks | ||
) |
Definition at line 597 of file smgr.c.
References SMgrRelationData::smgr_which, f_smgr::smgr_writeback, and smgrsw.
Referenced by IssuePendingWritebacks().
void smgrzeroextend | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum, | ||
int | nblocks, | ||
bool | skipFsync | ||
) |
Definition at line 523 of file smgr.c.
References InvalidBlockNumber, SMgrRelationData::smgr_cached_nblocks, SMgrRelationData::smgr_which, f_smgr::smgr_zeroextend, and smgrsw.
Referenced by ExtendBufferedRelLocal(), and ExtendBufferedRelShared().