]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Renamed _store_rebuild_data to StoreRebuildData, moved it to store_rebuild.h
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 6 Sep 2012 14:22:03 +0000 (16:22 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 6 Sep 2012 14:22:03 +0000 (16:22 +0200)
src/fs/coss/store_dir_coss.cc
src/fs/rock/RockRebuild.h
src/fs/ufs/RebuildState.h
src/store_rebuild.cc
src/store_rebuild.h
src/structs.h
src/tests/stub_store_rebuild.cc

index b797edd12ef016a455fcde318bbd0d16bf42c8d3..6601d20aa8c1bba5be74ed72f6072d25f9a26251 100644 (file)
@@ -77,7 +77,7 @@ struct _RebuildState {
         unsigned int clean:1;
     } flags;
 
-    struct _store_rebuild_data counts;
+    StoreRebuildData counts;
 };
 
 static char *storeCossDirSwapLogFile(SwapDir *, const char *);
index 20d025156aedd1eb5226413d7573716fe0d1a0e1..f4864633bd40e33235cd774430d06032ec390ba6 100644 (file)
@@ -2,7 +2,8 @@
 #define SQUID_FS_ROCK_REBUILD_H
 
 #include "base/AsyncJob.h"
-#include "structs.h"
+#include "cbdata.h"
+#include "store_rebuild.h"
 
 namespace Rock
 {
@@ -39,7 +40,7 @@ private:
     int64_t dbOffset;
     int filen;
 
-    struct _store_rebuild_data counts;
+    StoreRebuildData counts;
 
     static void Steps(void *data);
 
index 9a7d7c5760159e98124958870020462bc5229b08..29f69fea2e4a86d381915fa7733cf391ed6fb171 100644 (file)
@@ -32,8 +32,8 @@
 
 #include "RefCount.h"
 #include "UFSSwapDir.h"
-#include "structs.h"
 #include "UFSSwapLogParser.h"
+#include "store_rebuild.h"
 
 class StoreEntry;
 
@@ -76,7 +76,7 @@ public:
     char fullpath[MAXPATHLEN];
     char fullfilename[MAXPATHLEN];
 
-    struct _store_rebuild_data counts;
+    StoreRebuildData counts;
 
 private:
     CBDATA_CLASS2(RebuildState);
index 5098bfd4b7baa11aeef5d4a1aa9a7aefd9b0464f..a601b06e6c2a7b9d6398e2a50b2ac6d36abcffc9 100644 (file)
@@ -47,7 +47,7 @@
 #if HAVE_ERRNO_H
 #include <errno.h>
 #endif
-static struct _store_rebuild_data counts;
+static StoreRebuildData counts;
 
 static struct timeval rebuild_start;
 static void storeCleanup(void *);
@@ -137,7 +137,7 @@ storeCleanup(void *datanotused)
 /* meta data recreated from disk image in swap directory */
 void
 
-storeRebuildComplete(struct _store_rebuild_data *dc)
+storeRebuildComplete(StoreRebuildData *dc)
 {
     double dt;
     counts.objcount += dc->objcount;
@@ -295,7 +295,7 @@ struct InitStoreEntry : public unary_function<StoreMeta, void> {
 
 bool
 storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf,
-                      struct _store_rebuild_data &counts)
+                      StoreRebuildData &counts)
 {
     if (fd < 0)
         return false;
@@ -317,7 +317,7 @@ storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf,
 
 bool
 storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key,
-                       struct _store_rebuild_data &counts,
+                       StoreRebuildData &counts,
                        uint64_t expectedSize)
 {
     int swap_hdr_len = 0;
@@ -383,7 +383,7 @@ storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key,
 
 bool
 storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key,
-                      struct _store_rebuild_data &counts)
+                      StoreRebuildData &counts)
 {
     /* this needs to become
      * 1) unpack url
index 4088fe2505a21689c42909327b357f4862f4cc6c..ae8947a6d3e9f0eee36779718ae5042b2d784bb9 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
  *
  */
+class StoreRebuildData {
+public:
+    int objcount;       /* # objects successfully reloaded */
+    int expcount;       /* # objects expired */
+    int scancount;      /* # entries scanned or read from state file */
+    int clashcount;     /* # swapfile clashes avoided */
+    int dupcount;       /* # duplicates purged */
+    int cancelcount;        /* # SWAP_LOG_DEL objects purged */
+    int invalid;        /* # bad lines */
+    int badflags;       /* # bad e->flags */
+    int bad_log_op;
+    int zero_object_sz;
+};
 
 extern void storeRebuildStart(void);
-extern void storeRebuildComplete(struct _store_rebuild_data *);
+extern void storeRebuildComplete(StoreRebuildData *);
 extern void storeRebuildProgress(int sd_index, int total, int sofar);
 
 /// loads entry from disk; fills supplied memory buffer on success
-extern bool storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, struct _store_rebuild_data &counts);
+extern bool storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, StoreRebuildData &counts);
 /// parses entry buffer and validates entry metadata; fills e on success
-extern bool storeRebuildParseEntry(MemBuf &buf, StoreEntry &e, cache_key *key, struct _store_rebuild_data &counts, uint64_t expectedSize);
+extern bool storeRebuildParseEntry(MemBuf &buf, StoreEntry &e, cache_key *key, StoreRebuildData &counts, uint64_t expectedSize);
 /// checks whether the loaded entry should be kept; updates counters
-extern bool storeRebuildKeepEntry(const StoreEntry &e, const cache_key *key, struct _store_rebuild_data &counts);
+extern bool storeRebuildKeepEntry(const StoreEntry &e, const cache_key *key, StoreRebuildData &counts);
 
 
 
index 5744ce07248f4522237d76ebff97d9f78eac4de5..49f6faf50906c0b8feba0f0f35a1c97445767f66 100644 (file)
@@ -352,19 +352,6 @@ public:
     int del_count;             /* number of deletions performed so far */
 };
 
-struct _store_rebuild_data {
-    int objcount;              /* # objects successfully reloaded */
-    int expcount;              /* # objects expired */
-    int scancount;             /* # entries scanned or read from state file */
-    int clashcount;            /* # swapfile clashes avoided */
-    int dupcount;              /* # duplicates purged */
-    int cancelcount;           /* # SWAP_LOG_DEL objects purged */
-    int invalid;               /* # bad lines */
-    int badflags;              /* # bad e->flags */
-    int bad_log_op;
-    int zero_object_sz;
-};
-
 #if USE_SSL
 struct _sslproxy_cert_sign {
     int alg;
index 014b2aea65431b2646e46c6ead1e2ea428e8d216..8d952394744d39adc239eacee28a1b69a02854bc 100644 (file)
 
 #include "squid.h"
 #include "MemBuf.h"
+#include "store_rebuild.h"
 
 #define STUB_API "stub_store_rebuild.cc"
 #include "tests/STUB.h"
 
 void storeRebuildProgress(int sd_index, int total, int sofar) STUB
-void storeRebuildComplete(struct _store_rebuild_data *dc) STUB_NOP
-bool storeRebuildLoadEntry(int, int, MemBuf&, _store_rebuild_data&)
+void storeRebuildComplete(StoreRebuildData *dc) STUB_NOP
+bool storeRebuildLoadEntry(int, int, MemBuf&, StoreRebuildData&)
 {
     return false;
 }
-bool storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key, struct _store_rebuild_data &counts) STUB_RETVAL(false)
-bool storeRebuildParseEntry(MemBuf &, StoreEntry &, cache_key *, struct _store_rebuild_data &, uint64_t) STUB_RETVAL(false)
+bool storeRebuildKeepEntry(const StoreEntry &tmpe, const cache_key *key, StoreRebuildData &counts) STUB_RETVAL(false)
+bool storeRebuildParseEntry(MemBuf &, StoreEntry &, cache_key *, StoreRebuildData &, uint64_t) STUB_RETVAL(false)