]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
dns_adb: Remove deadnames and deadentries
authorOndřej Surý <ondrej@isc.org>
Wed, 27 Jul 2022 11:45:15 +0000 (13:45 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 30 Nov 2022 09:03:23 +0000 (10:03 +0100)
Previously, the name and entry buckets were much larger, so the dead
names and entries were moved to a secondary list to be cleaned
later (f.e. after the already running fetch has been canceled).  After
the last refactoring, the bucket now contains only the name (entry)
itself and thus the extra list has a little use.  Remove the .deadnames
and .deadentries from dns_adbnamebucket_t and dns_adbentrybucket_t
structures.

lib/dns/adb.c

index c8c566bdeb6d595e41756f374b595b74df597739..ad72c6ab4aef87eabf1acc218265e7c56c5c83a8 100644 (file)
@@ -171,7 +171,6 @@ struct dns_adbname {
  */
 struct dns_adbnamebucket {
        dns_adbnamelist_t names;
-       dns_adbnamelist_t deadnames;
        isc_mutex_t lock;
        isc_refcount_t references;
        size_t keysize;
@@ -278,7 +277,6 @@ struct dns_adbentry {
  */
 struct dns_adbentrybucket {
        dns_adbentrylist_t entries;
-       dns_adbentrylist_t deadentries;
        isc_mutex_t lock;
        isc_refcount_t references;
        size_t keysize;
@@ -790,9 +788,6 @@ expire_name(dns_adbname_t **n, isc_eventtype_t evtype) {
         * we'll clean it up later.
         */
        if (!NAME_DEAD(adbname)) {
-               dns_adbnamebucket_t *nbucket = adbname->bucket;
-               ISC_LIST_UNLINK(nbucket->names, adbname, plink);
-               ISC_LIST_APPEND(nbucket->deadnames, adbname, plink);
                adbname->flags |= NAME_IS_DEAD;
        }
 }
@@ -874,11 +869,7 @@ unlink_name(dns_adbname_t *name) {
 
        REQUIRE(nbucket != NULL);
 
-       if (NAME_DEAD(name)) {
-               ISC_LIST_UNLINK(nbucket->deadnames, name, plink);
-       } else {
-               ISC_LIST_UNLINK(nbucket->names, name, plink);
-       }
+       ISC_LIST_UNLINK(nbucket->names, name, plink);
 
        isc_refcount_decrement(&nbucket->references);
 }
@@ -922,8 +913,6 @@ link_entry(dns_adbentrybucket_t *ebucket, dns_adbentry_t *entry) {
 
                        INSIST((e->flags & ENTRY_IS_DEAD) == 0);
                        e->flags |= ENTRY_IS_DEAD;
-                       ISC_LIST_UNLINK(ebucket->entries, e, plink);
-                       ISC_LIST_PREPEND(ebucket->deadentries, e, plink);
                }
        }
 
@@ -949,11 +938,7 @@ unlink_entry(dns_adbentry_t *entry) {
 
        DP(DEF_LEVEL, "unlink ADB entry %p from bucket %p", entry, ebucket);
 
-       if ((entry->flags & ENTRY_IS_DEAD) != 0) {
-               ISC_LIST_UNLINK(ebucket->deadentries, entry, plink);
-       } else {
-               ISC_LIST_UNLINK(ebucket->entries, entry, plink);
-       }
+       ISC_LIST_UNLINK(ebucket->entries, entry, plink);
 
        isc_refcount_decrement(&ebucket->references);
 }
@@ -1479,7 +1464,6 @@ new_adbentrybucket(dns_adb_t *adb, const uint8_t *key, const size_t keysize) {
        memmove(ebucket->key, key, keysize);
 
        ISC_LIST_INIT(ebucket->entries);
-       ISC_LIST_INIT(ebucket->deadentries);
 
        isc_mutex_init(&ebucket->lock);
        isc_refcount_init(&ebucket->references, 0);