A brief file description. More...
#include "P_Cache.h"
#include "ink_stack_trace.h"
Go to the source code of this file.
Defines | |
#define | CACHE_INC_DIR_USED(_m) |
#define | CACHE_DEC_DIR_USED(_m) |
#define | CACHE_INC_DIR_COLLISIONS(_m) |
#define | HIST_DEPTH 8 |
Functions | |
int | dir_bucket_loop_check (Dir *start_dir, Dir *seg) |
void | dir_init_segment (int s, Vol *d) |
int | dir_bucket_loop_fix (Dir *start_dir, int s, Vol *d) |
int | dir_freelist_length (Vol *d, int s) |
int | dir_bucket_length (Dir *b, int s, Vol *d) |
int | check_dir (Vol *d) |
void | unlink_from_freelist (Dir *e, int s, Vol *d) |
Dir * | dir_delete_entry (Dir *e, Dir *p, int s, Vol *d) |
void | dir_clean_bucket (Dir *b, int s, Vol *vol) |
void | dir_clean_segment (int s, Vol *d) |
void | dir_clean_vol (Vol *d) |
void | dir_clear_range (off_t start, off_t end, Vol *vol) |
void | check_bucket_not_contains (Dir *b, Dir *e, Dir *seg) |
void | freelist_clean (int s, Vol *vol) |
Dir * | freelist_pop (int s, Vol *d) |
int | dir_segment_accounted (int s, Vol *d, int offby, int *f, int *u, int *et, int *v, int *av, int *as) |
void | dir_free_entry (Dir *e, int s, Vol *d) |
int | dir_probe (CacheKey *key, Vol *d, Dir *result, Dir **last_collision) |
int | dir_insert (CacheKey *key, Vol *d, Dir *to_part) |
int | dir_overwrite (CacheKey *key, Vol *d, Dir *dir, Dir *overwrite, bool must_overwrite) |
int | dir_delete (CacheKey *key, Vol *d, Dir *del) |
int | dir_lookaside_probe (CacheKey *key, Vol *d, Dir *result, EvacuationBlock **eblock) |
int | dir_lookaside_insert (EvacuationBlock *eblock, Vol *d, Dir *to) |
int | dir_lookaside_fixup (CacheKey *key, Vol *d) |
void | dir_lookaside_cleanup (Vol *d) |
void | dir_lookaside_remove (CacheKey *key, Vol *d) |
void | dir_sync_init () |
uint64_t | dir_entries_used (Vol *d) |
void | sync_cache_dir_on_shutdown (void) |
void | regress_rand_init (unsigned int i) |
void | regress_rand_CacheKey (CacheKey *key) |
void | dir_corrupt_bucket (Dir *b, int s, Vol *d) |
EXCLUSIVE_REGRESSION_TEST() | Cache_dir (RegressionTest *t, int, int *status) |
Variables | |
ClassAllocator< OpenDirEntry > | openDirEntryAllocator ("openDirEntry") |
Dir | empty_dir |
uint8_t | CacheKey_next_table [256] |
uint8_t | CacheKey_prev_table [256] |
unsigned int | regress_rand_seed = 0 |
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file CacheDir.cc.
#define CACHE_DEC_DIR_USED | ( | _m | ) |
do { \ ProxyMutex *mutex = _m; \ CACHE_DECREMENT_DYN_STAT(cache_direntries_used_stat); \ } while (0) \
Definition at line 38 of file CacheDir.cc.
Referenced by dir_clean_bucket(), dir_clear_range(), dir_delete(), dir_probe(), and freelist_clean().
#define CACHE_INC_DIR_COLLISIONS | ( | _m | ) |
do {\ ProxyMutex *mutex = _m; \ CACHE_INCREMENT_DYN_STAT(cache_directory_collision_count_stat); \ } while (0);
Definition at line 43 of file CacheDir.cc.
Referenced by dir_probe().
#define CACHE_INC_DIR_USED | ( | _m | ) |
do { \ ProxyMutex *mutex = _m; \ CACHE_INCREMENT_DYN_STAT(cache_direntries_used_stat); \ } while (0) \
Definition at line 33 of file CacheDir.cc.
Referenced by dir_insert(), and dir_overwrite().
#define HIST_DEPTH 8 |
Definition at line 1240 of file CacheDir.cc.
Referenced by Vol::dir_check().
EXCLUSIVE_REGRESSION_TEST() Cache_dir | ( | RegressionTest * | t, | |
int | , | |||
int * | status | |||
) |
Definition at line 1421 of file CacheDir.cc.
References VolHeaderFooter::agg_pos, ats::CryptoHash::b, Vol::buckets, CACHE_INITIALIZED, check_dir(), dir_bucket(), dir_bucket_length(), dir_bucket_row(), dir_clean_segment(), dir_clear, dir_corrupt_bucket(), dir_freelist_length(), dir_from_offset(), dir_insert(), dir_overwrite(), dir_probe(), dir_segment, dir_set_head, dir_set_offset, dir_set_phase, VolHeaderFooter::freelist, gnvol, gvol, Vol::header, HRTIME_USECOND, ink_get_hrtime_internal(), ink_release_assert, CacheProcessor::IsCacheEnabled(), Thread::mutex, Continuation::mutex, MUTEX_TRY_LOCK, rand_CacheKey(), regress_rand_CacheKey(), regress_rand_init(), rprintf(), Vol::segments, ats::CryptoHash::slice32(), this_ethread(), vol_dir_clear(), vol_direntries(), and VolHeaderFooter::write_pos.
Definition at line 480 of file CacheDir.cc.
References ink_assert, and next_dir().
int check_dir | ( | Vol * | d | ) |
Definition at line 267 of file CacheDir.cc.
References Vol::buckets, Debug, dir_bucket(), dir_bucket_length(), dir_bucket_loop_check(), dir_next, dir_offset, dir_segment, and Vol::segments.
Referenced by Cache_dir().
Definition at line 248 of file CacheDir.cc.
References dir_bucket_loop_fix(), dir_segment, and next_dir().
Referenced by Cache_dir(), check_dir(), dir_clean_bucket(), and dir_corrupt_bucket().
Definition at line 177 of file CacheDir.cc.
References next_dir().
Referenced by check_dir(), and dir_bucket_loop_fix().
Definition at line 222 of file CacheDir.cc.
References dir_bucket_loop_check(), dir_init_segment(), dir_segment, and Warning.
Referenced by dir_bucket_length(), dir_clean_bucket(), dir_delete(), dir_entries_used(), dir_freelist_length(), dir_overwrite(), dir_probe(), and make_vol_map().
Definition at line 327 of file CacheDir.cc.
References CACHE_DEC_DIR_USED, Debug, dir_bucket_length(), dir_bucket_loop_fix(), dir_delete_entry(), dir_offset, dir_segment, dir_tag, dir_valid, is_debug_tag_set, Continuation::mutex, and next_dir().
Referenced by dir_clean_segment().
void dir_clean_segment | ( | int | s, | |
Vol * | d | |||
) |
Definition at line 357 of file CacheDir.cc.
References Vol::buckets, dir_bucket(), dir_clean_bucket(), dir_next, dir_offset, dir_segment, and ink_assert.
Referenced by Cache_dir(), dir_clean_vol(), and freelist_clean().
void dir_clean_vol | ( | Vol * | d | ) |
Definition at line 367 of file CacheDir.cc.
References CHECK_DIR, dir_clean_segment(), and Vol::segments.
Referenced by Vol::agg_wrap(), and dir_clear_range().
void dir_clear_range | ( | off_t | start, | |
off_t | end, | |||
Vol * | vol | |||
) |
Definition at line 467 of file CacheDir.cc.
References Vol::buckets, CACHE_DEC_DIR_USED, dir_clean_vol(), DIR_DEPTH, dir_index, dir_offset, dir_set_offset, dir_token, Continuation::mutex, and Vol::segments.
Referenced by Vol::handle_recover_from_data().
Definition at line 1408 of file CacheDir.cc.
References dir_bucket_length(), dir_segment, dir_set_next, dir_to_offset(), ink_release_assert, and next_dir().
Referenced by Cache_dir().
Definition at line 796 of file CacheDir.cc.
References Vol::buckets, CACHE_DEC_DIR_USED, CHECK_DIR, dir_bucket(), dir_bucket_loop_fix(), dir_compare_tag(), dir_delete_entry(), dir_offset, dir_segment, ink_assert, Continuation::mutex, next_dir(), Vol::segments, ats::CryptoHash::slice32(), and this_ethread().
Referenced by Vol::aggWriteDone(), dir_delete_lock(), CacheVC::openReadMain(), CacheVC::openReadReadDone(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteCloseDir(), and CacheVC::removeEvent().
Definition at line 298 of file CacheDir.cc.
References dir_assign, dir_clear, dir_from_offset(), dir_next, dir_segment, dir_set_next, dir_set_prev, dir_to_offset(), VolHeaderFooter::dirty, VolHeaderFooter::freelist, Vol::header, and next_dir().
Referenced by dir_clean_bucket(), dir_delete(), and dir_probe().
uint64_t dir_entries_used | ( | Vol * | d | ) |
Definition at line 971 of file CacheDir.cc.
References Vol::buckets, dir_bucket(), dir_bucket_loop_fix(), dir_offset, dir_segment, next_dir(), and Vol::segments.
Referenced by CacheProcessor::cacheInitialized(), and CacheProcessor::mark_storage_offline().
Definition at line 579 of file CacheDir.cc.
References dir_from_offset(), dir_segment, dir_set_next, dir_set_prev, dir_to_offset(), VolHeaderFooter::freelist, and Vol::header.
Referenced by dir_init_segment(), and vol_init_dir().
int dir_freelist_length | ( | Vol * | d, | |
int | s | |||
) |
Definition at line 233 of file CacheDir.cc.
References Vol::buckets, dir_bucket_loop_fix(), DIR_DEPTH, dir_from_offset(), dir_segment, VolHeaderFooter::freelist, Vol::header, and next_dir().
Referenced by Cache_dir(), Vol::dir_check(), and dir_segment_accounted().
void dir_init_segment | ( | int | s, | |
Vol * | d | |||
) |
Definition at line 204 of file CacheDir.cc.
References Vol::buckets, dir_bucket(), dir_bucket_row(), DIR_DEPTH, dir_free_entry(), dir_segment, VolHeaderFooter::freelist, Vol::header, and SIZEOF_DIR.
Referenced by dir_bucket_loop_fix(), and freelist_pop().
Definition at line 657 of file CacheDir.cc.
References Vol::buckets, CACHE_INC_DIR_USED, CHECK_DIR, DDebug, dir_approx_size, dir_assign, dir_assign_data, dir_bucket(), dir_bucket_row(), dir_is_empty, DIR_MASK_TAG, dir_next, dir_offset, dir_segment, dir_set_next, dir_set_tag, dir_tag, dir_to_offset(), VolHeaderFooter::dirty, Vol::fd, freelist_pop(), Vol::header, ink_assert, Vol::len, MAX_FRAG_SIZE, Continuation::mutex, next_dir(), Vol::segments, sizeofDoc, Vol::skip, ats::CryptoHash::slice32(), this_ethread(), unlink_from_freelist(), and vol_offset().
Referenced by Cache_dir(), dir_insert_lock(), CacheVC::linkWrite(), CacheVC::openWriteCloseDataDone(), CacheVC::openWriteCloseHeadDone(), CacheVC::openWriteWriteDone(), and CacheVC::scanUpdateDone().
void dir_lookaside_cleanup | ( | Vol * | d | ) |
Definition at line 906 of file CacheDir.cc.
References DDebug, dir_valid, EvacuationBlock::earliest_evacuator, EvacuationKey::earliest_key, EvacuationBlock::evac_frags, free_CacheVC(), free_EvacuationBlock(), DLL< C, L >::head, ink_assert, Vol::lookaside, Continuation::mutex, EvacuationBlock::new_dir, DLL< C, L >::remove(), ats::CryptoHash::slice32(), and this_ethread().
Referenced by Vol::agg_wrap().
Definition at line 879 of file CacheDir.cc.
References DDebug, EvacuationBlock::dir, dir_offset, dir_overwrite(), dir_phase, EvacuationBlock::evac_frags, RamCache::fixup(), free_EvacuationBlock(), DLL< C, L >::head, ink_assert, EvacuationKey::key, Vol::lookaside, Continuation::mutex, EvacuationBlock::new_dir, Vol::ram_cache, DLL< C, L >::remove(), ats::CryptoHash::slice32(), and this_ethread().
Referenced by CacheVC::evacuateDocDone(), and CacheVC::evacuateReadHead().
int dir_lookaside_insert | ( | EvacuationBlock * | eblock, | |
Vol * | d, | |||
Dir * | to | |||
) |
Definition at line 861 of file CacheDir.cc.
References DDebug, EvacuationBlock::dir, dir_offset, dir_phase, EvacuationBlock::earliest_evacuator, EvacuationKey::earliest_key, EvacuationBlock::evac_frags, ink_assert, EvacuationKey::key, Vol::lookaside, Continuation::mutex, EvacuationBlock::new_dir, new_EvacuationBlock(), DLL< C, L >::push(), ats::CryptoHash::slice32(), and this_ethread().
Referenced by CacheVC::evacuateDocDone().
int dir_lookaside_probe | ( | CacheKey * | key, | |
Vol * | d, | |||
Dir * | result, | |||
EvacuationBlock ** | eblock | |||
) |
Definition at line 839 of file CacheDir.cc.
References DDebug, dir_valid, EvacuationBlock::evac_frags, DLL< C, L >::head, ink_assert, EvacuationKey::key, Vol::lookaside, Continuation::mutex, EvacuationBlock::new_dir, ats::CryptoHash::slice32(), and this_ethread().
Referenced by CacheVC::evacuateDocDone(), and CacheVC::openReadStartEarliest().
Definition at line 929 of file CacheDir.cc.
References DDebug, dir_offset, dir_phase, EvacuationBlock::evac_frags, free_EvacuationBlock(), DLL< C, L >::head, ink_assert, EvacuationKey::key, Vol::lookaside, Continuation::mutex, EvacuationBlock::new_dir, DLL< C, L >::remove(), ats::CryptoHash::slice32(), and this_ethread().
Referenced by CacheVC::evacuateReadHead().
Definition at line 719 of file CacheDir.cc.
References Vol::buckets, CACHE_INC_DIR_USED, CHECK_DIR, DDebug, dir_approx_size, dir_assign_data, dir_bucket(), dir_bucket_loop_fix(), dir_bucket_row(), dir_is_empty, DIR_MASK_TAG, dir_next, dir_offset, dir_segment, dir_set_next, dir_set_tag, dir_tag, dir_to_offset(), VolHeaderFooter::dirty, Vol::fd, freelist_pop(), Vol::header, ink_assert, Vol::len, MAX_FRAG_SIZE, Continuation::mutex, next_dir(), Vol::segments, sizeofDoc, Vol::skip, ats::CryptoHash::slice32(), this_ethread(), unlink_from_freelist(), and vol_offset().
Referenced by Cache_dir(), dir_lookaside_fixup(), dir_overwrite_lock(), CacheVC::evacuateDocDone(), CacheVC::openWriteCloseHeadDone(), and CacheVC::scanUpdateDone().
Definition at line 591 of file CacheDir.cc.
References Vol::buckets, CACHE_DEC_DIR_USED, CACHE_INC_DIR_COLLISIONS, CHECK_DIR, DDebug, dir_assign, dir_bucket(), dir_bucket_loop_fix(), dir_compare_tag(), dir_delete_entry(), dir_offset, dir_segment, dir_tag, dir_valid, Vol::fd, ink_assert, Continuation::mutex, next_dir(), Vol::segments, ats::CryptoHash::slice32(), and this_ethread().
Referenced by Cache_dir(), Cache::deref(), CacheVC::derefRead(), evacuate_fragments(), CacheVC::evacuateDocDone(), CacheVC::evacuateReadHead(), Cache::open_read(), CacheVC::openReadMain(), CacheVC::openReadReadDone(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteOverwrite(), CacheVC::removeEvent(), CacheVC::scanObject(), and CacheVC::scanOpenWrite().
int dir_segment_accounted | ( | int | s, | |
Vol * | d, | |||
int | offby, | |||
int * | f, | |||
int * | u, | |||
int * | et, | |||
int * | v, | |||
int * | av, | |||
int * | as | |||
) |
Definition at line 535 of file CacheDir.cc.
References Vol::buckets, dir_agg_valid, dir_approx_size, dir_bucket(), DIR_DEPTH, dir_freelist_length(), dir_offset, dir_segment, dir_valid, ink_assert, and next_dir().
Referenced by ShowCacheInternal::showSegSegment().
void dir_sync_init | ( | ) |
Definition at line 952 of file CacheDir.cc.
References cache_config_dir_sync_frequency, cacheDirSync, eventProcessor, HRTIME_SECONDS, EventProcessor::schedule_in(), and CacheSync::trigger.
Referenced by CacheProcessor::cacheInitialized().
void freelist_clean | ( | int | s, | |
Vol * | vol | |||
) |
Definition at line 492 of file CacheDir.cc.
References Vol::buckets, CACHE_DEC_DIR_USED, dir_bucket(), dir_bucket_row(), dir_clean_segment(), dir_head, dir_segment, dir_set_offset, VolHeaderFooter::freelist, Vol::header, Continuation::mutex, Vol::path, and Warning.
Referenced by freelist_pop().
Definition at line 514 of file CacheDir.cc.
References dir_from_offset(), dir_init_segment(), dir_next, dir_offset, dir_segment, dir_set_prev, VolHeaderFooter::freelist, freelist_clean(), and Vol::header.
Referenced by dir_insert(), and dir_overwrite().
void regress_rand_CacheKey | ( | CacheKey * | key | ) |
void regress_rand_init | ( | unsigned int | i | ) |
Definition at line 1394 of file CacheDir.cc.
Referenced by Cache_dir().
void sync_cache_dir_on_shutdown | ( | void | ) |
Definition at line 1003 of file CacheDir.cc.
References Vol::agg_buf_pos, Vol::agg_buffer, VolHeaderFooter::agg_pos, ats_memalign(), ats_memalign_free(), cache_config_hit_evacuate_percent, CHECK_DIR, Vol::data_blocks, Debug, Vol::dir_sync_in_progress, VolHeaderFooter::dirty, Vol::disk, DISK_BAD, Vol::fd, Vol::footer, gnvol, gvol, Vol::hash_text, Vol::header, Vol::hit_evacuate_window, ink_assert, VolHeaderFooter::last_write_pos, memcpy, MUTEX_TAKE_LOCK, Vol::raw_dir, Vol::skip, VolHeaderFooter::sync_serial, vol_dirlen(), VolHeaderFooter::write_pos, and VolHeaderFooter::write_serial.
Referenced by mgmt_restart_shutdown_callback().
Definition at line 284 of file CacheDir.cc.
References dir_from_offset(), dir_next, dir_prev, dir_segment, dir_set_next, dir_set_prev, VolHeaderFooter::freelist, and Vol::header.
Referenced by dir_insert(), and dir_overwrite().
uint8_t CacheKey_next_table[256] |
Definition at line 1318 of file CacheDir.cc.
uint8_t CacheKey_prev_table[256] |
Definition at line 1354 of file CacheDir.cc.
Definition at line 52 of file CacheDir.cc.
ClassAllocator<OpenDirEntry> openDirEntryAllocator("openDirEntry") |
Referenced by OpenDir::close_write(), and OpenDir::open_write().
unsigned int regress_rand_seed = 0 |
Definition at line 1392 of file CacheDir.cc.