]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: cleanup.
authorPritha Srivastava <prsrivas@redhat.com>
Wed, 27 Oct 2021 09:12:46 +0000 (14:42 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Mon, 6 Jun 2022 10:49:43 +0000 (16:19 +0530)
Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
src/rgw/rgw_role.cc
src/rgw/rgw_role.h
src/rgw/rgw_service.cc
src/rgw/rgw_service.h

index beefc2c60b509eb8f8ea1c34ea2f4a4c494ccfc1..02d3687b0064471e3157cce6eac8abfc6e5e4d5c 100644 (file)
@@ -329,7 +329,7 @@ RGWRoleMetadataHandler::RGWRoleMetadataHandler(CephContext *cct, Store* store,
                                               RGWSI_SysObj *_sysobj_svc)
 {
   this->cct = cct;
-  store = store;
+  this->store = store;
   init(_zone_svc, _meta_svc, _meta_be_svc, _sysobj_svc);
 }
 
@@ -337,14 +337,14 @@ void RGWRoleCompleteInfo::dump(ceph::Formatter *f) const
 {
   info->dump(f);
   if (has_attrs) {
-    encode_json("attrs", attrs, f);
+    encode_json("attrs", info->get_attrs(), f);
   }
 }
 
 void RGWRoleCompleteInfo::decode_json(JSONObj *obj)
 {
   decode_json_obj(*info, obj);
-  has_attrs = JSONDecoder::decode_json("attrs", attrs, obj);
+  has_attrs = JSONDecoder::decode_json("attrs", info->get_attrs(), obj);
 }
 
 
@@ -370,16 +370,6 @@ int RGWRoleMetadataHandler::do_get(RGWSI_MetaBackend_Handler::Op *op,
                                    const DoutPrefixProvider *dpp)
 {
   RGWRoleCompleteInfo rci;
-#if 0
-  int ret = svc.role->read_info(op->ctx(),
-                                entry,
-                                &rci.info,
-                                &objv_tracker,
-                                &mtime,
-                                &rci.attrs,
-                                y,
-                                dpp);
-#endif
   rci.info = store->get_role(entry).get();
   int ret = rci.info->read_info(dpp, y);
   if (ret < 0) {
@@ -402,14 +392,6 @@ int RGWRoleMetadataHandler::do_remove(RGWSI_MetaBackend_Handler::Op *op,
                                       optional_yield y,
                                       const DoutPrefixProvider *dpp)
 {
-#if 0
-  int ret = svc.role->read_info(op->ctx(), entry, &info, &objv_tracker,
-                               &_mtime, nullptr, y, dpp);
-  if (ret < 0) {
-    return ret == -ENOENT ? 0 : ret;
-  }
-  return svc.role->delete_role(op->ctx(), info, &objv_tracker, y, dpp);
-#endif
   std::unique_ptr<rgw::sal::RGWRole> role = store->get_role(entry);
   int ret = role->read_info(dpp, y);
   if (ret < 0) {
@@ -440,18 +422,6 @@ public:
   int put_checked(const DoutPrefixProvider *dpp) override {
     auto& rci = mdo->get_rci();
     auto mtime = mdo->get_mtime();
-#if 0
-    int ret = rhandler->role->create(op->ctx(),
-                                        rci.info,
-                                        &objv_tracker,
-                                        mtime,
-                                        false,
-                                        pattrs,
-                                        y,
-           dpp);
-
-    return ret < 0 ? ret : STATUS_APPLIED;
-#endif
     rci.info->set_mtime(mtime);
     int ret = rci.info->create(dpp, true, y);
     return ret < 0 ? ret : STATUS_APPLIED;
index c1204c363f8427d8bfee55d3d63959b0841826fe..3090c94d8fd0c60923a9cba26c25579d88e35b97 100644 (file)
 #include "rgw/rgw_rados.h"
 #include "rgw_metadata.h"
 
-class RGWCtl;
 class RGWRados;
-class RGWSI_Role;
-class RGWSI_MetaBackend_Handler;
-class RGWRoleCtl;
 
 namespace rgw { namespace sal {
 class RGWRole
@@ -33,8 +29,6 @@ public:
   static constexpr uint64_t SESSION_DURATION_MAX = 43200; // in seconds
 protected:
 
-  RGWRoleCtl *role_ctl;
-
   std::string id;
   std::string name;
   std::string path;
@@ -128,11 +122,9 @@ public:
   const uint64_t& get_max_session_duration() const { return max_session_duration; }
   const RGWObjVersionTracker& get_objv_tracker() const { return objv_tracker; }
   const real_time& get_mtime() const { return mtime; }
+  std::map<std::string, bufferlist>& get_attrs() { return attrs; }
 
   void set_id(const std::string& id) { this->id = id; }
-  //TODO: Remove the following two
-  void set_arn(const std::string& arn) { this->arn = arn; }
-  void set_creation_date(const std::string& creation_date) { this->creation_date = creation_date; }
   void set_mtime(const real_time& mtime) { this->mtime = mtime; }
 
   virtual int create(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y) = 0;
@@ -159,7 +151,6 @@ WRITE_CLASS_ENCODER(RGWRole)
 
 struct RGWRoleCompleteInfo {
   RGWRole* info;
-  std::map<std::string, bufferlist> attrs;
   bool has_attrs;
 
   void dump(Formatter *f) const;
@@ -238,7 +229,7 @@ public:
 private:
   RGWSI_MetaBackend_Handler *be_handler;
   std::unique_ptr<RGWSI_MetaBackend::Module> be_module;
-  std::unique_ptr<Store> store;
+  Store* store;
   CephContext *cct;
 };
 } } // namespace rgw::sal
index fc723c05394128d023764e3eb5fd5446b4307f7b..7188220bc1618fc0ac964bd9a14c275641a8712e 100644 (file)
@@ -77,7 +77,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<rgw::sal::RadosRole>(store);
 
   if (have_cache) {
     sysobj_cache = std::make_unique<RGWSI_SysObj_Cache>(dpp, cct);
@@ -117,7 +116,6 @@ int RGWServices_Def::init(CephContext *cct,
   }
   user_rados->init(rados.get(), zone.get(), sysobj.get(), sysobj_cache.get(),
                    meta.get(), meta_be_sobj.get(), sync_modules.get());
-  //role_rados->init(zone.get(), meta.get(), meta_be_sobj.get(), sysobj.get());
 
   can_shutdown = true;
 
@@ -250,11 +248,6 @@ int RGWServices_Def::init(CephContext *cct,
       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 */
@@ -324,7 +317,6 @@ int RGWServices::do_init(CephContext *_cct, bool have_cache, bool raw, bool run_
   cache = _svc.sysobj_cache.get();
   core = _svc.sysobj_core.get();
   user = _svc.user_rados.get();
-  //role = _svc.role_rados.get();
 
   return 0;
 }
@@ -380,7 +372,6 @@ int RGWCtlDef::init(RGWServices& svc, rgw::sal::Store* store, const DoutPrefixPr
                                 svc.bucket_sync,
                                 svc.bi));
   otp.reset(new RGWOTPCtl(svc.zone, svc.otp));
-  //role = std::make_unique<RGWRoleCtl>(svc.role, static_cast<RGWRoleMetadataHandler*>(meta.role.get()));
 
   RGWBucketMetadataHandlerBase *bucket_meta_handler = static_cast<RGWBucketMetadataHandlerBase *>(meta.bucket.get());
   RGWBucketInstanceMetadataHandlerBase *bi_meta_handler = static_cast<RGWBucketInstanceMetadataHandlerBase *>(meta.bucket_instance.get());
@@ -424,7 +415,6 @@ int RGWCtl::init(RGWServices *_svc, rgw::sal::Store* store, const DoutPrefixProv
   user = _ctl.user.get();
   bucket = _ctl.bucket.get();
   otp = _ctl.otp.get();
-  //role = _ctl.role.get();
 
   r = meta.user->attach(meta.mgr);
   if (r < 0) {
index e70db0d0e6bede8ea23cc788b58a313bfd9052dd..b1f59d3ff5c8c7d0e825d7215456e6bc0ef2751e 100644 (file)
@@ -12,7 +12,6 @@
 #include "common/async/yield_context.h"
 
 #include "rgw/rgw_common.h"
-//#include "rgw/rgw_sal_rados.h"
 
 struct RGWServices_Def;
 
@@ -66,8 +65,6 @@ class RGWSI_MetaBackend_OTP;
 class RGWSI_Notify;
 class RGWSI_OTP;
 class RGWSI_RADOS;
-//class RGWSI_Role;
-//class RGWSI_Role_RADOS;
 class RGWSI_Zone;
 class RGWSI_ZoneUtils;
 class RGWSI_Quota;
@@ -108,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<rgw::sal::RadosRole> role_rados;
 
   RGWServices_Def();
   ~RGWServices_Def();
@@ -172,7 +168,6 @@ class RGWMetadataHandler;
 class RGWUserCtl;
 class RGWBucketCtl;
 class RGWOTPCtl;
-//class RGWRoleCtl;
 
 struct RGWCtlDef {
   struct _meta {
@@ -190,7 +185,6 @@ struct RGWCtlDef {
   std::unique_ptr<RGWUserCtl> user;
   std::unique_ptr<RGWBucketCtl> bucket;
   std::unique_ptr<RGWOTPCtl> otp;
-  //std::unique_ptr<RGWRoleCtl> role;
 
   RGWCtlDef();
   ~RGWCtlDef();
@@ -217,7 +211,6 @@ struct RGWCtl {
   RGWUserCtl *user{nullptr};
   RGWBucketCtl *bucket{nullptr};
   RGWOTPCtl *otp{nullptr};
-  //RGWRoleCtl *role{nullptr};
 
   int init(RGWServices *_svc, rgw::sal::Store* store, const DoutPrefixProvider *dpp);
 };