From ce9f6e68c345f359a288d0af5dfd8eb4a212ebbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Mon, 3 Feb 2025 00:06:48 +0100 Subject: [PATCH] Unify how we handle database version in the cache Database versions are not used in cache databases. Some places in qpcache.c required the version argument to be NULL; others marked it as UNUSED. Unify all cases to require version to be NULL. --- lib/dns/qpcache.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/dns/qpcache.c b/lib/dns/qpcache.c index be6bc5ebbf..210c2abbbb 100644 --- a/lib/dns/qpcache.c +++ b/lib/dns/qpcache.c @@ -383,8 +383,7 @@ qp_makekey(dns_qpkey_t key, void *uctx ISC_ATTR_UNUSED, void *pval, } static void -qp_triename(void *uctx, char *buf, size_t size) { - UNUSED(uctx); +qp_triename(void *uctx ISC_ATTR_UNUSED, char *buf, size_t size) { snprintf(buf, size, "qpdb-lite"); } @@ -1631,8 +1630,6 @@ qpcache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version, .now = __now ? __now : isc_stdtime_now(), }; - UNUSED(version); - REQUIRE(VALID_QPDB((qpcache_t *)db)); REQUIRE(version == NULL); @@ -2149,10 +2146,9 @@ qpcache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version, }; REQUIRE(VALID_QPDB(qpdb)); + REQUIRE(version == NULL); REQUIRE(type != dns_rdatatype_any); - UNUSED(version); - result = ISC_R_SUCCESS; nlock = &qpdb->buckets[qpnode->locknum].lock; @@ -2677,8 +2673,7 @@ qpcache_allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version, qpc_rditer_t *iterator = NULL; REQUIRE(VALID_QPDB(qpdb)); - - UNUSED(version); + REQUIRE(version == NULL); iterator = isc_mem_get(qpdb->common.mctx, sizeof(*iterator)); *iterator = (qpc_rditer_t){