]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/fs/ufs/RebuildState.h
2 * Copyright (C) 1996-2019 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 #ifndef SQUID_FS_UFS_REBUILDSTATE_H
10 #define SQUID_FS_UFS_REBUILDSTATE_H
12 #include "base/RefCount.h"
13 #include "store_rebuild.h"
14 #include "UFSSwapDir.h"
15 #include "UFSSwapLogParser.h"
26 CBDATA_CLASS(RebuildState
);
29 static EVH RebuildStep
;
31 RebuildState(RefCount
<UFSSwapDir
> sd
);
32 virtual ~RebuildState();
34 virtual bool error() const;
35 virtual bool isDone() const;
37 RefCount
<UFSSwapDir
> sd
;
40 Fs::Ufs::UFSSwapLogParser
*LogParser
;
45 Flags() : need_to_validate(false), clean(false), init(false) {}
46 bool need_to_validate
;
56 char fullpath
[MAXPATHLEN
];
57 char fullfilename
[MAXPATHLEN
*2];
59 StoreRebuildData counts
;
62 void rebuildFromDirectory();
63 void rebuildFromSwapLog();
65 void addIfFresh(const cache_key
*key
,
67 uint64_t swap_file_sz
,
74 bool evictStaleAndContinue(const cache_key
*candidateKey
, const time_t maxRef
, int &staleCount
);
75 int getNextFile(sfileno
*, int *size
);
78 /// \bug (callback) should be hidden behind a proper human readable name
79 void (callback
)(void *cbdata
);
86 #endif /* SQUID_FS_UFS_REBUILDSTATE_H */