From: Casey Bodley Date: Fri, 3 Oct 2025 20:15:24 +0000 (-0400) Subject: rgw: remove unused RGWSI_Finisher X-Git-Tag: v21.0.0~209^2~39^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=137d2094a456c8ff828b8953785eff415c2acd1c;p=ceph.git rgw: remove unused RGWSI_Finisher Signed-off-by: Casey Bodley --- diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 0fd7a8bca473..0b6dabe0a718 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -152,7 +152,6 @@ list(APPEND librgw_common_srcs if(WITH_RADOSGW_RADOS) list(APPEND librgw_common_srcs - services/svc_finisher.cc services/svc_bi_rados.cc services/svc_bilog_rados.cc services/svc_bucket.cc diff --git a/src/rgw/driver/rados/rgw_service.cc b/src/rgw/driver/rados/rgw_service.cc index 2865885f0f76..dbd86426c8ef 100644 --- a/src/rgw/driver/rados/rgw_service.cc +++ b/src/rgw/driver/rados/rgw_service.cc @@ -3,7 +3,6 @@ #include "rgw_service.h" -#include "services/svc_finisher.h" #include "services/svc_bi_rados.h" #include "services/svc_bilog_rados.h" #include "services/svc_bucket_sobj.h" @@ -57,7 +56,6 @@ int RGWServices_Def::init(CephContext *cct, rgw::sal::ConfigStore* cfgstore, const rgw::SiteConfig* site) { - finisher = std::make_unique(cct); bucket_sobj = std::make_unique(cct); bucket_sync_sobj = std::make_unique(cct); bi_rados = std::make_unique(cct); @@ -82,7 +80,6 @@ int RGWServices_Def::init(CephContext *cct, } async_processor->start(); - finisher->init(); bi_rados->init(zone.get(), driver->getRados()->get_rados_handle(), bilog_rados.get(), datalog_rados.get()); bilog_rados->init(bi_rados.get()); @@ -115,21 +112,14 @@ int RGWServices_Def::init(CephContext *cct, can_shutdown = true; - int r = finisher->start(y, dpp); - if (r < 0) { - ldpp_dout(dpp, 0) << "ERROR: failed to start finisher service (" << cpp_strerror(-r) << dendl; - return r; - } - + int r = 0; if (!raw) { r = notify->start(y, dpp); if (r < 0) { ldpp_dout(dpp, 0) << "ERROR: failed to start notify service (" << cpp_strerror(-r) << dendl; return r; } - } - if (!raw) { r = zone->start(y, dpp); if (r < 0) { ldpp_dout(dpp, 0) << "ERROR: failed to start zone service (" << cpp_strerror(-r) << dendl; @@ -247,7 +237,6 @@ void RGWServices_Def::shutdown() bi_rados->shutdown(); bucket_sync_sobj->shutdown(); bucket_sobj->shutdown(); - finisher->shutdown(); sysobj->shutdown(); sysobj_core->shutdown(); @@ -273,7 +262,6 @@ int RGWServices::do_init(CephContext *_cct, rgw::sal::RadosStore* driver, bool h return r; } - finisher = _svc.finisher.get(); bi_rados = _svc.bi_rados.get(); bi = bi_rados; bilog_rados = _svc.bilog_rados.get(); diff --git a/src/rgw/driver/rados/rgw_service.h b/src/rgw/driver/rados/rgw_service.h index 8005dc1af14c..96fe99c367fd 100644 --- a/src/rgw/driver/rados/rgw_service.h +++ b/src/rgw/driver/rados/rgw_service.h @@ -53,7 +53,6 @@ public: } }; -class RGWSI_Finisher; class RGWSI_Bucket; class RGWSI_Bucket_SObj; class RGWSI_Bucket_Sync; @@ -84,7 +83,6 @@ struct RGWServices_Def bool can_shutdown{false}; bool has_shutdown{false}; - std::unique_ptr finisher; std::unique_ptr bucket_sobj; std::unique_ptr bucket_sync_sobj; std::unique_ptr bi_rados; @@ -122,7 +120,6 @@ struct RGWServices CephContext *cct; const rgw::SiteConfig* site{nullptr}; - RGWSI_Finisher *finisher{nullptr}; RGWSI_Bucket *bucket{nullptr}; RGWSI_Bucket_SObj *bucket_sobj{nullptr}; RGWSI_Bucket_Sync *bucket_sync{nullptr}; diff --git a/src/rgw/services/svc_finisher.cc b/src/rgw/services/svc_finisher.cc deleted file mode 100644 index 64bb636251cd..000000000000 --- a/src/rgw/services/svc_finisher.cc +++ /dev/null @@ -1,58 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*- -// vim: ts=8 sw=2 sts=2 expandtab ft=cpp - -#include "common/Finisher.h" - -#include "svc_finisher.h" - -using namespace std; - -int RGWSI_Finisher::do_start(optional_yield, const DoutPrefixProvider *dpp) -{ - finisher = new Finisher(cct); - finisher->start(); - - return 0; -} - -void RGWSI_Finisher::shutdown() -{ - if (finalized) { - return; - } - - if (finisher) { - finisher->stop(); - - map cbs; - cbs.swap(shutdown_cbs); /* move cbs out, in case caller unregisters */ - for (auto& iter : cbs) { - iter.second->call(); - } - delete finisher; - } - - finalized = true; -} - -RGWSI_Finisher::~RGWSI_Finisher() -{ - shutdown(); -} - -void RGWSI_Finisher::register_caller(ShutdownCB *cb, int *phandle) -{ - *phandle = ++handles_counter; - shutdown_cbs[*phandle] = cb; -} - -void RGWSI_Finisher::unregister_caller(int handle) -{ - shutdown_cbs.erase(handle); -} - -void RGWSI_Finisher::schedule_context(Context *c) -{ - finisher->queue(c); -} - diff --git a/src/rgw/services/svc_finisher.h b/src/rgw/services/svc_finisher.h deleted file mode 100644 index 6ddc6bfe9f4f..000000000000 --- a/src/rgw/services/svc_finisher.h +++ /dev/null @@ -1,44 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*- -// vim: ts=8 sw=2 sts=2 expandtab ft=cpp - -#pragma once - -#include "rgw_service.h" - -class Context; -class Finisher; - -class RGWSI_Finisher : public RGWServiceInstance -{ - friend struct RGWServices_Def; -public: - class ShutdownCB; - -private: - Finisher *finisher{nullptr}; - bool finalized{false}; - - void shutdown() override; - - std::map shutdown_cbs; - std::atomic handles_counter{0}; - -protected: - void init() {} - int do_start(optional_yield y, const DoutPrefixProvider *dpp) override; - -public: - RGWSI_Finisher(CephContext *cct): RGWServiceInstance(cct) {} - ~RGWSI_Finisher(); - - class ShutdownCB { - public: - virtual ~ShutdownCB() {} - virtual void call() = 0; - }; - - void register_caller(ShutdownCB *cb, int *phandle); - void unregister_caller(int handle); - - void schedule_context(Context *c); -};