summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib/dns
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2020-01-21 23:59:21 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2020-01-21 23:59:21 +0000
commit5aa7556e4d812af3a62e4492f999c068d39cc536 (patch)
tree656fb509c90d3f03b00a32183c23f601a4ff2f31 /usr.sbin/bind/lib/dns
parent00e28ecca5f996eb20b19dfb7c8600b3dc03f865 (diff)
remove mutex.h etc. since this code is now unthreaded.
ok florian
Diffstat (limited to 'usr.sbin/bind/lib/dns')
-rw-r--r--usr.sbin/bind/lib/dns/lib.c14
-rw-r--r--usr.sbin/bind/lib/dns/master.c16
-rw-r--r--usr.sbin/bind/lib/dns/openssl_link.c2
-rw-r--r--usr.sbin/bind/lib/dns/rdata/in_1/wks_11.c17
4 files changed, 3 insertions, 46 deletions
diff --git a/usr.sbin/bind/lib/dns/lib.c b/usr.sbin/bind/lib/dns/lib.c
index fcba11db4aa..55dd08d1b04 100644
--- a/usr.sbin/bind/lib/dns/lib.c
+++ b/usr.sbin/bind/lib/dns/lib.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lib.c,v 1.8 2020/01/20 18:51:52 florian Exp $ */
+/* $Id: lib.c,v 1.9 2020/01/21 23:59:20 tedu Exp $ */
/*! \file */
@@ -25,7 +25,6 @@
#include <isc/hash.h>
-#include <isc/mutex.h>
#include <isc/once.h>
#include <isc/util.h>
@@ -49,7 +48,6 @@ unsigned int dns_pps = 0U;
static isc_once_t init_once = ISC_ONCE_INIT;
static isc_boolean_t initialize_done = ISC_FALSE;
-static isc_mutex_t reflock;
static unsigned int references = 0;
static void
@@ -67,15 +65,9 @@ initialize(void) {
if (result != ISC_R_SUCCESS)
goto cleanup_hash;
- result = isc_mutex_init(&reflock);
- if (result != ISC_R_SUCCESS)
- goto cleanup_dst;
-
initialize_done = ISC_TRUE;
return;
- cleanup_dst:
- dst_lib_destroy();
cleanup_hash:
isc_hash_destroy();
}
@@ -96,9 +88,7 @@ dns_lib_init(void) {
if (!initialize_done)
return (ISC_R_FAILURE);
- LOCK(&reflock);
references++;
- UNLOCK(&reflock);
return (ISC_R_SUCCESS);
}
@@ -107,10 +97,8 @@ void
dns_lib_shutdown(void) {
isc_boolean_t cleanup_ok = ISC_FALSE;
- LOCK(&reflock);
if (--references == 0)
cleanup_ok = ISC_TRUE;
- UNLOCK(&reflock);
if (!cleanup_ok)
return;
diff --git a/usr.sbin/bind/lib/dns/master.c b/usr.sbin/bind/lib/dns/master.c
index fc78d33846d..1bfc0bfaef3 100644
--- a/usr.sbin/bind/lib/dns/master.c
+++ b/usr.sbin/bind/lib/dns/master.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: master.c,v 1.12 2020/01/20 18:51:52 florian Exp $ */
+/* $Id: master.c,v 1.13 2020/01/21 23:59:20 tedu Exp $ */
/*! \file */
@@ -23,7 +23,6 @@
#include <isc/event.h>
#include <isc/lex.h>
#include <isc/magic.h>
-#include <isc/mutex.h>
#include <isc/serial.h>
#include <isc/stdio.h>
@@ -152,7 +151,6 @@ struct dns_loadctx {
unsigned int loop_cnt; /*% records per quantum,
* 0 => all. */
isc_boolean_t canceled;
- isc_mutex_t lock;
isc_result_t result;
/* locked by lock */
uint32_t references;
@@ -403,11 +401,9 @@ dns_loadctx_attach(dns_loadctx_t *source, dns_loadctx_t **target) {
REQUIRE(target != NULL && *target == NULL);
REQUIRE(DNS_LCTX_VALID(source));
- LOCK(&source->lock);
INSIST(source->references > 0);
source->references++;
INSIST(source->references != 0); /* Overflow? */
- UNLOCK(&source->lock);
*target = source;
}
@@ -421,12 +417,10 @@ dns_loadctx_detach(dns_loadctx_t **lctxp) {
lctx = *lctxp;
REQUIRE(DNS_LCTX_VALID(lctx));
- LOCK(&lctx->lock);
INSIST(lctx->references > 0);
lctx->references--;
if (lctx->references == 0)
need_destroy = ISC_TRUE;
- UNLOCK(&lctx->lock);
if (need_destroy)
loadctx_destroy(lctx);
@@ -474,7 +468,6 @@ loadctx_destroy(dns_loadctx_t *lctx) {
if (lctx->task != NULL)
isc_task_detach(&lctx->task);
- DESTROYLOCK(&lctx->lock);
free(lctx);
}
@@ -540,11 +533,6 @@ loadctx_create(dns_masterformat_t format,
lctx = malloc(sizeof(*lctx));
if (lctx == NULL)
return (ISC_R_NOMEMORY);
- result = isc_mutex_init(&lctx->lock);
- if (result != ISC_R_SUCCESS) {
- free(lctx);
- return (result);
- }
lctx->inc = NULL;
result = incctx_create(origin, &lctx->inc);
@@ -3220,9 +3208,7 @@ void
dns_loadctx_cancel(dns_loadctx_t *lctx) {
REQUIRE(DNS_LCTX_VALID(lctx));
- LOCK(&lctx->lock);
lctx->canceled = ISC_TRUE;
- UNLOCK(&lctx->lock);
}
void
diff --git a/usr.sbin/bind/lib/dns/openssl_link.c b/usr.sbin/bind/lib/dns/openssl_link.c
index e084a2920e6..ecca3eaecdb 100644
--- a/usr.sbin/bind/lib/dns/openssl_link.c
+++ b/usr.sbin/bind/lib/dns/openssl_link.c
@@ -39,8 +39,6 @@
#include <stdlib.h>
-#include <isc/mutex.h>
-#include <isc/mutexblock.h>
#include <string.h>
#include <isc/thread.h>
#include <isc/util.h>
diff --git a/usr.sbin/bind/lib/dns/rdata/in_1/wks_11.c b/usr.sbin/bind/lib/dns/rdata/in_1/wks_11.c
index a4f6d1b6d0f..e081c62fedc 100644
--- a/usr.sbin/bind/lib/dns/rdata/in_1/wks_11.c
+++ b/usr.sbin/bind/lib/dns/rdata/in_1/wks_11.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: wks_11.c,v 1.10 2020/01/20 18:51:53 florian Exp $ */
+/* $Id: wks_11.c,v 1.11 2020/01/21 23:59:20 tedu Exp $ */
/* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */
@@ -26,8 +26,6 @@
#include <isc/net.h>
#include <isc/netdb.h>
-#include <isc/once.h>
-#include <isc/mutex.h>
/*
* Redefine CHECK here so cppcheck "sees" the define.
@@ -41,21 +39,13 @@
#define RRTYPE_WKS_ATTRIBUTES (0)
-static isc_mutex_t wks_lock;
-
-static void init_lock(void) {
- RUNTIME_CHECK(isc_mutex_init(&wks_lock) == ISC_R_SUCCESS);
-}
-
static isc_boolean_t
mygetprotobyname(const char *name, long *proto) {
struct protoent *pe;
- LOCK(&wks_lock);
pe = getprotobyname(name);
if (pe != NULL)
*proto = pe->p_proto;
- UNLOCK(&wks_lock);
return (ISC_TF(pe != NULL));
}
@@ -63,17 +53,14 @@ static isc_boolean_t
mygetservbyname(const char *name, const char *proto, long *port) {
struct servent *se;
- LOCK(&wks_lock);
se = getservbyname(name, proto);
if (se != NULL)
*port = ntohs(se->s_port);
- UNLOCK(&wks_lock);
return (ISC_TF(se != NULL));
}
static inline isc_result_t
fromtext_in_wks(ARGS_FROMTEXT) {
- static isc_once_t once = ISC_ONCE_INIT;
isc_token_t token;
isc_region_t region;
struct in_addr addr;
@@ -96,8 +83,6 @@ fromtext_in_wks(ARGS_FROMTEXT) {
UNUSED(options);
UNUSED(rdclass);
- RUNTIME_CHECK(isc_once_do(&once, init_lock) == ISC_R_SUCCESS);
-
/*
* IPv4 dotted quad.
*/