]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw:Use count fn in RGWUserBuckets for quota check 8294/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 24 Mar 2016 11:01:51 +0000 (12:01 +0100)
committerAbhishek Lekshmanan <abhishek@suse.com>
Thu, 24 Mar 2016 11:01:51 +0000 (12:01 +0100)
We already have a count function from RGWUserBuckets class which gives
the total size of the map, use that instead of getting the map and doing
a count.

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_op.cc

index 2702111b0fb4016cd3e75e580dbf766884e26aa9..66ecd5568d28a5adcc939af66c4c7c1211b18b66 100644 (file)
@@ -1779,8 +1779,7 @@ int RGWCreateBucket::verify_permission()
     if (op_ret < 0)
       return op_ret;
 
-    map<string, RGWBucketEnt>& m = buckets.get_buckets();
-    if (m.size() >= s->user->max_buckets) {
+    if (buckets.count() >= s->user->max_buckets) {
       return -ERR_TOO_MANY_BUCKETS;
     }
   }