From 5caddb39faf1313d9ebf7ddcdee01242d334bd8b Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 19 Sep 2018 09:35:03 -0400 Subject: [PATCH] rgw: remove redundant quota logic from admin/user api RGWOp_User_Create was applying the configured default quotas to the RGWUserAdminOpState, but RGWUser::execute_add() will already apply those defaults when the AdminOpState doesn't provide them Signed-off-by: Casey Bodley (cherry picked from commit 3a252bbc59fd0a0fb8430e09948420c7092717a6) --- src/rgw/rgw_rest_user.cc | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/rgw/rgw_rest_user.cc b/src/rgw/rgw_rest_user.cc index ee526e3c03a41..2d23c4d4430d8 100644 --- a/src/rgw/rgw_rest_user.cc +++ b/src/rgw/rgw_rest_user.cc @@ -151,37 +151,6 @@ void RGWOp_User_Create::execute() if (gen_key) op_state.set_generate_key(); - RGWQuotaInfo bucket_quota; - RGWQuotaInfo user_quota; - - if (s->cct->_conf->rgw_bucket_default_quota_max_objects >= 0) { - bucket_quota.max_objects = s->cct->_conf->rgw_bucket_default_quota_max_objects; - bucket_quota.enabled = true; - } - - if (s->cct->_conf->rgw_bucket_default_quota_max_size >= 0) { - bucket_quota.max_size = s->cct->_conf->rgw_bucket_default_quota_max_size; - bucket_quota.enabled = true; - } - - if (s->cct->_conf->rgw_user_default_quota_max_objects >= 0) { - user_quota.max_objects = s->cct->_conf->rgw_user_default_quota_max_objects; - user_quota.enabled = true; - } - - if (s->cct->_conf->rgw_user_default_quota_max_size >= 0) { - user_quota.max_size = s->cct->_conf->rgw_user_default_quota_max_size; - user_quota.enabled = true; - } - - if (bucket_quota.enabled) { - op_state.set_bucket_quota(bucket_quota); - } - - if (user_quota.enabled) { - op_state.set_user_quota(user_quota); - } - http_ret = RGWUserAdminOp_User::create(store, op_state, flusher); } -- 2.39.5