diff options
| author | 2020-01-09 18:14:47 +0000 | |
|---|---|---|
| committer | 2020-01-09 18:14:47 +0000 | |
| commit | d8522c75c94de2047cbcea221e788dbe519057d5 (patch) | |
| tree | 9a9e67d57996c3824d5d3c0aece5186fbdbf8893 /usr.sbin/bind/lib/dns/acache.c | |
| parent | Rev 1.59 of main.c allows omission of addresses in a range. (diff) | |
| download | wireguard-openbsd-d8522c75c94de2047cbcea221e788dbe519057d5.tar.xz wireguard-openbsd-d8522c75c94de2047cbcea221e788dbe519057d5.zip | |
Nuke atomics support. This gets rid of 4k lines of code including a bunch
of assembly code. It's used for various statistics gathering in the
bind daemon which we won't need in dig etc.
OK millert
Diffstat (limited to 'usr.sbin/bind/lib/dns/acache.c')
| -rw-r--r-- | usr.sbin/bind/lib/dns/acache.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/usr.sbin/bind/lib/dns/acache.c b/usr.sbin/bind/lib/dns/acache.c index 8eb17cd154a..74755e5e6e9 100644 --- a/usr.sbin/bind/lib/dns/acache.c +++ b/usr.sbin/bind/lib/dns/acache.c @@ -14,12 +14,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: acache.c,v 1.4 2020/01/09 14:24:07 florian Exp $ */ +/* $Id: acache.c,v 1.5 2020/01/09 18:14:48 florian Exp $ */ #include <config.h> #include <stdlib.h> -#include <isc/atomic.h> + #include <isc/event.h> #include <isc/hash.h> #include <isc/magic.h> @@ -45,10 +45,6 @@ #include <dns/result.h> #include <dns/zone.h> -#if defined(ISC_PLATFORM_HAVESTDATOMIC) -#include <stdatomic.h> -#endif - #define ACACHE_MAGIC ISC_MAGIC('A', 'C', 'H', 'E') #define DNS_ACACHE_VALID(acache) ISC_MAGIC_VALID(acache, ACACHE_MAGIC) @@ -85,38 +81,12 @@ #define DEFAULT_ACACHE_ENTRY_LOCK_COUNT 1009 /*%< Should be prime. */ -#if defined(ISC_RWLOCK_USEATOMIC) && \ - ((defined(ISC_PLATFORM_HAVESTDATOMIC) && defined(ATOMIC_LONG_LOCK_FREE)) || \ - defined(ISC_PLATFORM_HAVEATOMICSTORE)) -#define ACACHE_USE_RWLOCK 1 -#if (defined(ISC_PLATFORM_HAVESTDATOMIC) && defined(ATOMIC_LONG_LOCK_FREE)) -#define ACACHE_HAVESTDATOMIC 1 -#endif -#endif - -#ifdef ACACHE_USE_RWLOCK -#define ACACHE_INITLOCK(l) isc_rwlock_init((l), 0, 0) -#define ACACHE_DESTROYLOCK(l) isc_rwlock_destroy(l) -#define ACACHE_LOCK(l, t) RWLOCK((l), (t)) -#define ACACHE_UNLOCK(l, t) RWUNLOCK((l), (t)) - -#ifdef ACACHE_HAVESTDATOMIC -#define acache_storetime(entry, t) \ - atomic_store_explicit(&(entry)->lastused, (t), \ - memory_order_relaxed); -#else -#define acache_storetime(entry, t) \ - (isc_atomic_store((isc_int32_t *)&(entry)->lastused, (t))) -#endif - -#else #define ACACHE_INITLOCK(l) isc_mutex_init(l) #define ACACHE_DESTROYLOCK(l) DESTROYLOCK(l) #define ACACHE_LOCK(l, t) LOCK(l) #define ACACHE_UNLOCK(l, t) UNLOCK(l) #define acache_storetime(entry, t) ((entry)->lastused = (t)) -#endif /* Locked by acache lock */ typedef struct dbentry { @@ -254,11 +224,7 @@ struct dns_acacheentry { void *cbarg; /* Timestamp of the last time this entry is referred to */ -#ifdef ACACHE_HAVESTDATOMIC - atomic_uint_fast32_t lastused; -#else isc_stdtime32_t lastused; -#endif }; /* |
