From 984f9874147e3da49705867ab83506ad80af86b8 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Mon, 7 Feb 2011 21:04:57 -0700 Subject: [PATCH] Destroy unused entries so that they do not keep Rock::SwapDir slots locked. May need more work to identify all cases where [un]locked entries are [un]used. --- src/store.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/store.cc b/src/store.cc index 19f4c4322e..87a7e66ef4 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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(this)); + return 0; + } else if (keepInMemory()) { Store::Root().dereference(*this); setMemStatus(IN_MEMORY); -- 2.47.2