Commit 31e20792 authored by Zardosht Kasheff's avatar Zardosht Kasheff

This checkin was meant for a branch. Undoing

Revert "stuff"

This reverts commit 2423c9d0.
parent 2423c9d0
......@@ -380,9 +380,7 @@ public:
toku_pthread_rwlock_t m_pending_lock_cheap;
void init();
void destroy();
void evict_completely(PAIR pair);
void evict_from_cachetable(PAIR pair);
void evict_from_cachefile(PAIR pair);
void evict(PAIR pair);
void put(PAIR pair);
PAIR find_pair(CACHEFILE file, CACHEKEY key, uint32_t hash);
void pending_pairs_remove (PAIR p);
......
......@@ -534,12 +534,12 @@ static void pair_touch (PAIR p) {
p->count = (p->count < CLOCK_SATURATION) ? p->count+1 : CLOCK_SATURATION;
}
// Remove a pair from the cachetable, requires write list lock to be held and p->mutex to be held
// Remove a pair from the cachetable
// Effects: the pair is removed from the LRU list and from the cachetable's hash table.
// The size of the objects in the cachetable is adjusted by the size of the pair being
// removed.
static void cachetable_remove_pair (pair_list* list, evictor* ev, PAIR p) {
list->evict_completely(p);
list->evict(p);
ev->remove_pair_attr(p->attr);
}
......@@ -3250,31 +3250,20 @@ void pair_list::put(PAIR p) {
m_n_in_table++;
}
// This removes the given pair from completely from the pair list.
// This removes the given pair from the pair list.
//
// requires caller to have grabbed write lock on list, and p->mutex held
// requires caller to have grabbed write lock on list.
//
void pair_list::evict_completely(PAIR p) {
this->evict_from_cachetable(p);
this->evict_from_cachefile(p);
}
// Removes the PAIR from the cachetable's lists,
// but does NOT impact the list maintained by the cachefile
void pair_list::evict_from_cachetable(PAIR p) {
void pair_list::evict(PAIR p) {
this->pair_remove(p);
this->pending_pairs_remove(p);
this->cf_pairs_remove(p);
this->remove_from_hash_chain(p);
assert(m_n_in_table > 0);
m_n_in_table--;
}
// Removes the PAIR from the cachefile's list of PAIRs
void pair_list::evict_from_cachefile(PAIR p) {
this->cf_pairs_remove(p);
}
//
// Remove pair from linked list for cleaner/clock
//
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment