From: Evan Hunt Date: Thu, 27 Oct 2022 05:36:04 +0000 (-0700) Subject: change dns_db_settask() to _setloop() X-Git-Tag: v9.19.8~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09ee2545143d6566de00bec7c3405b065e0acc3c;p=thirdparty%2Fbind9.git change dns_db_settask() to _setloop() The mechanism for associating a worker task to a database now uses loops rather than tasks. For this reason, the parameters to dns_cache_create() have been updated to take a loop manager rather than a task manager. --- diff --git a/bin/named/server.c b/bin/named/server.c index 8d341e0b0e1..0962230718a 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -4734,7 +4734,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config, * view name but not a forward reference either, then it * is simply a named cache that is not shared. */ - CHECK(dns_cache_create(named_g_taskmgr, view->rdclass, + CHECK(dns_cache_create(named_g_loopmgr, view->rdclass, cachename, &cache)); } nsc = isc_mem_get(mctx, sizeof(*nsc)); diff --git a/bin/tests/system/dyndb/driver/db.c b/bin/tests/system/dyndb/driver/db.c index 4c2366dc417..a4073a7453c 100644 --- a/bin/tests/system/dyndb/driver/db.c +++ b/bin/tests/system/dyndb/driver/db.c @@ -419,12 +419,12 @@ overmem(dns_db_t *db, bool over) { } static void -settask(dns_db_t *db, isc_task_t *task) { +setloop(dns_db_t *db, isc_loop_t *loop) { sampledb_t *sampledb = (sampledb_t *)db; REQUIRE(VALID_SAMPLEDB(sampledb)); - dns_db_settask(sampledb->rbtdb, task); + dns_db_setloop(sampledb->rbtdb, loop); } static isc_result_t @@ -570,7 +570,7 @@ static dns_dbmethods_t sampledb_methods = { printnode, createiterator, findrdataset, allrdatasets, addrdataset, subtractrdataset, deleterdataset, issecure, nodecount, - ispersistent, overmem, settask, + ispersistent, overmem, setloop, getoriginnode, transfernode, getnsec3parameters, findnsec3node, setsigningtime, getsigningtime, resigned, isdnssec, getrrsetstats, diff --git a/lib/dns/cache.c b/lib/dns/cache.c index 39550b7179f..3faa5f0ae0d 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -16,13 +16,13 @@ #include #include +#include #include #include #include #include #include #include -#include #include #include #include @@ -108,14 +108,15 @@ cache_create_db(dns_cache_t *cache, dns_db_t **db) { } isc_result_t -dns_cache_create(isc_taskmgr_t *taskmgr, dns_rdataclass_t rdclass, +dns_cache_create(isc_loopmgr_t *loopmgr, dns_rdataclass_t rdclass, const char *cachename, dns_cache_t **cachep) { isc_result_t result; dns_cache_t *cache = NULL; isc_mem_t *mctx = NULL, *hmctx = NULL; - REQUIRE(cachep != NULL && *cachep == NULL); + REQUIRE(loopmgr != NULL); REQUIRE(cachename != NULL); + REQUIRE(cachep != NULL && *cachep == NULL); /* * This will be the main cache memory context, which is subject @@ -159,18 +160,7 @@ dns_cache_create(isc_taskmgr_t *taskmgr, dns_rdataclass_t rdclass, goto cleanup_stats; } - if (taskmgr != NULL) { - isc_task_t *dbtask = NULL; - result = isc_task_create(taskmgr, &dbtask, 0); - if (result != ISC_R_SUCCESS) { - goto cleanup_db; - } - - isc_task_setname(dbtask, "cache_dbtask", NULL); - dns_db_settask(cache->db, dbtask); - isc_task_detach(&dbtask); - } - + dns_db_setloop(cache->db, isc_loop_main(loopmgr)); cache->magic = CACHE_MAGIC; /* diff --git a/lib/dns/db.c b/lib/dns/db.c index 9c1472ada4b..5ea9532816c 100644 --- a/lib/dns/db.c +++ b/lib/dns/db.c @@ -827,10 +827,10 @@ dns_db_hashsize(dns_db_t *db) { } void -dns_db_settask(dns_db_t *db, isc_task_t *task) { +dns_db_setloop(dns_db_t *db, isc_loop_t *loop) { REQUIRE(DNS_DB_VALID(db)); - (db->methods->settask)(db, task); + (db->methods->setloop)(db, loop); } isc_result_t diff --git a/lib/dns/dnsrps.c b/lib/dns/dnsrps.c index 3ca00825777..94f5d1c4907 100644 --- a/lib/dns/dnsrps.c +++ b/lib/dns/dnsrps.c @@ -955,7 +955,7 @@ static dns_dbmethods_t rpsdb_db_methods = { NULL, /* nodecount */ NULL, /* ispersistent */ NULL, /* overmem */ - NULL, /* settask */ + NULL, /* setloop */ rpsdb_getoriginnode, NULL, /* transfernode */ NULL, /* getnsec3parameters */ diff --git a/lib/dns/include/dns/cache.h b/lib/dns/include/dns/cache.h index e2238dbd77c..418975c3ae6 100644 --- a/lib/dns/include/dns/cache.h +++ b/lib/dns/include/dns/cache.h @@ -56,7 +56,7 @@ ISC_LANG_BEGINDECLS *** Functions ***/ isc_result_t -dns_cache_create(isc_taskmgr_t *taskmgr, dns_rdataclass_t rdclass, +dns_cache_create(isc_loopmgr_t *loopmgr, dns_rdataclass_t rdclass, const char *cachename, dns_cache_t **cachep); /*%< * Create a new DNS cache. @@ -65,8 +65,7 @@ dns_cache_create(isc_taskmgr_t *taskmgr, dns_rdataclass_t rdclass, * * Requires: * - *\li 'taskmgr' is a valid task manager or are NULL. If NULL, no periodic - * cleaning of the cache will take place. + *\li 'loopmgr' is a valid loop manager. * *\li 'cachename' is a valid string. This must not be NULL. * diff --git a/lib/dns/include/dns/db.h b/lib/dns/include/dns/db.h index 2fa4cfd2afc..1831473e513 100644 --- a/lib/dns/include/dns/db.h +++ b/lib/dns/include/dns/db.h @@ -139,7 +139,7 @@ typedef struct dns_dbmethods { unsigned int (*nodecount)(dns_db_t *db, dns_dbtree_t); bool (*ispersistent)(dns_db_t *db); void (*overmem)(dns_db_t *db, bool overmem); - void (*settask)(dns_db_t *db, isc_task_t *); + void (*setloop)(dns_db_t *db, isc_loop_t *); isc_result_t (*getoriginnode)(dns_db_t *db, dns_dbnode_t **nodep); void (*transfernode)(dns_db_t *db, dns_dbnode_t **sourcep, dns_dbnode_t **targetp); @@ -1379,13 +1379,13 @@ dns_db_hashsize(dns_db_t *db); */ void -dns_db_settask(dns_db_t *db, isc_task_t *task); +dns_db_setloop(dns_db_t *db, isc_loop_t *loop); /*%< - * If task is set then the final detach maybe performed asynchronously. + * If loop is set then the final detach maybe performed asynchronously. * * Requires: * \li 'db' is a valid database. - * \li 'task' to be valid or NULL. + * \li 'loop' to be valid or NULL. */ bool diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 45570500083..cf8170e874b 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -19,13 +19,14 @@ #include #include +#include #include #include -#include #include #include #include #include +#include #include #include #include @@ -37,14 +38,12 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -567,7 +566,7 @@ struct dns_rbtdb { rbtdb_version_t *current_version; rbtdb_version_t *future_version; rbtdb_versionlist_t open_versions; - isc_task_t *task; + isc_loop_t *loop; dns_dbnode_t *soanode; dns_dbnode_t *nsnode; @@ -647,6 +646,14 @@ typedef struct { isc_stdtime_t now; } rbtdb_load_t; +/*% + * Prune context + */ +typedef struct { + dns_db_t *db; + dns_rbtnode_t *node; +} prune_t; + static void delete_callback(void *data, void *arg); static void @@ -683,7 +690,7 @@ static void resign_delete(dns_rbtdb_t *rbtdb, rbtdb_version_t *version, rdatasetheader_t *header); static void -prune_tree(isc_task_t *task, isc_event_t *event); +prune_tree(void *arg); static void rdataset_settrust(dns_rdataset_t *rdataset, dns_trust_t trust); static void @@ -817,7 +824,7 @@ typedef struct rbtdb_dbiterator { #define IS_CACHE(rbtdb) (((rbtdb)->common.attributes & DNS_DBATTR_CACHE) != 0) static void -free_rbtdb(dns_rbtdb_t *rbtdb, bool log, isc_event_t *event); +free_rbtdb(dns_rbtdb_t *rbtdb, bool log); static void overmem(dns_db_t *db, bool over); static void @@ -888,12 +895,10 @@ attach(dns_db_t *source, dns_db_t **targetp) { } static void -free_rbtdb_callback(isc_task_t *task, isc_event_t *event) { - dns_rbtdb_t *rbtdb = event->ev_arg; - - UNUSED(task); +free_rbtdb_callback(void *arg) { + dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)arg; - free_rbtdb(rbtdb, true, event); + free_rbtdb(rbtdb, true); } static void @@ -1101,7 +1106,7 @@ adjust_quantum(unsigned int old, isc_time_t *start) { } static void -free_rbtdb(dns_rbtdb_t *rbtdb, bool log, isc_event_t *event) { +free_rbtdb(dns_rbtdb_t *rbtdb, bool log) { unsigned int i; isc_result_t result; char buf[DNS_NAME_FORMATSIZE]; @@ -1140,9 +1145,7 @@ free_rbtdb(dns_rbtdb_t *rbtdb, bool log, isc_event_t *event) { } } - if (event == NULL) { - rbtdb->quantum = (rbtdb->task != NULL) ? 100 : 0; - } + rbtdb->quantum = (rbtdb->loop != NULL) ? 100 : 0; for (;;) { /* @@ -1165,27 +1168,17 @@ free_rbtdb(dns_rbtdb_t *rbtdb, bool log, isc_event_t *event) { isc_time_now(&start); result = dns_rbt_destroy2(treep, rbtdb->quantum); if (result == ISC_R_QUOTA) { - INSIST(rbtdb->task != NULL); + INSIST(rbtdb->loop != NULL); if (rbtdb->quantum != 0) { rbtdb->quantum = adjust_quantum(rbtdb->quantum, &start); } - if (event == NULL) { - event = isc_event_allocate( - rbtdb->common.mctx, NULL, - DNS_EVENT_FREESTORAGE, - free_rbtdb_callback, rbtdb, - sizeof(isc_event_t)); - } - isc_task_send(rbtdb->task, &event); + isc_async_run(rbtdb->loop, free_rbtdb_callback, rbtdb); return; } INSIST(result == ISC_R_SUCCESS && *treep == NULL); } - if (event != NULL) { - isc_event_free(&event); - } if (log) { if (dns_name_dynamic(&rbtdb->common.origin)) { dns_name_format(&rbtdb->common.origin, buf, @@ -1251,8 +1244,8 @@ free_rbtdb(dns_rbtdb_t *rbtdb, bool log, isc_event_t *event) { rbtdb->node_lock_count * sizeof(rbtdb_nodelock_t)); TREE_DESTROYLOCK(&rbtdb->tree_lock); isc_refcount_destroy(&rbtdb->references); - if (rbtdb->task != NULL) { - isc_task_detach(&rbtdb->task); + if (rbtdb->loop != NULL) { + isc_loop_detach(&rbtdb->loop); } RBTDB_DESTROYLOCK(&rbtdb->lock); @@ -1329,7 +1322,7 @@ maybe_free_rbtdb(dns_rbtdb_t *rbtdb) { isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), "calling free_rbtdb(%s)", buf); - free_rbtdb(rbtdb, true, NULL); + free_rbtdb(rbtdb, true); } } } @@ -1955,16 +1948,13 @@ is_leaf(dns_rbtnode_t *node) { static void send_to_prune_tree(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node, isc_rwlocktype_t locktype) { - isc_event_t *ev; - dns_db_t *db; + prune_t *prune = isc_mem_get(rbtdb->common.mctx, sizeof(*prune)); + *prune = (prune_t){ .node = node }; - ev = isc_event_allocate(rbtdb->common.mctx, NULL, DNS_EVENT_RBTPRUNE, - prune_tree, node, sizeof(isc_event_t)); + attach((dns_db_t *)rbtdb, &prune->db); new_reference(rbtdb, node, locktype); - db = NULL; - attach((dns_db_t *)rbtdb, &db); - ev->ev_sender = db; - isc_task_send(rbtdb->task, &ev); + + isc_async_run(rbtdb->loop, prune_tree, prune); } /*% @@ -1997,7 +1987,7 @@ cleanup_dead_nodes(dns_rbtdb_t *rbtdb, int bucketnum) { continue; } - if (is_leaf(node) && rbtdb->task != NULL) { + if (is_leaf(node) && rbtdb->loop != NULL) { send_to_prune_tree(rbtdb, node, isc_rwlocktype_write); } else if (node->down == NULL && node->data == NULL) { /* @@ -2206,12 +2196,12 @@ decrement_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node, * the trouble, we'll dispatch a separate event for batch * cleaning. We need to check whether we're deleting the node * as a result of pruning to avoid infinite dispatching. - * Note: pruning happens only when a task has been set for the - * rbtdb. If the user of the rbtdb chooses not to set a task, + * Note: pruning happens only when a loop has been set for the + * rbtdb. If the user of the rbtdb chooses not to set a loop, * it's their responsibility to purge stale leaves (e.g. by * periodic walk-through). */ - if (!pruning && is_leaf(node) && rbtdb->task != NULL) { + if (!pruning && is_leaf(node) && rbtdb->loop != NULL) { send_to_prune_tree(rbtdb, node, isc_rwlocktype_write); no_reference = false; } else { @@ -2244,17 +2234,16 @@ restore_locks: * acceptable for a single event. */ static void -prune_tree(isc_task_t *task, isc_event_t *event) { - dns_rbtdb_t *rbtdb = event->ev_sender; - dns_rbtnode_t *node = event->ev_arg; - dns_rbtnode_t *parent; +prune_tree(void *arg) { + prune_t *prune = (prune_t *)arg; + dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)prune->db; + dns_rbtnode_t *node = prune->node; + dns_rbtnode_t *parent = NULL; unsigned int locknum; isc_rwlocktype_t tlocktype = isc_rwlocktype_none; isc_rwlocktype_t nlocktype = isc_rwlocktype_none; - UNUSED(task); - - isc_event_free(&event); + isc_mem_put(rbtdb->common.mctx, prune, sizeof(*prune)); TREE_WRLOCK(&rbtdb->tree_lock, &tlocktype); locknum = node->locknum; @@ -2488,8 +2477,8 @@ unlock: } static void -cleanup_dead_nodes_callback(isc_task_t *task, isc_event_t *event) { - dns_rbtdb_t *rbtdb = event->ev_arg; +cleanup_dead_nodes_callback(void *arg) { + dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)arg; bool again = false; unsigned int locknum; isc_rwlocktype_t tlocktype = isc_rwlocktype_none; @@ -2506,9 +2495,8 @@ cleanup_dead_nodes_callback(isc_task_t *task, isc_event_t *event) { } TREE_UNLOCK(&rbtdb->tree_lock, &tlocktype); if (again) { - isc_task_send(task, &event); + isc_async_run(rbtdb->loop, cleanup_dead_nodes_callback, rbtdb); } else { - isc_event_free(&event); if (isc_refcount_decrement(&rbtdb->references) == 1) { (void)isc_refcount_current(&rbtdb->references); maybe_free_rbtdb(rbtdb); @@ -2724,23 +2712,16 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, bool commit) { } if (!EMPTY(cleanup_list)) { - isc_event_t *event = NULL; isc_rwlocktype_t tlocktype = isc_rwlocktype_none; - if (rbtdb->task != NULL) { - event = isc_event_allocate(rbtdb->common.mctx, NULL, - DNS_EVENT_RBTDEADNODES, - cleanup_dead_nodes_callback, - rbtdb, sizeof(isc_event_t)); - } - if (event == NULL) { + if (rbtdb->loop == NULL) { /* * We acquire a tree write lock here in order to make * sure that stale nodes will be removed in * decrement_reference(). If we didn't have the lock, * those nodes could miss the chance to be removed * until the server stops. The write lock is - * expensive, but this event should be rare enough + * expensive, but this should be rare enough * to justify the cost. */ TREE_WRLOCK(&rbtdb->tree_lock, &tlocktype); @@ -2761,7 +2742,7 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, bool commit) { * This is a good opportunity to purge any dead nodes, * so use it. */ - if (event == NULL) { + if (rbtdb->loop == NULL) { cleanup_dead_nodes(rbtdb, rbtnode->locknum); } @@ -2777,9 +2758,10 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, bool commit) { isc_mem_put(rbtdb->common.mctx, changed, sizeof(*changed)); } - if (event != NULL) { + if (rbtdb->loop != NULL) { isc_refcount_increment(&rbtdb->references); - isc_task_send(rbtdb->task, &event); + isc_async_run(rbtdb->loop, cleanup_dead_nodes_callback, + rbtdb); } else { TREE_UNLOCK(&rbtdb->tree_lock, &tlocktype); } @@ -5690,7 +5672,7 @@ detachnode(dns_db_t *db, dns_dbnode_t **targetp) { isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE, ISC_LOG_DEBUG(1), "calling free_rbtdb(%s)", buf); - free_rbtdb(rbtdb, true, NULL); + free_rbtdb(rbtdb, true); } } } @@ -7825,7 +7807,7 @@ hashsize(dns_db_t *db) { } static void -settask(dns_db_t *db, isc_task_t *task) { +setloop(dns_db_t *db, isc_loop_t *loop) { dns_rbtdb_t *rbtdb; rbtdb = (dns_rbtdb_t *)db; @@ -7833,11 +7815,11 @@ settask(dns_db_t *db, isc_task_t *task) { REQUIRE(VALID_RBTDB(rbtdb)); RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write); - if (rbtdb->task != NULL) { - isc_task_detach(&rbtdb->task); + if (rbtdb->loop != NULL) { + isc_loop_detach(&rbtdb->loop); } - if (task != NULL) { - isc_task_attach(task, &rbtdb->task); + if (loop != NULL) { + isc_loop_attach(loop, &rbtdb->loop); } RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write); } @@ -8232,7 +8214,7 @@ static dns_dbmethods_t zone_methods = { attach, nodecount, ispersistent, overmem, - settask, + setloop, getoriginnode, NULL, /* transfernode */ getnsec3parameters, @@ -8282,7 +8264,7 @@ static dns_dbmethods_t cache_methods = { attach, nodecount, ispersistent, overmem, - settask, + setloop, getoriginnode, NULL, /* transfernode */ NULL, /* getnsec3parameters */ @@ -8431,7 +8413,7 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type, */ result = dns_name_dupwithoffsets(origin, mctx, &rbtdb->common.origin); if (result != ISC_R_SUCCESS) { - free_rbtdb(rbtdb, false, NULL); + free_rbtdb(rbtdb, false); return (result); } @@ -8440,19 +8422,19 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type, */ result = dns_rbt_create(mctx, delete_callback, rbtdb, &rbtdb->tree); if (result != ISC_R_SUCCESS) { - free_rbtdb(rbtdb, false, NULL); + free_rbtdb(rbtdb, false); return (result); } result = dns_rbt_create(mctx, delete_callback, rbtdb, &rbtdb->nsec); if (result != ISC_R_SUCCESS) { - free_rbtdb(rbtdb, false, NULL); + free_rbtdb(rbtdb, false); return (result); } result = dns_rbt_create(mctx, delete_callback, rbtdb, &rbtdb->nsec3); if (result != ISC_R_SUCCESS) { - free_rbtdb(rbtdb, false, NULL); + free_rbtdb(rbtdb, false); return (result); } @@ -8475,7 +8457,7 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type, &rbtdb->origin_node); if (result != ISC_R_SUCCESS) { INSIST(result != ISC_R_EXISTS); - free_rbtdb(rbtdb, false, NULL); + free_rbtdb(rbtdb, false); return (result); } INSIST(rbtdb->origin_node != NULL); @@ -8497,7 +8479,7 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type, &rbtdb->nsec3_origin_node); if (result != ISC_R_SUCCESS) { INSIST(result != ISC_R_EXISTS); - free_rbtdb(rbtdb, false, NULL); + free_rbtdb(rbtdb, false); return (result); } rbtdb->nsec3_origin_node->nsec = DNS_RBT_NSEC_NSEC3; @@ -8516,7 +8498,7 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type, */ isc_refcount_init(&rbtdb->references, 1); rbtdb->attributes = 0; - rbtdb->task = NULL; + rbtdb->loop = NULL; rbtdb->serve_stale_ttl = 0; /* diff --git a/lib/dns/sdb.c b/lib/dns/sdb.c index 079abbae282..c31d278beca 100644 --- a/lib/dns/sdb.c +++ b/lib/dns/sdb.c @@ -1258,9 +1258,9 @@ overmem(dns_db_t *db, bool over) { } static void -settask(dns_db_t *db, isc_task_t *task) { +setloop(dns_db_t *db, isc_loop_t *loop) { UNUSED(db); - UNUSED(task); + UNUSED(loop); } static dns_dbmethods_t sdb_methods = { @@ -1277,7 +1277,7 @@ static dns_dbmethods_t sdb_methods = { addrdataset, subtractrdataset, deleterdataset, issecure, nodecount, ispersistent, - overmem, settask, + overmem, setloop, getoriginnode, /* getoriginnode */ NULL, /* transfernode */ NULL, /* getnsec3parameters */ diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c index 1841602a159..8cc7eb5433a 100644 --- a/lib/dns/sdlz.c +++ b/lib/dns/sdlz.c @@ -1199,9 +1199,9 @@ overmem(dns_db_t *db, bool over) { } static void -settask(dns_db_t *db, isc_task_t *task) { +setloop(dns_db_t *db, isc_loop_t *loop) { UNUSED(db); - UNUSED(task); + UNUSED(loop); } /* @@ -1236,7 +1236,7 @@ static dns_dbmethods_t sdlzdb_methods = { printnode, createiterator, findrdataset, allrdatasets, addrdataset, subtractrdataset, deleterdataset, issecure, nodecount, - ispersistent, overmem, settask, + ispersistent, overmem, setloop, getoriginnode, NULL, /* transfernode */ NULL, /* getnsec3parameters */ NULL, /* findnsec3node */ diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 670898e2cfd..c1fedd43f93 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -2355,7 +2355,7 @@ zone_load(dns_zone_t *zone, unsigned int flags, bool locked) { isc_result_totext(result)); goto cleanup; } - dns_db_settask(db, zone->task); + dns_db_setloop(db, zone->loop); if (zone->type == dns_zone_primary || zone->type == dns_zone_secondary || zone->type == dns_zone_mirror) @@ -14978,7 +14978,7 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) { isc_result_totext(result)); goto cleanup; } - dns_db_settask(stub->db, zone->task); + dns_db_setloop(stub->db, zone->loop); } result = dns_db_newversion(stub->db, &stub->version); @@ -17666,7 +17666,7 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, bool dump) { zone_detachdb(zone); } zone_attachdb(zone, db); - dns_db_settask(zone->db, zone->task); + dns_db_setloop(zone->db, zone->loop); DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED | DNS_ZONEFLG_NEEDNOTIFY); return (ISC_R_SUCCESS); diff --git a/tests/libtest/dns.c b/tests/libtest/dns.c index c6b12bc2715..a2063e17799 100644 --- a/tests/libtest/dns.c +++ b/tests/libtest/dns.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include @@ -72,7 +71,7 @@ dns_test_makeview(const char *name, bool with_cache, dns_view_t **viewp) { } if (with_cache) { - result = dns_cache_create(taskmgr, dns_rdataclass_in, "", + result = dns_cache_create(loopmgr, dns_rdataclass_in, "", &cache); if (result != ISC_R_SUCCESS) { dns_view_detach(&view);