]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
The zone table no longer depends on the loop manager
authorTony Finch <fanf@isc.org>
Thu, 27 Apr 2023 11:47:03 +0000 (12:47 +0100)
committerTony Finch <fanf@isc.org>
Fri, 12 May 2023 19:48:31 +0000 (20:48 +0100)
This reverts some of the changes in commit b171cacf4f0123ba
because now it isn't necessary to pass the loopmgr around.

13 files changed:
bin/delv/delv.c
bin/named/server.c
bin/tests/system/pipelined/pipequeries.c
bin/tools/mdig.c
fuzz/dns_message_checksig.c
lib/dns/client.c
lib/dns/include/dns/view.h
lib/dns/include/dns/zt.h
lib/dns/view.c
lib/dns/zt.c
tests/bench/qpmulti.c
tests/dns/qpmulti_test.c
tests/libtest/dns.c

index fc10c7137cbe2f669ce6d04be221a2a3b5e89666..6ae6af9183149278a58e739707e7107d6765af1d 100644 (file)
@@ -2147,8 +2147,7 @@ run_server(void *arg) {
        CHECK(ns_interfacemgr_create(mctx, sctx, loopmgr, netmgr, dispatchmgr,
                                     NULL, false, &interfacemgr));
 
-       CHECK(dns_view_create(mctx, loopmgr, dns_rdataclass_in, "_default",
-                             &view));
+       CHECK(dns_view_create(mctx, dns_rdataclass_in, "_default", &view));
        CHECK(dns_cache_create(loopmgr, dns_rdataclass_in, "", &cache));
        dns_view_setcache(view, cache, false);
        dns_cache_detach(&cache);
index a13c9c7a4d46c9b4c676cabceddb4e8d2dccdcf0..d38ecffd0175f24678f52312e031c83b0826ecf0 100644 (file)
@@ -6437,8 +6437,7 @@ create_view(const cfg_obj_t *vconfig, dns_viewlist_t *viewlist,
        }
        INSIST(view == NULL);
 
-       result = dns_view_create(named_g_mctx, named_g_loopmgr, viewclass,
-                                viewname, &view);
+       result = dns_view_create(named_g_mctx, viewclass, viewname, &view);
        if (result != ISC_R_SUCCESS) {
                return (result);
        }
index 5569ad318d37c90cdcd03c720c63393e0138b0db..805e3c534438f55280f9665c69afeec925d7005a 100644 (file)
@@ -256,7 +256,7 @@ main(int argc, char *argv[]) {
        RUNCHECK(dns_requestmgr_create(mctx, dispatchmgr, dispatchv4, NULL,
                                       &requestmgr));
 
-       RUNCHECK(dns_view_create(mctx, loopmgr, 0, "_test", &view));
+       RUNCHECK(dns_view_create(mctx, 0, "_test", &view));
 
        isc_loopmgr_setup(loopmgr, sendqueries, NULL);
        isc_loopmgr_run(loopmgr);
index 4193f06912dd07daa9c90c05f1810d52c5692c5c..7a366c0e8524f67c72cd0fcfabda515c3130901a 100644 (file)
@@ -2141,7 +2141,7 @@ main(int argc, char *argv[]) {
                mctx, dispatchmgr, have_ipv4 ? dispatchvx : NULL,
                have_ipv6 ? dispatchvx : NULL, &requestmgr));
 
-       RUNCHECK(dns_view_create(mctx, loopmgr, 0, "_mdig", &view));
+       RUNCHECK(dns_view_create(mctx, 0, "_mdig", &view));
 
        query = ISC_LIST_HEAD(queries);
        isc_loopmgr_setup(loopmgr, sendqueries, query);
index c27bfebe8bc631e39d2ec0ed9125c2914e0cc17c..a4b9dd15ab1fd1e5ca18d765660792160f0e3fde 100644 (file)
@@ -236,8 +236,7 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
 
        isc_loopmgr_create(mctx, 1, &loopmgr);
 
-       result = dns_view_create(mctx, loopmgr, dns_rdataclass_in, "view",
-                                &view);
+       result = dns_view_create(mctx, dns_rdataclass_in, "view", &view);
        if (result != ISC_R_SUCCESS) {
                fprintf(stderr, "dns_view_create failed: %s\n",
                        isc_result_totext(result));
index 5a3c0fadda83d8537a2333ab609337b145de7edc..579b9c3aab1acbfe59c138510018fa3c1e613cca 100644 (file)
@@ -206,8 +206,7 @@ createview(isc_mem_t *mctx, dns_rdataclass_t rdclass, isc_loopmgr_t *loopmgr,
        isc_result_t result;
        dns_view_t *view = NULL;
 
-       result = dns_view_create(mctx, loopmgr, rdclass, DNS_CLIENTVIEW_NAME,
-                                &view);
+       result = dns_view_create(mctx, rdclass, DNS_CLIENTVIEW_NAME, &view);
        if (result != ISC_R_SUCCESS) {
                return (result);
        }
index b72a3dd44f162eb8ef15d80668668c3b040ac66d..e801b3a30f2702bcde15bfdb1806b6dd6415e5a6 100644 (file)
@@ -259,8 +259,8 @@ struct dns_view {
 #endif /* HAVE_LMDB */
 
 isc_result_t
-dns_view_create(isc_mem_t *mctx, isc_loopmgr_t *loopmgr,
-               dns_rdataclass_t rdclass, const char *name, dns_view_t **viewp);
+dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, const char *name,
+               dns_view_t **viewp);
 /*%<
  * Create a view.
  *
index 1118d064280188fe41b22c01a0e0e5d473d985e4..3ed74911c26ad170440f4b9ed5cfedf7440255c4 100644 (file)
@@ -34,8 +34,7 @@ typedef isc_result_t
 dns_zt_callback_t(void *arg);
 
 void
-dns_zt_create(isc_mem_t *mctx, isc_loopmgr_t *loopmgr, dns_view_t *view,
-             dns_zt_t **ztp);
+dns_zt_create(isc_mem_t *mctx, dns_view_t *view, dns_zt_t **ztp);
 /*%<
  * Creates a new zone table for a view.
  *
index 5f58142627741fe493eae1283a0116bf0d4708a5..ee2a5c9a06e5d2f0fc8b4cb34fd1ef1feb88fbd0 100644 (file)
@@ -79,8 +79,7 @@
 #define DEFAULT_EDNS_BUFSIZE 1232
 
 isc_result_t
-dns_view_create(isc_mem_t *mctx, isc_loopmgr_t *loopmgr,
-               dns_rdataclass_t rdclass, const char *name,
+dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, const char *name,
                dns_view_t **viewp) {
        dns_view_t *view = NULL;
        isc_result_t result;
@@ -135,7 +134,7 @@ dns_view_create(isc_mem_t *mctx, isc_loopmgr_t *loopmgr,
        isc_rwlock_init(&view->sfd_lock);
 
        view->zonetable = NULL;
-       dns_zt_create(mctx, loopmgr, view, &view->zonetable);
+       dns_zt_create(mctx, view, &view->zonetable);
 
        result = dns_fwdtable_create(mctx, &view->fwdtable);
        if (result != ISC_R_SUCCESS) {
index cf91f7285b0892353b0e935ca2a5177d76fcbc24..01bed3c290b03f2b145e902aecef216493b9ec9d 100644 (file)
@@ -94,15 +94,14 @@ static dns_qpmethods_t ztqpmethods = {
 };
 
 void
-dns_zt_create(isc_mem_t *mctx, isc_loopmgr_t *loopmgr, dns_view_t *view,
-             dns_zt_t **ztp) {
+dns_zt_create(isc_mem_t *mctx, dns_view_t *view, dns_zt_t **ztp) {
        dns_qpmulti_t *multi = NULL;
        dns_zt_t *zt = NULL;
 
        REQUIRE(ztp != NULL && *ztp == NULL);
        REQUIRE(view != NULL);
 
-       dns_qpmulti_create(mctx, loopmgr, &ztqpmethods, view, &multi);
+       dns_qpmulti_create(mctx, &ztqpmethods, view, &multi);
 
        zt = isc_mem_get(mctx, sizeof(*zt));
        *zt = (dns_zt_t){
@@ -177,11 +176,8 @@ dns_zt_find(dns_zt_t *zt, const dns_name_t *name, dns_ztfind_t options,
        REQUIRE(VALID_ZT(zt));
        REQUIRE(exactopts != exactmask);
 
-       if (isc_tid() == ISC_TID_UNKNOWN) {
-               dns_qpmulti_lockedread(zt->multi, &qpr);
-       } else {
-               dns_qpmulti_query(zt->multi, &qpr);
-       }
+       dns_qpmulti_query(zt->multi, &qpr);
+
        if (exactopts == DNS_ZTFIND_EXACT) {
                result = dns_qp_getname(&qpr, name, &pval, &ival);
        } else if (exactopts == DNS_ZTFIND_NOEXACT) {
index 7034ac983fc10f85179627dee8a8bb5092a5de6c..93b98a0b6aa35b3cc19ce409bd741b614cc9f1b1 100644 (file)
@@ -380,8 +380,7 @@ load_multi(struct bench_state *bctx) {
        size_t count = 0;
        uint64_t start;
 
-       dns_qpmulti_create(bctx->mctx, bctx->loopmgr, &item_methods, NULL,
-                          &bctx->multi);
+       dns_qpmulti_create(bctx->mctx, &item_methods, NULL, &bctx->multi);
 
        /* initial contents of the trie */
        start = isc_time_monotonic();
index 16e5350dec2a4a9b6fc3e0cf5f30c7f3db329e97..d5a5b91d0b51154eca818bf7af5380ec183dc360 100644 (file)
@@ -367,7 +367,7 @@ many_transactions(void *arg) {
        UNUSED(arg);
 
        dns_qpmulti_t *qpm = NULL;
-       dns_qpmulti_create(mctx, loopmgr, &test_methods, NULL, &qpm);
+       dns_qpmulti_create(mctx, &test_methods, NULL, &qpm);
        qpm->writer.write_protect = true;
 
        for (size_t n = 0; n < TRANSACTION_COUNT; n++) {
index b093b88c43ad4f32bc5fad0d8e926c4f88d8078b..d398c5c954f36fdb86459b0c521e336aad99c9b0 100644 (file)
@@ -64,7 +64,7 @@ dns_test_makeview(const char *name, bool with_cache, dns_view_t **viewp) {
        dns_view_t *view = NULL;
        dns_cache_t *cache = NULL;
 
-       result = dns_view_create(mctx, loopmgr, dns_rdataclass_in, name, &view);
+       result = dns_view_create(mctx, dns_rdataclass_in, name, &view);
        if (result != ISC_R_SUCCESS) {
                return (result);
        }