]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Removing getRados() - RGWGetObjLayout
authorDaniel Gryniewicz <dang@redhat.com>
Wed, 29 Jul 2020 16:27:25 +0000 (12:27 -0400)
committerDaniel Gryniewicz <dang@redhat.com>
Mon, 17 Aug 2020 16:30:58 +0000 (12:30 -0400)
Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
src/rgw/rgw_op.cc
src/rgw/rgw_sal.cc
src/rgw/rgw_sal.h

index 667c09a3bd90c93488019b8c4fcb29ae9690eefb..ef63108532b7775137cb56e95e041bdce68e5b01 100644 (file)
@@ -7216,20 +7216,20 @@ void RGWGetObjLayout::pre_exec()
 
 void RGWGetObjLayout::execute()
 {
-  RGWRados::Object target(store->getRados(),
-                          s->bucket->get_info(),
-                          *static_cast<RGWObjectCtx *>(s->obj_ctx),
-                          s->object->get_obj());
-  RGWRados::Object::Read stat_op(&target);
+  /* Make sure bucket is correct */
+  s->object->set_bucket(s->bucket.get());
+
+  std::unique_ptr<rgw::sal::RGWObject::ReadOp> stat_op(s->object->get_read_op(s->obj_ctx));
+
 
-  op_ret = stat_op.prepare(s->yield);
+  op_ret = stat_op->prepare(s->yield);
   if (op_ret < 0) {
     return;
   }
 
-  head_obj = stat_op.state.head_obj;
+  head_obj = stat_op->result.head_obj;
 
-  op_ret = target.get_manifest(&manifest, s->yield);
+  op_ret = stat_op->get_manifest(&manifest, s->yield);
 }
 
 
index 1aa974954bb517e9299981e118fca79e26878696..39e573cafeee3fb25b7bcdc33eeb5769f61b41c6 100644 (file)
@@ -559,6 +559,7 @@ int RGWRadosObject::RadosReadOp::prepare(optional_yield y)
 
   source->set_key(parent_op.state.obj.key);
   source->set_obj_size(obj_size);
+  result.head_obj = parent_op.state.head_obj;
 
   return ret;
 }
index 2be5675c5fe8da86d6075aa630ba22e25e0ab2e4..f185b7d6ce62edfb925f799dbc615e33658d5ac1 100644 (file)
@@ -293,11 +293,18 @@ class RGWObject {
         rgw_obj *target_obj{nullptr}; // XXX dang remove?
       } params;
 
+      struct Result {
+        rgw_raw_obj head_obj;
+
+        Result() : head_obj() {}
+      } result;
+
       virtual ~ReadOp() = default;
 
       virtual int prepare(optional_yield y) = 0;
       virtual int read(int64_t ofs, int64_t end, bufferlist& bl, optional_yield y) = 0;
       virtual int iterate(int64_t ofs, int64_t end, RGWGetDataCB *cb, optional_yield y) = 0;
+      virtual int get_manifest(RGWObjManifest **pmanifest, optional_yield y) = 0;
     };
 
     RGWObject()
@@ -445,6 +452,7 @@ class RGWRadosObject : public RGWObject {
       virtual int prepare(optional_yield y) override;
       virtual int read(int64_t ofs, int64_t end, bufferlist& bl, optional_yield y) override;
       virtual int iterate(int64_t ofs, int64_t end, RGWGetDataCB *cb, optional_yield y) override;
+      virtual int get_manifest(RGWObjManifest **pmanifest, optional_yield y) override;
     };
 
     RGWRadosObject() = default;