From: Eduard Bagdasaryan Date: Thu, 23 Feb 2023 23:35:48 +0000 (+0000) Subject: Removed unused StoreSearchUFS (#1285) X-Git-Tag: SQUID_7_0_1~480 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f120a7742a5e63ad2799bda7122c11d27078367b;p=thirdparty%2Fsquid.git Removed unused StoreSearchUFS (#1285) It is unused since 2015 commit 2745fea. --- diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index 8f32da62a9..8ee268713f 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am @@ -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 index 45f7be3a7a..0000000000 --- a/src/fs/ufs/StoreSearchUFS.cc +++ /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 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(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 index 10c7ff158b..0000000000 --- a/src/fs/ufs/StoreSearchUFS.h +++ /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 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 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 */ - diff --git a/src/fs/ufs/UFSSwapDir.cc b/src/fs/ufs/UFSSwapDir.cc index 0cdcef8de7..d4e744d31a 100644 --- a/src/fs/ufs/UFSSwapDir.cc +++ b/src/fs/ufs/UFSSwapDir.cc @@ -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"