From 434a9f09d615f3169754bf96eb538382007e5ed7 Mon Sep 17 00:00:00 2001 From: Daniel Gryniewicz Date: Wed, 29 Jul 2020 12:27:25 -0400 Subject: [PATCH] Removing getRados() - RGWGetObjLayout Signed-off-by: Daniel Gryniewicz --- src/rgw/rgw_op.cc | 16 ++++++++-------- src/rgw/rgw_sal.cc | 1 + src/rgw/rgw_sal.h | 8 ++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 667c09a3bd9..ef63108532b 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -7216,20 +7216,20 @@ void RGWGetObjLayout::pre_exec() void RGWGetObjLayout::execute() { - RGWRados::Object target(store->getRados(), - s->bucket->get_info(), - *static_cast(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 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); } diff --git a/src/rgw/rgw_sal.cc b/src/rgw/rgw_sal.cc index 1aa974954bb..39e573cafee 100644 --- a/src/rgw/rgw_sal.cc +++ b/src/rgw/rgw_sal.cc @@ -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; } diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 2be5675c5fe..f185b7d6ce6 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -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; -- 2.39.5