]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Removed unused StoreSearchUFS (#1285)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Thu, 23 Feb 2023 23:35:48 +0000 (23:35 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 24 Feb 2023 14:34:19 +0000 (14:34 +0000)
It is unused since 2015 commit 2745fea.

src/fs/Makefile.am
src/fs/ufs/StoreSearchUFS.cc [deleted file]
src/fs/ufs/StoreSearchUFS.h [deleted file]
src/fs/ufs/UFSSwapDir.cc

index 8f32da62a9264db76390bc29e7e10edfadc767dd..8ee268713f7d5b4800220ac24f3fd9cd80811cdc 100644 (file)
@@ -23,8 +23,6 @@ libufs_la_SOURCES = \
        ufs/RebuildState.h \
        ufs/StoreFSufs.cc \
        ufs/StoreFSufs.h \
-       ufs/StoreSearchUFS.cc \
-       ufs/StoreSearchUFS.h \
        ufs/UFSStoreState.cc \
        ufs/UFSStoreState.h \
        ufs/UFSStrategy.cc \
diff --git a/src/fs/ufs/StoreSearchUFS.cc b/src/fs/ufs/StoreSearchUFS.cc
deleted file mode 100644 (file)
index 45f7be3..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.
- */
-
-/* DEBUG: section 47    Store Directory Routines */
-
-#include "squid.h"
-#include "cbdata.h"
-#include "StoreSearchUFS.h"
-#include "UFSSwapDir.h"
-
-CBDATA_NAMESPACED_CLASS_INIT(Fs::Ufs,StoreSearchUFS);
-
-Fs::Ufs::StoreSearchUFS::StoreSearchUFS(RefCount<UFSSwapDir> aSwapDir) :
-    sd(aSwapDir),
-    walker(sd->repl->WalkInit(sd->repl)),
-    cbdata(nullptr),
-    current(nullptr),
-    _done(false)
-{}
-
-Fs::Ufs::StoreSearchUFS::~StoreSearchUFS()
-{
-    walker->Done(walker);
-    walker = nullptr;
-}
-
-void
-Fs::Ufs::StoreSearchUFS::next(void (aCallback)(void *cbdata), void *aCallbackArgs)
-{
-    next();
-    aCallback(aCallbackArgs);
-}
-
-bool
-Fs::Ufs::StoreSearchUFS::next()
-{
-    /* the walker API doesn't make sense. the store entries referred to are already readwrite
-     * from their hash table entries
-     */
-
-    if (walker)
-        current = const_cast<StoreEntry *>(walker->Next(walker));
-
-    if (current == nullptr)
-        _done = true;
-
-    return current != nullptr;
-}
-
-bool
-Fs::Ufs::StoreSearchUFS::error() const
-{
-    return false;
-}
-
-bool
-Fs::Ufs::StoreSearchUFS::isDone() const
-{
-    return _done;
-}
-
-StoreEntry *
-Fs::Ufs::StoreSearchUFS::currentItem()
-{
-    return current;
-}
-
diff --git a/src/fs/ufs/StoreSearchUFS.h b/src/fs/ufs/StoreSearchUFS.h
deleted file mode 100644 (file)
index 10c7ff1..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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_STORESEARCHUFS_H
-#define SQUID_FS_UFS_STORESEARCHUFS_H
-
-#include "StoreSearch.h"
-#include "UFSSwapDir.h"
-
-namespace Fs
-{
-namespace Ufs
-{
-
-class StoreSearchUFS : public StoreSearch
-{
-    CBDATA_CLASS(StoreSearchUFS);
-
-public:
-    StoreSearchUFS(RefCount<UFSSwapDir> sd);
-    ~StoreSearchUFS() override;
-
-    // TODO: misplaced Iterator API
-    /**
-     * callback the client when a new StoreEntry is available
-     * or an error occurs
-     */
-    void next(void (callback)(void *cbdata), void *cbdata) override;
-
-    /**
-     \retval true if a new StoreEntry is immediately available
-     \retval false if a new StoreEntry is NOT immediately available
-     */
-    bool next() override;
-
-    bool error() const override;
-    bool isDone() const override;
-    StoreEntry *currentItem() override;
-
-    RefCount<UFSSwapDir> sd;
-    RemovalPolicyWalker *walker;
-
-private:
-    /// \bug (callback) should be hidden behind a proper human readable name
-    void (callback)(void *cbdata);
-    void *cbdata;
-    StoreEntry * current;
-    bool _done;
-
-    StoreSearchUFS(StoreSearchUFS const &); //disabled
-    StoreSearchUFS& operator=(StoreSearchUFS const &); //disabled
-    StoreSearchUFS(); //disabled
-};
-
-} //namespace Ufs
-} //namespace Fs
-#endif /* SQUID_FS_UFS_STORESEARCHUFS_H */
-
index 0cdcef8de7b652ffcddeeb0deb426a80b94e1e8a..d4e744d31ab7583f947f678d96d6d0ba87b149d2 100644 (file)
@@ -26,7 +26,6 @@
 #include "SquidMath.h"
 #include "StatCounters.h"
 #include "store_key_md5.h"
-#include "StoreSearchUFS.h"
 #include "StoreSwapLogData.h"
 #include "tools.h"
 #include "UFSSwapDir.h"