From: Francesco Chemolli Date: Thu, 30 Aug 2012 08:30:12 +0000 (+0200) Subject: Moved some prototypes to newly-created store_rebuild.h X-Git-Tag: sourceformat-review-1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=687f52756356fbfadab6bfaaf0352ac1913ae7e0;p=thirdparty%2Fsquid.git Moved some prototypes to newly-created store_rebuild.h --- diff --git a/src/Makefile.am b/src/Makefile.am index 3da64dbeae..a4686456f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -480,6 +480,7 @@ squid_SOURCES = \ store_key_md5.cc \ store_log.h \ store_log.cc \ + store_rebuild.h \ store_rebuild.cc \ store_swapin.cc \ store_swapmeta.cc \ @@ -1263,6 +1264,7 @@ tests_testACLMaxUserIP_SOURCES= \ tests/stub_Port.cc \ repl_modules.h \ tests/stub_store.cc \ + store_rebuild.h \ tests/stub_store_rebuild.cc \ tests/stub_store_stats.cc \ tests/stub_store_swapout.cc \ @@ -1477,6 +1479,7 @@ tests_testCacheManager_SOURCES = \ store_key_md5.cc \ store_log.h \ store_log.cc \ + store_rebuild.h \ store_rebuild.cc \ store_swapin.cc \ store_swapmeta.cc \ @@ -1657,6 +1660,7 @@ tests_testDiskIO_SOURCES = \ tests/stub_Port.cc \ tests/stub_store_client.cc \ tests/stub_store_stats.cc \ + store_rebuild.h \ tests/stub_store_rebuild.cc \ tools.h \ tests/stub_tools.cc \ @@ -1860,6 +1864,7 @@ tests_testEvent_SOURCES = \ store_key_md5.cc \ store_log.h \ store_log.cc \ + store_rebuild.h \ store_rebuild.cc \ store_swapin.cc \ store_swapmeta.cc \ @@ -2085,6 +2090,7 @@ tests_testEventLoop_SOURCES = \ store_key_md5.cc \ store_log.h \ store_log.cc \ + store_rebuild.h \ store_rebuild.cc \ store_swapin.cc \ store_swapmeta.cc \ @@ -2307,6 +2313,7 @@ tests_test_http_range_SOURCES = \ store_io.cc \ store_log.h \ store_log.cc \ + store_rebuild.h \ store_rebuild.cc \ store_swapin.cc \ store_swapmeta.cc \ @@ -2572,6 +2579,7 @@ tests_testHttpRequest_SOURCES = \ store_key_md5.cc \ store_log.h \ store_log.cc \ + store_rebuild.h \ store_rebuild.cc \ store_swapin.cc \ store_swapmeta.cc \ @@ -2746,6 +2754,7 @@ tests_testStore_SOURCES= \ tests/stub_Port.cc \ tests/stub_store_client.cc \ tests/stub_store_stats.cc \ + store_rebuild.h \ tests/stub_store_rebuild.cc \ tests/stub_store_swapout.cc \ tools.h \ @@ -2879,6 +2888,7 @@ tests_testUfs_SOURCES = \ internal.h \ tests/stub_internal.cc \ tests/stub_libformat.cc \ + store_rebuild.h \ tests/stub_store_rebuild.cc \ tests/stub_store_stats.cc \ fd.h \ @@ -3120,6 +3130,7 @@ tests_testRock_SOURCES = \ tests/stub_Port.cc \ tests/stub_pconn.cc \ tests/stub_store_client.cc \ + store_rebuild.h \ tests/stub_store_rebuild.cc \ tests/stub_store_stats.cc \ tools.h \ @@ -3182,6 +3193,7 @@ tests_testCoss_SOURCES = \ tests/stub_internal.cc \ tests/stub_ipc.cc \ tests/stub_pconn.cc \ + store_rebuild.h \ tests/stub_store_rebuild.cc \ tests/stub_store_stats.cc \ fd.h \ @@ -3330,6 +3342,7 @@ tests_testNull_SOURCES = \ tests/testNull.h \ internal.h \ tests/stub_internal.cc \ + store_rebuild.h \ tests/stub_store_rebuild.cc \ tests/stub_store_stats.cc \ fd.h \ @@ -3600,6 +3613,7 @@ tests_testURL_SOURCES = \ store_key_md5.cc \ store_log.h \ store_log.cc \ + store_rebuild.h \ store_rebuild.cc \ store_swapin.cc \ store_swapmeta.cc \ diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index 554af54dd5..7f2ae9344d 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -51,6 +51,7 @@ #include "Parsing.h" #include "store_key_md5.h" #include "swap_log_op.h" +#include "store_rebuild.h" #include "SquidMath.h" #if HAVE_ERRNO_H diff --git a/src/fs/rock/RockRebuild.cc b/src/fs/rock/RockRebuild.cc index 0d62591d15..f1b7b3687e 100644 --- a/src/fs/rock/RockRebuild.cc +++ b/src/fs/rock/RockRebuild.cc @@ -1,6 +1,4 @@ /* - * $Id$ - * * DEBUG: section 79 Disk IO Routines */ @@ -13,6 +11,7 @@ #include "protos.h" #include "typedefs.h" #include "SquidTime.h" +#include "store_rebuild.h" #if HAVE_ERRNO_H #include diff --git a/src/fs/ufs/RebuildState.cc b/src/fs/ufs/RebuildState.cc index 28f694b8f9..78ea660397 100644 --- a/src/fs/ufs/RebuildState.cc +++ b/src/fs/ufs/RebuildState.cc @@ -38,6 +38,7 @@ #include "SquidTime.h" #include "store_key_md5.h" #include "StoreSwapLogData.h" +#include "store_rebuild.h" #include "UFSSwapLogParser.h" #if HAVE_MATH_H diff --git a/src/protos.h b/src/protos.h index f004733cec..4b19dfd71d 100644 --- a/src/protos.h +++ b/src/protos.h @@ -86,20 +86,7 @@ extern void shut_down(int); extern void rotate_logs(int); extern void reconfigure(int); -/* - * store_rebuild.c - */ -SQUIDCEXTERN void storeRebuildStart(void); - -SQUIDCEXTERN void storeRebuildComplete(struct _store_rebuild_data *); -SQUIDCEXTERN 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); -/// 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); -/// 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); /* * store_swapin.c diff --git a/src/store.cc b/src/store.cc index 7e1ace430c..ebebef3930 100644 --- a/src/store.cc +++ b/src/store.cc @@ -63,6 +63,7 @@ #include "store_digest.h" #include "store_key_md5.h" #include "store_log.h" +#include "store_rebuild.h" #include "SwapDir.h" #include "swap_log_op.h" #if USE_DELAY_POOLS diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index 1818a0b2b2..fb098d5457 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -43,6 +43,7 @@ #include "store_key_md5.h" #include "SwapDir.h" #include "store_digest.h" +#include "store_rebuild.h" #include "StoreSearch.h" #include "SquidTime.h" diff --git a/src/store_rebuild.h b/src/store_rebuild.h new file mode 100644 index 0000000000..7c514492a4 --- /dev/null +++ b/src/store_rebuild.h @@ -0,0 +1,48 @@ +#ifndef SQUID_STORE_REBUILD_H_ +#define SQUID_STORE_REBUILD_H_ +/* + * DEBUG: section + * AUTHOR: + * + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +extern void storeRebuildStart(void); +extern void storeRebuildComplete(struct _store_rebuild_data *); +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); +/// 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); +/// 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); + + + +#endif /* SQUID_STORE_REBUILD_H_ */