* Cache-eviction routines.
*/
-static void
+static size_t
expireheader(dns_slabheader_t *header, isc_rwlocktype_t *nlocktypep,
isc_rwlocktype_t *tlocktypep, dns_expire_t reason DNS__DB_FLARG);
dns_slabheader_t *header = first_header(top);
- expired += rdataset_size(header);
-
- expireheader(header, nlocktypep, tlocktypep,
- dns_expire_lru DNS__DB_FLARG_PASS);
+ expired += expireheader(header, nlocktypep, tlocktypep,
+ dns_expire_lru DNS__DB_FLARG_PASS);
} while (expired < requested);
}
/*
* Caller must hold the node (write) lock.
*/
-static void
+static size_t
expireheader(dns_slabheader_t *header, isc_rwlocktype_t *nlocktypep,
isc_rwlocktype_t *tlocktypep, dns_expire_t reason DNS__DB_FLARG) {
+ size_t expired = rdataset_size(header);
mark_ancient(header);
if (isc_refcount_current(&HEADERNODE(header)->erefs) == 0) {
tlocktypep DNS__DB_FLARG_PASS);
if (qpdb->cachestats == NULL) {
- return;
+ return expired;
}
switch (reason) {
break;
}
}
+
+ return expired;
}
static void
isc_rwlock_t *nlock = &qpdb->buckets[qpnode->locknum].lock;
NODE_WRLOCK(nlock, &nlocktype);
- expireheader(header, &nlocktype, &tlocktype,
- dns_expire_flush DNS__DB_FILELINE);
+ (void)expireheader(header, &nlocktype, &tlocktype,
+ dns_expire_flush DNS__DB_FILELINE);
NODE_UNLOCK(nlock, &nlocktype);
INSIST(tlocktype == isc_rwlocktype_none);
}
return;
}
- expireheader(header, nlocktypep, tlocktypep,
- dns_expire_ttl DNS__DB_FLARG_PASS);
+ (void)expireheader(header, nlocktypep, tlocktypep,
+ dns_expire_ttl DNS__DB_FLARG_PASS);
}
}