From f428c9c432f287e7fba4371527918dc73720b9d4 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Mon, 7 Feb 2011 11:55:41 -0700 Subject: [PATCH] Removed temporary code disabling Rock::SwapDir::maintain(). Standard code now works because we do not create a replacement policy. Polished/optimized Rock::SwapDir::maintain() guards. --- src/fs/rock/RockSwapDir.cc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/fs/rock/RockSwapDir.cc b/src/fs/rock/RockSwapDir.cc index 701f22d3df..0a7445f14a 100644 --- a/src/fs/rock/RockSwapDir.cc +++ b/src/fs/rock/RockSwapDir.cc @@ -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()); -- 2.47.2