Before this change, we destroyed unused/idle StoreEntries if nobody was voting
to keep them in store_table. That blocked non-shared memory cache from getting
new entries if there were no cache_dirs to vote for them, which is wrong. The
new code keeps unused/idle StoreEntries in store_table if nobody objects.
bool
StoreController::dereference(StoreEntry & e)
{
- bool keepInStoreTable = false;
+ bool keepInStoreTable = true; // keep if there are no objections
/* Notify the fs that we're not referencing this object any more */
if (e.swap_filen > -1)
- keepInStoreTable = swapDir->dereference(e) || keepInStoreTable;
+ keepInStoreTable = swapDir->dereference(e) && keepInStoreTable;
// Notify the memory cache that we're not referencing this object any more
if (memStore && e.mem_status == IN_MEMORY)
- keepInStoreTable = memStore->dereference(e) || keepInStoreTable;
+ keepInStoreTable = memStore->dereference(e) && keepInStoreTable;
// TODO: move this code to a non-shared memory cache class when we have it
if (e.mem_obj) {