From: Ondřej Surý Date: Tue, 16 Dec 2025 10:43:34 +0000 (+0100) Subject: Cleanup the unused members of dns_slabheader_t X-Git-Tag: v9.21.19~22^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaf3454079529a53211006d4f434a5103f969f36;p=thirdparty%2Fbind9.git Cleanup the unused members of dns_slabheader_t After the rdataslab -> rdataslab,rdatavec split, there were couple of unused struct members. Remove all the unused members, reorder the members to eliminate the padding holes and thus reduce the dns_slabheader_t and dns_slabtop_t structure sizes. --- diff --git a/lib/dns/include/dns/rdataslab.h b/lib/dns/include/dns/rdataslab.h index a2e33ad998f..0a19338dc08 100644 --- a/lib/dns/include/dns/rdataslab.h +++ b/lib/dns/include/dns/rdataslab.h @@ -77,14 +77,13 @@ struct dns_slabtop { struct cds_list_head types_link; struct cds_list_head headers; - dns_typepair_t typepair; - dns_slabtop_t *related; - /*% Used for SIEVE-LRU (cache) and changed_list (zone) */ - ISC_LINK(struct dns_slabtop) link; - /*% Used for SIEVE-LRU */ + dns_typepair_t typepair; + + /*% Used for SIEVE-LRU (cache) */ bool visited; + ISC_LINK(struct dns_slabtop) link; }; struct dns_slabheader { @@ -94,21 +93,15 @@ struct dns_slabheader { /*% * Locked by the owning node's lock. */ - uint32_t serial; - union { - isc_stdtime_t expire; - dns_ttl_t ttl; - }; + isc_stdtime_t expire; dns_typepair_t typepair; - /* resigning (zone) and TTL-cleaning (cache) */ - uint16_t resign_lsb : 1; - isc_stdtime_t resign; - isc_heap_t *heap; - unsigned int heap_index; + /* TTL-cleaning (cache) */ + unsigned int heap_index; + isc_heap_t *heap; /* Used for stale refresh */ - _Atomic(uint32_t) last_refresh_fail_ts; + _Atomic(isc_stdtime_t) last_refresh_fail_ts; dns_slabheader_proof_t *noqname; dns_slabheader_proof_t *closest; diff --git a/lib/dns/rdataslab.c b/lib/dns/rdataslab.c index 6850fd1fb73..d73e3ce2733 100644 --- a/lib/dns/rdataslab.c +++ b/lib/dns/rdataslab.c @@ -110,7 +110,7 @@ newslab(dns_rdataset_t *rdataset, isc_mem_t *mctx, isc_region_t *region, *header = (dns_slabheader_t){ .headers_link = CDS_LIST_HEAD_INIT(header->headers_link), .trust = rdataset->trust, - .ttl = rdataset->ttl, + .expire = rdataset->ttl, .dirtylink = ISC_LINK_INITIALIZER, };