]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Bucket::List::list_objects no longer reads compression attribute for size
authorCasey Bodley <cbodley@redhat.com>
Thu, 29 Sep 2016 16:38:19 +0000 (12:38 -0400)
committerAdam Kupczyk <akupczyk@mirantis.com>
Wed, 2 Nov 2016 11:13:06 +0000 (12:13 +0100)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc

index 59186d3e6057fe428d8705a2191672dd53eff21b..fd13ba9e4607f39476f6c37c54bd8d5d6abdc779 100644 (file)
@@ -5196,26 +5196,9 @@ int RGWRados::Bucket::List::list_objects(int max, vector<RGWObjEnt> *result,
         goto done;
       }
 
-      RGWObjEnt ent = eiter->second;
-      ent.key = obj;
-      ent.ns = ns;
-      rgw_obj cs_obj(bucket, obj);
-      bufferlist attr;
-      map<string, bufferlist> attrset;
-      int y = store->raw_obj_stat(cs_obj, NULL, NULL, NULL, &attrset, NULL, NULL);
-      map<string, bufferlist>::iterator cmp = attrset.find(RGW_ATTR_COMPRESSION);
-      if (!y && cmp != attrset.end()) {
-        RGWCompressionInfo cs_info;
-        bufferlist::iterator bliter = cmp->second.begin();
-        try {
-          ::decode(cs_info, bliter);
-        } catch (buffer::error& err) {
-          ldout(cct, 20) << "Failed to get decompressed obj size" << dendl;
-        }
-        if (cs_info.compression_type != "none")
-          ent.size = cs_info.orig_size;
-      }
-      result->push_back(ent);
+      entry.key = obj;
+      entry.ns = ns;
+      result->emplace_back(std::move(entry));
       count++;
     }
 
@@ -11924,8 +11907,8 @@ int RGWRados::cls_bucket_list(rgw_bucket& bucket, int shard_id, rgw_obj_key& sta
       }
     }
     if (r >= 0) {
-      m[name] = e;
       ldout(cct, 10) << "RGWRados::cls_bucket_list: got " << e.key.name << "[" << e.key.instance << "]" << dendl;
+      m[name] = std::move(e);
       ++count;
     }