Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions include/iocore/cache/CacheVC.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ struct CacheVC : public CacheVConnection {
int
get_volume_number() const override
{
if (vol && vol->cache_vol) {
return vol->cache_vol->vol_number;
if (stripe && stripe->cache_vol) {
return stripe->cache_vol->vol_number;
}

return -1;
Expand All @@ -119,8 +119,8 @@ struct CacheVC : public CacheVConnection {
const char *
get_disk_path() const override
{
if (vol && vol->disk) {
return vol->disk->path;
if (stripe && stripe->disk) {
return stripe->disk->path;
}

return nullptr;
Expand Down Expand Up @@ -176,7 +176,7 @@ struct CacheVC : public CacheVConnection {

int removeEvent(int event, Event *e);

int scanVol(int event, Event *e);
int scanStripe(int event, Event *e);
int scanObject(int event, Event *e);
int scanUpdateDone(int event, Event *e);
int scanOpenWrite(int event, Event *e);
Expand Down Expand Up @@ -265,7 +265,7 @@ struct CacheVC : public CacheVConnection {
uint32_t write_len; // for communicating with agg_copy
uint32_t agg_len; // for communicating with aggWrite
uint32_t write_serial; // serial of the final write for SYNC
Stripe *vol;
Stripe *stripe;
Dir *last_collision;
Event *trigger;
CacheKey *read_key;
Expand Down Expand Up @@ -320,7 +320,7 @@ struct CacheVC : public CacheVConnection {
};
// BTF optimization used to skip reading stuff in cache partition that doesn't contain any
// dir entries.
char *scan_vol_map;
char *scan_stripe_map;
// BTF fix to handle objects that overlapped over two different reads,
// this is how much we need to back up the buffer to get the start of the overlapping object.
off_t scan_fix_buffer_offset;
Expand Down
4 changes: 2 additions & 2 deletions src/iocore/cache/Cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ Cache::lookup(Continuation *cont, const CacheKey *key, CacheFragType type, const
c->first_key = c->key = *key;
c->frag_type = type;
c->f.lookup = 1;
c->vol = stripe;
c->stripe = stripe;
c->last_collision = nullptr;

if (c->handleEvent(EVENT_INTERVAL, nullptr) == EVENT_CONT) {
Expand Down Expand Up @@ -1242,7 +1242,7 @@ Cache::remove(Continuation *cont, const CacheKey *key, CacheFragType type, const
Metrics::Gauge::increment(cache_rsb.status[c->op_type].active);
Metrics::Gauge::increment(stripe->cache_vol->vol_rsb.status[c->op_type].active);
c->first_key = c->key = *key;
c->vol = stripe;
c->stripe = stripe;
c->dir = result;
c->f.remove = 1;

Expand Down
8 changes: 4 additions & 4 deletions src/iocore/cache/CacheDir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ OpenDir::OpenDir()
int
OpenDir::open_write(CacheVC *cont, int allow_if_writers, int max_writers)
{
ink_assert(cont->vol->mutex->thread_holding == this_ethread());
ink_assert(cont->stripe->mutex->thread_holding == this_ethread());
unsigned int h = cont->first_key.slice32(0);
int b = h % OPEN_DIR_BUCKETS;
for (OpenDirEntry *d = bucket[b].head; d; d = d->link.next) {
Expand Down Expand Up @@ -135,7 +135,7 @@ OpenDir::signal_readers(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
int
OpenDir::close_write(CacheVC *cont)
{
ink_assert(cont->vol->mutex->thread_holding == this_ethread());
ink_assert(cont->stripe->mutex->thread_holding == this_ethread());
cont->od->writers.remove(cont);
cont->od->num_writers--;
if (!cont->od->writers.head) {
Expand Down Expand Up @@ -167,10 +167,10 @@ OpenDir::open_read(const CryptoHash *key) const
int
OpenDirEntry::wait(CacheVC *cont, int msec)
{
ink_assert(cont->vol->mutex->thread_holding == this_ethread());
ink_assert(cont->stripe->mutex->thread_holding == this_ethread());
cont->f.open_read_timeout = 1;
ink_assert(!cont->trigger);
cont->trigger = cont->vol->mutex->thread_holding->schedule_in_local(cont, HRTIME_MSECONDS(msec));
cont->trigger = cont->stripe->mutex->thread_holding->schedule_in_local(cont, HRTIME_MSECONDS(msec));
readers.push(cont);
return EVENT_CONT;
}
Expand Down
30 changes: 15 additions & 15 deletions src/iocore/cache/CacheEvacuateDocVC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ DbgCtl dbg_ctl_cache_evac{"cache_evac"};
int
CacheEvacuateDocVC::evacuateDocDone(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
{
ink_assert(this->vol->mutex->thread_holding == this_ethread());
ink_assert(this->stripe->mutex->thread_holding == this_ethread());
Doc *doc = reinterpret_cast<Doc *>(this->buf->data());
DDbg(dbg_ctl_cache_evac, "evacuateDocDone %X o %d p %d new_o %d new_p %d", (int)key.slice32(0),
(int)dir_offset(&this->overwrite_dir), (int)dir_phase(&this->overwrite_dir), (int)dir_offset(&this->dir),
(int)dir_phase(&this->dir));
int i = dir_evac_bucket(&this->overwrite_dir);
// nasty beeping race condition, need to have the EvacuationBlock here
EvacuationBlock *b = this->vol->evac_bucket_valid(i) ? this->vol->evacuate[i].head : nullptr;
EvacuationBlock *b = this->stripe->evac_bucket_valid(i) ? this->stripe->evacuate[i].head : nullptr;
for (; b; b = b->link.next) {
if (dir_offset(&b->dir) == dir_offset(&this->overwrite_dir)) {
// If the document is single fragment (although not tied to the vector),
Expand All @@ -80,17 +80,17 @@ CacheEvacuateDocVC::evacuateDocDone(int /* event ATS_UNUSED */, Event * /* e ATS
evac->earliest_key.slice32(0));
EvacuationBlock *eblock = nullptr;
Dir dir_tmp;
dir_lookaside_probe(&evac->earliest_key, this->vol, &dir_tmp, &eblock);
dir_lookaside_probe(&evac->earliest_key, this->stripe, &dir_tmp, &eblock);
if (eblock) {
CacheEvacuateDocVC *earliest_evac = eblock->earliest_evacuator;
earliest_evac->total_len += doc->data_len();
if (earliest_evac->total_len == earliest_evac->doc_len) {
dir_lookaside_fixup(&evac->earliest_key, this->vol);
dir_lookaside_fixup(&evac->earliest_key, this->stripe);
free_CacheVC(earliest_evac);
}
}
}
dir_overwrite(&doc->key, this->vol, &this->dir, &this->overwrite_dir);
dir_overwrite(&doc->key, this->stripe, &this->dir, &this->overwrite_dir);
}
// if the tag in the overwrite_dir matches the first_key in the
// document, then it has to be the vector. We guarantee that
Expand All @@ -105,15 +105,15 @@ CacheEvacuateDocVC::evacuateDocDone(int /* event ATS_UNUSED */, Event * /* e ATS
OpenDirEntry *cod;
DDbg(dbg_ctl_cache_evac, "evacuating vector: %X %d", (int)doc->first_key.slice32(0),
(int)dir_offset(&this->overwrite_dir));
if ((cod = this->vol->open_read(&doc->first_key))) {
if ((cod = this->stripe->open_read(&doc->first_key))) {
// writer exists
DDbg(dbg_ctl_cache_evac, "overwriting the open directory %X %d %d", (int)doc->first_key.slice32(0),
(int)dir_offset(&cod->first_dir), (int)dir_offset(&this->dir));
cod->first_dir = this->dir;
}
if (dir_overwrite(&doc->first_key, this->vol, &this->dir, &this->overwrite_dir)) {
if (dir_overwrite(&doc->first_key, this->stripe, &this->dir, &this->overwrite_dir)) {
int64_t o = dir_offset(&this->overwrite_dir), n = dir_offset(&this->dir);
this->vol->ram_cache->fixup(&doc->first_key, static_cast<uint64_t>(o), static_cast<uint64_t>(n));
this->stripe->ram_cache->fixup(&doc->first_key, static_cast<uint64_t>(o), static_cast<uint64_t>(n));
}
} else {
DDbg(dbg_ctl_cache_evac, "evacuating earliest: %X %d", (int)doc->key.slice32(0), (int)dir_offset(&this->overwrite_dir));
Expand All @@ -122,8 +122,8 @@ CacheEvacuateDocVC::evacuateDocDone(int /* event ATS_UNUSED */, Event * /* e ATS
this->total_len += doc->data_len();
this->first_key = doc->first_key;
this->earliest_dir = this->dir;
if (dir_probe(&this->first_key, this->vol, &this->dir, &last_collision) > 0) {
dir_lookaside_insert(b, this->vol, &this->earliest_dir);
if (dir_probe(&this->first_key, this->stripe, &this->dir, &last_collision) > 0) {
dir_lookaside_insert(b, this->stripe, &this->earliest_dir);
// read the vector
SET_HANDLER(&CacheEvacuateDocVC::evacuateReadHead);
int ret = do_read_call(&this->first_key);
Expand All @@ -144,15 +144,15 @@ int
CacheEvacuateDocVC::evacuateReadHead(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
{
// The evacuator vc shares the lock with the volition mutex
ink_assert(this->vol->mutex->thread_holding == this_ethread());
ink_assert(this->stripe->mutex->thread_holding == this_ethread());
cancel_trigger();
Doc *doc = reinterpret_cast<Doc *>(this->buf->data());
CacheHTTPInfo *alternate_tmp = nullptr;
if (!io.ok()) {
goto Ldone;
}
// a directory entry which is no longer valid may have been overwritten
if (!dir_valid(this->vol, &this->dir)) {
if (!dir_valid(this->stripe, &this->dir)) {
last_collision = nullptr;
goto Lcollision;
}
Expand Down Expand Up @@ -188,19 +188,19 @@ CacheEvacuateDocVC::evacuateReadHead(int /* event ATS_UNUSED */, Event * /* e AT
if (doc_len == this->total_len) {
// the whole document has been evacuated. Insert the directory
// entry in the directory.
dir_lookaside_fixup(&earliest_key, this->vol);
dir_lookaside_fixup(&earliest_key, this->stripe);
return free_CacheVC(this);
}
return EVENT_CONT;
Lcollision:
if (dir_probe(&this->first_key, this->vol, &this->dir, &last_collision)) {
if (dir_probe(&this->first_key, this->stripe, &this->dir, &last_collision)) {
int ret = do_read_call(&this->first_key);
if (ret == EVENT_RETURN) {
return handleEvent(AIO_EVENT_DONE, nullptr);
}
return ret;
}
Ldone:
dir_lookaside_remove(&earliest_key, this->vol);
dir_lookaside_remove(&earliest_key, this->stripe);
return free_CacheVC(this);
}
Loading