]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not start rebuilding cache_dir (i.e., loading its index into RAM) until we
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 1 Feb 2011 20:27:13 +0000 (13:27 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 1 Feb 2011 20:27:13 +0000 (13:27 -0700)
complete cache_dir initialization sequence, which ends in not in
Rock::SwapDir::init but in Rock::SwapDir::ioCompletedNotification where we
open the shared map or bail on errors.

It does not make sense to start loading index before the map is configured
because there will be no place to store loaded information.

src/fs/rock/RockSwapDir.cc

index d9a1ccb5758c3a6b9bb1ed320e7bf2a4abecb4c5..6f8e04c765ae59793c8acbca065a80d94f19f97f 100644 (file)
@@ -185,8 +185,6 @@ Rock::SwapDir::init()
 
     theFile = io->newFile(filePath);
     theFile->open(O_RDWR, 0644, this);
-
-    rebuild();
 }
 
 void
@@ -453,6 +451,8 @@ Rock::SwapDir::ioCompletedNotification()
     debugs(47,1, "Rock cache_dir[" << index << "] limits: " << 
         std::setw(12) << maximumSize() << " disk bytes and " <<
         std::setw(7) << map->entryLimit() << " entries");
+
+    rebuild();
 }
 
 void