]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Cleanup the unused members of dns_slabheader_t
authorOndřej Surý <ondrej@isc.org>
Tue, 16 Dec 2025 10:43:34 +0000 (11:43 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 18 Feb 2026 13:29:16 +0000 (14:29 +0100)
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.

lib/dns/include/dns/rdataslab.h
lib/dns/rdataslab.c

index a2e33ad998f56cdb3b73e8ceddc454182db9a2c4..0a19338dc086b8bd53e85711e9812be7cb9218b2 100644 (file)
@@ -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;
index 6850fd1fb7337dcfc800dcb67b37d1a0ce074493..d73e3ce2733a419ffb8a3a44172e8f3ee0f204d0 100644 (file)
@@ -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,
        };