From 3500e6cf06f125ff870f34984969839de933acda Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 2 Nov 2022 13:14:42 -0400 Subject: [PATCH] rgw: auth_registry uses unique_ptr instead of shared_ptr Signed-off-by: Casey Bodley --- src/rgw/rgw_appmain.cc | 5 ++--- src/rgw/rgw_auth_registry.h | 6 +++--- src/rgw/rgw_process.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/rgw/rgw_appmain.cc b/src/rgw/rgw_appmain.cc index a572d763ff96f..bef2bddd9bef0 100644 --- a/src/rgw/rgw_appmain.cc +++ b/src/rgw/rgw_appmain.cc @@ -390,8 +390,6 @@ int rgw::AppMain::init_frontends2(RGWLib* rgwlib) * the dynamic reconfiguration. */ implicit_tenant_context.reset(new rgw::auth::ImplicitTenants{g_conf()}); g_conf().add_observer(implicit_tenant_context.get()); - auto auth_registry = - rgw::auth::StrategyRegistry::create(dpp->get_cct(), *implicit_tenant_context, env.driver); /* allocate a mime table (you'd never guess that from the name) */ rgw_tools_init(dpp, dpp->get_cct()); @@ -406,7 +404,8 @@ int rgw::AppMain::init_frontends2(RGWLib* rgwlib) // initialize RGWProcessEnv env.rest = &rest; env.olog = olog; - env.auth_registry = auth_registry; + env.auth_registry = rgw::auth::StrategyRegistry::create( + dpp->get_cct(), *implicit_tenant_context, env.driver); env.ratelimiting = ratelimiter.get(); env.lua_background = lua_background.get(); diff --git a/src/rgw/rgw_auth_registry.h b/src/rgw/rgw_auth_registry.h index 003c32d87ebda..992ee46e81c73 100644 --- a/src/rgw/rgw_auth_registry.h +++ b/src/rgw/rgw_auth_registry.h @@ -84,11 +84,11 @@ public: return sts_strategy; } - static std::shared_ptr + static std::unique_ptr create(CephContext* const cct, const ImplicitTenants& implicit_tenant_context, rgw::sal::Driver* driver) { - return std::make_shared(cct, implicit_tenant_context, driver); + return std::make_unique(cct, implicit_tenant_context, driver); } }; @@ -96,6 +96,6 @@ public: } /* namespace rgw */ using rgw_auth_registry_t = rgw::auth::StrategyRegistry; -using rgw_auth_registry_ptr_t = std::shared_ptr; +using rgw_auth_registry_ptr_t = std::unique_ptr; #endif /* CEPH_RGW_AUTH_REGISTRY_H */ diff --git a/src/rgw/rgw_process.h b/src/rgw/rgw_process.h index 36f7ba924de51..d3a9f5cc24e80 100644 --- a/src/rgw/rgw_process.h +++ b/src/rgw/rgw_process.h @@ -32,7 +32,7 @@ struct RGWProcessEnv { rgw::sal::Driver* driver = nullptr; RGWREST *rest = nullptr; OpsLogSink *olog = nullptr; - std::shared_ptr auth_registry; + rgw_auth_registry_ptr_t auth_registry; ActiveRateLimiter* ratelimiting = nullptr; rgw::lua::Background* lua_background = nullptr; }; -- 2.39.5