]> git.ipfire.org Git - thirdparty/squid.git/blame - src/store_rebuild.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / store_rebuild.h
CommitLineData
687f5275 1/*
bde978a6 2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
687f5275 3 *
bbc27441
AJ
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.
687f5275 7 */
001d55dc 8
bbc27441
AJ
9/* DEBUG: section 20 Store Rebuild Routines */
10
11#ifndef SQUID_STORE_REBUILD_H_
12#define SQUID_STORE_REBUILD_H_
13
001d55dc 14// currently a POD
1b2f0924
FC
15class StoreRebuildData
16{
211e9ce2
FC
17public:
18 int objcount; /* # objects successfully reloaded */
19 int expcount; /* # objects expired */
20 int scancount; /* # entries scanned or read from state file */
21 int clashcount; /* # swapfile clashes avoided */
22 int dupcount; /* # duplicates purged */
23 int cancelcount; /* # SWAP_LOG_DEL objects purged */
24 int invalid; /* # bad lines */
25 int badflags; /* # bad e->flags */
26 int bad_log_op;
27 int zero_object_sz;
28};
687f5275 29
8a648e8d
FC
30void storeRebuildStart(void);
31void storeRebuildComplete(StoreRebuildData *);
32void storeRebuildProgress(int sd_index, int total, int sofar);
687f5275
FC
33
34/// loads entry from disk; fills supplied memory buffer on success
8a648e8d 35bool storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, StoreRebuildData &counts);
687f5275 36/// parses entry buffer and validates entry metadata; fills e on success
8a648e8d 37bool storeRebuildParseEntry(MemBuf &buf, StoreEntry &e, cache_key *key, StoreRebuildData &counts, uint64_t expectedSize);
687f5275 38/// checks whether the loaded entry should be kept; updates counters
8a648e8d 39bool storeRebuildKeepEntry(const StoreEntry &e, const cache_key *key, StoreRebuildData &counts);
687f5275 40
687f5275 41#endif /* SQUID_STORE_REBUILD_H_ */
f53969cc 42