]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove redundant quota logic from admin/user api
authorCasey Bodley <cbodley@redhat.com>
Wed, 19 Sep 2018 13:35:03 +0000 (09:35 -0400)
committerNathan Cutler <ncutler@suse.com>
Mon, 12 Nov 2018 14:30:42 +0000 (15:30 +0100)
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 <cbodley@redhat.com>
(cherry picked from commit 3a252bbc59fd0a0fb8430e09948420c7092717a6)

src/rgw/rgw_rest_user.cc

index ee526e3c03a41fdc80e1d834dbebf3c192d47c58..2d23c4d4430d8df5959bfb88dd968f131caa1ab2 100644 (file)
@@ -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);
 }