#include "postgres.h"
#include "access/htup_details.h"
#include "access/xloginsert.h"
#include "access/xlogutils.h"
#include "miscadmin.h"
#include "storage/freespace.h"
#include "storage/fsm_internals.h"
#include "storage/smgr.h"
#include "utils/rel.h"
Go to the source code of this file.
Definition at line 78 of file freespace.c.
Definition at line 65 of file freespace.c.
Definition at line 64 of file freespace.c.
Definition at line 77 of file freespace.c.
Definition at line 75 of file freespace.c.
Definition at line 66 of file freespace.c.
Definition at line 275 of file freespace.c.
References buf, BUFFER_LOCK_EXCLUSIVE, BufferGetPage(), BufferIsValid(), END_CRIT_SECTION, FSM_FORKNUM, fsm_get_location(), fsm_logical_to_physical(), fsm_readbuf(), fsm_truncate_avail(), InRecovery, InvalidBlockNumber, LockBuffer(), log_newpage_buffer(), MarkBufferDirty(), RelationGetSmgr(), RelationNeedsWAL, smgrexists(), smgrnblocks(), START_CRIT_SECTION, UnlockReleaseBuffer(), and XLogHintBitIsNeeded.
Referenced by RelationTruncate(), and smgr_redo().
Definition at line 358 of file freespace.c.
References FSM_ROOT_ADDRESS, fsm_vacuum_page(), and InvalidBlockNumber.
Referenced by brin_vacuum_scan(), and IndexFreeSpaceMapVacuum().
Definition at line 377 of file freespace.c.
References FSM_ROOT_ADDRESS, fsm_vacuum_page(), and start.
Referenced by brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), lazy_scan_heap(), RelationAddBlocks(), RelationTruncate(), smgr_redo(), and terminate_brin_buildstate().
Definition at line 926 of file freespace.c.
References BlockNumberIsValid(), MAIN_FORKNUM, RelationGetNumberOfBlocks, RelationGetSmgr(), and SMgrRelationData::smgr_cached_nblocks.
Referenced by fsm_search(), and RecordAndGetPageWithFreeSpace().
Definition at line 629 of file freespace.c.
References BMR_REL, EB_CLEAR_SIZE_CACHE, EB_CREATE_FORK_IF_NEEDED, ExtendBufferedRelTo(), FSM_FORKNUM, and RBM_ZERO_ON_ERROR.
Referenced by fsm_readbuf().
Definition at line 535 of file freespace.c.
References Assert(), FSM_BOTTOM_LEVEL, FSMAddress::level, FSMAddress::logpageno, and SlotsPerFSMPage.
Referenced by fsm_search(), and fsm_vacuum_page().
Definition at line 506 of file freespace.c.
References Assert(), FSM_BOTTOM_LEVEL, FSMAddress::level, FSMAddress::logpageno, and SlotsPerFSMPage.
Referenced by fsm_search(), and RecordAndGetPageWithFreeSpace().
Definition at line 491 of file freespace.c.
References FSM_BOTTOM_LEVEL, FSMAddress::level, FSMAddress::logpageno, and SlotsPerFSMPage.
Referenced by FreeSpaceMapPrepareTruncateRel(), fsm_vacuum_page(), GetRecordedFreeSpace(), RecordAndGetPageWithFreeSpace(), RecordPageWithFreeSpace(), and XLogRecordPageWithFreeSpace().
Definition at line 517 of file freespace.c.
References Assert(), FSM_ROOT_LEVEL, FSMAddress::level, FSMAddress::logpageno, and SlotsPerFSMPage.
Referenced by fsm_search(), and fsm_vacuum_page().
Definition at line 455 of file freespace.c.
References FSM_TREE_DEPTH, FSMAddress::level, FSMAddress::logpageno, and SlotsPerFSMPage.
Referenced by FreeSpaceMapPrepareTruncateRel(), fsm_readbuf(), and XLogRecordPageWithFreeSpace().
Definition at line 554 of file freespace.c.
References buf, BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetPage(), fsm_extend(), FSM_FORKNUM, fsm_logical_to_physical(), InvalidBlockNumber, InvalidBuffer, LockBuffer(), PageInit(), PageIsNew(), RBM_ZERO_ON_ERROR, ReadBufferExtended(), RelationGetSmgr(), SMgrRelationData::smgr_cached_nblocks, smgrexists(), and smgrnblocks().
Referenced by FreeSpaceMapPrepareTruncateRel(), fsm_search(), fsm_set_and_search(), fsm_vacuum_page(), and GetRecordedFreeSpace().
Definition at line 678 of file freespace.c.
References buf, BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_SHARE, BUFFER_LOCK_UNLOCK, BufferGetPage(), BufferIsValid(), FSM_BOTTOM_LEVEL, fsm_does_block_exist(), fsm_get_child(), fsm_get_heap_blk(), fsm_get_max_avail(), fsm_get_parent(), fsm_readbuf(), FSM_ROOT_ADDRESS, FSM_ROOT_LEVEL, fsm_search_avail(), fsm_set_and_search(), fsm_set_avail(), InvalidBlockNumber, FSMAddress::level, LockBuffer(), MarkBufferDirtyHint(), ReleaseBuffer(), and UnlockReleaseBuffer().
Referenced by GetPageWithFreeSpace(), and RecordAndGetPageWithFreeSpace().
Definition at line 646 of file freespace.c.
References buf, BUFFER_LOCK_EXCLUSIVE, BufferGetPage(), FSM_BOTTOM_LEVEL, fsm_readbuf(), fsm_search_avail(), fsm_set_avail(), FSMAddress::level, LockBuffer(), MarkBufferDirtyHint(), and UnlockReleaseBuffer().
Referenced by fsm_search(), RecordAndGetPageWithFreeSpace(), and RecordPageWithFreeSpace().
Definition at line 392 of file freespace.c.
References Assert(), FSM_CAT_STEP, and MaxFSMRequestSize.
Referenced by RecordAndGetPageWithFreeSpace(), RecordPageWithFreeSpace(), and XLogRecordPageWithFreeSpace().
Definition at line 418 of file freespace.c.
References FSM_CAT_STEP, and MaxFSMRequestSize.
Referenced by GetRecordedFreeSpace().
Definition at line 432 of file freespace.c.
References elog, ERROR, FSM_CAT_STEP, and MaxFSMRequestSize.
Referenced by GetPageWithFreeSpace(), and RecordAndGetPageWithFreeSpace().
Definition at line 812 of file freespace.c.
References Assert(), buf, BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetPage(), BufferIsValid(), CHECK_FOR_INTERRUPTS, FSM_BOTTOM_LEVEL, fsm_get_avail(), fsm_get_child(), fsm_get_location(), fsm_get_max_avail(), fsm_get_parent(), fsm_readbuf(), fsm_set_avail(), fsm_vacuum_page(), FSMAddress::level, LockBuffer(), FSMAddress::logpageno, MarkBufferDirtyHint(), PageGetContents(), ReleaseBuffer(), SlotsPerFSMPage, and start.
Referenced by FreeSpaceMapVacuum(), FreeSpaceMapVacuumRange(), and fsm_vacuum_page().
Definition at line 137 of file freespace.c.
References fsm_search(), and fsm_space_needed_to_cat().
Referenced by brin_getinsertbuffer(), GetFreeIndexPage(), and RelationGetBufferForTuple().
Definition at line 244 of file freespace.c.
References buf, BufferGetPage(), BufferIsValid(), fsm_get_avail(), fsm_get_location(), fsm_readbuf(), fsm_space_cat_to_avail(), and ReleaseBuffer().
Referenced by lazy_scan_new_or_empty(), pg_freespace(), and statapprox_heap().
Definition at line 154 of file freespace.c.
References fsm_does_block_exist(), fsm_get_heap_blk(), fsm_get_location(), fsm_search(), fsm_set_and_search(), fsm_space_avail_to_cat(), and fsm_space_needed_to_cat().
Referenced by brin_getinsertbuffer(), and RelationGetBufferForTuple().
Definition at line 194 of file freespace.c.
References fsm_get_location(), fsm_set_and_search(), and fsm_space_avail_to_cat().
Referenced by brin_doinsert(), brin_doupdate(), brin_initialize_empty_new_buffer(), brin_page_cleanup(), lazy_scan_heap(), lazy_scan_new_or_empty(), lazy_vacuum_heap_rel(), RecordFreeIndexPage(), RecordUsedIndexPage(), RelationAddBlocks(), RelationGetBufferForTuple(), and terminate_brin_buildstate().
Definition at line 211 of file freespace.c.
References buf, BUFFER_LOCK_EXCLUSIVE, BufferGetPage(), FSM_FORKNUM, fsm_get_location(), fsm_logical_to_physical(), fsm_set_avail(), fsm_space_avail_to_cat(), InvalidBuffer, LockBuffer(), MarkBufferDirtyHint(), PageInit(), PageIsNew(), RBM_ZERO_ON_ERROR, UnlockReleaseBuffer(), and XLogReadBufferExtended().
Referenced by heap_xlog_insert(), heap_xlog_multi_insert(), heap_xlog_prune_freeze(), heap_xlog_update(), and heap_xlog_visible().
Definition at line 91 of file freespace.c.
Referenced by FreeSpaceMapVacuum(), FreeSpaceMapVacuumRange(), and fsm_search().