]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Removed temporary code disabling Rock::SwapDir::maintain().
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 7 Feb 2011 18:55:41 +0000 (11:55 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 7 Feb 2011 18:55:41 +0000 (11:55 -0700)
Standard code now works because we do not create a replacement policy.

Polished/optimized Rock::SwapDir::maintain() guards.

src/fs/rock/RockSwapDir.cc

index 701f22d3df297a7f8d2524d9ddf222c576fdad19..0a7445f14a3ec2347c91249c02a026a02410616f 100644 (file)
@@ -220,6 +220,8 @@ Rock::SwapDir::parse(int anIndex, char *aPath)
     parseSize();
     parseOptions(0);
 
+    // Current openForWriting() code overwrites the old slot if needed
+    // and possible, so proactively removing old slots is probably useless.
     assert(!repl); // repl = createRemovalPolicy(Config.replPolicy);
 
     validateOptions();
@@ -525,26 +527,22 @@ Rock::SwapDir::diskFull() {
 void
 Rock::SwapDir::maintain()
 {
-    // Current openForWriting() code does not search for an empty
-    // slot so removing old slots will not make any difference.
-    return;
-
-    if (!map)
-        return;
-
     debugs(47,3, HERE << "cache_dir[" << index << "] guards: " << 
-        StoreController::store_dirs_rebuilding << !repl << !full());
-
-    // XXX: UFSSwapDir::maintain says we must quit during rebuild
-    if (StoreController::store_dirs_rebuilding)
-        return;
+        !repl << !map << !full() << StoreController::store_dirs_rebuilding);
 
     if (!repl)
         return; // no means (cannot find a victim)
 
+    if (!map)
+        return; // no victims (yet)
+
     if (!full())
         return; // no need (to find a victim)
 
+    // XXX: UFSSwapDir::maintain says we must quit during rebuild
+    if (StoreController::store_dirs_rebuilding)
+        return;
+
     debugs(47,3, HERE << "cache_dir[" << index << "] state: " << 
         map->full() << ' ' << currentSize() << " < " << diskOffsetLimit());