]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Revert r12231 - seems to break SMP cache
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 1 Aug 2012 11:54:23 +0000 (23:54 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 1 Aug 2012 11:54:23 +0000 (23:54 +1200)
src/store_dir.cc

index eb84dcd18429081fd4c03610931aa9153d33dbdb..ace530e68b89689f7cabb2672609b62657e934d1 100644 (file)
@@ -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);