From: Abhishek Lekshmanan Date: Mon, 31 Aug 2020 12:46:45 +0000 (+0200) Subject: rgw: introduce RGW Role Rados service X-Git-Tag: v17.2.6~119^2~53 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=87d24ac24ad5375d91f0aaddaac73bd3a9c44fa0;p=ceph.git rgw: introduce RGW Role Rados service This handles the metadata for RGW Roles with the RADOS backend Signed-off-by: Abhishek Lekshmanan (cherry picked from commit 3fe43071e2d641ff0bf39510716abc13fd13f5a6) --- diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index bee4cd0c9a42..2471ebda666d 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -39,6 +39,7 @@ set(librgw_common_srcs services/svc_quota.cc services/svc_sync_modules.cc services/svc_rados.cc + services/svc_role_rados.cc services/svc_sys_obj.cc services/svc_sys_obj_cache.cc services/svc_sys_obj_core.cc diff --git a/src/rgw/services/svc_role_rados.cc b/src/rgw/services/svc_role_rados.cc new file mode 100644 index 000000000000..ec592325f127 --- /dev/null +++ b/src/rgw/services/svc_role_rados.cc @@ -0,0 +1,6 @@ +#include "svc_role_rados.h" + +RGWSI_MetaBackend_Handler* RGWSI_Role_RADOS::get_be_handler() +{ + return be_handler; +} diff --git a/src/rgw/services/svc_role_rados.h b/src/rgw/services/svc_role_rados.h new file mode 100644 index 000000000000..44dbc5aa8483 --- /dev/null +++ b/src/rgw/services/svc_role_rados.h @@ -0,0 +1,79 @@ +// -*- 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 "svc_role.h" +#include "svc_meta_be.h" + +class RGWSI_Role_RADOS: public RGWSI_Role +{ + public: + RGWSI_Role_RADOS(CephContext *cct) : RGWSI_Role(cct) {} + ~RGWSI_Role_RADOS() {} + + RGWSI_MetaBackend_Handler * get_be_handler() override; + + int store_info(RGWSI_MetaBackend::Context *ctx, + const RGWRole& role, + RGWObjVersionTracker * const objv_tracker, + real_time * const pmtime, + bool exclusive, + std::map * pattrs, + optional_yield y) override; + + int store_name(RGWSI_MetaBackend::Context *ctx, + const std::string& name, + RGWObjVersionTracker * const objv_tracker, + real_time * const pmtime, + bool exclusive, + optional_yield y) override; + + int store_path(RGWSI_MetaBackend::Context *ctx, + const std::string& path, + RGWObjVersionTracker * const objv_tracker, + real_time * const pmtime, + bool exclusive, + optional_yield y) override; + + int read_info(RGWSI_MetaBackend::Context *ctx, + RGWRole *role, + RGWObjVersionTracker * const objv_tracker, + real_time * const pmtime, + std::map * pattrs, + optional_yield y) override; + + int read_name(RGWSI_MetaBackend::Context *ctx, + std::string& name, + RGWObjVersionTracker * const objv_tracker, + real_time * const pmtime, + optional_yield y) override; + + int read_path(RGWSI_MetaBackend::Context *ctx, + std::string& path, + RGWObjVersionTracker * const objv_tracker, + real_time * const pmtime, + optional_yield y) override; + + int delete_info(RGWSI_MetaBackend::Context *ctx, + const std::string& name, + RGWObjVersionTracker * const objv_tracker, + optional_yield y) override; + + +private: + RGWSI_MetaBackend_Handler *be_handler; + std::unique_ptr be_module; +};