From: Alex Rousskov Date: Tue, 8 Feb 2011 04:04:57 +0000 (-0700) Subject: Destroy unused entries so that they do not keep Rock::SwapDir slots locked. X-Git-Tag: take02 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=984f9874147e3da49705867ab83506ad80af86b8;p=thirdparty%2Fsquid.git 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. --- 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);