]> git.ipfire.org Git - thirdparty/squid.git/blame - src/tests/stub_store_rebuild.cc
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / tests / stub_store_rebuild.cc
CommitLineData
c8f4eac4 1/*
f70aedc4 2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
c8f4eac4 3 *
4e0938ef
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.
c8f4eac4 7 */
8
4e0938ef
AJ
9/* DEBUG: section 84 Helper process maintenance */
10
582c2af2
FC
11#include "squid.h"
12#include "MemBuf.h"
8ecbe78d 13#include "SquidTime.h"
2745fea5 14#include "store/Controller.h"
b3f7fd88 15#include "store_rebuild.h"
074d6a40
AJ
16
17#include <cstring>
c8f4eac4 18
d3546528
FC
19#define STUB_API "stub_store_rebuild.cc"
20#include "tests/STUB.h"
c8f4eac4 21
d3546528 22void storeRebuildProgress(int sd_index, int total, int sofar) STUB
211e9ce2 23bool storeRebuildParseEntry(MemBuf &, StoreEntry &, cache_key *, StoreRebuildData &, uint64_t) STUB_RETVAL(false)
02c267b0 24
8ecbe78d
EB
25void StoreRebuildData::updateStartTime(const timeval &dirStartTime)
26{
27 startTime = started() ? std::min(startTime, dirStartTime) : dirStartTime;
28}
29
02c267b0
AR
30void storeRebuildComplete(StoreRebuildData *)
31{
32 --StoreController::store_dirs_rebuilding;
8ecbe78d
EB
33 if (StoreController::store_dirs_rebuilding == 1)
34 --StoreController::store_dirs_rebuilding; // normally in storeCleanup()
02c267b0
AR
35}
36
37bool
38storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, StoreRebuildData &)
39{
40 if (fd < 0)
41 return false;
42
43 assert(buf.hasSpace()); // caller must allocate
44 // this stub simulates reading an empty entry
45 memset(buf.space(), 0, buf.spaceSize());
46 buf.appended(buf.spaceSize());
47 return true;
48}
f53969cc 49
8ecbe78d
EB
50void Progress::print(std::ostream &) const STUB
51