mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 13:12:05 -04:00
The zone table no longer depends on the loop manager
This reverts some of the changes in commit b171cacf4f
because now it isn't necessary to pass the loopmgr around.
This commit is contained in:
parent
6217e434b5
commit
9882a6ef90
13 changed files with 18 additions and 29 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
12
lib/dns/zt.c
12
lib/dns/zt.c
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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++) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue