]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: optimize rgw performance, avoid unnecessary bucket list and memory copy
authorliuchang0812 <liuchang0812@gmail.com>
Thu, 16 Mar 2017 03:59:25 +0000 (11:59 +0800)
committerliuchang0812 <liuchang0812@gmail.com>
Thu, 16 Mar 2017 06:25:07 +0000 (14:25 +0800)
We do not use buckets_vec in following code, and rgw_read_user_buckets with
`need_stats=false` will not modify other variables. So we could remove this
bucket-listing code, get better performance.

Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
src/rgw/rgw_user.cc

index 162e1b7189c19099d9d6b6ba74f59508103fb7f3..cbc2c248f4efeb21988adedea4b228e81437b5be 100644 (file)
@@ -404,34 +404,7 @@ int rgw_remove_swift_name_index(RGWRados *store, string& swift_name)
  * themselves alone, as well as any ACLs embedded in object xattrs.
  */
 int rgw_delete_user(RGWRados *store, RGWUserInfo& info, RGWObjVersionTracker& objv_tracker) {
-  string marker;
-  vector<rgw_bucket> buckets_vec;
-
-  bool done;
-  bool is_truncated;
   int ret;
-  CephContext *cct = store->ctx();
-  size_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk;
-
-  do {
-    RGWUserBuckets user_buckets;
-    ret = rgw_read_user_buckets(store, info.user_id, user_buckets, marker,
-                               string(), max_buckets, false, &is_truncated);
-    if (ret < 0)
-      return ret;
-
-    map<string, RGWBucketEnt>& buckets = user_buckets.get_buckets();
-    for (map<string, RGWBucketEnt>::iterator i = buckets.begin();
-        i != buckets.end();
-        ++i) {
-      RGWBucketEnt& bucket = i->second;
-      buckets_vec.push_back(bucket.bucket);
-
-      marker = i->first;
-    }
-
-    done = (buckets.size() < max_buckets);
-  } while (!done);
 
   map<string, RGWAccessKey>::iterator kiter = info.access_keys.begin();
   for (; kiter != info.access_keys.end(); ++kiter) {