]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/store_rebuild.h
2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 20 Store Rebuild Routines */
11 #ifndef SQUID_STORE_REBUILD_H_
12 #define SQUID_STORE_REBUILD_H_
14 #include "store_key_md5.h"
16 class StoreRebuildData
19 int objcount
= 0; /* # objects successfully reloaded */
20 int expcount
= 0; /* # objects expired */
21 int scancount
= 0; /* # entries scanned or read from state file */
22 int clashcount
= 0; /* # swapfile clashes avoided */
23 int dupcount
= 0; /* # duplicates purged */
24 int cancelcount
= 0; /* # SWAP_LOG_DEL objects purged */
25 int invalid
= 0; /* # bad lines */
26 int badflags
= 0; /* # bad e->flags */
28 int zero_object_sz
= 0;
31 void storeRebuildStart(void);
32 void storeRebuildComplete(StoreRebuildData
*);
33 void storeRebuildProgress(int sd_index
, int total
, int sofar
);
35 /// loads entry from disk; fills supplied memory buffer on success
36 bool storeRebuildLoadEntry(int fd
, int diskIndex
, MemBuf
&buf
, StoreRebuildData
&counts
);
37 /// parses entry buffer and validates entry metadata; fills e on success
38 bool storeRebuildParseEntry(MemBuf
&buf
, StoreEntry
&e
, cache_key
*key
, StoreRebuildData
&counts
, uint64_t expectedSize
);
40 #endif /* SQUID_STORE_REBUILD_H_ */