]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/store_rebuild.cc
Removed squid-old.h
[thirdparty/squid.git] / src / store_rebuild.cc
index 3f49a355a08c4c281b98c4ba4371cf28f0098895..e6cf618a81578dd05b3f4c4b9effd3ccdf9500a0 100644 (file)
  *
  */
 
-#include "squid-old.h"
+#include "squid.h"
 #include "event.h"
+#include "globals.h"
+#include "md5.h"
+#include "protos.h"
 #include "StatCounters.h"
 #include "Store.h"
 #include "SwapDir.h"
@@ -92,7 +95,7 @@ storeCleanup(void *datanotused)
 
         if (opt_store_doublecheck)
             if (storeCleanupDoubleCheck(e))
-                store_errors++;
+                ++store_errors;
 
         EBIT_SET(e->flags, ENTRY_VALIDATED);
 
@@ -103,14 +106,14 @@ storeCleanup(void *datanotused)
 
         if ((++validated & 0x3FFFF) == 0)
             /* TODO format the int with with a stream operator */
-            debugs(20, 1, "  " << validated << " Entries Validated so far.");
+            debugs(20, DBG_IMPORTANT, "  " << validated << " Entries Validated so far.");
     }
 
     if (currentSearch->isDone()) {
-        debugs(20, 1, "  Completed Validation Procedure");
-        debugs(20, 1, "  Validated " << validated << " Entries");
-        debugs(20, 1, "  store_swap_size = " << Store::Root().currentSize() / 1024.0 << " KB");
-        StoreController::store_dirs_rebuilding--;
+        debugs(20, DBG_IMPORTANT, "  Completed Validation Procedure");
+        debugs(20, DBG_IMPORTANT, "  Validated " << validated << " Entries");
+        debugs(20, DBG_IMPORTANT, "  store_swap_size = " << Store::Root().currentSize() / 1024.0 << " KB");
+        --StoreController::store_dirs_rebuilding;
         assert(0 == StoreController::store_dirs_rebuilding);
 
         if (opt_store_doublecheck && store_errors) {
@@ -155,18 +158,18 @@ storeRebuildComplete(struct _store_rebuild_data *dc)
 
     dt = tvSubDsec(rebuild_start, current_time);
 
-    debugs(20, 1, "Finished rebuilding storage from disk.");
-    debugs(20, 1, "  " << std::setw(7) << counts.scancount  << " Entries scanned");
-    debugs(20, 1, "  " << std::setw(7) << counts.invalid  << " Invalid entries.");
-    debugs(20, 1, "  " << std::setw(7) << counts.badflags  << " With invalid flags.");
-    debugs(20, 1, "  " << std::setw(7) << counts.objcount  << " Objects loaded.");
-    debugs(20, 1, "  " << std::setw(7) << counts.expcount  << " Objects expired.");
-    debugs(20, 1, "  " << std::setw(7) << counts.cancelcount  << " Objects cancelled.");
-    debugs(20, 1, "  " << std::setw(7) << counts.dupcount  << " Duplicate URLs purged.");
-    debugs(20, 1, "  " << std::setw(7) << counts.clashcount  << " Swapfile clashes avoided.");
-    debugs(20, 1, "  Took "<< std::setw(3)<< std::setprecision(2) << dt << " seconds ("<< std::setw(6) <<
+    debugs(20, DBG_IMPORTANT, "Finished rebuilding storage from disk.");
+    debugs(20, DBG_IMPORTANT, "  " << std::setw(7) << counts.scancount  << " Entries scanned");
+    debugs(20, DBG_IMPORTANT, "  " << std::setw(7) << counts.invalid  << " Invalid entries.");
+    debugs(20, DBG_IMPORTANT, "  " << std::setw(7) << counts.badflags  << " With invalid flags.");
+    debugs(20, DBG_IMPORTANT, "  " << std::setw(7) << counts.objcount  << " Objects loaded.");
+    debugs(20, DBG_IMPORTANT, "  " << std::setw(7) << counts.expcount  << " Objects expired.");
+    debugs(20, DBG_IMPORTANT, "  " << std::setw(7) << counts.cancelcount  << " Objects cancelled.");
+    debugs(20, DBG_IMPORTANT, "  " << std::setw(7) << counts.dupcount  << " Duplicate URLs purged.");
+    debugs(20, DBG_IMPORTANT, "  " << std::setw(7) << counts.clashcount  << " Swapfile clashes avoided.");
+    debugs(20, DBG_IMPORTANT, "  Took "<< std::setw(3)<< std::setprecision(2) << dt << " seconds ("<< std::setw(6) <<
            ((double) counts.objcount / (dt > 0.0 ? dt : 1.0)) << " objects/sec).");
-    debugs(20, 1, "Beginning Validation Procedure");
+    debugs(20, DBG_IMPORTANT, "Beginning Validation Procedure");
 
     eventAdd("storeCleanup", storeCleanup, NULL, 0.0, 1);
 
@@ -227,12 +230,12 @@ storeRebuildProgress(int sd_index, int total, int sofar)
     if (squid_curtime - last_report < 15)
         return;
 
-    for (sd_index = 0; sd_index < Config.cacheSwap.n_configured; sd_index++) {
+    for (sd_index = 0; sd_index < Config.cacheSwap.n_configured; ++sd_index) {
         n += (double) RebuildProgress[sd_index].scanned;
         d += (double) RebuildProgress[sd_index].total;
     }
 
-    debugs(20, 1, "Store rebuilding is "<< std::setw(4)<< std::setprecision(2) << 100.0 * n / d << "% complete");
+    debugs(20, DBG_IMPORTANT, "Store rebuilding is "<< std::setw(4)<< std::setprecision(2) << 100.0 * n / d << "% complete");
     last_report = squid_curtime;
 }
 
@@ -297,7 +300,7 @@ storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf,
     assert(buf.hasSpace()); // caller must allocate
 
     const int len = FD_READ_METHOD(fd, buf.space(), buf.spaceSize());
-    statCounter.syscalls.disk.reads++;
+    ++ statCounter.syscalls.disk.reads;
     if (len < 0) {
         const int xerrno = errno;
         debugs(47, DBG_IMPORTANT, "WARNING: cache_dir[" << diskIndex << "]: " <<
@@ -368,7 +371,7 @@ storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key,
     }
 
     if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) {
-        counts.badflags++;
+        ++ counts.badflags;
         return false;
     }
 
@@ -402,7 +405,7 @@ storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key,
         if (e->lastref >= tmpe.lastref) {
             /* key already exists, old entry is newer */
             /* keep old, ignore new */
-            counts.dupcount++;
+            ++counts.dupcount;
 
             // For some stores, get() creates/unpacks a store entry. Signal
             // such stores that we will no longer use the get() result:
@@ -414,7 +417,7 @@ storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key,
             /* URL already exists, this swapfile not being used */
             /* junk old, load new */
             e->release();      /* release old entry */
-            counts.dupcount++;
+            ++counts.dupcount;
         }
     }