Use consistent casing of get_principal_key_hash()

There was no good reason to have an upper case H.
pull/238/head
Andreas Karlsson 4 months ago committed by Andreas Karlsson
parent 3852075490
commit 8084e6a35a
  1. 16
      contrib/pg_tde/src/catalog/tde_principal_key.c

@ -87,7 +87,7 @@ static void initialize_objects_in_dsa_area(dsa_area *dsa, void *raw_dsa_area);
static Size required_shared_mem_size(void); static Size required_shared_mem_size(void);
static void shared_memory_shutdown(int code, Datum arg); static void shared_memory_shutdown(int code, Datum arg);
static void clear_principal_key_cache(Oid databaseId); static void clear_principal_key_cache(Oid databaseId);
static inline dshash_table *get_principal_key_Hash(void); static inline dshash_table *get_principal_key_hash(void);
static TDEPrincipalKey *get_principal_key_from_cache(Oid dbOid); static TDEPrincipalKey *get_principal_key_from_cache(Oid dbOid);
static bool pg_tde_is_same_principal_key(TDEPrincipalKey *a, TDEPrincipalKey *b); static bool pg_tde_is_same_principal_key(TDEPrincipalKey *a, TDEPrincipalKey *b);
static void pg_tde_update_global_principal_key_everywhere(TDEPrincipalKey *oldKey, TDEPrincipalKey *newKey); static void pg_tde_update_global_principal_key_everywhere(TDEPrincipalKey *oldKey, TDEPrincipalKey *newKey);
@ -369,7 +369,7 @@ xl_tde_perform_rotate_key(XLogPrincipalKeyRotate *xlrec)
*/ */
static inline dshash_table * static inline dshash_table *
get_principal_key_Hash(void) get_principal_key_hash(void)
{ {
if (!principalKeyLocalState.sharedHash) if (!principalKeyLocalState.sharedHash)
principal_key_info_attach_shmem(); principal_key_info_attach_shmem();
@ -384,10 +384,10 @@ get_principal_key_from_cache(Oid dbOid)
{ {
TDEPrincipalKey *cacheEntry = NULL; TDEPrincipalKey *cacheEntry = NULL;
cacheEntry = (TDEPrincipalKey *) dshash_find(get_principal_key_Hash(), cacheEntry = (TDEPrincipalKey *) dshash_find(get_principal_key_hash(),
&dbOid, false); &dbOid, false);
if (cacheEntry) if (cacheEntry)
dshash_release_lock(get_principal_key_Hash(), cacheEntry); dshash_release_lock(get_principal_key_hash(), cacheEntry);
return cacheEntry; return cacheEntry;
} }
@ -409,12 +409,12 @@ push_principal_key_to_cache(TDEPrincipalKey *principalKey)
Oid databaseId = principalKey->keyInfo.databaseId; Oid databaseId = principalKey->keyInfo.databaseId;
bool found = false; bool found = false;
cacheEntry = dshash_find_or_insert(get_principal_key_Hash(), cacheEntry = dshash_find_or_insert(get_principal_key_hash(),
&databaseId, &found); &databaseId, &found);
if (!found) if (!found)
*cacheEntry = *principalKey; *cacheEntry = *principalKey;
dshash_release_lock(get_principal_key_Hash(), cacheEntry); dshash_release_lock(get_principal_key_hash(), cacheEntry);
/* we don't want principal keys to end up paged to the swap */ /* we don't want principal keys to end up paged to the swap */
if (mlock(cacheEntry, sizeof(TDEPrincipalKey)) == -1) if (mlock(cacheEntry, sizeof(TDEPrincipalKey)) == -1)
@ -445,11 +445,11 @@ clear_principal_key_cache(Oid databaseId)
TDEPrincipalKey *cache_entry; TDEPrincipalKey *cache_entry;
/* Start with deleting the cache entry for the database */ /* Start with deleting the cache entry for the database */
cache_entry = (TDEPrincipalKey *) dshash_find(get_principal_key_Hash(), cache_entry = (TDEPrincipalKey *) dshash_find(get_principal_key_hash(),
&databaseId, true); &databaseId, true);
if (cache_entry) if (cache_entry)
{ {
dshash_delete_entry(get_principal_key_Hash(), cache_entry); dshash_delete_entry(get_principal_key_hash(), cache_entry);
} }
} }

Loading…
Cancel
Save