]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: removing do_start() method from
authorPritha Srivastava <prsrivas@redhat.com>
Tue, 26 Oct 2021 06:21:35 +0000 (11:51 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Mon, 6 Jun 2022 10:49:43 +0000 (16:19 +0530)
RGWRoleMetadataHandler and class RGWSI_Role_Module.

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
src/rgw/rgw_role.cc
src/rgw/rgw_role.h
src/rgw/rgw_service.cc

index 420021eb5b8aa2bbfb2224897db3e7def6951b95..dc5f8a2c0aebeaaf5c128a45f20ab6045e3df095 100644 (file)
@@ -287,8 +287,22 @@ void RGWRoleMetadataHandler::init(RGWSI_Zone *_zone_svc,
   svc.meta = _meta_svc;
   svc.meta_be = _meta_be_svc;
   svc.sysobj = _sysobj_svc;
+  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;
+  }
+
+  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);
+  base_init(cct, get_be_handler());
 }
 
+#if 0
 int RGWRoleMetadataHandler::do_start(optional_yield y, const DoutPrefixProvider *dpp)
 {
 
@@ -306,11 +320,17 @@ int RGWRoleMetadataHandler::do_start(optional_yield y, const DoutPrefixProvider
   bh->set_module(module);
   return 0;
 }
+#endif
 
-RGWRoleMetadataHandler::RGWRoleMetadataHandler(CephContext *cct, Store* store)
+RGWRoleMetadataHandler::RGWRoleMetadataHandler(CephContext *cct, Store* store,
+                                              RGWSI_Zone *_zone_svc,
+                                              RGWSI_Meta *_meta_svc,
+                                              RGWSI_MetaBackend *_meta_be_svc,
+                                              RGWSI_SysObj *_sysobj_svc)
 {
-  base_init(cct, get_be_handler());
+  this->cct = cct;
   store = store;
+  init(_zone_svc, _meta_svc, _meta_be_svc, _sysobj_svc);
 }
 
 void RGWRoleCompleteInfo::dump(ceph::Formatter *f) const
index 03a21eb6d3ef8ba53568b4dcd236ba2cb5e56975..3f3ac266ec6ad914c6c819411630bdbebb0d3b36 100644 (file)
@@ -193,9 +193,13 @@ public:
 
   RGWSI_MetaBackend_Handler * get_be_handler();
 
-  int do_start(optional_yield y, const DoutPrefixProvider *dpp);
+  //int do_start(optional_yield y, const DoutPrefixProvider *dpp);
 
-  RGWRoleMetadataHandler(CephContext *cct, Store* store);
+  RGWRoleMetadataHandler(CephContext *cct, Store* store,
+                          RGWSI_Zone *_zone_svc,
+                          RGWSI_Meta *_meta_svc,
+                          RGWSI_MetaBackend *_meta_be_svc,
+                          RGWSI_SysObj *_sysobj_svc);
 
   std::string get_type() final { return "roles";  }
 
@@ -228,6 +232,7 @@ private:
   RGWSI_MetaBackend_Handler *be_handler;
   std::unique_ptr<RGWSI_MetaBackend::Module> be_module;
   std::unique_ptr<Store> store;
+  CephContext *cct;
 };
 } } // namespace rgw::sal
 
index 537334b4cad0eab2d01f4b0678e33dbad2d82456..fc723c05394128d023764e3eb5fd5446b4307f7b 100644 (file)
@@ -372,7 +372,7 @@ int RGWCtlDef::init(RGWServices& svc, rgw::sal::Store* store, const DoutPrefixPr
   }
 
   meta.otp.reset(RGWOTPMetaHandlerAllocator::alloc());
-  meta.role = std::make_unique<rgw::sal::RGWRoleMetadataHandler>(svc.cct, store);
+  meta.role = std::make_unique<rgw::sal::RGWRoleMetadataHandler>(svc.cct, store, svc.zone, svc.meta, svc.meta_be_sobj, svc.sysobj);
 
   user.reset(new RGWUserCtl(svc.zone, svc.user, (RGWUserMetadataHandler *)meta.user.get()));
   bucket.reset(new RGWBucketCtl(svc.zone,