From: Matthijs Mekking Date: Wed, 4 Feb 2026 08:39:25 +0000 (+0100) Subject: Remove unused dns_view_load() and dns_zt_load() X-Git-Tag: v9.21.19~28^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04f39e92d10514e297d6e09ae8b2693f611ac944;p=thirdparty%2Fbind9.git Remove unused dns_view_load() and dns_zt_load() We always load zones asynchronously. --- diff --git a/lib/dns/include/dns/view.h b/lib/dns/include/dns/view.h index ddf51e5f2f9..9edad1852fc 100644 --- a/lib/dns/include/dns/view.h +++ b/lib/dns/include/dns/view.h @@ -774,28 +774,17 @@ dns_view_findzone(dns_view_t *view, const dns_name_t *name, *\li #ISC_R_NOTFOUND No matching zone was found. */ -isc_result_t -dns_view_load(dns_view_t *view, bool stop, bool newonly); - isc_result_t dns_view_asyncload(dns_view_t *view, bool newonly, dns_zt_callback_t *callback, void *arg); /*%< - * Load zones attached to this view. dns_view_load() loads - * all zones whose master file has changed since the last - * load - * - * dns_view_asyncload() loads zones asynchronously. When all zones + * Load zones attached to this view asynchronously. When all zones * in the view have finished loading, 'callback' is called with argument * 'arg' to inform the caller. * - * If 'stop' is true, stop on the first error and return it. - * If 'stop' is false (or we are loading asynchronously), ignore errors. - * * If 'newonly' is true load only zones that were never loaded. * * Requires: - * *\li 'view' is valid. */ diff --git a/lib/dns/include/dns/zt.h b/lib/dns/include/dns/zt.h index 733f576f1ee..1284143ec2c 100644 --- a/lib/dns/include/dns/zt.h +++ b/lib/dns/include/dns/zt.h @@ -135,25 +135,18 @@ dns_zt_attach(dns_zt_t *zt, dns_zt_t **ztp); * \li '*ztp' to be NULL */ -isc_result_t -dns_zt_load(dns_zt_t *zt, bool stop, bool newonly); - isc_result_t dns_zt_asyncload(dns_zt_t *zt, bool newonly, dns_zt_callback_t alldone, void *arg); /*%< - * Load all zones in the table. If 'stop' is true, stop on the first - * error and return it. If 'stop' is false, ignore errors. - * - * If newonly is set only zones that were never loaded are loaded. + * Load all zones in the table asynchronously. When all zones in the zone + * table have finished loaded (or failed due to errors), the caller is + * informed by calling 'alldone' with an argument of 'arg'. * - * dns_zt_asyncload() loads zones asynchronously; when all - * zones in the zone table have finished loaded (or failed due - * to errors), the caller is informed by calling 'alldone' - * with an argument of 'arg'. + * If 'newonly' is set only zones that were never loaded are loaded. * * Requires: - * \li 'zt' to be valid + * \li 'zt' to be valid. */ isc_result_t diff --git a/lib/dns/view.c b/lib/dns/view.c index 753b573d74d..217a46faaca 100644 --- a/lib/dns/view.c +++ b/lib/dns/view.c @@ -1233,24 +1233,6 @@ dns_viewlist_findzone(dns_viewlist_t *list, const dns_name_t *name, return ISC_R_NOTFOUND; } -isc_result_t -dns_view_load(dns_view_t *view, bool stop, bool newonly) { - isc_result_t result; - dns_zt_t *zonetable = NULL; - - REQUIRE(DNS_VIEW_VALID(view)); - - rcu_read_lock(); - zonetable = rcu_dereference(view->zonetable); - if (zonetable != NULL) { - result = dns_zt_load(zonetable, stop, newonly); - } else { - result = ISC_R_SUCCESS; - } - rcu_read_unlock(); - return result; -} - isc_result_t dns_view_asyncload(dns_view_t *view, bool newonly, dns_zt_callback_t *callback, void *arg) { diff --git a/lib/dns/zt.c b/lib/dns/zt.c index f946a87da1e..7342fa2f79e 100644 --- a/lib/dns/zt.c +++ b/lib/dns/zt.c @@ -281,24 +281,6 @@ dns_zt_flush(dns_zt_t *zt) { atomic_store_release(&zt->flush, true); } -static isc_result_t -load(dns_zone_t *zone, void *uap) { - isc_result_t result; - result = dns_zone_load(zone, uap != NULL); - if (result == DNS_R_CONTINUE || result == ISC_R_LOADING || - result == DNS_R_UPTODATE || result == DNS_R_DYNAMIC) - { - result = ISC_R_SUCCESS; - } - return result; -} - -isc_result_t -dns_zt_load(dns_zt_t *zt, bool stop, bool newonly) { - REQUIRE(VALID_ZT(zt)); - return dns_zt_apply(zt, stop, NULL, load, newonly ? &newonly : NULL); -} - static void loaded_all(struct zt_load_params *params) { if (params->loaddone != NULL) {