We always load zones asynchronously.
*\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.
*/
* \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
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) {
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) {