diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rgw/rgw_role.cc | 5 | ||||
-rw-r--r-- | src/rgw/rgw_role.h | 38 | ||||
-rw-r--r-- | src/rgw/rgw_service.cc | 1 |
3 files changed, 42 insertions, 2 deletions
diff --git a/src/rgw/rgw_role.cc b/src/rgw/rgw_role.cc index 5398c900be8..35161e2bcac 100644 --- a/src/rgw/rgw_role.cc +++ b/src/rgw/rgw_role.cc @@ -381,3 +381,8 @@ int RGWRoleCtl::delete_path(const std::string& role_id, }); } +RGWRoleMetadataHandler::RGWRoleMetadataHandler(RGWSI_Role *role_svc) +{ + base_init(role_svc->ctx(), role_svc->get_be_handler()); + svc.role = role_svc; +} diff --git a/src/rgw/rgw_role.h b/src/rgw/rgw_role.h index 2fc39b13748..0332159ab56 100644 --- a/src/rgw/rgw_role.h +++ b/src/rgw/rgw_role.h @@ -11,8 +11,9 @@ #include "common/ceph_json.h" #include "common/ceph_context.h" #include "rgw/rgw_rados.h" -//#include "svc_meta_be.h" +#include "rgw_metadata.h" +class RGWCtl; class RGWRados; class RGWRoleMetadataHandler; class RGWSI_Role; @@ -146,6 +147,36 @@ public: WRITE_CLASS_ENCODER(RGWRole) } } // namespace rgw::sal +//class RGWMetadataObject; + +class RGWRoleMetadataHandler: public RGWMetadataHandler_GenericMetaBE +{ + struct Svc { + RGWSI_Role *role{nullptr}; + } svc; + +public: + + RGWRoleMetadataHandler(RGWSI_Role *role_svc); + + int do_get(RGWSI_MetaBackend_Handler::Op *op, + std::string& entry, + RGWMetadataObject **obj, + optional_yield y, + const DoutPrefixProvider *dpp) final + { + return 0; // TODO + } + + int do_remove(RGWSI_MetaBackend_Handler::Op *op, + std::string& entry, + RGWObjVersionTracker& objv_tracker, + optional_yield y, + const DoutPrefixProvider *dpp) final { + return 0; // TODO + } +}; + class RGWRoleCtl { struct Svc { RGWSI_Role *role {nullptr}; @@ -154,7 +185,10 @@ class RGWRoleCtl { RGWSI_MetaBackend_Handler *be_handler{nullptr}; public: RGWRoleCtl(RGWSI_Role *_role_svc, - RGWRoleMetadataHandler *_rmhander); + RGWRoleMetadataHandler *_rmhandler) { + svc.role = _role_svc; + rmhandler = _rmhandler; + } struct PutParams { ceph::real_time mtime; diff --git a/src/rgw/rgw_service.cc b/src/rgw/rgw_service.cc index aacdf35646d..9fd6a74a361 100644 --- a/src/rgw/rgw_service.cc +++ b/src/rgw/rgw_service.cc @@ -378,6 +378,7 @@ int RGWCtlDef::init(RGWServices& svc, const DoutPrefixProvider *dpp) 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()); |