2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Refactor how ADB names and entries are stored in the dns_adb

Replace adb->{names,entries} and related arrays (indexed by hashed
bucket) with a isc_ht hash tables storing the new struct
adb{name,entry}bucket_t that wraps all the variables that were
originally stored in arrays indexed by "bucket" number stored directly
in the struct dns_adb.

Previously, the task exclusive mode has been used to grow the internal
arrays used to store the named and entries objects.  The isc_ht hash
tables are now protected by the isc_rwlock instead and thus the usage of
the task exclusive mode has been removed from the dns_adb.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
This commit is contained in:
Evan Hunt
2022-03-16 21:58:55 +01:00
committed by Ondřej Surý
parent 6e11211ac6
commit 76bcb4d16b
2 changed files with 691 additions and 1202 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -92,7 +92,9 @@ ISC_LANG_BEGINDECLS
*** TYPES
***/
typedef struct dns_adbname dns_adbname_t;
typedef struct dns_adbname dns_adbname_t;
typedef struct dns_adbnamebucket dns_adbnamebucket_t;
typedef struct dns_adbentrybucket dns_adbentrybucket_t;
/*!
*\brief
@@ -114,13 +116,13 @@ struct dns_adbfind {
ISC_LINK(dns_adbfind_t) publink; /*%< RW: client use */
/* Private */
isc_mutex_t lock; /* locks all below */
in_port_t port;
int name_bucket;
unsigned int flags;
dns_adbname_t *adbname;
dns_adb_t *adb;
isc_event_t event;
isc_mutex_t lock; /* locks all below */
in_port_t port;
dns_adbnamebucket_t *bucket;
unsigned int flags;
dns_adbname_t *adbname;
dns_adb_t *adb;
isc_event_t event;
ISC_LINK(dns_adbfind_t) plink;
};