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);
}
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()
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;