acache.c File Reference

#include <config.h>
#include <isc/atomic.h>
#include <isc/event.h>
#include <isc/hash.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/mutex.h>
#include <isc/random.h>
#include <isc/refcount.h>
#include <isc/rwlock.h>
#include <isc/serial.h>
#include <isc/task.h>
#include <isc/time.h>
#include <isc/timer.h>
#include <dns/acache.h>
#include <dns/db.h>
#include <dns/events.h>
#include <dns/log.h>
#include <dns/message.h>
#include <dns/name.h>
#include <dns/rdataset.h>
#include <dns/result.h>
#include <dns/zone.h>

Go to the source code of this file.

Data Structures

struct  dbentry
struct  acache_cleaner
struct  dns_acachestats
struct  dns_acache
struct  dns_acacheentry

Defines

#define ACACHE_MAGIC   ISC_MAGIC('A', 'C', 'H', 'E')
#define DNS_ACACHE_VALID(acache)   ISC_MAGIC_VALID(acache, ACACHE_MAGIC)
#define ACACHEENTRY_MAGIC   ISC_MAGIC('A', 'C', 'E', 'T')
#define DNS_ACACHEENTRY_VALID(entry)   ISC_MAGIC_VALID(entry, ACACHEENTRY_MAGIC)
#define DBBUCKETS   67
#define ATRACE(m)
#define AATRACE(a, m)
#define DNS_ACACHE_MINSIZE   2097152U
#define DNS_ACACHE_CLEANERINCREMENT   1000
#define DEFAULT_ACACHE_ENTRY_LOCK_COUNT   1009
 Should be prime.
#define ACACHE_INITLOCK(l)   isc_mutex_init(l)
#define ACACHE_DESTROYLOCK(l)   DESTROYLOCK(l)
#define ACACHE_LOCK(l, t)   LOCK(l)
#define ACACHE_UNLOCK(l, t)   UNLOCK(l)
#define acache_storetime(entry, t)   ((entry)->lastused = (t))
#define CLEANER_IDLE(c)
#define CLEANER_BUSY(c)

Typedefs

typedef struct dbentry dbentry_t

Functions

typedef ISC_LIST (dbentry_t)
static isc_boolean_t check_noentry (dns_acache_t *acache)
static void destroy (dns_acache_t *acache)
static void shutdown_entries (dns_acache_t *acache)
static void shutdown_buckets (dns_acache_t *acache)
static void destroy_entry (dns_acacheentry_t *ent)
static void unlink_dbentries (dns_acache_t *acache, dns_acacheentry_t *ent)
static isc_result_t finddbent (dns_acache_t *acache, dns_db_t *db, dbentry_t **dbentryp)
static void clear_entry (dns_acache_t *acache, dns_acacheentry_t *entry)
static isc_result_t acache_cleaner_init (dns_acache_t *acache, isc_timermgr_t *timermgr, acache_cleaner_t *cleaner)
static void acache_cleaning_timer_action (isc_task_t *task, isc_event_t *event)
static void acache_incremental_cleaning_action (isc_task_t *task, isc_event_t *event)
static void acache_overmem_cleaning_action (isc_task_t *task, isc_event_t *event)
static void acache_cleaner_shutdown_action (isc_task_t *task, isc_event_t *event)
static void reset_stats (dns_acache_t *acache)
static void shutdown_task (isc_task_t *task, isc_event_t *ev)
static void begin_cleaning (acache_cleaner_t *cleaner)
static void end_cleaning (acache_cleaner_t *cleaner, isc_event_t *event)
static isc_boolean_t entry_stale (acache_cleaner_t *cleaner, dns_acacheentry_t *entry, isc_stdtime32_t now32, unsigned int interval)
static void water (void *arg, int mark)
isc_result_t dns_acache_create (dns_acache_t **acachep, isc_mem_t *mctx, isc_taskmgr_t *taskmgr, isc_timermgr_t *timermgr)
void dns_acache_attach (dns_acache_t *source, dns_acache_t **targetp)
void dns_acache_countquerymiss (dns_acache_t *acache)
void dns_acache_detach (dns_acache_t **acachep)
void dns_acache_shutdown (dns_acache_t *acache)
isc_result_t dns_acache_setdb (dns_acache_t *acache, dns_db_t *db)
isc_result_t dns_acache_putdb (dns_acache_t *acache, dns_db_t *db)
isc_result_t dns_acache_createentry (dns_acache_t *acache, dns_db_t *origdb, void(*callback)(dns_acacheentry_t *, void **), void *cbarg, dns_acacheentry_t **entryp)
isc_result_t dns_acache_getentry (dns_acacheentry_t *entry, dns_zone_t **zonep, dns_db_t **dbp, dns_dbversion_t **versionp, dns_dbnode_t **nodep, dns_name_t *fname, dns_message_t *msg, isc_stdtime_t now)
isc_result_t dns_acache_setentry (dns_acache_t *acache, dns_acacheentry_t *entry, dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node, dns_name_t *fname)
isc_boolean_t dns_acache_cancelentry (dns_acacheentry_t *entry)
void dns_acache_attachentry (dns_acacheentry_t *source, dns_acacheentry_t **targetp)
void dns_acache_detachentry (dns_acacheentry_t **entryp)
void dns_acache_setcleaninginterval (dns_acache_t *acache, unsigned int t)
void dns_acache_setcachesize (dns_acache_t *acache, size_t size)

Variables

 cleaner_state_t


Define Documentation

#define ACACHE_MAGIC   ISC_MAGIC('A', 'C', 'H', 'E')

Definition at line 45 of file acache.c.

Referenced by dns_acache_create().

#define DNS_ACACHE_VALID ( acache   )     ISC_MAGIC_VALID(acache, ACACHE_MAGIC)

Definition at line 46 of file acache.c.

Referenced by acache_cleaner_shutdown_action(), acache_incremental_cleaning_action(), begin_cleaning(), clear_entry(), destroy(), destroy_entry(), dns_acache_attach(), dns_acache_cancelentry(), dns_acache_createentry(), dns_acache_detach(), dns_acache_getentry(), dns_acache_putdb(), dns_acache_setcachesize(), dns_acache_setcleaninginterval(), dns_acache_setdb(), dns_acache_setentry(), dns_acache_shutdown(), finddbent(), shutdown_buckets(), shutdown_entries(), shutdown_task(), and water().

#define ACACHEENTRY_MAGIC   ISC_MAGIC('A', 'C', 'E', 'T')

Definition at line 48 of file acache.c.

Referenced by dns_acache_createentry().

#define DNS_ACACHEENTRY_VALID ( entry   )     ISC_MAGIC_VALID(entry, ACACHEENTRY_MAGIC)

Definition at line 49 of file acache.c.

Referenced by clear_entry(), destroy_entry(), dns_acache_attachentry(), dns_acache_cancelentry(), dns_acache_detachentry(), dns_acache_getentry(), dns_acache_setentry(), and end_cleaning().

#define DBBUCKETS   67

Definition at line 51 of file acache.c.

#define ATRACE (  ) 

Definition at line 65 of file acache.c.

Referenced by acache_cleaner_init(), acache_cleaner_shutdown_action(), destroy(), dns_acache_create(), dns_acache_detach(), dns_acache_putdb(), dns_acache_setcleaninginterval(), dns_acache_setdb(), and dns_acache_shutdown().

#define AATRACE ( a,
 ) 

Definition at line 66 of file acache.c.

Referenced by dns_acache_attach().

#define DNS_ACACHE_MINSIZE   2097152U

Definition at line 76 of file acache.c.

Referenced by dns_acache_setcachesize().

#define DNS_ACACHE_CLEANERINCREMENT   1000

Definition at line 77 of file acache.c.

Referenced by acache_cleaner_init().

#define DEFAULT_ACACHE_ENTRY_LOCK_COUNT   1009

Should be prime.

Definition at line 79 of file acache.c.

Referenced by destroy(), dns_acache_create(), and dns_acache_createentry().

#define ACACHE_INITLOCK (  )     isc_mutex_init(l)

Definition at line 94 of file acache.c.

Referenced by dns_acache_create().

#define ACACHE_DESTROYLOCK (  )     DESTROYLOCK(l)

Definition at line 95 of file acache.c.

Referenced by destroy(), and dns_acache_create().

#define ACACHE_LOCK ( l,
 )     LOCK(l)

Definition at line 96 of file acache.c.

Referenced by acache_incremental_cleaning_action(), dns_acache_cancelentry(), dns_acache_getentry(), dns_acache_putdb(), dns_acache_setentry(), and shutdown_entries().

#define ACACHE_UNLOCK ( l,
 )     UNLOCK(l)

Definition at line 97 of file acache.c.

Referenced by acache_incremental_cleaning_action(), dns_acache_cancelentry(), dns_acache_getentry(), dns_acache_putdb(), dns_acache_setentry(), and shutdown_entries().

#define acache_storetime ( entry,
 )     ((entry)->lastused = (t))

Definition at line 99 of file acache.c.

Referenced by dns_acache_getentry().

#define CLEANER_IDLE (  ) 

Value:

((c)->state == cleaner_s_idle && \
                         (c)->resched_event != NULL)

Definition at line 124 of file acache.c.

Referenced by begin_cleaning().

#define CLEANER_BUSY (  ) 

Value:

((c)->state == cleaner_s_busy && \
                         (c)->resched_event == NULL)

Definition at line 126 of file acache.c.

Referenced by acache_cleaner_shutdown_action(), acache_incremental_cleaning_action(), cleaner_shutdown_action(), end_cleaning(), and incremental_cleaning_action().


Typedef Documentation

typedef struct dbentry dbentry_t


Function Documentation

typedef ISC_LIST ( dbentry_t   ) 

Definition at line 111 of file acache.c.

References cleaner_s_busy, cleaner_s_done, and cleaner_s_idle.

static isc_boolean_t check_noentry ( dns_acache_t acache  )  [inline, static]

Definition at line 286 of file acache.c.

References ISC_FALSE, ISC_LIST_EMPTY, and ISC_TRUE.

Referenced by acache_cleaner_shutdown_action(), and dns_acache_detach().

static void destroy ( dns_acache_t acache  )  [static]

Definition at line 430 of file acache.c.

References ACACHE_DESTROYLOCK, ATRACE, dns_acache::cleaner, DEFAULT_ACACHE_ENTRY_LOCK_COUNT, DESTROYLOCK, DNS_ACACHE_VALID, dns_acache::entrylocks, isc_event_free(), isc_mem_put, isc_mem_putanddetach, isc_mem_setwater(), isc_task_detach(), dns_acache::lock, dns_acache::magic, dns_acache::mctx, and REQUIRE.

static void shutdown_entries ( dns_acache_t acache  )  [static]

Definition at line 298 of file acache.c.

References ACACHE_LOCK, ACACHE_UNLOCK, dns_acache::cleaner, dns_acache_detachentry(), DNS_ACACHE_VALID, dns_acache::entrylocks, INSIST, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, isc_rwlocktype_write, dns_acacheentry::locknum, REQUIRE, and unlink_dbentries().

Referenced by shutdown_stage2(), and shutdown_task().

static void shutdown_buckets ( dns_acache_t acache  )  [static]

Definition at line 339 of file acache.c.

References dbentry::db, DNS_ACACHE_VALID, dns_db_detach(), INSIST, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_UNLINK, isc_mem_put, dns_acache::mctx, and REQUIRE.

Referenced by shutdown_task().

static void destroy_entry ( dns_acacheentry_t ent  )  [static]

Definition at line 410 of file acache.c.

References dns_acacheentry::acache, clear_entry(), dns_acache_detach(), DNS_ACACHE_VALID, DNS_ACACHEENTRY_VALID, isc_mem_put, dns_acache::mctx, and REQUIRE.

Referenced by dec_entry_refcnt(), and dns_acache_detachentry().

static void unlink_dbentries ( dns_acache_t acache,
dns_acacheentry_t ent 
) [inline, static]

Definition at line 386 of file acache.c.

References finddbent(), INSIST, ISC_LINK_LINKED, ISC_LIST_UNLINK, and ISC_R_SUCCESS.

Referenced by acache_incremental_cleaning_action(), dns_acache_cancelentry(), dns_acache_putdb(), and shutdown_entries().

static isc_result_t finddbent ( dns_acache_t acache,
dns_db_t db,
dbentry_t **  dbentryp 
) [inline, static]

Definition at line 463 of file acache.c.

References dbentry::db, DNS_ACACHE_VALID, isc_hash_calc(), ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_TRUE, and REQUIRE.

Referenced by dns_acache_putdb(), dns_acache_setdb(), dns_acache_setentry(), and unlink_dbentries().

static void clear_entry ( dns_acache_t acache,
dns_acacheentry_t entry 
) [inline, static]

Definition at line 494 of file acache.c.

References DNS_ACACHE_VALID, DNS_ACACHEENTRY_VALID, dns_db_closeversion(), dns_db_detach(), dns_db_detachnode(), dns_name_dynamic(), dns_name_free(), dns_rdataset_disassociate(), dns_zone_detach(), INSIST, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, isc_mem_put, dns_acache::mctx, rdataset_next(), and REQUIRE.

Referenced by destroy_entry(), dns_acache_cancelentry(), and dns_acache_setentry().

static isc_result_t acache_cleaner_init ( dns_acache_t acache,
isc_timermgr_t timermgr,
acache_cleaner_t *  cleaner 
) [static]

Definition at line 539 of file acache.c.

References acache_cleaner_shutdown_action(), acache_cleaning_timer_action(), acache_incremental_cleaning_action(), acache_overmem_cleaning_action(), ATRACE, cleaner_s_idle, cleanup(), DESTROYLOCK, DNS_ACACHE_CLEANERINCREMENT, DNS_EVENT_ACACHECLEAN, DNS_EVENT_ACACHEOVERMEM, dns_result_totext(), isc_event_allocate(), isc_event_free(), ISC_FALSE, isc_mutex_init, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_R_UNEXPECTED, isc_stdtime_get(), isc_task_onshutdown(), isc_timer_create(), isc_timer_detach(), isc_timertype_inactive, dns_acache::mctx, and UNEXPECTED_ERROR.

Referenced by dns_acache_create().

static void acache_cleaning_timer_action ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 739 of file acache.c.

References begin_cleaning(), cleaner_s_idle, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ACACHE, INSIST, isc_event_free(), ISC_LOG_DEBUG, isc_log_write(), ISC_TIMEREVENT_TICK, and UNUSED.

Referenced by acache_cleaner_init().

static void acache_incremental_cleaning_action ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 803 of file acache.c.

References ACACHE_LOCK, ACACHE_UNLOCK, CLEANER_BUSY, cleaner_s_busy, cleaner_s_done, dns_acache_attachentry(), dns_acache_detachentry(), DNS_ACACHE_VALID, DNS_EVENT_ACACHECLEAN, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ACACHE, end_cleaning(), entry_stale(), dns_acache::entrylocks, INSIST, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, ISC_LOG_DEBUG, isc_log_write(), isc_mem_inuse(), isc_rwlocktype_write, isc_serial_ge(), isc_stdtime_convert32, isc_stdtime_get(), isc_task_send(), dns_acache::lock, LOCK, dns_acacheentry::locknum, now, unlink_dbentries(), and UNLOCK.

Referenced by acache_cleaner_init().

static void acache_overmem_cleaning_action ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 925 of file acache.c.

References begin_cleaning(), cleaner_s_busy, cleaner_s_done, cleaner_s_idle, DNS_EVENT_ACACHEOVERMEM, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ACACHE, INSIST, ISC_FALSE, ISC_LOG_DEBUG, isc_log_write(), ISC_TRUE, LOCK, UNLOCK, and UNUSED.

Referenced by acache_cleaner_init().

static void acache_cleaner_shutdown_action ( isc_task_t task,
isc_event_t event 
) [static]

Definition at line 996 of file acache.c.

References ATRACE, check_noentry(), dns_acache::cleaner, CLEANER_BUSY, destroy(), DNS_ACACHE_VALID, DNS_EVENT_ACACHECLEAN, end_cleaning(), INSIST, isc_event_free(), ISC_FALSE, isc_refcount_current, isc_task_purge(), ISC_TASKEVENT_SHUTDOWN, isc_timer_detach(), ISC_TRUE, dns_acache::live_cleaners, dns_acache::lock, LOCK, dns_acache::refs, and UNLOCK.

Referenced by acache_cleaner_init().

static void reset_stats ( dns_acache_t acache  )  [static]

Definition at line 270 of file acache.c.

Referenced by dns_acache_create(), and end_cleaning().

static void shutdown_task ( isc_task_t task,
isc_event_t ev 
) [static]

Definition at line 364 of file acache.c.

References dns_acache_detach(), DNS_ACACHE_VALID, INSIST, isc_event_free(), dns_acache::lock, LOCK, shutdown_buckets(), shutdown_entries(), UNLOCK, and UNUSED.

Referenced by check_exit(), and dns_acache_create().

static void begin_cleaning ( acache_cleaner_t *  cleaner  )  [static]

Definition at line 626 of file acache.c.

References CLEANER_IDLE, cleaner_s_busy, dns_acache_attachentry(), DNS_ACACHE_VALID, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ACACHE, INSIST, ISC_LIST_HEAD, ISC_LOG_DEBUG, isc_log_write(), isc_mem_inuse(), isc_task_send(), dns_acache::lock, LOCK, REQUIRE, and UNLOCK.

Referenced by acache_cleaning_timer_action(), acache_overmem_cleaning_action(), cleaning_timer_action(), and overmem_cleaning_action().

static void end_cleaning ( acache_cleaner_t *  cleaner,
isc_event_t event 
) [static]

Definition at line 663 of file acache.c.

References CLEANER_BUSY, cleaner_s_idle, dns_acache_detachentry(), dns_acache_setcleaninginterval(), DNS_ACACHEENTRY_VALID, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ACACHE, INSIST, ISC_LINK_LINKED, ISC_LIST_UNLINK, ISC_LOG_DEBUG, ISC_LOG_NOTICE, isc_log_write(), isc_mem_inuse(), isc_refcount_current, isc_stdtime_get(), dns_acache::lock, LOCK, REQUIRE, reset_stats(), and UNLOCK.

Referenced by acache_cleaner_shutdown_action(), acache_incremental_cleaning_action(), cleaner_shutdown_action(), and incremental_cleaning_action().

static isc_boolean_t entry_stale ( acache_cleaner_t *  cleaner,
dns_acacheentry_t entry,
isc_stdtime32_t  now32,
unsigned int  interval 
) [inline, static]

Definition at line 758 of file acache.c.

References ISC_FALSE, isc_random_get(), isc_serial_ge(), ISC_TF, and ISC_TRUE.

Referenced by acache_incremental_cleaning_action().

static void water ( void *  arg,
int  mark 
) [static]

Definition at line 966 of file acache.c.

References dns_acache::cleaner, DNS_ACACHE_VALID, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ACACHE, ISC_LOG_DEBUG, isc_log_write(), ISC_MEM_HIWATER, isc_mem_inuse(), isc_mem_waterack(), isc_task_send(), ISC_TF, LOCK, dns_acache::mctx, overmem(), REQUIRE, and UNLOCK.

Referenced by dns_acache_setcachesize(), dns_adb_setadbsize(), dns_adb_shutdown(), dns_cache_setcachesize(), and ISC_LIST().

isc_result_t dns_acache_create ( dns_acache_t **  acachep,
isc_mem_t mctx,
isc_taskmgr_t taskmgr,
isc_timermgr_t timermgr 
)

Definition at line 1043 of file acache.c.

References acache_cleaner_init(), ACACHE_DESTROYLOCK, ACACHE_INITLOCK, ACACHE_MAGIC, ATRACE, dns_acache::cleaner, cleanup(), DEFAULT_ACACHE_ENTRY_LOCK_COUNT, DESTROYLOCK, DNS_EVENT_ACACHECONTROL, dns_result_totext(), dns_acache::entrylocks, ISC_EVENT_INIT, ISC_FALSE, ISC_LIST_INIT, isc_mem_attach(), isc_mem_detach(), isc_mem_get, isc_mem_put, isc_mutex_init, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_R_UNEXPECTED, isc_refcount_decrement, isc_refcount_destroy, isc_refcount_init(), isc_task_create(), isc_task_detach(), isc_task_setname(), dns_acache::live_cleaners, dns_acache::lock, dns_acache::magic, dns_acache::mctx, dns_acache::refs, REQUIRE, reset_stats(), shutdown_task(), and UNEXPECTED_ERROR.

Referenced by configure_view().

void dns_acache_attach ( dns_acache_t source,
dns_acache_t **  targetp 
)

Definition at line 1153 of file acache.c.

References AATRACE, DNS_ACACHE_VALID, isc_refcount_increment, dns_acache::refs, and REQUIRE.

Referenced by dns_acache_createentry(), dns_acache_shutdown(), and dns_zone_setacache().

void dns_acache_countquerymiss ( dns_acache_t acache  ) 

Definition at line 1165 of file acache.c.

Referenced by rdataset_getadditional().

void dns_acache_detach ( dns_acache_t **  acachep  ) 

Definition at line 1171 of file acache.c.

References ATRACE, check_noentry(), destroy(), DNS_ACACHE_VALID, INSIST, ISC_FALSE, isc_refcount_decrement, isc_task_shutdown(), ISC_TRUE, dns_acache::live_cleaners, dns_acache::refs, and REQUIRE.

Referenced by destroy(), destroy_entry(), dns_zone_setacache(), shutdown_task(), and zone_free().

void dns_acache_shutdown ( dns_acache_t acache  ) 

Definition at line 1202 of file acache.c.

References ATRACE, dns_acache_attach(), DNS_ACACHE_VALID, INSIST, isc_mem_setwater(), isc_task_send(), ISC_TRUE, dns_acache::lock, LOCK, dns_acache::mctx, REQUIRE, and UNLOCK.

Referenced by view_flushanddetach().

isc_result_t dns_acache_setdb ( dns_acache_t acache,
dns_db_t db 
)

Definition at line 1234 of file acache.c.

References ATRACE, dbentry::db, DNS_ACACHE_VALID, dns_db_attach(), finddbent(), isc_hash_calc(), ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LIST_INIT, isc_mem_get, ISC_R_EXISTS, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_TRUE, dns_acache::lock, LOCK, dns_acache::mctx, REQUIRE, and UNLOCK.

Referenced by dns_view_flushcache2(), dns_view_setcache2(), dns_zone_setacache(), and zone_attachdb().

isc_result_t dns_acache_putdb ( dns_acache_t acache,
dns_db_t db 
)

Definition at line 1281 of file acache.c.

References ACACHE_LOCK, ACACHE_UNLOCK, ATRACE, dns_acache::cleaner, dbentry::db, dns_acache_detachentry(), DNS_ACACHE_VALID, dns_db_detach(), dns_acache::entrylocks, finddbent(), INSIST, isc_hash_calc(), ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_UNLINK, isc_mem_put, ISC_R_NOTFOUND, ISC_R_SUCCESS, isc_rwlocktype_write, ISC_TRUE, dns_acache::lock, LOCK, dns_acacheentry::locknum, dns_acache::mctx, REQUIRE, unlink_dbentries(), and UNLOCK.

Referenced by destroy(), dns_view_flushcache2(), dns_view_setcache2(), and zone_detachdb().

isc_result_t dns_acache_createentry ( dns_acache_t acache,
dns_db_t origdb,
void(*)(dns_acacheentry_t *, void **)  callback,
void *  cbarg,
dns_acacheentry_t **  entryp 
)

Definition at line 1373 of file acache.c.

References dns_acacheentry::acache, ACACHEENTRY_MAGIC, dns_acache::cleaner, DEFAULT_ACACHE_ENTRY_LOCK_COUNT, dns_acache_attach(), DNS_ACACHE_VALID, dns_db_attach(), ISC_LINK_INIT, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_NORESOURCES, ISC_R_SUCCESS, isc_random_get(), isc_refcount_init(), isc_stdtime_get(), dns_acacheentry::locknum, dns_acacheentry::magic, dns_acache::mctx, r, dns_acacheentry::references, and REQUIRE.

Referenced by rdataset_setadditional().

isc_result_t dns_acache_getentry ( dns_acacheentry_t entry,
dns_zone_t **  zonep,
dns_db_t **  dbp,
dns_dbversion_t **  versionp,
dns_dbnode_t **  nodep,
dns_name_t fname,
dns_message_t msg,
isc_stdtime_t  now 
)

Definition at line 1445 of file acache.c.

References dns_acacheentry::acache, ACACHE_LOCK, acache_storetime, ACACHE_UNLOCK, DNS_ACACHE_VALID, DNS_ACACHEENTRY_VALID, dns_db_attach(), dns_db_attachnode(), dns_db_attachversion(), dns_db_closeversion(), dns_db_detach(), dns_db_detachnode(), dns_message_gettemprdataset(), dns_message_puttemprdataset(), dns_name_copy(), dns_rdataset_clone(), dns_rdataset_disassociate(), dns_rdataset_init(), dns_zone_attach(), dns_zone_detach(), dns_acache::entrylocks, INSIST, ISC_FALSE, ISC_LIST_APPEND, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, ISC_R_SUCCESS, isc_rwlocktype_read, isc_stdtime_convert32, dns_acacheentry::locknum, and REQUIRE.

Referenced by rdataset_getadditional().

isc_result_t dns_acache_setentry ( dns_acache_t acache,
dns_acacheentry_t entry,
dns_zone_t zone,
dns_db_t db,
dns_dbversion_t version,
dns_dbnode_t node,
dns_name_t fname 
)

Definition at line 1540 of file acache.c.

References ACACHE_LOCK, ACACHE_UNLOCK, clear_entry(), dns_acache_attachentry(), DNS_ACACHE_VALID, DNS_ACACHEENTRY_VALID, dns_db_attach(), dns_db_attachnode(), dns_db_attachversion(), dns_db_closeversion(), dns_db_currentversion(), dns_name_dup(), dns_name_init(), dns_rdataset_clone(), dns_rdataset_init(), dns_zone_attach(), dns_acache::entrylocks, finddbent(), INSIST, ISC_FALSE, ISC_LIST_APPEND, ISC_LIST_HEAD, ISC_LIST_NEXT, isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_rwlocktype_write, ISC_TRUE, dns_acache::lock, LOCK, dns_acacheentry::locknum, dns_acache::mctx, REQUIRE, and UNLOCK.

Referenced by rdataset_setadditional().

isc_boolean_t dns_acache_cancelentry ( dns_acacheentry_t entry  ) 

Definition at line 1665 of file acache.c.

References dns_acacheentry::acache, ACACHE_LOCK, ACACHE_UNLOCK, clear_entry(), DNS_ACACHE_VALID, DNS_ACACHEENTRY_VALID, dns_acache::entrylocks, INSIST, isc_rwlocktype_write, ISC_TF, dns_acache::lock, LOCK, dns_acacheentry::locknum, REQUIRE, unlink_dbentries(), and UNLOCK.

Referenced by acache_cancelentry().

void dns_acache_attachentry ( dns_acacheentry_t source,
dns_acacheentry_t **  targetp 
)

Definition at line 1700 of file acache.c.

References DNS_ACACHEENTRY_VALID, isc_refcount_increment, dns_acacheentry::references, and REQUIRE.

Referenced by acache_incremental_cleaning_action(), begin_cleaning(), dns_acache_setentry(), and rdataset_getadditional().

void dns_acache_detachentry ( dns_acacheentry_t **  entryp  ) 

Definition at line 1712 of file acache.c.

References destroy_entry(), DNS_ACACHEENTRY_VALID, INSIST, ISC_LINK_LINKED, isc_refcount_decrement, dns_acacheentry::references, and REQUIRE.

Referenced by acache_callback(), acache_incremental_cleaning_action(), dns_acache_putdb(), end_cleaning(), rdataset_getadditional(), rdataset_putadditional(), rdataset_setadditional(), and shutdown_entries().

void dns_acache_setcleaninginterval ( dns_acache_t acache,
unsigned int  t 
)

Definition at line 1735 of file acache.c.

References ATRACE, dns_acache::cleaner, DNS_ACACHE_VALID, dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ACACHE, ISC_FALSE, isc_interval_set(), ISC_LOG_NOTICE, ISC_LOG_WARNING, isc_log_write(), ISC_R_SUCCESS, isc_result_totext(), isc_timer_reset(), isc_timertype_inactive, isc_timertype_ticker, ISC_TRUE, dns_acache::lock, LOCK, REQUIRE, and UNLOCK.

Referenced by configure_view(), and end_cleaning().

void dns_acache_setcachesize ( dns_acache_t acache,
size_t  size 
)

Definition at line 1785 of file acache.c.

References DNS_ACACHE_MINSIZE, DNS_ACACHE_VALID, isc_mem_setwater(), dns_acache::mctx, REQUIRE, and water().

Referenced by configure_view().


Variable Documentation

cleaner_state_t

Definition at line 119 of file acache.c.


Generated on Tue Apr 28 17:41:07 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha