]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: convert rgw_user_max_buckets to new config options 36019/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Thu, 4 Jun 2020 22:34:27 +0000 (18:34 -0400)
committerNathan Cutler <ncutler@suse.com>
Fri, 10 Jul 2020 19:27:15 +0000 (21:27 +0200)
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 db440588bd1a898073dff09f5421266e4bbec03b..62ba154510e3032690d23d0abee1d87377f87e81 100644 (file)
@@ -6480,8 +6480,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 38d5c9091889c7a96ca04a04380eac981c192e36..2f99074c6f4904b8f6717eb5d9fad75412b30e38 100644 (file)
@@ -521,7 +521,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 9ea45c37127872a44ecf6283ba772997f2d3a724..8b4e49e37f7747ed58a9f128fcf96b7daea20775 100644 (file)
@@ -20,7 +20,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 8e6984a7a165c4d81982f4fa36bc2da7a9282539..c777e0e813d1b20c7d0b2cb4be2ddbc5db013274 100644 (file)
@@ -125,7 +125,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 ee1cded39357bfe5cb3bcc7ee638e9605a87f1d9..b57987e2c1129dcdb5e983c3a0e08b7875faf5ca 100644 (file)
@@ -1743,7 +1743,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();