summaryrefslogtreecommitdiffstats
path: root/src/rgw
diff options
context:
space:
mode:
authorAbhishek Lekshmanan <abhishek@suse.com>2020-10-01 14:42:32 +0200
committerPritha Srivastava <prsrivas@redhat.com>2022-06-06 12:49:42 +0200
commite2b8006bb6a8a1922093eff8a1e207d991eda0ff (patch)
tree34699ec59151f5be564c83da1a4f65c6f4b9fbe7 /src/rgw
parentsvc: introduce role_rados service (diff)
downloadceph-e2b8006bb6a8a1922093eff8a1e207d991eda0ff.tar.xz
ceph-e2b8006bb6a8a1922093eff8a1e207d991eda0ff.zip
rgw: base role md handler decl
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
Diffstat (limited to 'src/rgw')
-rw-r--r--src/rgw/rgw_role.cc5
-rw-r--r--src/rgw/rgw_role.h38
-rw-r--r--src/rgw/rgw_service.cc1
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());