PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | SMgrRelationData |
Macros | |
#define | SmgrIsTemp(smgr) RelFileNodeBackendIsTemp((smgr)->smgr_rnode) |
Typedefs | |
typedef struct SMgrRelationData | SMgrRelationData |
typedef SMgrRelationData * | SMgrRelation |
#define SmgrIsTemp | ( | smgr | ) | RelFileNodeBackendIsTemp((smgr)->smgr_rnode) |
Definition at line 77 of file smgr.h.
Referenced by mdextend(), mdtruncate(), mdwrite(), ReadBuffer_common(), and register_dirty_segment().
typedef SMgrRelationData* SMgrRelation |
typedef struct SMgrRelationData SMgrRelationData |
void AtEOXact_SMgr | ( | void | ) |
Definition at line 678 of file smgr.c.
References Assert, dlist_mutable_iter::cur, dlist_container, dlist_foreach_modify, SMgrRelationData::smgr_owner, and smgrclose().
Referenced by AbortTransaction(), AutoVacLauncherMain(), BackgroundWriterMain(), CheckpointerMain(), CommitTransaction(), PrepareTransaction(), and WalWriterMain().
void smgrclearowner | ( | SMgrRelation * | owner, |
SMgrRelation | reln | ||
) |
Definition at line 227 of file smgr.c.
References dlist_push_tail(), SMgrRelationData::node, and SMgrRelationData::smgr_owner.
Referenced by FreeFakeRelcacheEntry().
void smgrclose | ( | SMgrRelation | reln | ) |
Definition at line 256 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_rnode, and SMgrRelationData::smgr_which.
Referenced by AtEOXact_SMgr(), DropRelationFiles(), heapam_relation_copy_data(), heapam_relation_set_new_filenode(), index_copy_data(), RelationSetNewRelfilenode(), smgrcloseall(), smgrclosenode(), and smgrDoPendingDeletes().
void smgrcloseall | ( | void | ) |
Definition at line 286 of file smgr.c.
References hash_seq_init(), hash_seq_search(), smgrclose(), and status().
Referenced by BackgroundWriterMain(), CheckpointerMain(), RelationCacheInvalidate(), RequestCheckpoint(), WalWriterMain(), and XLogDropDatabase().
void smgrclosenode | ( | RelFileNodeBackend | rnode | ) |
Definition at line 310 of file smgr.c.
References HASH_FIND, hash_search(), and smgrclose().
Referenced by LocalExecuteInvalidationMessage().
void smgrcreate | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
bool | isRedo | ||
) |
Definition at line 333 of file smgr.c.
References f_smgr::smgr_create, and SMgrRelationData::smgr_which.
Referenced by fsm_extend(), heapam_relation_copy_data(), heapam_relation_set_new_filenode(), index_build(), index_copy_data(), RelationCreateStorage(), smgr_redo(), vm_extend(), and XLogReadBufferExtended().
void smgrdosyncall | ( | SMgrRelation * | rels, |
int | nrels | ||
) |
Definition at line 348 of file smgr.c.
References FlushRelationsAllBuffers(), i, MAX_FORKNUM, f_smgr::smgr_exists, f_smgr::smgr_immedsync, and SMgrRelationData::smgr_which.
Referenced by smgrDoPendingSyncs().
void smgrdounlinkall | ( | SMgrRelation * | rels, |
int | nrels, | ||
bool | isRedo | ||
) |
Definition at line 384 of file smgr.c.
References CacheInvalidateSmgr(), DropRelFileNodesAllBuffers(), i, MAX_FORKNUM, palloc(), pfree(), f_smgr::smgr_close, SMgrRelationData::smgr_rnode, f_smgr::smgr_unlink, and SMgrRelationData::smgr_which.
Referenced by DropRelationFiles(), and smgrDoPendingDeletes().
bool smgrexists | ( | SMgrRelation | reln, |
ForkNumber | forknum | ||
) |
Definition at line 247 of file smgr.c.
References f_smgr::smgr_exists, and SMgrRelationData::smgr_which.
Referenced by autoprewarm_database_main(), bt_index_check_internal(), DropRelFileNodesAllBuffers(), FreeSpaceMapPrepareTruncateRel(), fsm_extend(), fsm_readbuf(), heapam_relation_copy_data(), index_build(), index_copy_data(), pg_prewarm(), RelationTruncate(), smgr_redo(), smgrDoPendingSyncs(), visibilitymap_prepare_truncate(), vm_extend(), and vm_readbuf().
void smgrextend | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum, | ||
char * | buffer, | ||
bool | skipFsync | ||
) |
Definition at line 462 of file smgr.c.
References InvalidBlockNumber, SMgrRelationData::smgr_cached_nblocks, f_smgr::smgr_extend, and SMgrRelationData::smgr_which.
Referenced by _bt_blwritepage(), _hash_alloc_buckets(), end_heap_rewrite(), fsm_extend(), gist_indexsortbuild(), gist_indexsortbuild_flush_ready_pages(), raw_heap_insert(), ReadBuffer_common(), RelationCopyStorage(), and vm_extend().
void smgrimmedsync | ( | SMgrRelation | reln, |
ForkNumber | forknum | ||
) |
Definition at line 660 of file smgr.c.
References f_smgr::smgr_immedsync, and SMgrRelationData::smgr_which.
Referenced by _bt_load(), blbuildempty(), btbuildempty(), end_heap_rewrite(), heapam_relation_set_new_filenode(), RelationCopyStorage(), and spgbuildempty().
void smgrinit | ( | void | ) |
Definition at line 111 of file smgr.c.
References i, NSmgr, on_proc_exit(), f_smgr::smgr_init, and smgrshutdown().
Referenced by BaseInit().
BlockNumber smgrnblocks | ( | SMgrRelation | reln, |
ForkNumber | forknum | ||
) |
Definition at line 548 of file smgr.c.
References InvalidBlockNumber, SMgrRelationData::smgr_cached_nblocks, f_smgr::smgr_nblocks, SMgrRelationData::smgr_which, and smgrnblocks_cached().
Referenced by FreeSpaceMapPrepareTruncateRel(), fsm_extend(), fsm_readbuf(), gistBuildCallback(), ReadBuffer_common(), RelationCopyStorage(), RelationGetNumberOfBlocksInFork(), smgrDoPendingSyncs(), table_block_relation_size(), visibilitymap_prepare_truncate(), vm_extend(), vm_readbuf(), and XLogReadBufferExtended().
BlockNumber smgrnblocks_cached | ( | SMgrRelation | reln, |
ForkNumber | forknum | ||
) |
Definition at line 572 of file smgr.c.
References InRecovery, InvalidBlockNumber, and SMgrRelationData::smgr_cached_nblocks.
Referenced by DropRelFileNodeBuffers(), DropRelFileNodesAllBuffers(), and smgrnblocks().
SMgrRelation smgropen | ( | RelFileNode | rnode, |
BackendId | backend | ||
) |
Definition at line 146 of file smgr.c.
References RelFileNodeBackend::backend, dlist_init(), dlist_push_tail(), HASHCTL::entrysize, HASH_BLOBS, hash_create(), HASH_ELEM, HASH_ENTER, hash_search(), i, InvalidBlockNumber, HASHCTL::keysize, MAX_FORKNUM, SMgrRelationData::node, RelFileNodeBackend::node, SMgrRelationData::smgr_cached_nblocks, f_smgr::smgr_open, SMgrRelationData::smgr_owner, SMgrRelationData::smgr_targblock, and SMgrRelationData::smgr_which.
Referenced by DropRelationFiles(), FlushBuffer(), heapam_relation_copy_data(), index_copy_data(), IssuePendingWritebacks(), LocalBufferAlloc(), mdsyncfiletag(), ReadBufferWithoutRelcache(), RelationCreateStorage(), smgr_redo(), smgrDoPendingDeletes(), smgrDoPendingSyncs(), and XLogReadBufferExtended().
bool smgrprefetch | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum | ||
) |
Definition at line 487 of file smgr.c.
References f_smgr::smgr_prefetch, and SMgrRelationData::smgr_which.
Referenced by PrefetchLocalBuffer(), and PrefetchSharedBuffer().
void smgrread | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum, | ||
char * | buffer | ||
) |
Definition at line 501 of file smgr.c.
References f_smgr::smgr_read, and SMgrRelationData::smgr_which.
Referenced by pg_prewarm(), ReadBuffer_common(), and RelationCopyStorage().
void smgrsetowner | ( | SMgrRelation * | owner, |
SMgrRelation | reln | ||
) |
Definition at line 198 of file smgr.c.
References Assert, dlist_delete(), SMgrRelationData::node, and SMgrRelationData::smgr_owner.
void smgrtruncate | ( | SMgrRelation | reln, |
ForkNumber * | forknum, | ||
int | nforks, | ||
BlockNumber * | nblocks | ||
) |
Definition at line 595 of file smgr.c.
References CacheInvalidateSmgr(), DropRelFileNodeBuffers(), i, InvalidBlockNumber, SMgrRelationData::smgr_cached_nblocks, SMgrRelationData::smgr_rnode, f_smgr::smgr_truncate, and SMgrRelationData::smgr_which.
Referenced by pg_truncate_visibility_map(), RelationTruncate(), and smgr_redo().
void smgrwrite | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum, | ||
char * | buffer, | ||
bool | skipFsync | ||
) |
Definition at line 523 of file smgr.c.
References SMgrRelationData::smgr_which, and f_smgr::smgr_write.
Referenced by _bt_blwritepage(), blbuildempty(), btbuildempty(), FlushBuffer(), FlushRelationBuffers(), gist_indexsortbuild(), LocalBufferAlloc(), and spgbuildempty().
void smgrwriteback | ( | SMgrRelation | reln, |
ForkNumber | forknum, | ||
BlockNumber | blocknum, | ||
BlockNumber | nblocks | ||
) |
Definition at line 536 of file smgr.c.
References SMgrRelationData::smgr_which, and f_smgr::smgr_writeback.
Referenced by IssuePendingWritebacks().