1 /*
2  * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 /* DEBUG: section 84    Helper process maintenance */
10 
11 #include "squid.h"
12 #include "MemBuf.h"
13 #include "store/Controller.h"
14 #include "store_rebuild.h"
15 
16 #include <cstring>
17 
18 #define STUB_API "stub_store_rebuild.cc"
19 #include "tests/STUB.h"
20 
storeRebuildProgress(int sd_index,int total,int sofar)21 void storeRebuildProgress(int sd_index, int total, int sofar) STUB
22 bool storeRebuildParseEntry(MemBuf &, StoreEntry &, cache_key *, StoreRebuildData &, uint64_t) STUB_RETVAL(false)
23 
24 void storeRebuildComplete(StoreRebuildData *)
25 {
26     --StoreController::store_dirs_rebuilding;
27 }
28 
29 bool
storeRebuildLoadEntry(int fd,int diskIndex,MemBuf & buf,StoreRebuildData &)30 storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf, StoreRebuildData &)
31 {
32     if (fd < 0)
33         return false;
34 
35     assert(buf.hasSpace()); // caller must allocate
36     // this stub simulates reading an empty entry
37     memset(buf.space(), 0, buf.spaceSize());
38     buf.appended(buf.spaceSize());
39     return true;
40 }
41 
42