From df64c45803f847dbda324132f63ea98e6795b25b Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 29 Sep 2016 12:38:19 -0400 Subject: [PATCH] rgw: Bucket::List::list_objects no longer reads compression attribute for size Signed-off-by: Casey Bodley --- src/rgw/rgw_rados.cc | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 59186d3e6057f..fd13ba9e4607f 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -5196,26 +5196,9 @@ int RGWRados::Bucket::List::list_objects(int max, vector *result, goto done; } - RGWObjEnt ent = eiter->second; - ent.key = obj; - ent.ns = ns; - rgw_obj cs_obj(bucket, obj); - bufferlist attr; - map attrset; - int y = store->raw_obj_stat(cs_obj, NULL, NULL, NULL, &attrset, NULL, NULL); - map::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; } -- 2.39.5