From ccdb0d1b506bf985d0c4c0c511eed57e3d696c97 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Thu, 24 Mar 2016 12:01:51 +0100 Subject: [PATCH] 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 --- src/rgw/rgw_op.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; } } -- 2.47.3