From 5c3f8daa45024a1d9a26e2fa235633ea217e5b11 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 2 Mar 2023 10:06:36 -0500 Subject: [PATCH] rgw/aio: remove RGWSI_RADOS from generic Aio::get() Signed-off-by: Casey Bodley --- src/rgw/rgw_aio.h | 6 ++---- src/rgw/rgw_aio_throttle.cc | 10 ++++------ src/rgw/rgw_aio_throttle.h | 7 ++----- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/rgw/rgw_aio.h b/src/rgw/rgw_aio.h index 6a49a5370eb5d..0070346327b71 100644 --- a/src/rgw/rgw_aio.h +++ b/src/rgw/rgw_aio.h @@ -23,8 +23,6 @@ #include "include/rados/librados_fwd.hpp" #include "common/async/yield_context.h" -#include "services/svc_rados.h" // cant forward declare RGWSI_RADOS::Obj - #include "rgw_common.h" #include "include/function2.hpp" @@ -34,7 +32,7 @@ struct D3nGetObjData; namespace rgw { struct AioResult { - RGWSI_RADOS::Obj obj; + rgw_raw_obj obj; uint64_t id = 0; // id allows caller to associate a result with its request bufferlist data; // result buffer for reads int result = 0; @@ -79,7 +77,7 @@ class Aio { virtual ~Aio() {} - virtual AioResultList get(const RGWSI_RADOS::Obj& obj, + virtual AioResultList get(rgw_raw_obj obj, OpFunc&& f, uint64_t cost, uint64_t id) = 0; virtual void put(AioResult& r) = 0; diff --git a/src/rgw/rgw_aio_throttle.cc b/src/rgw/rgw_aio_throttle.cc index 8ada6db34a91b..91f8202a08e2e 100644 --- a/src/rgw/rgw_aio_throttle.cc +++ b/src/rgw/rgw_aio_throttle.cc @@ -13,8 +13,6 @@ * */ -#include "include/rados/librados.hpp" - #include "rgw_aio_throttle.h" namespace rgw { @@ -29,12 +27,12 @@ bool Throttle::waiter_ready() const } } -AioResultList BlockingAioThrottle::get(const RGWSI_RADOS::Obj& obj, +AioResultList BlockingAioThrottle::get(rgw_raw_obj obj, OpFunc&& f, uint64_t cost, uint64_t id) { auto p = std::make_unique(); - p->obj = obj; + p->obj = std::move(obj); p->id = id; p->cost = cost; @@ -120,12 +118,12 @@ auto YieldingAioThrottle::async_wait(CompletionToken&& token) return init.result.get(); } -AioResultList YieldingAioThrottle::get(const RGWSI_RADOS::Obj& obj, +AioResultList YieldingAioThrottle::get(rgw_raw_obj obj, OpFunc&& f, uint64_t cost, uint64_t id) { auto p = std::make_unique(); - p->obj = obj; + p->obj = std::move(obj); p->id = id; p->cost = cost; diff --git a/src/rgw/rgw_aio_throttle.h b/src/rgw/rgw_aio_throttle.h index 30ae93cd6b546..89f9c0eef649b 100644 --- a/src/rgw/rgw_aio_throttle.h +++ b/src/rgw/rgw_aio_throttle.h @@ -15,12 +15,10 @@ #pragma once -#include "include/rados/librados_fwd.hpp" #include #include "common/ceph_mutex.h" #include "common/async/completion.h" #include "common/async/yield_context.h" -#include "services/svc_rados.h" #include "rgw_aio.h" namespace rgw { @@ -61,14 +59,13 @@ class BlockingAioThrottle final : public Aio, private Throttle { struct Pending : AioResultEntry { BlockingAioThrottle *parent = nullptr; uint64_t cost = 0; - librados::AioCompletion *completion = nullptr; }; public: BlockingAioThrottle(uint64_t window) : Throttle(window) {} virtual ~BlockingAioThrottle() override {}; - AioResultList get(const RGWSI_RADOS::Obj& obj, OpFunc&& f, + AioResultList get(rgw_raw_obj obj, OpFunc&& f, uint64_t cost, uint64_t id) override final; void put(AioResult& r) override final; @@ -104,7 +101,7 @@ class YieldingAioThrottle final : public Aio, private Throttle { virtual ~YieldingAioThrottle() override {}; - AioResultList get(const RGWSI_RADOS::Obj& obj, OpFunc&& f, + AioResultList get(rgw_raw_obj obj, OpFunc&& f, uint64_t cost, uint64_t id) override final; void put(AioResult& r) override final; -- 2.39.5