Lines Matching defs:cache

58 #include <dns/cache.h>
205 * Maximum ADB size for views that share a cache. Use this limit to suppress
207 * a cache. Only effective when a finite max-cache-size is specified.
220 dns_cache_t *cache;
241 dns_db_t *cache;
1677 strcmp(dns_cache_getname(nsc->cache), cachename) == 0)
1709 * If the cache cannot even reused for the same view, it cannot be
1716 * Check other cache related parameters that must be consistent among
1719 if (dns_cache_getcleaninginterval(originview->cache) !=
1721 dns_cache_getcachesize(originview->cache) != new_max_cache_size) {
3261 dns_cache_t *cache = NULL;
3333 * Create additional cache for this view and zones under the view
3497 * we can reuse/share an existing cache.
3505 result = ns_config_get(maps, "max-cache-size", &obj);
3520 "'max-cache-size "
3539 "memory, setting 'max-cache-size' to "
3544 "'max-cache-size %d%%' "
3572 result = ns_config_get(maps, "zero-no-soa-ttl-cache", &obj);
3702 result = ns_config_get(maps, "max-cache-ttl", &obj);
3714 * Configure the view's cache.
3716 * First, check to see if there are any attach-cache options. If yes,
3717 * attempt to lookup an existing cache at attach it to the view. If
3718 * there is not one, then try to reuse an existing cache if possible;
3719 * otherwise create a new cache.
3726 * XXX Determining when it is safe to reuse or share a cache is tricky.
3729 * some of the configuration parameters that could invalidate the cache
3733 * the cache. At the moment, it's the administrator's responsibility to
3737 result = ns_config_get(maps, "attach-cache", &obj);
3742 cache = NULL;
3749 "views %s and %s can't share the cache "
3755 dns_cache_attach(nsc->cache, &cache);
3771 "cache cannot be reused "
3776 INSIST(pview->cache != NULL);
3781 "reusing existing cache");
3783 dns_cache_attach(pview->cache, &cache);
3791 if (cache == NULL) {
3793 * Create a cache with the desired name. This normally
3795 * reference to a view that share the cache with this
3798 * is simply a named cache that is not shared.
3801 * cache, for the main cache memory and the heap
3805 isc_mem_setname(cmctx, "cache", NULL);
3811 &cache));
3820 nsc->cache = NULL;
3821 dns_cache_attach(cache, &nsc->cache);
3829 dns_view_setcache2(view, cache, shared_cache);
3832 * cache-file cannot be inherited if views are present, but this
3836 result = ns_config_get(maps, "cache-file", &obj);
3838 CHECK(dns_cache_setfilename(cache, cfg_obj_asstring(obj)));
3840 CHECK(dns_cache_load(cache));
3843 dns_cache_setcleaninginterval(cache, cleaning_interval);
3844 dns_cache_setcachesize(cache, max_cache_size);
3846 dns_cache_detach(&cache);
3892 * Set the ADB cache size to 1/8th of the max-cache-size or
3893 * MAX_ADB_SIZE_FOR_CACHESHARE when the cache is shared.
4262 "allow-query-cache-on", NULL, actx,
4280 result = ns_config_get(maps, "additional-from-cache", &obj);
4285 "'additional-from-cache no' is only supported "
4291 * Set "allow-query-cache", "allow-recursion", and
4297 CHECK(configure_view_acl(vconfig, config, NULL, "allow-query-cache",
4313 * "allow-query-cache" inherits from "allow-recursion" if set,
4315 * "allow-recursion" inherits from "allow-query-cache" if set,
4339 * "allow-recursion-on" and "allow-query-cache" ACLs from
4356 "allow-query-cache", NULL,
4362 * We're not recursive; if "allow-query-cache" hasn't been
4926 if (cache != NULL)
4927 dns_cache_detach(&cache);
8025 /* Swap our new cache list with the production one. */
8453 /* Same cleanup for cache list. */
8456 dns_cache_detach(&nsc->cache);
8726 dns_cache_detach(&nsc->cache);
9816 if (dctx->cache != NULL)
9817 dns_db_detach(&dctx->cache);
9851 dns_cache_getname(dctx->view->view->cache));
9852 } else if (dctx->zone == NULL && dctx->cache == NULL &&
9856 /* start cache dump */
9858 dns_db_attach(dctx->view->view->cachedb, &dctx->cache);
9859 if (dctx->cache != NULL) {
9861 ";\n; Cache dump of view '%s' (cache %s)\n;\n",
9863 dns_cache_getname(dctx->view->view->cache));
9865 dctx->cache, NULL,
9881 dctx->cache == NULL && dctx->view->view->cachedb != NULL)
9882 dns_db_attach(dctx->view->view->cachedb, &dctx->cache);
9884 if (dctx->cache != NULL) {
9892 "SERVFAIL cache", dctx->fp);
9893 dns_db_detach(&dctx->cache);
9985 dctx->cache = NULL;
9988 dctx->cache = NULL;
10006 } else if (ptr != NULL && strcmp(ptr, "-cache") == 0) {
10030 /* only dump servfail cache, suppress other caches */
10336 * Flushing a cache is tricky when caches are shared by multiple views.
10337 * We first identify which caches should be flushed in the local cache
10339 * the flushed cache DB.
10358 if (nsc->cache == view->cache)
10379 "flushing cache in view '%s' failed: %s",
10386 * Fix up views that share a flushed cache: let the views update the
10387 * cache DB they're referring to. This could also be an expensive
10389 * necessary for views that share a cache, and if there are many such
10390 * views the number of shared cache should normally be small.
10403 if (!nsc->needflush || nsc->cache != view->cache)
10410 "fixing cache in view '%s' "
10417 /* Cleanup the cache list. */
10428 "flushing cache in view '%s' succeeded",
10439 "flushing cache in view '%s' failed: "
10496 * if some of the views share a single cache. But since the
10504 "flushing %s '%s' in cache view '%s' "
10515 "flushing %s '%s' in cache view '%s' "
10522 "flushing %s '%s' in all cache views "
10531 "flushing %s '%s' in cache view '%s' "
13647 "flush tree '%s' in cache view '%s': %s",