2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Set a LMDB mapsize and also provide a config option to control it (#44954)

This commit is contained in:
Mukund Sivaraman
2017-04-26 23:43:35 +05:30
parent c118d16a1c
commit 241b49e611
18 changed files with 233 additions and 12 deletions

View File

@@ -503,7 +503,7 @@ destroy(dns_view_t *view) {
if (view->dtenv != NULL)
dns_dt_detach(&view->dtenv);
#endif /* HAVE_DNSTAP */
dns_view_setnewzones(view, ISC_FALSE, NULL, NULL);
dns_view_setnewzones(view, ISC_FALSE, NULL, NULL, 0ULL);
if (view->new_zone_file != NULL) {
isc_mem_free(view->mctx, view->new_zone_file);
view->new_zone_file = NULL;
@@ -2031,7 +2031,7 @@ nz_legacy(const char *directory, const char *viewname,
isc_result_t
dns_view_setnewzones(dns_view_t *view, isc_boolean_t allow, void *cfgctx,
void (*cfg_destroy)(void **))
void (*cfg_destroy)(void **), isc_uint64_t mapsize)
{
isc_result_t result;
char buffer[1024];
@@ -2088,6 +2088,14 @@ dns_view_setnewzones(dns_view_t *view, isc_boolean_t allow, void *cfgctx,
goto out;
}
if (mapsize != 0ULL) {
status = mdb_env_set_mapsize(env, mapsize);
if (status != 0) {
result = ISC_R_FAILURE;
goto out;
}
}
status = mdb_env_open(env, view->new_zone_db,
MDB_NOSUBDIR|MDB_CREATE, 0600);
if (status != 0) {