]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: convert rgw_user_max_buckets to new config options 36165/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Thu, 4 Jun 2020 22:34:27 +0000 (18:34 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Fri, 17 Jul 2020 22:34:16 +0000 (18:34 -0400)
Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 97bd1dca5c97c4e077de0b88f1280477e521bc43)

src/common/options.cc
src/rgw/rgw_auth.cc
src/rgw/rgw_cr_tools.cc
src/rgw/rgw_rest_user.cc
src/rgw/rgw_user.cc

index 149d14db7c8fa9c2ec4c7121ae29cd3ebb59fda1..f8cbebfd30e585888b028499b91f0ca07f0afc33 100644 (file)
@@ -6725,8 +6725,9 @@ std::vector<Option> get_rgw_options() {
     .set_default(1000)
     .set_description("Max number of buckets per user")
     .set_long_description(
-        "A user can create this many buckets. Zero means unlimited, negative number means "
-        "user cannot create any buckets (although user will retain buckets already created."),
+      "A user can create at most this number of buckets. Zero means "
+      "no limit; a negative value means users cannot create any new "
+      "buckets, although users will retain buckets already created."),
 
     Option("rgw_objexp_gc_interval", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(10_min)
index b03d5b280106b6577d00546f8e948b50b92dc22c..f89e80e44b72882ab177399c537b4f76ba1c459b 100644 (file)
@@ -506,7 +506,8 @@ void rgw::auth::RemoteApplier::create_account(const DoutPrefixProvider* dpp,
   user_info.user_id = new_acct_user;
   user_info.display_name = info.acct_name;
 
-  user_info.max_buckets = cct->_conf->rgw_user_max_buckets;
+  user_info.max_buckets =
+    cct->_conf.get_val<int64_t>("rgw_user_max_buckets");
   rgw_apply_default_bucket_quota(user_info.bucket_quota, cct->_conf);
   rgw_apply_default_user_quota(user_info.user_quota, cct->_conf);
 
index 0d5ab6f4af7af0c64a7ae8de42f8d922068a50d5..85654cb717b742f04d720c782d5405e1a054ad40 100644 (file)
@@ -15,7 +15,8 @@ int RGWUserCreateCR::Request::_send_request()
 {
   CephContext *cct = store->ctx();
 
-  int32_t default_max_buckets = cct->_conf->rgw_user_max_buckets;
+  const int32_t default_max_buckets =
+    cct->_conf.get_val<int64_t>("rgw_user_max_buckets");
 
   RGWUserAdminOpState op_state;
 
index a854afe50d323e834beada64c25c6cebe5ab1d8c..d27105e013a2578f16b466ae91e3b075d5b4df8a 100644 (file)
@@ -119,7 +119,8 @@ void RGWOp_User_Create::execute()
   bool exclusive;
 
   int32_t max_buckets;
-  int32_t default_max_buckets = s->cct->_conf->rgw_user_max_buckets;
+  const int32_t default_max_buckets =
+    s->cct->_conf.get_val<int64_t>("rgw_user_max_buckets");
 
   RGWUserAdminOpState op_state;
 
index 3d369cce0c4bfd942535e5675960426bf0750e61..d88e84436e55d8947bb8961c4d5ba784269ab132 100644 (file)
@@ -1998,7 +1998,8 @@ int RGWUser::execute_add(RGWUserAdminOpState& op_state, std::string *err_msg)
   if (op_state.max_buckets_specified) {
     user_info.max_buckets = op_state.get_max_buckets();
   } else {
-    user_info.max_buckets = cct->_conf->rgw_user_max_buckets;
+    user_info.max_buckets =
+      cct->_conf.get_val<int64_t>("rgw_user_max_buckets");
   }
 
   user_info.suspended = op_state.get_suspension_status();