From: Evan Hunt Date: Mon, 4 Aug 2025 21:31:59 +0000 (-0700) Subject: remove obsolete dns_db_setloop() X-Git-Tag: v9.21.14~44^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e7d8bece766cbeedae115a99bb2f041b8b6950a;p=thirdparty%2Fbind9.git remove obsolete dns_db_setloop() no database implementation has needed an event loop since the RBT cache was removed, so the setloop API call is no longer needed. --- diff --git a/bin/tests/system/dyndb/driver/db.c b/bin/tests/system/dyndb/driver/db.c index 23de0c79ab3..77534d9878b 100644 --- a/bin/tests/system/dyndb/driver/db.c +++ b/bin/tests/system/dyndb/driver/db.c @@ -284,15 +284,6 @@ nodecount(dns_db_t *db, dns_dbtree_t tree) { return dns_db_nodecount(sampledb->db, tree); } -static void -setloop(dns_db_t *db, isc_loop_t *loop) { - sampledb_t *sampledb = (sampledb_t *)db; - - REQUIRE(VALID_SAMPLEDB(sampledb)); - - dns_db_setloop(sampledb->db, loop); -} - static isc_result_t getoriginnode(dns_db_t *db, dns_dbnode_t **nodep DNS__DB_FLARG) { sampledb_t *sampledb = (sampledb_t *)db; @@ -410,7 +401,6 @@ static dns_dbmethods_t sampledb_methods = { .deleterdataset = deleterdataset, .issecure = issecure, .nodecount = nodecount, - .setloop = setloop, .getoriginnode = getoriginnode, .getnsec3parameters = getnsec3parameters, .findnsec3node = findnsec3node, diff --git a/lib/dns/cache.c b/lib/dns/cache.c index faf414b379f..83a8e494a90 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -130,12 +130,6 @@ cache_create_db(dns_cache_t *cache, dns_db_t **dbp, isc_mem_t **tmctxp, dns_db_setmaxrrperset(db, cache->maxrrperset); dns_db_setmaxtypepername(db, cache->maxtypepername); - /* - * XXX this is only used by the RBT cache, and can - * be removed when it is. - */ - dns_db_setloop(db, isc_loop_main()); - *dbp = db; *hmctxp = hmctx; *tmctxp = tmctx; diff --git a/lib/dns/db.c b/lib/dns/db.c index acb8051e392..c9f3363a342 100644 --- a/lib/dns/db.c +++ b/lib/dns/db.c @@ -811,15 +811,6 @@ dns_db_hashsize(dns_db_t *db) { return (db->methods->hashsize)(db); } -void -dns_db_setloop(dns_db_t *db, isc_loop_t *loop) { - REQUIRE(DNS_DB_VALID(db)); - - if (db->methods->setloop != NULL) { - (db->methods->setloop)(db, loop); - } -} - isc_result_t dns_db_register(const char *name, dns_dbcreatefunc_t create, void *driverarg, isc_mem_t *mctx, dns_dbimplementation_t **dbimp) { diff --git a/lib/dns/include/dns/db.h b/lib/dns/include/dns/db.h index cc80d5fa7b1..6b6f7427539 100644 --- a/lib/dns/include/dns/db.h +++ b/lib/dns/include/dns/db.h @@ -142,7 +142,6 @@ typedef struct dns_db_methods { dns_rdatatype_t covers DNS__DB_FLARG); bool (*issecure)(dns_db_t *db); unsigned int (*nodecount)(dns_db_t *db, dns_dbtree_t); - void (*setloop)(dns_db_t *db, isc_loop_t *); isc_result_t (*getoriginnode)(dns_db_t *db, dns_dbnode_t **nodep DNS__DB_FLARG); isc_result_t (*getnsec3parameters)(dns_db_t *db, @@ -1422,16 +1421,6 @@ dns_db_hashsize(dns_db_t *db); * 0 if not implemented. */ -void -dns_db_setloop(dns_db_t *db, isc_loop_t *loop); -/*%< - * If loop is set then the final detach may be performed asynchronously. - * - * Requires: - * \li 'db' is a valid database. - * \li 'loop' to be valid or NULL. - */ - bool dns_db_ispersistent(dns_db_t *db); /*%< diff --git a/lib/dns/qpzone.c b/lib/dns/qpzone.c index 5f5de351b2e..0f393dccf49 100644 --- a/lib/dns/qpzone.c +++ b/lib/dns/qpzone.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -238,7 +237,6 @@ struct qpzonedb { qpz_version_t *current_version; qpz_version_t *future_version; qpz_versionlist_t open_versions; - isc_loop_t *loop; struct rcu_head rcu_head; qpz_heap_t *heap; /* Resigning heap */ @@ -517,10 +515,6 @@ free_db_rcu(struct rcu_head *rcu_head) { isc_stats_detach(&qpdb->gluecachestats); } - if (qpdb->loop != NULL) { - isc_loop_detach(&qpdb->loop); - } - isc_rwlock_destroy(&qpdb->lock); isc_refcount_destroy(&qpdb->common.references); @@ -3872,24 +3866,6 @@ nodecount(dns_db_t *db, dns_dbtree_t tree ISC_ATTR_UNUSED) { return mu.leaves; } -static void -setloop(dns_db_t *db, isc_loop_t *loop) { - qpzonedb_t *qpdb = NULL; - - qpdb = (qpzonedb_t *)db; - - REQUIRE(VALID_QPZONE(qpdb)); - - RWLOCK(&qpdb->lock, isc_rwlocktype_write); - if (qpdb->loop != NULL) { - isc_loop_detach(&qpdb->loop); - } - if (loop != NULL) { - isc_loop_attach(loop, &qpdb->loop); - } - RWUNLOCK(&qpdb->lock, isc_rwlocktype_write); -} - static isc_result_t getoriginnode(dns_db_t *db, dns_dbnode_t **nodep DNS__DB_FLARG) { qpzonedb_t *qpdb = (qpzonedb_t *)db; @@ -5308,7 +5284,6 @@ static dns_dbmethods_t qpdb_zonemethods = { .deleterdataset = qpzone_deleterdataset, .issecure = issecure, .nodecount = nodecount, - .setloop = setloop, .getoriginnode = getoriginnode, .getnsec3parameters = getnsec3parameters, .findnsec3node = qpzone_findnsec3node, diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c index 7e2064dc985..598ba42e968 100644 --- a/lib/dns/sdlz.c +++ b/lib/dns/sdlz.c @@ -1122,12 +1122,6 @@ nodecount(dns_db_t *db, dns_dbtree_t tree) { return 0; } -static void -setloop(dns_db_t *db, isc_loop_t *loop) { - UNUSED(db); - UNUSED(loop); -} - /* * getoriginnode() is used by the update code to find the * dns_rdatatype_dnskey record for a zone @@ -1167,7 +1161,6 @@ static dns_dbmethods_t sdlzdb_methods = { .deleterdataset = deleterdataset, .issecure = issecure, .nodecount = nodecount, - .setloop = setloop, .getoriginnode = getoriginnode, .findnodeext = findnodeext, .findext = findext, diff --git a/lib/dns/zone.c b/lib/dns/zone.c index dd16e4ce6e2..e12ecae8927 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15128,7 +15128,6 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) { isc_result_totext(result)); goto cleanup; } - dns_db_setloop(stub->db, zone->loop); dns_db_setmaxrrperset(stub->db, zone->maxrrperset); dns_db_setmaxtypepername(stub->db, zone->maxtypepername); @@ -18172,7 +18171,6 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, bool dump) { zone_detachdb(zone); } zone_attachdb(zone, db); - dns_db_setloop(zone->db, zone->loop); dns_db_setmaxrrperset(zone->db, zone->maxrrperset); dns_db_setmaxtypepername(zone->db, zone->maxtypepername); DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED | DNS_ZONEFLG_NEEDNOTIFY); @@ -24800,7 +24798,6 @@ dns_zone_makedb(dns_zone_t *zone, dns_db_t **dbp) { break; } - dns_db_setloop(db, zone->loop); dns_db_setmaxrrperset(db, zone->maxrrperset); dns_db_setmaxtypepername(db, zone->maxtypepername);