/*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
-#ifndef SQUID_FS_UFS_REBUILDSTATE_H
-#define SQUID_FS_UFS_REBUILDSTATE_H
+#ifndef SQUID_SRC_FS_UFS_REBUILDSTATE_H
+#define SQUID_SRC_FS_UFS_REBUILDSTATE_H
#include "base/RefCount.h"
#include "store_rebuild.h"
virtual bool error() const;
virtual bool isDone() const;
- virtual StoreEntry *currentItem();
RefCount<UFSSwapDir> sd;
int n_read;
dirent_t *entry;
DIR *td;
- char fullpath[MAXPATHLEN];
- char fullfilename[MAXPATHLEN];
+ SBuf fullpath;
+ SBuf fullfilename;
StoreRebuildData counts;
void rebuildFromDirectory();
void rebuildFromSwapLog();
void rebuildStep();
- void undoAdd();
+ void addIfFresh(const cache_key *key,
+ sfileno file_number,
+ uint64_t swap_file_sz,
+ time_t expires,
+ time_t timestamp,
+ time_t lastref,
+ time_t lastmod,
+ uint32_t refcount,
+ uint16_t flags);
+ bool evictStaleAndContinue(const cache_key *candidateKey, const time_t maxRef, int &staleCount);
int getNextFile(sfileno *, int *size);
- StoreEntry *currentEntry() const;
- void currentEntry(StoreEntry *);
- StoreEntry *e;
bool fromLog;
bool _done;
- /// \bug (callback) should be hidden behind a proper human readable name
+ // TODO: (callback) should be hidden behind a proper human readable name
void (callback)(void *cbdata);
void *cbdata;
};
} /* namespace Ufs */
} /* namespace Fs */
-#endif /* SQUID_FS_UFS_REBUILDSTATE_H */
+#endif /* SQUID_SRC_FS_UFS_REBUILDSTATE_H */