]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/services: remove unused RGWSI_Role_RADOS
authorCasey Bodley <cbodley@redhat.com>
Mon, 4 Dec 2023 22:07:37 +0000 (17:07 -0500)
committerCasey Bodley <cbodley@redhat.com>
Thu, 12 Sep 2024 20:55:01 +0000 (16:55 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/CMakeLists.txt
src/rgw/driver/rados/rgw_sal_rados.cc
src/rgw/driver/rados/rgw_service.cc
src/rgw/driver/rados/rgw_service.h
src/rgw/rgw_role.cc
src/rgw/services/svc_role_rados.cc [deleted file]
src/rgw/services/svc_role_rados.h [deleted file]

index c09491200c6b127b29ecdad83e61b1d634837960..9f9099f31638f5fd5afc1cfd6a7e386b04bfc6b1 100644 (file)
@@ -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
index 92b8582e92f2ab89967ffe1524bb88ff1b97d9b6..2969eb9bd1a6d4ddb8a53909be08badc7ed816bd 100644 (file)
@@ -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"
index 6a177a4acd5eab54ec77e46a6fdd9acc1914e189..cc8bd3f06af05acbe02ea0bb646b0d8192d5c361 100644 (file)
@@ -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<RGWSI_SysObj>(cct);
   sysobj_core = std::make_unique<RGWSI_SysObj_Core>(cct);
   user_rados = std::make_unique<RGWSI_User_RADOS>(cct);
-  role_rados = std::make_unique<RGWSI_Role_RADOS>(cct);
   async_processor = std::make_unique<RGWAsyncRadosProcessor>(
     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;
index 19fb250323a5e0d261cb8f307f700c5c5a71316c..e2b53c9cd9257042948e90f69b5663b596539e84 100644 (file)
@@ -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<RGWSI_SysObj_Cache> sysobj_cache;
   std::unique_ptr<RGWSI_User_RADOS> user_rados;
   std::unique_ptr<RGWDataChangesLog> datalog_rados;
-  std::unique_ptr<RGWSI_Role_RADOS> role_rados;
   std::unique_ptr<RGWAsyncRadosProcessor> 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,
index d7070e4785e2b31ca588c3143e310a851d1cec3b..24c45afbe5771e973e1824168808be8287f96ebf 100644 (file)
@@ -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 (file)
index a840224..0000000
+++ /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 <<dendl;
-    return r;
-  }
-
-  auto module = new RGWSI_Role_Module(svc);
-  RGWSI_MetaBackend_Handler_SObj* bh= static_cast<RGWSI_MetaBackend_Handler_SObj *>(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 (file)
index d4d3530..0000000
+++ /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<RGWSI_MetaBackend::Module> 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.";