]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: new rest api to retrieve object layout
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 9 Jan 2017 21:04:43 +0000 (13:04 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 9 Mar 2017 17:18:56 +0000 (09:18 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_rest_s3.cc

index 72629986fd962afb73e586c4857d99852b7e4bf7..66520db7732869600a1ed663168da8b2cc9fdf56 100644 (file)
@@ -5526,9 +5526,8 @@ void RGWGetObjLayout::pre_exec()
 
 void RGWGetObjLayout::execute()
 {
-  rgw_obj obj(s->bucket, s->object.name);
-  obj.set_instance(s->object.instance);
-  target = new RGWRados::Object(store, s->bucket_info, *static_cast<RGWObjectCtx *>(s->obj_ctx), obj);
+  rgw_obj obj(s->bucket, s->object);
+  target = new RGWRados::Object(store, s->bucket_info, *static_cast<RGWObjectCtx *>(s->obj_ctx), rgw_obj(s->bucket, s->object));
   RGWRados::Object::Read stat_op(target);
 
   op_ret = stat_op.prepare();
@@ -5536,7 +5535,7 @@ void RGWGetObjLayout::execute()
     return;
   }
 
-  head_obj = stat_op.state.obj;
+  head_obj = stat_op.state.head_obj;
 
   op_ret = target->get_manifest(&manifest);
 }
index 717c6ef318db5a123fa69afea16cd10f89fbc414..0d2ef7844a25fb49003f35541da7e2fd37f526c4 100644 (file)
@@ -1770,7 +1770,7 @@ class RGWGetObjLayout : public RGWOp {
 protected:
   RGWRados::Object *target{nullptr};
   RGWObjManifest *manifest{nullptr};
-  rgw_obj head_obj;
+  rgw_raw_obj head_obj;
 
 public:
   RGWGetObjLayout() {
index 34f38027ecaf951b0635bc01958f29da76c3776a..83c267ff3b2d3c968c317f82d81bf03742e5537d 100644 (file)
@@ -2921,9 +2921,9 @@ void RGWGetObjLayout_ObjStore_S3::send_response()
   f.open_array_section("data_location");
   for (auto miter = manifest->obj_begin(); miter != manifest->obj_end(); ++miter) {
     f.open_object_section("obj");
-    rgw_obj loc = miter.get_location();
+    rgw_raw_obj raw_loc = miter.get_location().get_raw_obj(store);
     ::encode_json("ofs", miter.get_ofs(), &f);
-    ::encode_json("loc", loc, &f);
+    ::encode_json("loc", raw_loc, &f);
     ::encode_json("loc_ofs", miter.location_ofs(), &f);
     ::encode_json("loc_size", miter.get_stripe_size(), &f);
     f.close_section();