From: Casey Bodley Date: Mon, 4 Dec 2023 22:07:37 +0000 (-0500) Subject: rgw/services: remove unused RGWSI_Role_RADOS X-Git-Tag: v20.0.0~1070^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fb7cb18df927aa671f2c8181efb4d0beca3a05fc;p=ceph.git rgw/services: remove unused RGWSI_Role_RADOS Signed-off-by: Casey Bodley --- diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index c09491200c6b1..9f9099f31638f 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -46,7 +46,6 @@ set(librgw_common_srcs services/svc_notify.cc services/svc_quota.cc services/svc_sync_modules.cc - services/svc_role_rados.cc services/svc_sys_obj.cc services/svc_sys_obj_cache.cc services/svc_sys_obj_core.cc diff --git a/src/rgw/driver/rados/rgw_sal_rados.cc b/src/rgw/driver/rados/rgw_sal_rados.cc index 92b8582e92f2a..2969eb9bd1a6d 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.cc +++ b/src/rgw/driver/rados/rgw_sal_rados.cc @@ -67,7 +67,6 @@ #include "services/svc_quota.h" #include "services/svc_config_key.h" #include "services/svc_zone_utils.h" -#include "services/svc_role_rados.h" #include "services/svc_user.h" #include "services/svc_sys_obj_cache.h" #include "cls/rgw/cls_rgw_client.h" diff --git a/src/rgw/driver/rados/rgw_service.cc b/src/rgw/driver/rados/rgw_service.cc index 6a177a4acd5ea..cc8bd3f06af05 100644 --- a/src/rgw/driver/rados/rgw_service.cc +++ b/src/rgw/driver/rados/rgw_service.cc @@ -23,7 +23,6 @@ #include "services/svc_sys_obj_cache.h" #include "services/svc_sys_obj_core.h" #include "services/svc_user_rados.h" -#include "services/svc_role_rados.h" #include "common/errno.h" @@ -77,7 +76,6 @@ int RGWServices_Def::init(CephContext *cct, sysobj = std::make_unique(cct); sysobj_core = std::make_unique(cct); user_rados = std::make_unique(cct); - role_rados = std::make_unique(cct); async_processor = std::make_unique( cct, cct->_conf->rgw_num_async_rados_threads); @@ -121,7 +119,7 @@ int RGWServices_Def::init(CephContext *cct, } user_rados->init(driver->getRados()->get_rados_handle(), zone.get(), mdlog.get(), sysobj.get(), sysobj_cache.get(), meta.get()); - role_rados->init(zone.get(), meta.get(), meta_be_sobj.get(), sysobj.get()); + can_shutdown = true; int r = finisher->start(y, dpp); @@ -240,12 +238,6 @@ int RGWServices_Def::init(CephContext *cct, ldpp_dout(dpp, 0) << "ERROR: failed to start user_rados service (" << cpp_strerror(-r) << dendl; return r; } - - r = role_rados->start(y, dpp); - if (r < 0) { - ldout(cct, 0) << "ERROR: failed to start role_rados service (" << cpp_strerror(-r) << dendl; - return r; - } } /* cache or core services will be started by sysobj */ @@ -263,7 +255,6 @@ void RGWServices_Def::shutdown() return; } - role_rados->shutdown(); datalog_rados.reset(); user_rados->shutdown(); sync_modules->shutdown(); @@ -327,7 +318,6 @@ int RGWServices::do_init(CephContext *_cct, rgw::sal::RadosStore* driver, bool h cache = _svc.sysobj_cache.get(); core = _svc.sysobj_core.get(); user = _svc.user_rados.get(); - role = _svc.role_rados.get(); async_processor = _svc.async_processor.get(); return 0; diff --git a/src/rgw/driver/rados/rgw_service.h b/src/rgw/driver/rados/rgw_service.h index 19fb250323a5e..e2b53c9cd9257 100644 --- a/src/rgw/driver/rados/rgw_service.h +++ b/src/rgw/driver/rados/rgw_service.h @@ -78,7 +78,6 @@ class RGWSI_SysObj_Cache; class RGWSI_User; class RGWSI_User_RADOS; class RGWDataChangesLog; -class RGWSI_Role_RADOS; class RGWAsyncRadosProcessor; struct RGWServices_Def @@ -106,7 +105,6 @@ struct RGWServices_Def std::unique_ptr sysobj_cache; std::unique_ptr user_rados; std::unique_ptr datalog_rados; - std::unique_ptr role_rados; std::unique_ptr async_processor; RGWServices_Def(); @@ -151,7 +149,6 @@ struct RGWServices RGWSI_SysObj_Cache *cache{nullptr}; RGWSI_SysObj_Core *core{nullptr}; RGWSI_User *user{nullptr}; - RGWSI_Role_RADOS *role{nullptr}; RGWAsyncRadosProcessor* async_processor; int do_init(CephContext *cct, rgw::sal::RadosStore* store, bool have_cache, diff --git a/src/rgw/rgw_role.cc b/src/rgw/rgw_role.cc index d7070e4785e2b..24c45afbe5771 100644 --- a/src/rgw/rgw_role.cc +++ b/src/rgw/rgw_role.cc @@ -26,7 +26,6 @@ #include "services/svc_sys_obj.h" #include "services/svc_meta_be_sobj.h" #include "services/svc_meta.h" -#include "services/svc_role_rados.h" #define dout_subsys ceph_subsys_rgw diff --git a/src/rgw/services/svc_role_rados.cc b/src/rgw/services/svc_role_rados.cc deleted file mode 100644 index a840224978b34..0000000000000 --- a/src/rgw/services/svc_role_rados.cc +++ /dev/null @@ -1,82 +0,0 @@ -#include "svc_role_rados.h" -#include "svc_meta_be_sobj.h" -#include "svc_meta.h" -#include "rgw_role.h" -#include "rgw_zone.h" -#include "svc_zone.h" -#include "rgw_tools.h" - -#define dout_subsys ceph_subsys_rgw - -class RGWSI_Role_Module : public RGWSI_MBSObj_Handler_Module { - RGWSI_Role_RADOS::Svc& svc; - const std::string prefix; -public: - RGWSI_Role_Module(RGWSI_Role_RADOS::Svc& _svc): RGWSI_MBSObj_Handler_Module("roles"), - svc(_svc), - prefix(role_oid_prefix) {} - - void get_pool_and_oid(const std::string& key, - rgw_pool *pool, - std::string *oid) override - { - if (pool) { - *pool = svc.zone->get_zone_params().roles_pool; - } - - if (oid) { - *oid = key_to_oid(key); - } - } - - bool is_valid_oid(const std::string& oid) override { - return boost::algorithm::starts_with(oid, prefix); - } - - std::string key_to_oid(const std::string& key) override { - return prefix + key; - } - - // This is called after `is_valid_oid` and is assumed to be a valid oid - std::string oid_to_key(const std::string& oid) override { - return oid.substr(prefix.size()); - } - - const std::string& get_oid_prefix() { - return prefix; - } -}; - -RGWSI_MetaBackend_Handler* RGWSI_Role_RADOS::get_be_handler() -{ - return be_handler; -} - -void RGWSI_Role_RADOS::init(RGWSI_Zone *_zone_svc, - RGWSI_Meta *_meta_svc, - RGWSI_MetaBackend *_meta_be_svc, - RGWSI_SysObj *_sysobj_svc) -{ - svc.zone = _zone_svc; - svc.meta = _meta_svc; - svc.meta_be = _meta_be_svc; - svc.sysobj = _sysobj_svc; -} - -int RGWSI_Role_RADOS::do_start(optional_yield y, const DoutPrefixProvider *dpp) -{ - - int r = svc.meta->create_be_handler(RGWSI_MetaBackend::Type::MDBE_SOBJ, - &be_handler); - if (r < 0) { - ldout(ctx(), 0) << "ERROR: failed to create be_handler for Roles: r=" - << r <(be_handler); - be_module.reset(module); - bh->set_module(module); - return 0; -} diff --git a/src/rgw/services/svc_role_rados.h b/src/rgw/services/svc_role_rados.h deleted file mode 100644 index d4d3530c278c3..0000000000000 --- a/src/rgw/services/svc_role_rados.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab ft=cpp - -/* - * Ceph - scalable distributed file system - * - * Copyright (C) 2020 SUSE LLC - * - * This is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software - * Foundation. See file COPYING. - * - */ - -#pragma once - -#include "rgw_service.h" -#include "rgw_role.h" -#include "svc_meta_be.h" - -class RGWSI_Role_RADOS: public RGWServiceInstance -{ - public: - struct Svc { - RGWSI_Zone *zone{nullptr}; - RGWSI_Meta *meta{nullptr}; - RGWSI_MetaBackend *meta_be{nullptr}; - RGWSI_SysObj *sysobj{nullptr}; - } svc; - - RGWSI_Role_RADOS(CephContext *cct) : RGWServiceInstance(cct) {} - ~RGWSI_Role_RADOS() {} - - void init(RGWSI_Zone *_zone_svc, - RGWSI_Meta *_meta_svc, - RGWSI_MetaBackend *_meta_be_svc, - RGWSI_SysObj *_sysobj_svc); - - RGWSI_MetaBackend_Handler * get_be_handler(); - int do_start(optional_yield y, const DoutPrefixProvider *dpp) override; - -private: - RGWSI_MetaBackend_Handler *be_handler; - std::unique_ptr be_module; -}; - -static const std::string role_name_oid_prefix = "role_names."; -static const std::string role_oid_prefix = "roles."; -static const std::string role_path_oid_prefix = "role_paths.";