]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/aio: remove RGWSI_RADOS from generic Aio::get()
authorCasey Bodley <cbodley@redhat.com>
Thu, 2 Mar 2023 15:06:36 +0000 (10:06 -0500)
committerCasey Bodley <cbodley@redhat.com>
Sun, 12 Mar 2023 22:56:54 +0000 (18:56 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_aio.h
src/rgw/rgw_aio_throttle.cc
src/rgw/rgw_aio_throttle.h

index 6a49a5370eb5dd45bfc66ae173dcdbc81eba0f17..0070346327b71b5074ff3f182aa79b37c9cacbcc 100644 (file)
@@ -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;
index 8ada6db34a91bcf3d065bd668b48187b6d1d78e3..91f8202a08e2e0a3d1942f2fd49389c85d187896 100644 (file)
@@ -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<Pending>();
-  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<Pending>();
-  p->obj = obj;
+  p->obj = std::move(obj);
   p->id = id;
   p->cost = cost;
 
index 30ae93cd6b546fd73ea2c03a3f9535727700d699..89f9c0eef649b2670acb4eaebbc732ce367a7560 100644 (file)
 
 #pragma once
 
-#include "include/rados/librados_fwd.hpp"
 #include <memory>
 #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;