]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/fs/rock/RockSwapDir.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / fs / rock / RockSwapDir.cc
index 6e65ccff05158574d5c047e6e979c2d2d29a53cc..294e7b5cc8ab13a484d8aabb0168f49d531db9bc 100644 (file)
@@ -1,7 +1,13 @@
 /*
- * DEBUG: section 47    Store Directory Routines
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
+/* DEBUG: section 47    Store Directory Routines */
+
 #include "squid.h"
 #include "cache_cf.h"
 #include "CollapsedForwarding.h"
@@ -33,8 +39,8 @@
 const int64_t Rock::SwapDir::HeaderSize = 16*1024;
 
 Rock::SwapDir::SwapDir(): ::SwapDir("rock"),
-        slotSize(HeaderSize), filePath(NULL), map(NULL), io(NULL),
-        waitingForPage(NULL)
+    slotSize(HeaderSize), filePath(NULL), map(NULL), io(NULL),
+    waitingForPage(NULL)
 {
 }
 
@@ -46,7 +52,7 @@ Rock::SwapDir::~SwapDir()
 }
 
 StoreSearch *
-Rock::SwapDir::search(String const url, HttpRequest *)
+Rock::SwapDir::search(String const, HttpRequest *)
 {
     assert(false);
     return NULL; // XXX: implement
@@ -89,7 +95,7 @@ Rock::SwapDir::anchorCollapsed(StoreEntry &collapsed, bool &inSync)
 
     sfileno filen;
     const Ipc::StoreMapAnchor *const slot = map->openForReading(
-                                                reinterpret_cast<cache_key*>(collapsed.key), filen);
+            reinterpret_cast<cache_key*>(collapsed.key), filen);
     if (!slot)
         return false;
 
@@ -804,7 +810,7 @@ Rock::SwapDir::closeCompleted()
 }
 
 void
-Rock::SwapDir::readCompleted(const char *buf, int rlen, int errflag, RefCount< ::ReadRequest> r)
+Rock::SwapDir::readCompleted(const char *, int rlen, int errflag, RefCount< ::ReadRequest> r)
 {
     ReadRequest *request = dynamic_cast<Rock::ReadRequest*>(r.getRaw());
     assert(request);
@@ -817,7 +823,7 @@ Rock::SwapDir::readCompleted(const char *buf, int rlen, int errflag, RefCount< :
 }
 
 void
-Rock::SwapDir::writeCompleted(int errflag, size_t rlen, RefCount< ::WriteRequest> r)
+Rock::SwapDir::writeCompleted(int errflag, size_t, RefCount< ::WriteRequest> r)
 {
     Rock::WriteRequest *request = dynamic_cast<Rock::WriteRequest*>(r.getRaw());
     assert(request);
@@ -972,24 +978,24 @@ Rock::SwapDir::statfs(StoreEntry &e) const
     const int slotLimit = slotLimitActual();
     storeAppendPrintf(&e, "Maximum entries: %9d\n", entryLimit);
     if (map && entryLimit > 0) {
-            const int entryCount = map->entryCount();
-            storeAppendPrintf(&e, "Current entries: %9d %.2f%%\n",
-                              entryCount, (100.0 * entryCount / entryLimit));
+        const int entryCount = map->entryCount();
+        storeAppendPrintf(&e, "Current entries: %9d %.2f%%\n",
+                          entryCount, (100.0 * entryCount / entryLimit));
     }
 
     storeAppendPrintf(&e, "Maximum slots:   %9d\n", slotLimit);
     if (map && slotLimit > 0) {
-            const unsigned int slotsFree = !freeSlots ? 0 : freeSlots->size();
-            if (slotsFree <= static_cast<const unsigned int>(slotLimit)) {
-                const int usedSlots = slotLimit - static_cast<const int>(slotsFree);
-                storeAppendPrintf(&e, "Used slots:      %9d %.2f%%\n",
-                                  usedSlots, (100.0 * usedSlots / slotLimit));
-            }
-            if (slotLimit < 100) { // XXX: otherwise too expensive to count
-                Ipc::ReadWriteLockStats stats;
-                map->updateStats(stats);
-                stats.dump(e);
-            }
+        const unsigned int slotsFree = !freeSlots ? 0 : freeSlots->size();
+        if (slotsFree <= static_cast<const unsigned int>(slotLimit)) {
+            const int usedSlots = slotLimit - static_cast<const int>(slotsFree);
+            storeAppendPrintf(&e, "Used slots:      %9d %.2f%%\n",
+                              usedSlots, (100.0 * usedSlots / slotLimit));
+        }
+        if (slotLimit < 100) { // XXX: otherwise too expensive to count
+            Ipc::ReadWriteLockStats stats;
+            map->updateStats(stats);
+            stats.dump(e);
+        }
     }
 
     storeAppendPrintf(&e, "Pending operations: %d out of %d\n",
@@ -1061,3 +1067,4 @@ Rock::SwapDirRr::~SwapDirRr()
         delete freeSlotsOwners[i];
     }
 }
+