A brief file description. More...
Go to the source code of this file.
Data Structures | |
struct | VolHeaderFooter |
struct | EvacuationKey |
struct | EvacuationBlock |
struct | Vol |
struct | AIO_Callback_handler |
struct | CacheVol |
struct | Doc |
Defines | |
#define | CACHE_BLOCK_SHIFT 9 |
#define | CACHE_BLOCK_SIZE (1<<CACHE_BLOCK_SHIFT) |
#define | ROUND_TO_STORE_BLOCK(_x) INK_ALIGN((_x), STORE_BLOCK_SIZE) |
#define | ROUND_TO_CACHE_BLOCK(_x) INK_ALIGN((_x), CACHE_BLOCK_SIZE) |
#define | ROUND_TO_SECTOR(_p, _x) INK_ALIGN((_x), _p->sector_size) |
#define | ROUND_TO(_x, _y) INK_ALIGN((_x), (_y)) |
#define | VOL_MAGIC 0xF1D0F00D |
#define | START_BLOCKS 16 |
#define | START_POS ((off_t)START_BLOCKS * CACHE_BLOCK_SIZE) |
#define | AGG_SIZE (4 * 1024 * 1024) |
#define | AGG_HIGH_WATER (AGG_SIZE / 2) |
#define | EVACUATION_SIZE (2 * AGG_SIZE) |
#define | MAX_VOL_SIZE ((off_t)512 * 1024 * 1024 * 1024 * 1024) |
#define | STORE_BLOCKS_PER_CACHE_BLOCK (STORE_BLOCK_SIZE / CACHE_BLOCK_SIZE) |
#define | MAX_VOL_BLOCKS (MAX_VOL_SIZE / CACHE_BLOCK_SIZE) |
#define | MAX_FRAG_SIZE (AGG_SIZE - sizeofDoc) |
#define | LEAVE_FREE DEFAULT_MAX_BUFFER_SIZE |
#define | PIN_SCAN_EVERY 16 |
#define | VOL_HASH_TABLE_SIZE 32707 |
#define | VOL_HASH_EMPTY 0xFFFF |
#define | VOL_HASH_ALLOC_SIZE (8 * 1024 * 1024) |
#define | LOOKASIDE_SIZE 256 |
#define | EVACUATION_BUCKET_SIZE (2 * EVACUATION_SIZE) |
#define | RECOVERY_SIZE EVACUATION_SIZE |
#define | AIO_NOT_IN_PROGRESS 0 |
#define | AIO_AGG_WRITE_IN_PROGRESS -1 |
#define | AUTO_SIZE_RAM_CACHE -1 |
#define | DEFAULT_TARGET_FRAGMENT_SIZE (1048576 - sizeofDoc) |
#define | dir_offset_evac_bucket(_o) (_o / (EVACUATION_BUCKET_SIZE / CACHE_BLOCK_SIZE)) |
#define | dir_evac_bucket(_e) dir_offset_evac_bucket(dir_offset(_e)) |
#define | offset_evac_bucket(_d, _o) dir_offset_evac_bucket((offset_to_vol_offset(_d, _o) |
#define | DOC_MAGIC ((uint32_t)0x5F129B13) |
#define | DOC_CORRUPT ((uint32_t)0xDEADBABE) |
#define | DOC_NO_CHECKSUM ((uint32_t)0xA0B0C0D0) |
#define | sizeofDoc (((uint32_t)(uintptr_t)&((Doc*)0)->checksum)+(uint32_t)sizeof(uint32_t)) |
Functions | |
TS_INLINE int | vol_headerlen (Vol *d) |
TS_INLINE size_t | vol_dirlen (Vol *d) |
TS_INLINE int | vol_direntries (Vol *d) |
TS_INLINE int | vol_out_of_phase_valid (Vol *d, Dir *e) |
TS_INLINE int | vol_out_of_phase_agg_valid (Vol *d, Dir *e) |
TS_INLINE int | vol_out_of_phase_write_valid (Vol *d, Dir *e) |
TS_INLINE int | vol_in_phase_valid (Vol *d, Dir *e) |
TS_INLINE off_t | vol_offset (Vol *d, Dir *e) |
TS_INLINE off_t | offset_to_vol_offset (Vol *d, off_t pos) |
TS_INLINE off_t | vol_offset_to_offset (Vol *d, off_t pos) |
TS_INLINE Dir * | vol_dir_segment (Vol *d, int s) |
TS_INLINE int | vol_in_phase_agg_buf_valid (Vol *d, Dir *e) |
TS_INLINE off_t | vol_relative_length (Vol *v, off_t start_offset) |
int | vol_dir_clear (Vol *d) |
int | vol_init (Vol *d, char *s, off_t blocks, off_t skip, bool clear) |
TS_INLINE EvacuationBlock * | evacuation_block_exists (Dir *dir, Vol *p) |
TS_INLINE EvacuationBlock * | new_EvacuationBlock (EThread *t) |
TS_INLINE void | free_EvacuationBlock (EvacuationBlock *b, EThread *t) |
Variables | |
Vol ** | gvol |
volatile int | gnvol |
ClassAllocator< OpenDirEntry > | openDirEntryAllocator |
ClassAllocator< EvacuationBlock > | evacuationBlockAllocator |
ClassAllocator< EvacuationKey > | evacuationKeyAllocator |
unsigned short * | vol_hash_table |
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 P_CacheVol.h.
#define AGG_HIGH_WATER (AGG_SIZE / 2) |
Definition at line 40 of file P_CacheVol.h.
Referenced by Vol::aggWrite().
#define AGG_SIZE (4 * 1024 * 1024) |
Definition at line 39 of file P_CacheVol.h.
Referenced by Vol::aggWrite(), Vol::evacuateWrite(), Vol::handle_recover_from_data(), CacheVC::handleWrite(), Vol::scan_for_pinned_documents(), Vol::Vol(), vol_out_of_phase_agg_valid(), and Vol::within_hit_evacuate_window().
#define AIO_AGG_WRITE_IN_PROGRESS -1 |
Definition at line 55 of file P_CacheVol.h.
#define AIO_NOT_IN_PROGRESS 0 |
Definition at line 54 of file P_CacheVol.h.
#define AUTO_SIZE_RAM_CACHE -1 |
Definition at line 56 of file P_CacheVol.h.
Referenced by CacheProcessor::cacheInitialized().
#define CACHE_BLOCK_SHIFT 9 |
Definition at line 28 of file P_CacheVol.h.
#define CACHE_BLOCK_SIZE (1<<CACHE_BLOCK_SHIFT) |
Definition at line 29 of file P_CacheVol.h.
Referenced by Vol::aggWriteDone(), Vol::evacuate_cleanup(), offset_to_vol_offset(), ShowCacheInternal::showVolVolumes(), vol_in_phase_valid(), vol_offset(), vol_offset_to_offset(), vol_out_of_phase_agg_valid(), vol_out_of_phase_valid(), vol_out_of_phase_write_valid(), and Vol::within_hit_evacuate_window().
#define DEFAULT_TARGET_FRAGMENT_SIZE (1048576 - sizeofDoc) |
Definition at line 57 of file P_CacheVol.h.
#define dir_evac_bucket | ( | _e | ) | dir_offset_evac_bucket(dir_offset(_e)) |
Definition at line 62 of file P_CacheVol.h.
Referenced by Vol::begin_read(), Vol::close_read(), evacuate_fragments(), CacheVC::evacuateDocDone(), Vol::evacuateDocReadDone(), evacuation_block_exists(), and Vol::force_evacuate_head().
#define dir_offset_evac_bucket | ( | _o | ) | (_o / (EVACUATION_BUCKET_SIZE / CACHE_BLOCK_SIZE)) |
Definition at line 60 of file P_CacheVol.h.
Referenced by Vol::evac_range(), and Vol::evacuate_cleanup().
#define DOC_CORRUPT ((uint32_t)0xDEADBABE) |
Definition at line 69 of file P_CacheVol.h.
Referenced by CacheVC::openReadReadDone(), CacheVC::openReadStartEarliest(), and CacheVC::openReadStartHead().
#define DOC_MAGIC ((uint32_t)0x5F129B13) |
Definition at line 68 of file P_CacheVol.h.
Referenced by Vol::evacuateDocReadDone(), CacheVC::evacuateReadHead(), Vol::handle_recover_from_data(), CacheVC::handleReadDone(), CacheVC::openReadReadDone(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::removeEvent(), and CacheVC::scanObject().
#define DOC_NO_CHECKSUM ((uint32_t)0xA0B0C0D0) |
Definition at line 70 of file P_CacheVol.h.
Referenced by CacheVC::handleReadDone().
#define EVACUATION_BUCKET_SIZE (2 * EVACUATION_SIZE) |
Definition at line 52 of file P_CacheVol.h.
Referenced by Vol::init().
#define EVACUATION_SIZE (2 * AGG_SIZE) |
Definition at line 41 of file P_CacheVol.h.
Referenced by Vol::aggWriteDone(), Vol::handle_recover_from_data(), and Vol::scan_for_pinned_documents().
#define LEAVE_FREE DEFAULT_MAX_BUFFER_SIZE |
Definition at line 46 of file P_CacheVol.h.
#define LOOKASIDE_SIZE 256 |
Definition at line 51 of file P_CacheVol.h.
#define MAX_FRAG_SIZE (AGG_SIZE - sizeofDoc) |
Definition at line 45 of file P_CacheVol.h.
Referenced by dir_insert(), dir_overwrite(), CacheVC::handleWrite(), CacheVC::openWriteClose(), CacheVC::openWriteCloseDataDone(), and CacheVC::openWriteMain().
#define MAX_VOL_BLOCKS (MAX_VOL_SIZE / CACHE_BLOCK_SIZE) |
Definition at line 44 of file P_CacheVol.h.
#define MAX_VOL_SIZE ((off_t)512 * 1024 * 1024 * 1024 * 1024) |
Definition at line 42 of file P_CacheVol.h.
Referenced by create_config(), CacheDisk::create_volume(), and Vol::init().
#define offset_evac_bucket | ( | _d, | ||
_o | ||||
) | dir_offset_evac_bucket((offset_to_vol_offset(_d, _o) |
Definition at line 63 of file P_CacheVol.h.
#define PIN_SCAN_EVERY 16 |
Definition at line 47 of file P_CacheVol.h.
Referenced by Vol::scan_for_pinned_documents().
#define RECOVERY_SIZE EVACUATION_SIZE |
Definition at line 53 of file P_CacheVol.h.
#define ROUND_TO | ( | _x, | ||
_y | ||||
) | INK_ALIGN((_x), (_y)) |
Definition at line 33 of file P_CacheVol.h.
#define ROUND_TO_CACHE_BLOCK | ( | _x | ) | INK_ALIGN((_x), CACHE_BLOCK_SIZE) |
Definition at line 31 of file P_CacheVol.h.
#define ROUND_TO_SECTOR | ( | _p, | ||
_x | ||||
) | INK_ALIGN((_x), _p->sector_size) |
Definition at line 32 of file P_CacheVol.h.
Referenced by Vol::round_to_approx_size().
#define ROUND_TO_STORE_BLOCK | ( | _x | ) | INK_ALIGN((_x), STORE_BLOCK_SIZE) |
Definition at line 30 of file P_CacheVol.h.
Referenced by Vol::handle_dir_clear(), Vol::handle_recover_from_data(), Vol::init(), CacheSync::mainEvent(), CacheDisk::open(), CacheProcessor::start_internal(), vol_dirlen(), and vol_headerlen().
#define sizeofDoc (((uint32_t)(uintptr_t)&((Doc*)0)->checksum)+(uint32_t)sizeof(uint32_t)) |
Definition at line 72 of file P_CacheVol.h.
Referenced by agg_copy(), Doc::data_len(), dir_insert(), dir_overwrite(), CacheVC::handleWrite(), Doc::hdr(), and Doc::prefix_len().
#define START_BLOCKS 16 |
Definition at line 37 of file P_CacheVol.h.
#define START_POS ((off_t)START_BLOCKS * CACHE_BLOCK_SIZE) |
Definition at line 38 of file P_CacheVol.h.
Referenced by Vol::init(), and CacheProcessor::start_internal().
#define STORE_BLOCKS_PER_CACHE_BLOCK (STORE_BLOCK_SIZE / CACHE_BLOCK_SIZE) |
Definition at line 43 of file P_CacheVol.h.
#define VOL_HASH_ALLOC_SIZE (8 * 1024 * 1024) |
Definition at line 50 of file P_CacheVol.h.
#define VOL_HASH_EMPTY 0xFFFF |
Definition at line 49 of file P_CacheVol.h.
Referenced by build_vol_hash_table().
#define VOL_HASH_TABLE_SIZE 32707 |
Definition at line 48 of file P_CacheVol.h.
Referenced by build_vol_hash_table(), and Cache::key_to_vol().
#define VOL_MAGIC 0xF1D0F00D |
Definition at line 36 of file P_CacheVol.h.
Referenced by Vol::handle_dir_read().
TS_INLINE EvacuationBlock* evacuation_block_exists | ( | Dir * | dir, | |
Vol * | p | |||
) |
Definition at line 815 of file P_CacheVol.h.
References EvacuationBlock::dir, dir_evac_bucket, dir_offset, Vol::evacuate, and DLL< C, L >::head.
Referenced by evacuate_fragments(), and Vol::force_evacuate_head().
TS_INLINE void free_EvacuationBlock | ( | EvacuationBlock * | b, | |
EThread * | t | |||
) |
Definition at line 845 of file P_CacheVol.h.
References EvacuationBlock::evac_frags, ClassAllocator< C >::free(), EvacuationKey::link, SLink< C >::next, and THREAD_FREE.
Referenced by Vol::close_read(), dir_lookaside_cleanup(), dir_lookaside_fixup(), dir_lookaside_remove(), and Vol::evacuate_cleanup_blocks().
TS_INLINE EvacuationBlock* new_EvacuationBlock | ( | EThread * | t | ) |
Definition at line 834 of file P_CacheVol.h.
References EvacuationBlock::earliest_evacuator, EvacuationBlock::evac_frags, EvacuationBlock::init, EvacuationKey::link, SLink< C >::next, EvacuationBlock::readers, and THREAD_ALLOC.
Referenced by Vol::begin_read(), dir_lookaside_insert(), evacuate_fragments(), and Vol::force_evacuate_head().
TS_INLINE off_t offset_to_vol_offset | ( | Vol * | d, | |
off_t | pos | |||
) |
Definition at line 749 of file P_CacheVol.h.
References CACHE_BLOCK_SIZE, and Vol::start.
Referenced by agg_copy(), Vol::evac_range(), Vol::handle_recover_from_data(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), and Vol::scan_for_pinned_documents().
int vol_dir_clear | ( | Vol * | d | ) |
Definition at line 1232 of file Cache.cc.
References Vol::fd, Vol::hash_text, Vol::raw_dir, Vol::skip, vol_clear_init(), vol_dirlen(), and Warning.
Referenced by Cache_dir().
Definition at line 761 of file P_CacheVol.h.
References Vol::buckets, Vol::dir, DIR_DEPTH, and SIZEOF_DIR.
TS_INLINE int vol_direntries | ( | Vol * | d | ) |
Definition at line 676 of file P_CacheVol.h.
References Vol::buckets, DIR_DEPTH, and Vol::segments.
Referenced by Cache_dir(), and Vol::scan_for_pinned_documents().
TS_INLINE size_t vol_dirlen | ( | Vol * | d | ) |
Definition at line 668 of file P_CacheVol.h.
References Vol::buckets, DIR_DEPTH, ROUND_TO_STORE_BLOCK, Vol::segments, SIZEOF_DIR, and vol_headerlen().
Referenced by cache_bytes_used(), CacheProcessor::cacheInitialized(), Vol::clear_dir(), Vol::handle_dir_clear(), Vol::handle_header_read(), Vol::handle_recover_from_data(), Vol::init(), CacheSync::mainEvent(), CacheProcessor::mark_storage_offline(), sync_cache_dir_on_shutdown(), vol_clear_init(), vol_dir_clear(), and vol_init_data_internal().
TS_INLINE int vol_headerlen | ( | Vol * | d | ) |
Definition at line 663 of file P_CacheVol.h.
References ROUND_TO_STORE_BLOCK, and Vol::segments.
Referenced by Vol::init(), and vol_dirlen().
Definition at line 767 of file P_CacheVol.h.
References Vol::agg_buf_pos, Vol::header, vol_offset(), and VolHeaderFooter::write_pos.
Definition at line 737 of file P_CacheVol.h.
References Vol::agg_buf_pos, CACHE_BLOCK_SIZE, dir_offset, Vol::header, Vol::start, and VolHeaderFooter::write_pos.
int vol_init | ( | Vol * | d, | |
char * | s, | |||
off_t | blocks, | |||
off_t | skip, | |||
bool | clear | |||
) |
Definition at line 743 of file P_CacheVol.h.
References CACHE_BLOCK_SIZE, dir_offset, and Vol::start.
Referenced by agg_copy(), dir_insert(), dir_overwrite(), Vol::evac_range(), Vol::evacuate_cleanup_blocks(), CacheVC::handleRead(), make_vol_map(), CacheVC::scanObject(), ShowCacheInternal::showVolEvacuations(), and vol_in_phase_agg_buf_valid().
TS_INLINE off_t vol_offset_to_offset | ( | Vol * | d, | |
off_t | pos | |||
) |
Definition at line 755 of file P_CacheVol.h.
References CACHE_BLOCK_SIZE, and Vol::start.
Referenced by make_vol_map(), next_in_map(), and CacheVC::scanObject().
Definition at line 725 of file P_CacheVol.h.
References VolHeaderFooter::agg_pos, AGG_SIZE, CACHE_BLOCK_SIZE, dir_offset, Vol::header, and Vol::start.
Definition at line 719 of file P_CacheVol.h.
References VolHeaderFooter::agg_pos, CACHE_BLOCK_SIZE, dir_offset, Vol::header, and Vol::start.
Definition at line 731 of file P_CacheVol.h.
References CACHE_BLOCK_SIZE, dir_offset, Vol::header, Vol::start, and VolHeaderFooter::write_pos.
TS_INLINE off_t vol_relative_length | ( | Vol * | v, | |
off_t | start_offset | |||
) |
Definition at line 774 of file P_CacheVol.h.
References Vol::len, and Vol::skip.
Referenced by make_vol_map(), and next_in_map().
Referenced by evacuate_fragments().
volatile int gnvol |
Definition at line 113 of file Cache.cc.
Referenced by cache_bytes_used(), Cache_dir(), CacheProcessor::cacheInitialized(), cplist_reconfigure(), CacheProcessor::db_check(), CacheProcessor::dir_check(), Vol::dir_init_done(), CacheProcessor::diskInitialized(), CacheSync::mainEvent(), CacheProcessor::mark_storage_offline(), ShowCacheInternal::showSegSegment(), ShowCacheInternal::showVolEvacuations(), and sync_cache_dir_on_shutdown().
Definition at line 112 of file Cache.cc.
Referenced by Cache_dir(), CacheSync::mainEvent(), and sync_cache_dir_on_shutdown().
ClassAllocator<OpenDirEntry> openDirEntryAllocator |
Referenced by OpenDir::close_write(), and OpenDir::open_write().
unsigned short* vol_hash_table |