From: Mark Nelson Date: Wed, 28 Aug 2019 03:35:47 +0000 (-0400) Subject: rgw/rgw_op: Remove get_val from hotpath via legacy options X-Git-Tag: v14.2.5~206^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=35c188b05a6f863c3f231152f07dacce0ec3ad17;p=ceph.git rgw/rgw_op: Remove get_val from hotpath via legacy options Signed-off-by: Mark Nelson (cherry picked from commit b7608ec2800d5b1e015682a31a889b4cd64794c9) --- diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 340e740b4699..72a0f389632a 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1262,6 +1262,10 @@ OPTION(rados_tracing, OPT_BOOL) // true if LTTng-UST tracepoints should be enabl OPTION(nss_db_path, OPT_STR) // path to nss db +OPTION(rgw_max_attr_name_len, OPT_SIZE) +OPTION(rgw_max_attr_size, OPT_SIZE) +OPTION(rgw_max_attrs_num_in_req, OPT_U64) + OPTION(rgw_max_chunk_size, OPT_INT) OPTION(rgw_put_obj_min_window_size, OPT_INT) OPTION(rgw_put_obj_max_window_size, OPT_INT) diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index 346c518ff343..7dfed9959542 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -1954,26 +1954,23 @@ static inline int rgw_get_request_metadata(CephContext* const cct, * name. Passing here doesn't guarantee that an OSD will accept that * as ObjectStore::get_max_attr_name_length() can set the limit even * lower than the "osd_max_attr_name_len" configurable. */ - const size_t max_attr_name_len = \ - cct->_conf.get_val("rgw_max_attr_name_len"); + const auto max_attr_name_len = cct->_conf->rgw_max_attr_name_len; if (max_attr_name_len && attr_name.length() > max_attr_name_len) { return -ENAMETOOLONG; } /* 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("rgw_max_attr_size"); + const auto max_attr_size = cct->_conf->rgw_max_attr_size; if (max_attr_size && xattr.length() > max_attr_size) { return -EFBIG; } /* Swift allows administrators to limit the number of metadats items * send _in a single request_. */ - const auto rgw_max_attrs_num_in_req = \ - cct->_conf.get_val("rgw_max_attrs_num_in_req"); - if (rgw_max_attrs_num_in_req && - ++valid_meta_count > rgw_max_attrs_num_in_req) { + const auto max_attrs_num_in_req = cct->_conf->rgw_max_attrs_num_in_req; + if (max_attrs_num_in_req && + ++valid_meta_count > max_attrs_num_in_req) { return -E2BIG; }