]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options: switch some rgw options to TYPE_SIZE
authorKefu Chai <kchai@redhat.com>
Tue, 13 Feb 2018 08:03:08 +0000 (16:03 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 9 Mar 2018 05:01:05 +0000 (13:01 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/options.cc
src/rgw/rgw_op.h
src/rgw/rgw_rest_swift.cc

index 8fa372391aa907e095c4f0ceabe94102b264d567..40d9aef7785bd122766352dbcb9733c1bcf38625 100644 (file)
@@ -4718,7 +4718,7 @@ std::vector<Option> get_rgw_options() {
     .set_default(100)
     .set_description("Max number of ACL grants in a single request"),
 
-    Option("rgw_max_chunk_size", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rgw_max_chunk_size", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(4_M)
     .set_description("Set RGW max chunk size")
     .set_long_description(
@@ -4728,7 +4728,7 @@ std::vector<Option> get_rgw_options() {
         "need to be atomic, and anything larger than this would require more than a single "
         "operation."),
 
-    Option("rgw_put_obj_min_window_size", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rgw_put_obj_min_window_size", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(16_M)
     .set_description("The minimum RADOS write window size (in bytes).")
     .set_long_description(
@@ -4738,13 +4738,13 @@ std::vector<Option> get_rgw_options() {
         "in order to better utilize the pipe.")
     .add_see_also({"rgw_put_obj_max_window_size", "rgw_max_chunk_size"}),
 
-    Option("rgw_put_obj_max_window_size", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rgw_put_obj_max_window_size", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(64_M)
     .set_description("The maximum RADOS write window size (in bytes).")
     .set_long_description("The window size may be dynamically adjusted, but will not surpass this value.")
     .add_see_also({"rgw_put_obj_min_window_size", "rgw_max_chunk_size"}),
 
-    Option("rgw_max_put_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("rgw_max_put_size", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(5_G)
     .set_description("Max size (in bytes) of regular (non multi-part) object upload.")
     .set_long_description(
@@ -4752,11 +4752,11 @@ std::vector<Option> get_rgw_options() {
         "objects, a special upload mechanism is required. The S3 API provides the "
         "multi-part upload, and Swift provides DLO and SLO."),
 
-    Option("rgw_max_put_param_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("rgw_max_put_param_size", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(1_M)
     .set_description("The maximum size (in bytes) of data input of certain RESTful requests."),
 
-    Option("rgw_max_attr_size", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("rgw_max_attr_size", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(0)
     .set_description("The maximum length of metadata value. 0 skips the check"),
 
@@ -5502,7 +5502,7 @@ std::vector<Option> get_rgw_options() {
     .set_description("RGW shutdown timeout")
     .set_long_description("Number of seconds to wait for a process before exiting unconditionally."),
 
-    Option("rgw_get_obj_window_size", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rgw_get_obj_window_size", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(16_M)
     .set_description("RGW object read window size")
     .set_long_description("The window size in bytes for a single object read request"),
@@ -5560,7 +5560,7 @@ std::vector<Option> get_rgw_options() {
     .set_long_description(
         "If true, RGW will send progress information when copy operation is executed. "),
 
-    Option("rgw_copy_obj_progress_every_bytes", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("rgw_copy_obj_progress_every_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(1_M)
     .set_description("Send copy-object progress info after these many bytes"),
 
index c8cf312ff26b8b0e395e6a3888991b56f68a0240..b4ee8e499592f810b471b004c25099282c4e6574 100644 (file)
@@ -1966,7 +1966,7 @@ static inline int rgw_get_request_metadata(CephContext* const cct,
       /* Similar remarks apply to the check for value size. We're veryfing
        * it early at the RGW's side as it's being claimed in /info. */
       const size_t max_attr_size = \
-        cct->_conf->get_val<size_t>("rgw_max_attr_size");
+        cct->_conf->get_val<Option::size_t>("rgw_max_attr_size");
       if (max_attr_size && xattr.length() > max_attr_size) {
         return -EFBIG;
       }
index 5a3aa19633b9585f81349b5d9a7e33668028956a..9a2551cc86e450e7d05903729d6cf5e6a928aac3 100644 (file)
@@ -711,7 +711,7 @@ static inline int handle_metadata_errors(req_state* const s, const int op_ret)
      * (stored as xattr) size. */
     const auto error_message = boost::str(
       boost::format("Metadata value longer than %lld")
-        % s->cct->_conf->get_val<size_t>("rgw_max_attr_size"));
+        % s->cct->_conf->get_val<Option::size_t>("rgw_max_attr_size"));
     set_req_state_err(s, EINVAL, error_message);
     return -EINVAL;
   } else if (op_ret == -E2BIG) {
@@ -1779,7 +1779,7 @@ void RGWInfo_ObjStore_SWIFT::list_swift_data(Formatter& formatter,
     formatter.dump_int("max_meta_name_length", meta_name_limit);
   }
 
-  const size_t meta_value_limit = g_conf->get_val<size_t>("rgw_max_attr_size");
+  const size_t meta_value_limit = g_conf->get_val<Option::size_t>("rgw_max_attr_size");
   if (meta_value_limit) {
     formatter.dump_int("max_meta_value_length", meta_value_limit);
   }