|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "funcapi.h"#include "lib/dshash.h"#include "storage/dsm_registry.h"#include "storage/lwlock.h"#include "storage/shmem.h"#include "utils/builtins.h"#include "utils/memutils.h"
Go to the source code of this file.
Data Structures | |
| struct | DSMRegistryCtxStruct |
| struct | NamedDSMState |
| struct | NamedDSAState |
| struct | NamedDSHState |
| struct | DSMRegistryEntry |
Typedefs | |
| typedef struct DSMRegistryCtxStruct | DSMRegistryCtxStruct |
| typedef struct NamedDSMState | NamedDSMState |
| typedef struct NamedDSAState | NamedDSAState |
| typedef struct NamedDSHState | NamedDSHState |
| typedef enum DSMREntryType | DSMREntryType |
| typedef struct DSMRegistryEntry | DSMRegistryEntry |
Enumerations | |
| enum | DSMREntryType { DSMR_ENTRY_TYPE_DSM , DSMR_ENTRY_TYPE_DSA , DSMR_ENTRY_TYPE_DSH } |
Functions | |
| Size | DSMRegistryShmemSize (void) |
| void | DSMRegistryShmemInit (void) |
| static void | init_dsm_registry (void) |
| void * | GetNamedDSMSegment (const char *name, size_t size, void(*init_callback)(void *ptr), bool *found) |
| dsa_area * | GetNamedDSA (const char *name, bool *found) |
| dshash_table * | GetNamedDSHash (const char *name, const dshash_parameters *params, bool *found) |
| Datum | pg_get_dsm_registry_allocations (PG_FUNCTION_ARGS) |
Variables | |
| static DSMRegistryCtxStruct * | DSMRegistryCtx |
| static const char *const | DSMREntryTypeNames [] |
| static const dshash_parameters | dsh_params |
| static dsa_area * | dsm_registry_dsa |
| static dshash_table * | dsm_registry_table |
| typedef struct DSMRegistryCtxStruct DSMRegistryCtxStruct |
| typedef struct DSMRegistryEntry DSMRegistryEntry |
| typedef enum DSMREntryType DSMREntryType |
| typedef struct NamedDSAState NamedDSAState |
| typedef struct NamedDSHState NamedDSHState |
| typedef struct NamedDSMState NamedDSMState |
| enum DSMREntryType |
| Enumerator | |
|---|---|
| DSMR_ENTRY_TYPE_DSM | |
| DSMR_ENTRY_TYPE_DSA | |
| DSMR_ENTRY_TYPE_DSH | |
Definition at line 78 of file dsm_registry.c.
| void DSMRegistryShmemInit | ( | void | ) |
Definition at line 123 of file dsm_registry.c.
References DSA_HANDLE_INVALID, DSMRegistryCtxStruct::dsah, DSHASH_HANDLE_INVALID, DSMRegistryCtxStruct::dshh, DSMRegistryCtx, DSMRegistryShmemSize(), and ShmemInitStruct().
Referenced by CreateOrAttachShmemStructs().
| Size DSMRegistryShmemSize | ( | void | ) |
Definition at line 117 of file dsm_registry.c.
References MAXALIGN.
Referenced by CalculateShmemSize(), and DSMRegistryShmemInit().
| dsa_area * GetNamedDSA | ( | const char * | name, |
| bool * | found | ||
| ) |
Definition at line 274 of file dsm_registry.c.
References Assert(), DSMRegistryEntry::dsa, dsa_attach(), dsa_create, dsa_get_handle(), DSA_HANDLE_INVALID, dsa_is_attached(), dsa_pin(), dsa_pin_mapping(), dshash_find_or_insert(), dshash_release_lock(), dsm_registry_table, DSMR_ENTRY_TYPE_DSA, ereport, errmsg(), ERROR, init_dsm_registry(), LWLockNewTrancheId(), MemoryContextSwitchTo(), name, TopMemoryContext, DSMRegistryEntry::type, and type.
Referenced by tdr_attach_shmem().
| dshash_table * GetNamedDSHash | ( | const char * | name, |
| const dshash_parameters * | params, | ||
| bool * | found | ||
| ) |
Definition at line 355 of file dsm_registry.c.
References Assert(), dsa_attach(), dsa_create, dsa_get_handle(), NamedDSHState::dsa_handle, DSA_HANDLE_INVALID, dsa_is_attached(), dsa_pin(), dsa_pin_mapping(), DSMRegistryEntry::dsh, NamedDSHState::dsh_handle, dshash_attach(), dshash_create(), dshash_find_or_insert(), dshash_get_hash_table_handle(), DSHASH_HANDLE_INVALID, dshash_release_lock(), dsm_registry_table, DSMR_ENTRY_TYPE_DSH, ereport, errmsg(), ERROR, init_dsm_registry(), LWLockNewTrancheId(), MemoryContextSwitchTo(), name, TopMemoryContext, NamedDSHState::tranche, dshash_parameters::tranche_id, DSMRegistryEntry::type, and type.
Referenced by tdr_attach_shmem().
| void * GetNamedDSMSegment | ( | const char * | name, |
| size_t | size, | ||
| void(*)(void *ptr) | init_callback, | ||
| bool * | found | ||
| ) |
Definition at line 186 of file dsm_registry.c.
References Assert(), dshash_find_or_insert(), dshash_release_lock(), DSMRegistryEntry::dsm, dsm_attach(), dsm_create(), dsm_find_mapping(), DSM_HANDLE_INVALID, dsm_pin_mapping(), dsm_pin_segment(), dsm_registry_table, dsm_segment_address(), dsm_segment_handle(), DSMR_ENTRY_TYPE_DSM, elog, ereport, errmsg(), ERROR, init_dsm_registry(), MemoryContextSwitchTo(), name, TopMemoryContext, DSMRegistryEntry::type, and type.
Referenced by apw_init_shmem(), injection_init_shmem(), tdr_attach_shmem(), test_dsa_basic(), and test_dsa_resowners().
|
static |
Definition at line 145 of file dsm_registry.c.
References dsa_attach(), dsa_create, dsa_get_handle(), dsa_pin(), dsa_pin_mapping(), DSMRegistryCtxStruct::dsah, dsh_params, dshash_attach(), dshash_create(), dshash_get_hash_table_handle(), DSHASH_HANDLE_INVALID, DSMRegistryCtxStruct::dshh, dsm_registry_dsa, dsm_registry_table, DSMRegistryCtx, LW_EXCLUSIVE, LWLockAcquire(), and LWLockRelease().
Referenced by GetNamedDSA(), GetNamedDSHash(), GetNamedDSMSegment(), and pg_get_dsm_registry_allocations().
| Datum pg_get_dsm_registry_allocations | ( | PG_FUNCTION_ARGS | ) |
Definition at line 446 of file dsm_registry.c.
References CStringGetTextDatum, dsa_get_total_size_from_handle(), DSA_HANDLE_INVALID, dshash_seq_init(), dshash_seq_next(), dshash_seq_term(), DSM_HANDLE_INVALID, dsm_registry_table, DSMR_ENTRY_TYPE_DSA, DSMR_ENTRY_TYPE_DSH, DSMR_ENTRY_TYPE_DSM, DSMREntryTypeNames, init_dsm_registry(), InitMaterializedSRF(), Int64GetDatum(), MAT_SRF_USE_EXPECTED_DESC, MemoryContextSwitchTo(), ReturnSetInfo::setDesc, ReturnSetInfo::setResult, TopMemoryContext, and tuplestore_putvalues().
|
static |
Definition at line 104 of file dsm_registry.c.
Referenced by init_dsm_registry().
|
static |
Definition at line 113 of file dsm_registry.c.
Referenced by init_dsm_registry().
|
static |
Definition at line 114 of file dsm_registry.c.
Referenced by GetNamedDSA(), GetNamedDSHash(), GetNamedDSMSegment(), init_dsm_registry(), and pg_get_dsm_registry_allocations().
|
static |
Definition at line 57 of file dsm_registry.c.
Referenced by DSMRegistryShmemInit(), and init_dsm_registry().
|
static |
Definition at line 85 of file dsm_registry.c.
Referenced by pg_get_dsm_registry_allocations().