#define RBTDB_RDATATYPE_NCACHEANY \
RBTDB_RDATATYPE_VALUE(0, dns_rdatatype_any)
-#define RBTDB_INITLOCK(l) isc_rwlock_init((l), 0, 0)
-#define RBTDB_DESTROYLOCK(l) isc_rwlock_destroy(l)
-#define RBTDB_LOCK(l, t) RWLOCK((l), (t))
-#define RBTDB_UNLOCK(l, t) RWUNLOCK((l), (t))
-
/*
* Since node locking is sensitive to both performance and memory footprint,
* we need some trick here. If we have both high-performance rwlock and
if (rbtdb->task != NULL)
isc_task_detach(&rbtdb->task);
- RBTDB_DESTROYLOCK(&rbtdb->lock);
+ isc_rwlock_destroy(&rbtdb->lock);
rbtdb->common.magic = 0;
rbtdb->common.impmagic = 0;
isc_mem_detach(&rbtdb->hmctx);
}
if (inactive != 0) {
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
rbtdb->active -= inactive;
if (rbtdb->active == 0) {
want_free = ISC_TRUE;
}
- RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
if (want_free) {
char buf[DNS_NAME_FORMATSIZE];
if (dns_name_dynamic(&rbtdb->common.origin)) {
REQUIRE(VALID_RBTDB(rbtdb));
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
version = rbtdb->current_version;
isc_refcount_increment(&version->references, &refs);
- RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
+ RWUNLOCK(&rbtdb->lock, isc_rwlocktype_read);
*versionp = (dns_dbversion_t *)version;
}
REQUIRE(versionp != NULL && *versionp == NULL);
REQUIRE(rbtdb->future_version == NULL);
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
RUNTIME_CHECK(rbtdb->next_serial != 0); /* XXX Error? */
version = allocate_version(rbtdb->common.mctx, rbtdb->next_serial, 1,
ISC_TRUE);
}
} else
result = ISC_R_NOMEMORY;
- RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
if (version == NULL)
return (result);
changed = isc_mem_get(rbtdb->common.mctx, sizeof(*changed));
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
REQUIRE(version->writer);
} else
version->commit_ok = ISC_FALSE;
- RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
return (changed);
}
* Caller doesn't know the least serial.
* Get it.
*/
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
least_serial = rbtdb->least_serial;
- RBTDB_UNLOCK(&rbtdb->lock,
+ RWUNLOCK(&rbtdb->lock,
isc_rwlocktype_read);
}
clean_zone_node(rbtdb, node, least_serial);
isc_refcount_decrement(&version->references, &refs);
if (refs > 0) { /* typical and easy case first */
if (commit) {
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
INSIST(!version->writer);
- RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
+ RWUNLOCK(&rbtdb->lock, isc_rwlocktype_read);
}
goto end;
}
if (version->writer && commit && !IS_CACHE(rbtdb))
iszonesecure(db, version, rbtdb->origin_node);
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
serial = version->serial;
if (version->writer) {
if (commit) {
UNLINK(rbtdb->open_versions, version, link);
}
least_serial = rbtdb->least_serial;
- RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
if (cleanup_version != NULL) {
INSIST(EMPTY(cleanup_version->changed_list));
*targetp = NULL;
if (inactive) {
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
rbtdb->active--;
if (rbtdb->active == 0)
want_free = ISC_TRUE;
- RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
if (want_free) {
char buf[DNS_NAME_FORMATSIZE];
if (dns_name_dynamic(&rbtdb->common.origin))
else
loadctx->now = 0;
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
REQUIRE((rbtdb->attributes & (RBTDB_ATTR_LOADED|RBTDB_ATTR_LOADING))
== 0);
rbtdb->attributes |= RBTDB_ATTR_LOADING;
- RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
callbacks->add = loading_addrdataset;
callbacks->add_private = loadctx;
REQUIRE(loadctx != NULL);
REQUIRE(loadctx->rbtdb == rbtdb);
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
REQUIRE((rbtdb->attributes & RBTDB_ATTR_LOADING) != 0);
REQUIRE((rbtdb->attributes & RBTDB_ATTR_LOADED) == 0);
rbtdb->attributes &= ~RBTDB_ATTR_LOADING;
rbtdb->attributes |= RBTDB_ATTR_LOADED;
- RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
/*
* If there's a KEY rdataset at the zone origin containing a
REQUIRE(VALID_RBTDB(rbtdb));
- RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
if (rbtdb->task != NULL)
isc_task_detach(&rbtdb->task);
if (task != NULL)
isc_task_attach(task, &rbtdb->task);
- RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
+ RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
}
static isc_boolean_t
ISC_LIST_INIT(rbtdb->common.update_listeners);
- result = RBTDB_INITLOCK(&rbtdb->lock);
+ result = isc_rwlock_init(&rbtdb->lock, 0, 0);
if (result != ISC_R_SUCCESS)
goto cleanup_rbtdb;
isc_rwlock_destroy(&rbtdb->tree_lock);
cleanup_lock:
- RBTDB_DESTROYLOCK(&rbtdb->lock);
+ isc_rwlock_destroy(&rbtdb->lock);
cleanup_rbtdb:
isc_mem_put(mctx, rbtdb, sizeof(*rbtdb));
do { result = isc_mutex_trylock(&(z)->lock); } while (0)
#endif
-#define ZONEDB_INITLOCK(l) isc_rwlock_init((l), 0, 0)
-#define ZONEDB_DESTROYLOCK(l) isc_rwlock_destroy(l)
-#define ZONEDB_LOCK(l, t) RWLOCK((l), (t))
-#define ZONEDB_UNLOCK(l, t) RWUNLOCK((l), (t))
-
struct dns_zone {
/* Unlocked */
unsigned int magic;
goto free_zone;
}
- result = ZONEDB_INITLOCK(&zone->dblock);
+ result = isc_rwlock_init(&zone->dblock, 0, 0);
if (result != ISC_R_SUCCESS) {
goto free_mutex;
}
isc_refcount_destroy(&zone->erefs);
free_dblock:
- ZONEDB_DESTROYLOCK(&zone->dblock);
+ isc_rwlock_destroy(&zone->dblock);
free_mutex:
DESTROYLOCK(&zone->lock);
}
/* last stuff */
- ZONEDB_DESTROYLOCK(&zone->dblock);
+ isc_rwlock_destroy(&zone->dblock);
DESTROYLOCK(&zone->lock);
isc_refcount_destroy(&zone->erefs);
zone->magic = 0;
REQUIRE(serialp != NULL);
LOCK_ZONE(zone);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL) {
result = zone_get_from_db(zone, zone->db, NULL, &soacount,
serialp, NULL, NULL, NULL, NULL,
result = ISC_R_FAILURE;
} else
result = DNS_R_NOTLOADED;
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
UNLOCK_ZONE(zone);
return (result);
goto cleanup;
}
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write);
+ RWLOCK(&zone->dblock, isc_rwlocktype_write);
/* ask SDLZ driver if the zone is supported */
findzone = dlzdb->implementation->methods->findzone;
result = (*findzone)(dlzdb->implementation->driverarg,
dns_db_detach(&db);
result = ISC_R_SUCCESS;
}
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_write);
if (result == ISC_R_SUCCESS) {
if (dlzdb->configure_callback == NULL)
LOCK_ZONE(zone);
INSIST(zone != zone->raw);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL) {
const dns_master_style_t *output_style;
dns_db_closeversion(zone->db, &version, ISC_FALSE);
} else
result = ISC_R_CANCELED;
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
UNLOCK_ZONE(zone);
if (result != DNS_R_CONTINUE)
goto fail;
isc_result_t result;
dns_db_t *db = NULL;
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL)
goto cleanup;
char flags[sizeof("INITIAL|REMOVE|CREATE|NONSEC|OPTOUT")];
dns_db_t *db = NULL;
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL) {
result = ISC_R_SUCCESS;
if (zone->privatetype == 0)
return;
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL)
goto cleanup;
dns_rdataset_init(&rdataset);
dns_fixedname_init(&fixed);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL) {
isc_time_settoepoch(&zone->resigntime);
return;
DNS_ZONEKEY_OPTION(zone, DNS_ZONEKEY_MAINTAIN))
zone->refreshkeytime = now;
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write);
+ RWLOCK(&zone->dblock, isc_rwlocktype_write);
if (zone->db != NULL) {
result = zone_replacedb(zone, db, ISC_FALSE);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_write);
if (result != ISC_R_SUCCESS)
goto cleanup;
} else {
zone_attachdb(zone, db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_write);
DNS_ZONE_SETFLAG(zone,
DNS_ZONEFLG_LOADED|
DNS_ZONEFLG_NEEDSTARTUPNOTIFY);
REQUIRE(DNS_ZONE_VALID(zone));
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db == NULL)
result = DNS_R_NOTLOADED;
else
dns_db_attach(zone->db, dpb);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
return (result);
}
REQUIRE(DNS_ZONE_VALID(zone));
REQUIRE(zone->type == dns_zone_staticstub);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write);
+ RWLOCK(&zone->dblock, isc_rwlocktype_write);
REQUIRE(zone->db == NULL);
dns_db_attach(db, &zone->db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_write);
}
/*
goto failure;
}
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
result = dns_db_newversion(db, &version);
if (result != ISC_R_SUCCESS) {
goto failure;
}
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
/*
* This function is called when zone timer fires, after the latter gets
* set by zone_addnsec3chain(). If the action triggering the call to
if (zone->db != NULL) {
dns_db_attach(zone->db, &db);
}
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL) {
return;
}
LOCK_ZONE(zone);
nextnsec3chain = ISC_LIST_NEXT(nsec3chain, link);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (nsec3chain->done || nsec3chain->db != zone->db) {
ISC_LIST_UNLINK(zone->nsec3chain, nsec3chain, link);
ISC_LIST_APPEND(cleanup, nsec3chain, link);
}
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
UNLOCK_ZONE(zone);
if (ISC_LIST_TAIL(cleanup) == nsec3chain)
goto next_addchain;
goto failure;
}
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL) {
result = ISC_R_FAILURE;
goto failure;
while (signing != NULL && nodes-- > 0 && signatures > 0) {
nextsigning = ISC_LIST_NEXT(signing, link);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (signing->done || signing->db != zone->db) {
/*
* The zone has been reloaded. We will have
*/
ISC_LIST_UNLINK(zone->signing, signing, link);
ISC_LIST_APPEND(cleanup, signing, link);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
goto next_signing;
}
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (signing->db != db)
goto next_signing;
return;
}
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
dns_diff_init(zone->mctx, &diff);
goto again;
}
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL) {
result = zone_get_from_db(zone, zone->db, NULL,
&soacount, &serial,
NULL, NULL);
} else
result = DNS_R_NOTLOADED;
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (result == ISC_R_SUCCESS && soacount > 0U)
zone_send_secureserial(zone, serial);
}
isc_uint32_t sserial;
isc_result_t mresult;
- ZONEDB_LOCK(&secure->dblock, isc_rwlocktype_read);
+ RWLOCK(&secure->dblock, isc_rwlocktype_read);
if (secure->db != NULL) {
mresult = dns_db_getsoaserial(zone->secure->db,
NULL, &sserial);
isc_serial_lt(sserial, serial))
serial = sserial;
}
- ZONEDB_UNLOCK(&secure->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&secure->dblock, isc_rwlocktype_read);
}
if (tresult == ISC_R_SUCCESS && zone->xfr == NULL) {
dns_db_t *zdb = NULL;
ENTER;
redo:
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
LOCK_ZONE(zone);
if (zone->masterfile != NULL) {
masterfile = isc_mem_strdup(zone->mctx, zone->masterfile);
REQUIRE(DNS_ZONE_VALID(zone));
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL)
return (DNS_R_NOTLOADED);
if (zone->dctx != NULL)
dns_dumpctx_cancel(zone->dctx);
}
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write);
+ RWLOCK(&zone->dblock, isc_rwlocktype_write);
zone_detachdb(zone);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_write);
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_LOADED);
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NEEDDUMP);
}
/*
* Get SOA RRset.
*/
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &zonedb);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (zonedb == NULL)
return;
dns_db_currentversion(zonedb, &version);
* Tidy up.
*/
dns_db_closeversion(stub->db, &stub->version, ISC_TRUE);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write);
+ RWLOCK(&zone->dblock, isc_rwlocktype_write);
if (zone->db == NULL)
zone_attachdb(zone, stub->db);
result = zone_get_from_db(zone, zone->db, NULL, &soacount, NULL,
DNS_MAX_EXPIRE);
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_HAVETIMERS);
}
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_write);
dns_db_detach(&stub->db);
dns_message_destroy(&msg);
* new one and attach it to the zone once we have the NS
* RRset and glue.
*/
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL) {
dns_db_attach(zone->db, &stub->db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
} else {
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
INSIST(zone->db_argc >= 1);
result = dns_db_create(zone->mctx, zone->db_argv[0],
if (result != ISC_R_SUCCESS)
goto soa_cleanup;
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
INSIST(zone->db != NULL); /* XXXJT: is this assumption correct? */
dns_db_attach(zone->db, &zonedb);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
dns_name_init(tempname, NULL);
dns_name_clone(&zone->origin, tempname);
if (zone->task != NULL)
isc_task_detach(&zone->task);
isc_task_attach(task, &zone->task);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_settask(zone->db, zone->task);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
UNLOCK_ZONE(zone);
}
* zone->db may be NULL, if the load from disk failed.
*/
result = ISC_R_SUCCESS;
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &zone->rss_db);
else
result = ISC_R_FAILURE;
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (result == ISC_R_SUCCESS && zone->raw != NULL)
dns_zone_attach(zone->raw, &zone->rss_raw);
}
TIME_NOW(&loadtime);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL) {
result = dns_db_getsoaserial(zone->db, NULL, &oldserial);
if (result == ISC_R_SUCCESS)
*/
result = save_nsec3param(zone, &nsec3list);
if (result != ISC_R_SUCCESS) {
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
goto failure;
}
}
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
result = dns_db_create(zone->mctx, zone->db_argv[0],
&zone->origin, dns_dbtype_zone, zone->rdclass,
goto again;
}
}
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write);
+ RWLOCK(&zone->dblock, isc_rwlocktype_write);
result = zone_replacedb(zone, db, dump);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_write);
if (secure != NULL)
UNLOCK_ZONE(secure);
UNLOCK_ZONE(zone);
/*
* Has the zone expired underneath us?
*/
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db == NULL) {
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
goto same_master;
}
result = zone_get_from_db(zone, zone->db, &nscount,
&soacount, &serial, &refresh,
&retry, &expire, &minimum, NULL);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (result == ISC_R_SUCCESS) {
if (soacount != 1)
dns_zone_log(zone, ISC_LOG_ERROR,
/*
* Decide whether we should request IXFR or AXFR.
*/
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
loaded = ISC_TF(zone->db != NULL);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (!loaded) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
TIME_NOW(&now);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL) {
result = ISC_R_NOTFOUND;
dns_rdataset_init(&rdataset);
dns_diff_init(zone->mctx, &diff);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL)
goto failure;
dns_rdataset_init(&nrdataset);
dns_diff_init(zone->mctx, &diff);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL)
goto failure;
dns_db_currentversion(db, &oldver);
result = dns_db_newversion(db, &newver);
if (result != ISC_R_SUCCESS) {
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
dns_zone_log(zone, ISC_LOG_ERROR,
"setnsec3param:dns_db_newversion -> %s",
dns_result_totext(result));
dns_diff_init(zone->mctx, &diff);
- ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
+ RWLOCK(&zone->dblock, isc_rwlocktype_read);
if (zone->db != NULL)
dns_db_attach(zone->db, &db);
- ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
+ RWUNLOCK(&zone->dblock, isc_rwlocktype_read);
if (db == NULL)
goto failure;