]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Destroy unused entries so that they do not keep Rock::SwapDir slots locked. take02
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 8 Feb 2011 04:04:57 +0000 (21:04 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 8 Feb 2011 04:04:57 +0000 (21:04 -0700)
May need more work to identify all cases where [un]locked entries are [un]used.

src/store.cc

index 19f4c4322e548fab4f26384349f0699d10c24014..87a7e66ef46184469e95401f725445129d7f5a63 100644 (file)
@@ -526,7 +526,20 @@ StoreEntry::unlock()
     assert(storePendingNClients(this) == 0);
 
     if (EBIT_TEST(flags, RELEASE_REQUEST))
+    {
         this->release();
+        return 0;
+    }
+
+    // XXX: Rock store specific: since each SwapDir controls the index,
+    // unlocked entries should not stay in the global store_table
+    if (fileno >= 0) {
+        Store::Root().dereference(*this);
+        debugs(20, 5, HERE << "destroying unlocked entry: " << this << ' ' << *this);
+        setMemStatus(NOT_IN_MEMORY);
+        destroyStoreEntry(static_cast<hash_link *>(this));
+        return 0;
+    }
     else if (keepInMemory()) {
         Store::Root().dereference(*this);
         setMemStatus(IN_MEMORY);