86 BlockNumber blocknum,
const void *buffer,
bool skipFsync);
111 .smgr_shutdown = NULL,
283 for (forknum = 0; forknum <=
MAX_FORKNUM; forknum++)
291 elog(
ERROR,
"SMgrRelation hashtable corrupted");
439 for (
i = 0;
i < nrels;
i++)
443 for (forknum = 0; forknum <=
MAX_FORKNUM; forknum++)
445 if (
smgrsw[which].smgr_exists(rels[
i], forknum))
482 for (
i = 0;
i < nrels;
i++)
487 rlocators[
i] = rlocator;
490 for (forknum = 0; forknum <=
MAX_FORKNUM; forknum++)
491 smgrsw[which].smgr_close(rels[
i], forknum);
502 for (
i = 0;
i < nrels;
i++)
513 for (
i = 0;
i < nrels;
i++)
517 for (forknum = 0; forknum <=
MAX_FORKNUM; forknum++)
518 smgrsw[which].smgr_unlink(rlocators[
i], forknum, isRedo);
536 const void *buffer,
bool skipFsync)
561 int nblocks,
bool skipFsync)
632 const void **buffers,
BlockNumber nblocks,
bool skipFsync)
635 buffers, nblocks, skipFsync);
726 for (
i = 0;
i < nforks;
i++)
#define InvalidBlockNumber
void FlushRelationsAllBuffers(SMgrRelation *smgrs, int nrels)
void DropRelationBuffers(SMgrRelation smgr_reln, ForkNumber *forkNum, int nforks, BlockNumber *firstDelBlock)
void DropRelationsAllBuffers(SMgrRelation *smgr_reln, int nlocators)
#define Assert(condition)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
void * hash_seq_search(HASH_SEQ_STATUS *status)
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
static void dlist_init(dlist_head *head)
static void dlist_delete(dlist_node *node)
#define dlist_foreach_modify(iter, lhead)
static void dlist_push_tail(dlist_head *head, dlist_node *node)
#define dlist_container(type, membername, ptr)
void CacheInvalidateSmgr(RelFileLocatorBackend rlocator)
void on_proc_exit(pg_on_exit_callback function, Datum arg)
void pfree(void *pointer)
void mdunlink(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
void mdwritev(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void **buffers, BlockNumber nblocks, bool skipFsync)
bool mdexists(SMgrRelation reln, ForkNumber forknum)
void mdreadv(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, void **buffers, BlockNumber nblocks)
BlockNumber mdnblocks(SMgrRelation reln, ForkNumber forknum)
void mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
void mdextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void *buffer, bool skipFsync)
void mdclose(SMgrRelation reln, ForkNumber forknum)
void mdzeroextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks, bool skipFsync)
void mdwriteback(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, BlockNumber nblocks)
bool mdprefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks)
void mdregistersync(SMgrRelation reln, ForkNumber forknum)
void mdopen(SMgrRelation reln)
void mdtruncate(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks)
void mdimmedsync(SMgrRelation reln, ForkNumber forknum)
struct RelFileLocatorBackend RelFileLocatorBackend
#define RelFileNumberIsValid(relnumber)
BlockNumber smgrnblocks(SMgrRelation reln, ForkNumber forknum)
static HTAB * SMgrRelationHash
void smgrwriteback(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, BlockNumber nblocks)
void smgrrelease(SMgrRelation reln)
static void smgrdestroy(SMgrRelation reln)
SMgrRelation smgropen(RelFileLocator rlocator, ProcNumber backend)
void smgrdestroyall(void)
void smgrreleaseall(void)
static dlist_head unpinned_relns
void smgrpin(SMgrRelation reln)
void smgrunpin(SMgrRelation reln)
void smgrdosyncall(SMgrRelation *rels, int nrels)
void smgrimmedsync(SMgrRelation reln, ForkNumber forknum)
void smgrcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
BlockNumber smgrnblocks_cached(SMgrRelation reln, ForkNumber forknum)
void smgrclose(SMgrRelation reln)
void smgrzeroextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks, bool skipFsync)
bool ProcessBarrierSmgrRelease(void)
static void smgrshutdown(int code, Datum arg)
void smgrextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void *buffer, bool skipFsync)
void smgrtruncate(SMgrRelation reln, ForkNumber *forknum, int nforks, BlockNumber *nblocks)
void smgrwritev(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void **buffers, BlockNumber nblocks, bool skipFsync)
void smgrreleaserellocator(RelFileLocatorBackend rlocator)
bool smgrexists(SMgrRelation reln, ForkNumber forknum)
void smgrreadv(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, void **buffers, BlockNumber nblocks)
void smgrdounlinkall(SMgrRelation *rels, int nrels, bool isRedo)
void smgrregistersync(SMgrRelation reln, ForkNumber forknum)
bool smgrprefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks)
static const f_smgr smgrsw[]
struct SMgrRelationData SMgrRelationData
SMgrRelationData * SMgrRelation
BlockNumber smgr_targblock
BlockNumber smgr_cached_nblocks[MAX_FORKNUM+1]
RelFileLocatorBackend smgr_rlocator
bool(* smgr_prefetch)(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks)
void(* smgr_writeback)(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, BlockNumber nblocks)
void(* smgr_extend)(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void *buffer, bool skipFsync)
void(* smgr_create)(SMgrRelation reln, ForkNumber forknum, bool isRedo)
BlockNumber(* smgr_nblocks)(SMgrRelation reln, ForkNumber forknum)
void(* smgr_registersync)(SMgrRelation reln, ForkNumber forknum)
void(* smgr_immedsync)(SMgrRelation reln, ForkNumber forknum)
void(* smgr_zeroextend)(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, int nblocks, bool skipFsync)
void(* smgr_readv)(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, void **buffers, BlockNumber nblocks)
void(* smgr_unlink)(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
void(* smgr_open)(SMgrRelation reln)
void(* smgr_shutdown)(void)
void(* smgr_writev)(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const void **buffers, BlockNumber nblocks, bool skipFsync)
bool(* smgr_exists)(SMgrRelation reln, ForkNumber forknum)
void(* smgr_truncate)(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks)
void(* smgr_close)(SMgrRelation reln, ForkNumber forknum)