Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMurloc committed Dec 13, 2023
1 parent a94fd92 commit cdc9414
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/diskquota.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,6 @@ extern HTAB *diskquota_hash_create(const char *tabname, long nelem, HASHC
extern HTAB *DiskquotaShmemInitHash(const char *name, long init_size, long max_size, HASHCTL *infoP, int hash_flags,
DiskquotaHashFunction hash_function);
extern void refresh_monitored_dbid_cache(void);
extern HASHACTION check_hash_fullness(HTAB *hashp, int max_size, const char *warning_message,
TimestampTz *last_overflow_report, int guc_value);
extern HASHACTION check_hash_fullness(HTAB *hashp, int max_size, const char *warning_message,
TimestampTz *last_overflow_report, int guc_value);
#endif
14 changes: 8 additions & 6 deletions src/quotamodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,14 @@ update_size_for_quota(int64 size, QuotaType type, Oid *keys, int16 segid)
bool found;
QuotaInfoEntry *entry;
QuotaInfoEntryKey key = {0};
HASHACTION action;

memcpy(key.keys, keys, quota_key_num[type] * sizeof(Oid));
key.type = type;
key.segid = segid;
HASHACTION action = check_hash_fullness(quota_info_map, diskquota_max_quota_probes, QUOTA_INFO_WARNING,
&quota_info_map_last_overflow_report, diskquota_max_quota_probes);
entry = hash_search(quota_info_map, &key, action, &found);
action = check_hash_fullness(quota_info_map, diskquota_max_quota_probes, QUOTA_INFO_WARNING,
&quota_info_map_last_overflow_report, diskquota_max_quota_probes);
entry = hash_search(quota_info_map, &key, action, &found);
/* If the number of quota exceeds the limit, entry will be NULL */
if (entry == NULL) return;
if (!found)
Expand All @@ -275,13 +276,14 @@ update_limit_for_quota(int64 limit, float segratio, QuotaType type, Oid *keys)
{
QuotaInfoEntry *entry;
QuotaInfoEntryKey key = {0};
HASHACTION action;

memcpy(key.keys, keys, quota_key_num[type] * sizeof(Oid));
key.type = type;
key.segid = i;
HASHACTION action = check_hash_fullness(quota_info_map, diskquota_max_quota_probes, QUOTA_INFO_WARNING,
&quota_info_map_last_overflow_report, diskquota_max_quota_probes);
entry = hash_search(quota_info_map, &key, action, &found);
action = check_hash_fullness(quota_info_map, diskquota_max_quota_probes, QUOTA_INFO_WARNING,
&quota_info_map_last_overflow_report, diskquota_max_quota_probes);
entry = hash_search(quota_info_map, &key, action, &found);
/* If the number of quota exceeds the limit, entry will be NULL */
if (entry == NULL) continue;
if (!found)
Expand Down

0 comments on commit cdc9414

Please sign in to comment.