REQUIRE(num_zonesp != NULL);
+ LOCK(&view->new_zone_lock);
+
CHECK(migrate_nzf(view));
isc_log_write(ns_g_lctx,
"for view '%s'",
view->new_zone_db, view->name);
- LOCK(&view->new_zone_lock);
-
CHECK(nzd_count(view, &n));
*num_zonesp = n;
return (result);
}
+/*
+ * Migrate zone configuration from an NZF file to an NZD database.
+ * Caller must hold view->new_zone_lock.
+ */
static isc_result_t
migrate_nzf(dns_view_t *view) {
isc_result_t result;
MDB_val key, data;
ns_dzarg_t dzarg;
- LOCK(&view->new_zone_lock);
-
/*
* If NZF file doesn't exist, or NZD DB exists and already
* has data, return without attempting migration.
result = nzd_close(&txn, commit);
}
- UNLOCK(&view->new_zone_lock);
-
if (text != NULL) {
isc_buffer_free(&text);
}