• Home
  • Raw
  • Download

Lines Matching refs:cache

1121 _cache_flush_locked( Cache*  cache )  in _cache_flush_locked()  argument
1128 Entry** pnode = &cache->entries[nn]; in _cache_flush_locked()
1137 cache->mru_list.mru_next = cache->mru_list.mru_prev = &cache->mru_list; in _cache_flush_locked()
1138 cache->num_entries = 0; in _cache_flush_locked()
1139 cache->last_id = 0; in _cache_flush_locked()
1149 struct resolv_cache* cache; in _resolv_cache_create() local
1151 cache = calloc(sizeof(*cache), 1); in _resolv_cache_create()
1152 if (cache) { in _resolv_cache_create()
1153 cache->generation = ~0U; in _resolv_cache_create()
1154 pthread_mutex_init( &cache->lock, NULL ); in _resolv_cache_create()
1155 cache->mru_list.mru_prev = cache->mru_list.mru_next = &cache->mru_list; in _resolv_cache_create()
1158 return cache; in _resolv_cache_create()
1175 _cache_dump_mru( Cache* cache ) in _cache_dump_mru() argument
1180 p = _bprint(temp, end, "MRU LIST (%2d): ", cache->num_entries); in _cache_dump_mru()
1181 for (e = cache->mru_list.mru_next; e != &cache->mru_list; e = e->mru_next) in _cache_dump_mru()
1209 _cache_lookup_p( Cache* cache, in _cache_lookup_p() argument
1213 Entry** pnode = &cache->entries[ key->hash % MAX_HASH_ENTRIES ]; in _cache_lookup_p()
1235 _cache_add_p( Cache* cache, in _cache_add_p() argument
1240 e->id = ++cache->last_id; in _cache_add_p()
1241 entry_mru_add(e, &cache->mru_list); in _cache_add_p()
1242 cache->num_entries += 1; in _cache_add_p()
1245 e->id, cache->num_entries); in _cache_add_p()
1253 _cache_remove_p( Cache* cache, in _cache_remove_p() argument
1259 e->id, cache->num_entries-1); in _cache_remove_p()
1264 cache->num_entries -= 1; in _cache_remove_p()
1270 _cache_remove_oldest( Cache* cache ) in _cache_remove_oldest() argument
1272 Entry* oldest = cache->mru_list.mru_prev; in _cache_remove_oldest()
1273 Entry** lookup = _cache_lookup_p(cache, oldest); in _cache_remove_oldest()
1279 _cache_remove_p(cache, lookup); in _cache_remove_oldest()
1284 _resolv_cache_lookup( struct resolv_cache* cache, in _resolv_cache_lookup() argument
1309 pthread_mutex_lock( &cache->lock ); in _resolv_cache_lookup()
1314 lookup = _cache_lookup_p(cache, key); in _resolv_cache_lookup()
1327 _cache_remove_p(cache, lookup); in _resolv_cache_lookup()
1342 if (e != cache->mru_list.mru_next) { in _resolv_cache_lookup()
1344 entry_mru_add( e, &cache->mru_list ); in _resolv_cache_lookup()
1351 pthread_mutex_unlock( &cache->lock ); in _resolv_cache_lookup()
1357 _resolv_cache_add( struct resolv_cache* cache, in _resolv_cache_add() argument
1374 pthread_mutex_lock( &cache->lock ); in _resolv_cache_add()
1383 lookup = _cache_lookup_p(cache, key); in _resolv_cache_add()
1392 if (cache->num_entries >= CONFIG_MAX_ENTRIES) { in _resolv_cache_add()
1393 _cache_remove_oldest(cache); in _resolv_cache_add()
1395 lookup = _cache_lookup_p(cache, key); in _resolv_cache_add()
1406 _cache_add_p(cache, lookup, e); in _resolv_cache_add()
1409 _cache_dump_mru(cache); in _resolv_cache_add()
1412 pthread_mutex_unlock( &cache->lock ); in _resolv_cache_add()