diff --git a/bin/named/query.c b/bin/named/query.c index 43aee30e00..3ffa9c90a1 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.175 2001/01/22 19:21:19 gson Exp $ */ +/* $Id: query.c,v 1.176 2001/01/23 01:50:25 bwelling Exp $ */ #include @@ -141,10 +141,11 @@ synth_rev_respond(ns_client_t *client, dns_byaddrevent_t *bevent); /* * Increment query statistics counters. */ -static void -count_query(dns_zone_t *zone, isc_boolean_t is_zone, dns_statscounter_t counter) +static inline void +count_query(dns_zone_t *zone, isc_boolean_t is_zone, + dns_statscounter_t counter) { - REQUIRE(counter < dns_stats_ncounters()); + REQUIRE(counter < DNS_STATS_NCOUNTERS); ns_g_server->querystats[counter]++; @@ -2387,8 +2388,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) } fname = query_newname(client, dbuf, &b); if (fname == NULL) { - count_query(zone, is_zone, - dns_statscounter_failure); + count_query(zone, is_zone, dns_statscounter_failure); QUERY_ERROR(DNS_R_SERVFAIL); goto cleanup; } @@ -2518,7 +2518,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) result = dns_name_copy(client->query.qname, fname, NULL); if (result != ISC_R_SUCCESS) { - count_query(zone, is_zone, dns_statscounter_failure); + count_query(zone, is_zone, + dns_statscounter_failure); QUERY_ERROR(DNS_R_SERVFAIL); goto cleanup; } @@ -2704,7 +2705,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) NS_QUERYATTR_RECURSING; else { count_query(zone, is_zone, - dns_statscounter_failure); + dns_statscounter_failure); QUERY_ERROR(DNS_R_SERVFAIL); } } else { @@ -2758,8 +2759,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) */ result = query_addsoa(client, db, ISC_FALSE); if (result != ISC_R_SUCCESS) { - count_query(zone, is_zone, - dns_statscounter_failure); + count_query(zone, is_zone, dns_statscounter_failure); QUERY_ERROR(result); goto cleanup; } @@ -2817,8 +2817,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) else result = query_addsoa(client, db, ISC_FALSE); if (result != ISC_R_SUCCESS) { - count_query(zone, is_zone, - dns_statscounter_failure); + count_query(zone, is_zone, dns_statscounter_failure); QUERY_ERROR(result); goto cleanup; } @@ -3042,8 +3041,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) rdsiter = NULL; result = dns_db_allrdatasets(db, node, version, 0, &rdsiter); if (result != ISC_R_SUCCESS) { - count_query(zone, is_zone, - dns_statscounter_failure); + count_query(zone, is_zone, dns_statscounter_failure); QUERY_ERROR(DNS_R_SERVFAIL); goto cleanup; } diff --git a/bin/named/server.c b/bin/named/server.c index 404c026a83..bbb0ee86cf 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.283 2001/01/22 19:21:18 gson Exp $ */ +/* $Id: server.c,v 1.284 2001/01/23 01:50:26 bwelling Exp $ */ #include @@ -2395,7 +2395,7 @@ ns_server_dumpstats(ns_server_t *server) { CHECKM(isc_stdio_open(server->statsfile, "a", &fp), "could not open statistics dump file"); - ncounters = dns_stats_ncounters(); + ncounters = DNS_STATS_NCOUNTERS; fprintf(fp, "+++ Statistics Dump +++ (%lu)\n", (unsigned long)now); for (i = 0; i < ncounters; i++) diff --git a/lib/dns/include/dns/stats.h b/lib/dns/include/dns/stats.h index a843594c12..f37bce594d 100644 --- a/lib/dns/include/dns/stats.h +++ b/lib/dns/include/dns/stats.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: stats.h,v 1.2 2001/01/09 21:53:30 bwelling Exp $ */ +/* $Id: stats.h,v 1.3 2001/01/23 01:50:29 bwelling Exp $ */ #ifndef DNS_STATS_H #define DNS_STATS_H 1 @@ -52,12 +52,6 @@ dns_stats_freecounters(isc_mem_t *mctx, isc_uint64_t **ctrp); * context 'mctx'. */ -unsigned int -dns_stats_ncounters(void); -/* - * Return the number of query statistics counters. - */ - ISC_LANG_ENDDECLS #endif /* DNS_STATS_H */ diff --git a/lib/dns/stats.c b/lib/dns/stats.c index 6e34f00b7d..ca16f13d57 100644 --- a/lib/dns/stats.c +++ b/lib/dns/stats.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: stats.c,v 1.3 2001/01/09 21:51:34 bwelling Exp $ */ +/* $Id: stats.c,v 1.4 2001/01/23 01:50:28 bwelling Exp $ */ #include @@ -50,8 +50,3 @@ dns_stats_freecounters(isc_mem_t *mctx, isc_uint64_t **ctrp) { isc_mem_put(mctx, *ctrp, DNS_STATS_NCOUNTERS * sizeof(isc_uint64_t)); *ctrp = NULL; } - -unsigned int -dns_stats_ncounters(void) { - return (DNS_STATS_NCOUNTERS); -}