]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Aio reads return bufferlist in result
authorCasey Bodley <cbodley@redhat.com>
Sat, 17 Nov 2018 04:57:45 +0000 (23:57 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 5 Dec 2018 16:16:54 +0000 (11:16 -0500)
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 25f828a9dc4be42196a9ef1348594414ae6748dd..fe83b1f23add19372c84e4c7871a90534a4af48f 100644 (file)
@@ -27,6 +27,7 @@ namespace rgw {
 
 struct AioResult {
   rgw_raw_obj obj;
+  bufferlist data; // result buffer for reads
   int result = 0;
 };
 struct AioResultEntry : AioResult, boost::intrusive::list_base_hook<> {
@@ -63,7 +64,7 @@ class Aio {
   virtual AioResultList submit(RGWSI_RADOS::Obj& obj,
                                const rgw_raw_obj& raw_obj,
                                librados::ObjectReadOperation *op,
-                               bufferlist *data, uint64_t cost) = 0;
+                               uint64_t cost) = 0;
 
   virtual AioResultList submit(RGWSI_RADOS::Obj& obj,
                                const rgw_raw_obj& raw_obj,
index bf8a8a82722858de6bb13e788dc17b07491dd364..1ec0aa5d51361c6b7f1ccadd4fc1cafbde81c9e6 100644 (file)
@@ -62,7 +62,7 @@ AioResultList AioThrottle::submit(RGWSI_RADOS::Obj& obj,
 AioResultList AioThrottle::submit(RGWSI_RADOS::Obj& obj,
                                   const rgw_raw_obj& raw_obj,
                                   librados::ObjectReadOperation *op,
-                                  bufferlist *data, uint64_t cost)
+                                  uint64_t cost)
 {
   auto p = std::make_unique<Pending>();
   p->obj = raw_obj;
@@ -73,7 +73,7 @@ AioResultList AioThrottle::submit(RGWSI_RADOS::Obj& obj,
     completed.push_back(*p);
   } else {
     get(*p);
-    p->result = obj.aio_operate(p->completion, op, data);
+    p->result = obj.aio_operate(p->completion, op, &p->data);
     if (p->result < 0) {
       put(*p);
     }
index 1f9c53d4b9b4c48c026a6729937d23b501f86b04..b07eae3ae48b255a4a2fc49f5f541c93595ad2bb 100644 (file)
@@ -69,7 +69,7 @@ class AioThrottle : public Aio {
 
   AioResultList submit(RGWSI_RADOS::Obj& obj, const rgw_raw_obj& raw_obj,
                        librados::ObjectReadOperation *op,
-                       bufferlist *data, uint64_t cost) override;
+                       uint64_t cost) override;
 
   AioResultList submit(RGWSI_RADOS::Obj& obj, const rgw_raw_obj& raw_obj,
                        librados::ObjectWriteOperation *op,