From: Amos Jeffries Date: Wed, 1 Aug 2012 11:54:23 +0000 (+1200) Subject: Revert r12231 - seems to break SMP cache X-Git-Tag: sourceformat-review-1~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c02fb44004320cf15a8a777fe2df414bb2be630;p=thirdparty%2Fsquid.git Revert r12231 - seems to break SMP cache --- diff --git a/src/store_dir.cc b/src/store_dir.cc index eb84dcd184..ace530e68b 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -708,28 +708,25 @@ StoreController::reference(StoreEntry &e) bool StoreController::dereference(StoreEntry & e) { + bool keepInStoreTable = true; // keep if there are no objections + // special entries do not belong to any specific Store, but are IN_MEMORY if (EBIT_TEST(e.flags, ENTRY_SPECIAL)) - return true; - - bool keepInStoreTable = false; // keep only if somebody needs it there + return keepInStoreTable; /* 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) { if (mem_policy->Dereferenced) mem_policy->Dereferenced(mem_policy, &e, &e.mem_obj->repl); - // non-shared memory cache relies on store_table - if (!memStore) - keepInStoreTable = true || keepInStoreTable; } return keepInStoreTable; @@ -837,7 +834,7 @@ StoreController::handleIdleEntry(StoreEntry &e) (mem_node::InUseCount() <= store_pages_max); } - // An idle, unlocked entry that only belongs to a SwapDir which controls + // An idle, unlocked entry that belongs to a SwapDir which controls // its own index, should not stay in the global store_table. if (!dereference(e)) { debugs(20, 5, HERE << "destroying unlocked entry: " << &e << ' ' << e);