Light refactoring of catz.c

* Change 'dns_catz_new_zones()' function's prototype (the order of the
  arguments) to synchronize it with the similar function in rpz.c.
* Rename 'refs' to 'references' in preparation of ISC_REFCOUNT_*
  macros usage for reference tracking.
* Unify dns_catz_zone_t naming to catz, and dns_catz_zones_t naming to
  catzs, following the logic of similar changes in rpz.c.
* Use C compound literals for structure initialization.
* Synchronize the "new zone version came too soon" log message with the
  one in rpz.c.
* Use more of 'sizeof(*ptr)' style instead of the 'sizeof(type_t)' style
  expressions when allocating or freeing memory for 'ptr'.
This commit is contained in:
Aram Sargsyan 2023-02-09 10:32:33 +00:00 committed by Ondřej Surý
parent 52c9a5b2f5
commit 8cb79fec9d
No known key found for this signature in database
GPG key ID: 2820F37E873DEA41
3 changed files with 346 additions and 347 deletions

View file

@ -3163,8 +3163,8 @@ configure_catz(dns_view_t *view, dns_view_t *pview, const cfg_obj_t *config,
return (ISC_R_SUCCESS);
}
dns_catz_new_zones(&view->catzs, &ns_catz_zonemodmethods, view->mctx,
named_g_loopmgr);
dns_catz_new_zones(view->mctx, named_g_loopmgr, &view->catzs,
&ns_catz_zonemodmethods);
if (pview != NULL) {
old = pview->catzs;

File diff suppressed because it is too large Load diff

View file

@ -144,7 +144,7 @@ dns_catz_entry_new(isc_mem_t *mctx, const dns_name_t *domain,
*/
void
dns_catz_entry_copy(dns_catz_zone_t *zone, const dns_catz_entry_t *entry,
dns_catz_entry_copy(dns_catz_zone_t *catz, const dns_catz_entry_t *entry,
dns_catz_entry_t **nentryp);
/*%<
* Allocate a new catz_entry and deep copy 'entry' into 'nentryp'.
@ -170,7 +170,7 @@ dns_catz_entry_attach(dns_catz_entry_t *entry, dns_catz_entry_t **entryp);
*/
void
dns_catz_entry_detach(dns_catz_zone_t *zone, dns_catz_entry_t **entryp);
dns_catz_entry_detach(dns_catz_zone_t *catz, dns_catz_entry_t **entryp);
/*%<
* Detach an entry, free if no further references
*
@ -209,14 +209,14 @@ ISC_REFCOUNT_DECL(dns_catz_zone);
*/
isc_result_t
dns_catz_new_zone(dns_catz_zones_t *catzs, dns_catz_zone_t **zonep,
dns_catz_new_zone(dns_catz_zones_t *catzs, dns_catz_zone_t **catzp,
const dns_name_t *name);
/*%<
* Allocate a new catz zone on catzs mctx
*
* Requires:
* \li 'catzs' is a valid dns_catz_zones_t.
* \li 'zonep' is not NULL and '*zonep' is NULL.
* \li 'catzp' is not NULL and '*catzp' is NULL.
* \li 'name' is a valid dns_name_t.
*
*/
@ -318,13 +318,15 @@ struct dns_catz_zonemodmethods {
};
void
dns_catz_new_zones(dns_catz_zones_t **catzsp, dns_catz_zonemodmethods_t *zmm,
isc_mem_t *mctx, isc_loopmgr_t *loopmgr);
dns_catz_new_zones(isc_mem_t *mctx, isc_loopmgr_t *loopmgr,
dns_catz_zones_t **catzsp, dns_catz_zonemodmethods_t *zmm);
/*%<
* Allocate a new catz_zones object, a collection storing all catalog zones
* for a view.
*
* Requires:
* \li 'mctx' is not NULL.
* \li 'loopmgr' is not NULL.
* \li 'catzsp' is not NULL and '*catzsp' is NULL.
* \li 'zmm' is not NULL.
*