]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: optimize function abort_bucket_multiparts
authorBingyin Zhang <zhangbingyin@cloudin.cn>
Thu, 28 Dec 2017 09:09:26 +0000 (17:09 +0800)
committerBingyin Zhang <zhangbingyin@cloudin.cn>
Tue, 2 Jan 2018 23:03:21 +0000 (07:03 +0800)
* 1. common_prefixes is useless, so drop it;
* 2. RGWMPObj object is enough, so change RGWMultipartUploadEntry to RGWMPObj;

Signed-off-by: Bingyin Zhang <zhangbingyin@cloudin.cn>
src/rgw/rgw_multi.cc

index 27d35115dccee59b22c9b2f5647e716c95f6ee41..5c101397bbc9abd20082dff9d17226b80a187189 100644 (file)
@@ -270,23 +270,21 @@ int abort_bucket_multiparts(RGWRados *store, CephContext *cct, RGWBucketInfo& bu
   vector<rgw_bucket_dir_entry> objs;
   RGWObjectCtx obj_ctx(store);
   string marker;
-  map<string, bool> common_prefixes;
   bool is_truncated;
 
   do {
     ret = list_bucket_multiparts(store, bucket_info, prefix, marker, delim,
-                               max, &objs, &common_prefixes, &is_truncated);
+                               max, &objs, nullptr, &is_truncated);
     if (ret < 0) {
       return ret;
     }
     if (!objs.empty()) {
-      RGWMultipartUploadEntry entry;
+      RGWMPObj mp;
       for (const auto& obj : objs) {
         rgw_obj_key key(obj.key);
-        if (!entry.mp.from_meta(key.name))
+        if (!mp.from_meta(key.name))
           continue;
-        entry.obj = obj;
-        ret = abort_multipart_upload(store, cct, &obj_ctx, bucket_info, entry.mp);
+        ret = abort_multipart_upload(store, cct, &obj_ctx, bucket_info, mp);
         if (ret < 0) {
           return ret;
         }