]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/fs/ufs/RebuildState.h
Maintenance: automate header guards 2/3 (#1655)
[thirdparty/squid.git] / src / fs / ufs / RebuildState.h
index 17256cc78e7e24c211d822a6cf548c646b6b9361..73226bcf821e71dba4989f8647a3fc50c0fdbad0 100644 (file)
@@ -1,13 +1,13 @@
 /*
- * 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"
@@ -33,7 +33,6 @@ public:
 
     virtual bool error() const;
     virtual bool isDone() const;
-    virtual StoreEntry *currentItem();
 
     RefCount<UFSSwapDir> sd;
     int n_read;
@@ -54,8 +53,8 @@ public:
 
     dirent_t *entry;
     DIR *td;
-    char fullpath[MAXPATHLEN];
-    char fullfilename[MAXPATHLEN];
+    SBuf fullpath;
+    SBuf fullfilename;
 
     StoreRebuildData counts;
 
@@ -63,14 +62,20 @@ private:
     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;
 };
@@ -78,5 +83,5 @@ private:
 } /* namespace Ufs */
 } /* namespace Fs */
 
-#endif /* SQUID_FS_UFS_REBUILDSTATE_H */
+#endif /* SQUID_SRC_FS_UFS_REBUILDSTATE_H */