From: Abhishek Lekshmanan Date: Thu, 24 Mar 2016 11:01:51 +0000 (+0100) Subject: rgw:Use count fn in RGWUserBuckets for quota check X-Git-Tag: v10.1.1~113^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ccdb0d1b506bf985d0c4c0c511eed57e3d696c97;p=ceph.git rgw:Use count fn in RGWUserBuckets for quota check 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 --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 2702111b0fb4..66ecd5568d28 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1779,8 +1779,7 @@ int RGWCreateBucket::verify_permission() if (op_ret < 0) return op_ret; - map& m = buckets.get_buckets(); - if (m.size() >= s->user->max_buckets) { + if (buckets.count() >= s->user->max_buckets) { return -ERR_TOO_MANY_BUCKETS; } }