From f3f6325dbda5ec827de4d3fc1c09de08ba75da12 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 11 Aug 2021 11:43:42 +0800 Subject: [PATCH] rgw: build without "using namespace std" * add "std::" prefix in headers * add "using" declarations in .cc files. so we don't rely on "using namespace std" in one or more included headers. Signed-off-by: Kefu Chai --- src/rgw/cls_fifo_legacy.cc | 4 +- src/rgw/librgw.cc | 2 + src/rgw/rgw_acl.cc | 2 + src/rgw/rgw_acl.h | 56 ++-- src/rgw/rgw_acl_s3.cc | 2 + src/rgw/rgw_acl_s3.h | 20 +- src/rgw/rgw_acl_swift.cc | 2 + src/rgw/rgw_admin.cc | 2 + src/rgw/rgw_arn.cc | 2 + src/rgw/rgw_asio_frontend.cc | 2 + src/rgw/rgw_auth.cc | 1 + src/rgw/rgw_auth.h | 66 ++--- src/rgw/rgw_auth_filters.h | 6 +- src/rgw/rgw_auth_keystone.cc | 1 + src/rgw/rgw_auth_keystone.h | 2 +- src/rgw/rgw_auth_s3.cc | 2 + src/rgw/rgw_auth_s3.h | 2 +- src/rgw/rgw_basic_types.cc | 1 + src/rgw/rgw_basic_types.h | 14 +- src/rgw/rgw_bucket.cc | 2 + src/rgw/rgw_bucket.h | 82 +++--- src/rgw/rgw_bucket_encryption.h | 16 +- src/rgw/rgw_bucket_sync.cc | 1 + src/rgw/rgw_bucket_sync.h | 50 ++-- src/rgw/rgw_cache.cc | 1 + src/rgw/rgw_cache.h | 36 +-- src/rgw/rgw_client_io.h | 2 +- src/rgw/rgw_common.cc | 1 + src/rgw/rgw_common.h | 340 +++++++++++----------- src/rgw/rgw_compression.cc | 2 + src/rgw/rgw_compression.h | 6 +- src/rgw/rgw_compression_types.h | 4 +- src/rgw/rgw_coroutine.cc | 1 + src/rgw/rgw_coroutine.h | 83 +++--- src/rgw/rgw_cors.cc | 8 +- src/rgw/rgw_cors.h | 14 +- src/rgw/rgw_cors_s3.cc | 1 + src/rgw/rgw_cors_s3.h | 2 +- src/rgw/rgw_cors_swift.h | 4 +- src/rgw/rgw_cr_rados.cc | 2 + src/rgw/rgw_cr_rados.h | 138 ++++----- src/rgw/rgw_cr_rest.cc | 2 + src/rgw/rgw_cr_rest.h | 72 ++--- src/rgw/rgw_cr_tools.cc | 2 + src/rgw/rgw_cr_tools.h | 10 +- src/rgw/rgw_crypt.cc | 2 +- src/rgw/rgw_crypt.h | 4 +- src/rgw/rgw_d3n_datacache.cc | 2 +- src/rgw/rgw_d3n_datacache.h | 20 +- src/rgw/rgw_data_sync.cc | 2 + src/rgw/rgw_data_sync.h | 96 +++--- src/rgw/rgw_datalog.cc | 4 +- src/rgw/rgw_datalog.h | 4 +- src/rgw/rgw_dencoder.cc | 2 + src/rgw/rgw_env.cc | 2 + src/rgw/rgw_es_main.cc | 1 + src/rgw/rgw_es_query.cc | 2 + src/rgw/rgw_es_query.h | 53 ++-- src/rgw/rgw_etag_verifier.h | 4 +- src/rgw/rgw_file.cc | 1 + src/rgw/rgw_file.h | 22 +- src/rgw/rgw_formats.cc | 2 + src/rgw/rgw_formats.h | 6 +- src/rgw/rgw_frontend.cc | 2 + src/rgw/rgw_frontend.h | 6 +- src/rgw/rgw_gc.cc | 1 + src/rgw/rgw_gc.h | 14 +- src/rgw/rgw_http_client.cc | 2 + src/rgw/rgw_http_client.h | 60 ++-- src/rgw/rgw_iam_policy.cc | 2 + src/rgw/rgw_iam_policy.h | 10 +- src/rgw/rgw_json_enc.cc | 2 + src/rgw/rgw_jsonparser.cc | 1 + src/rgw/rgw_keystone.cc | 2 + src/rgw/rgw_keystone.h | 36 +-- src/rgw/rgw_kms.cc | 1 + src/rgw/rgw_kms.h | 4 +- src/rgw/rgw_lc.cc | 2 + src/rgw/rgw_lc.h | 90 +++--- src/rgw/rgw_lc_s3.cc | 2 + src/rgw/rgw_lc_s3.h | 2 +- src/rgw/rgw_ldap.cc | 2 + src/rgw/rgw_lib.h | 2 +- src/rgw/rgw_lib_frontend.h | 2 +- src/rgw/rgw_loadgen.cc | 2 + src/rgw/rgw_loadgen_process.cc | 2 + src/rgw/rgw_log.cc | 2 + src/rgw/rgw_log.h | 28 +- src/rgw/rgw_log_backing.cc | 3 +- src/rgw/rgw_log_backing.h | 2 +- src/rgw/rgw_lua.cc | 2 +- src/rgw/rgw_main.cc | 2 + src/rgw/rgw_mdlog.h | 34 +-- src/rgw/rgw_meta_sync_status.h | 6 +- src/rgw/rgw_metadata.cc | 2 + src/rgw/rgw_metadata.h | 76 ++--- src/rgw/rgw_multi.cc | 2 +- src/rgw/rgw_multi.h | 12 +- src/rgw/rgw_multi_del.cc | 2 +- src/rgw/rgw_multi_del.h | 8 +- src/rgw/rgw_multiparser.cc | 3 +- src/rgw/rgw_obj_manifest.cc | 2 + src/rgw/rgw_obj_manifest.h | 42 +-- src/rgw/rgw_object_expirer_core.cc | 2 + src/rgw/rgw_object_expirer_core.h | 2 + src/rgw/rgw_object_lock.cc | 2 + src/rgw/rgw_object_lock.h | 24 +- src/rgw/rgw_oidc_provider.cc | 2 + src/rgw/rgw_oidc_provider.h | 12 +- src/rgw/rgw_op.cc | 1 + src/rgw/rgw_op.h | 166 +++++------ src/rgw/rgw_opa.cc | 2 + src/rgw/rgw_orphan.cc | 2 + src/rgw/rgw_orphan.h | 54 ++-- src/rgw/rgw_policy_s3.cc | 2 + src/rgw/rgw_policy_s3.h | 22 +- src/rgw/rgw_process.cc | 1 + src/rgw/rgw_process.h | 4 +- src/rgw/rgw_public_access.cc | 2 +- src/rgw/rgw_public_access.h | 2 +- src/rgw/rgw_pubsub.cc | 1 + src/rgw/rgw_pubsub.h | 44 +-- src/rgw/rgw_putobj_processor.cc | 2 + src/rgw/rgw_putobj_processor.h | 8 +- src/rgw/rgw_quota.cc | 1 + src/rgw/rgw_rados.h | 329 +++++++++++---------- src/rgw/rgw_request.h | 6 +- src/rgw/rgw_reshard.cc | 2 + src/rgw/rgw_reshard.h | 28 +- src/rgw/rgw_resolve.cc | 1 + src/rgw/rgw_resolve.h | 2 +- src/rgw/rgw_rest.cc | 2 + src/rgw/rgw_rest.h | 32 +- src/rgw/rgw_rest_bucket.cc | 1 + src/rgw/rgw_rest_client.cc | 2 + src/rgw/rgw_rest_client.h | 78 ++--- src/rgw/rgw_rest_config.cc | 2 + src/rgw/rgw_rest_conn.cc | 2 + src/rgw/rgw_rest_conn.h | 132 ++++----- src/rgw/rgw_rest_iam.cc | 2 + src/rgw/rgw_rest_iam.h | 5 +- src/rgw/rgw_rest_log.cc | 2 + src/rgw/rgw_rest_log.h | 12 +- src/rgw/rgw_rest_metadata.cc | 2 + src/rgw/rgw_rest_metadata.h | 2 +- src/rgw/rgw_rest_oidc_provider.cc | 2 + src/rgw/rgw_rest_oidc_provider.h | 8 +- src/rgw/rgw_rest_pubsub.cc | 2 + src/rgw/rgw_rest_pubsub_common.h | 4 +- src/rgw/rgw_rest_realm.cc | 2 + src/rgw/rgw_rest_role.cc | 2 + src/rgw/rgw_rest_role.h | 14 +- src/rgw/rgw_rest_s3.cc | 3 +- src/rgw/rgw_rest_s3.h | 22 +- src/rgw/rgw_rest_s3website.h | 4 +- src/rgw/rgw_rest_sts.cc | 2 + src/rgw/rgw_rest_sts.h | 56 ++-- src/rgw/rgw_rest_swift.cc | 2 + src/rgw/rgw_rest_swift.h | 12 +- src/rgw/rgw_rest_usage.cc | 2 + src/rgw/rgw_rest_user.cc | 2 + src/rgw/rgw_rest_user_policy.cc | 1 + src/rgw/rgw_rest_user_policy.h | 6 +- src/rgw/rgw_role.cc | 2 + src/rgw/rgw_role.h | 4 +- src/rgw/rgw_sal.h | 76 ++--- src/rgw/rgw_sal_rados.cc | 2 + src/rgw/rgw_sal_rados.h | 52 ++-- src/rgw/rgw_service.cc | 2 + src/rgw/rgw_sts.cc | 2 + src/rgw/rgw_sts.h | 146 +++++----- src/rgw/rgw_swift_auth.cc | 1 + src/rgw/rgw_sync.cc | 2 + src/rgw/rgw_sync.h | 54 ++-- src/rgw/rgw_sync_module.h | 34 +-- src/rgw/rgw_sync_module_aws.cc | 2 + src/rgw/rgw_sync_module_aws.h | 6 +- src/rgw/rgw_sync_module_es.cc | 1 + src/rgw/rgw_sync_module_es.h | 2 +- src/rgw/rgw_sync_module_es_rest.cc | 2 + src/rgw/rgw_sync_module_log.cc | 2 + src/rgw/rgw_sync_module_pubsub.cc | 2 + src/rgw/rgw_sync_module_pubsub_rest.cc | 2 + src/rgw/rgw_sync_policy.cc | 1 + src/rgw/rgw_sync_policy.h | 68 ++--- src/rgw/rgw_sync_trace.cc | 2 + src/rgw/rgw_sync_trace.h | 16 +- src/rgw/rgw_tag.cc | 2 + src/rgw/rgw_tag_s3.cc | 2 + src/rgw/rgw_token.cc | 2 + src/rgw/rgw_token.h | 4 +- src/rgw/rgw_tools.cc | 2 + src/rgw/rgw_tools.h | 66 ++--- src/rgw/rgw_torrent.cc | 3 +- src/rgw/rgw_torrent.h | 14 +- src/rgw/rgw_trim_bilog.cc | 2 + src/rgw/rgw_usage.cc | 2 +- src/rgw/rgw_user.cc | 2 +- src/rgw/rgw_user.h | 58 ++-- src/rgw/rgw_website.cc | 2 +- src/rgw/rgw_worker.h | 4 +- src/rgw/rgw_xml.cc | 2 + src/rgw/rgw_xml.h | 28 +- src/rgw/rgw_xml_enc.cc | 2 + src/rgw/rgw_zone.cc | 1 + src/rgw/rgw_zone.h | 106 +++---- src/rgw/services/svc_bi_rados.cc | 2 + src/rgw/services/svc_bi_rados.h | 24 +- src/rgw/services/svc_bilog_rados.cc | 3 +- src/rgw/services/svc_bilog_rados.h | 2 +- src/rgw/services/svc_bucket.cc | 4 +- src/rgw/services/svc_bucket.h | 28 +- src/rgw/services/svc_bucket_sobj.cc | 2 + src/rgw/services/svc_bucket_sobj.h | 32 +- src/rgw/services/svc_bucket_sync_sobj.cc | 2 + src/rgw/services/svc_bucket_sync_sobj.h | 10 +- src/rgw/services/svc_cls.cc | 2 + src/rgw/services/svc_cls.h | 66 ++--- src/rgw/services/svc_config_key.h | 2 +- src/rgw/services/svc_config_key_rados.cc | 2 + src/rgw/services/svc_config_key_rados.h | 2 +- src/rgw/services/svc_finisher.cc | 2 + src/rgw/services/svc_mdlog.cc | 2 + src/rgw/services/svc_mdlog.h | 4 +- src/rgw/services/svc_meta.cc | 1 + src/rgw/services/svc_meta.h | 6 +- src/rgw/services/svc_meta_be.cc | 1 + src/rgw/services/svc_meta_be.h | 16 +- src/rgw/services/svc_meta_be_otp.cc | 1 + src/rgw/services/svc_meta_be_otp.h | 8 +- src/rgw/services/svc_meta_be_sobj.cc | 1 + src/rgw/services/svc_meta_be_sobj.h | 30 +- src/rgw/services/svc_notify.cc | 2 + src/rgw/services/svc_notify.h | 8 +- src/rgw/services/svc_otp.cc | 2 + src/rgw/services/svc_otp.h | 6 +- src/rgw/services/svc_rados.cc | 2 + src/rgw/services/svc_rados.h | 24 +- src/rgw/services/svc_sys_obj.cc | 2 + src/rgw/services/svc_sys_obj.h | 28 +- src/rgw/services/svc_sys_obj_cache.cc | 2 + src/rgw/services/svc_sys_obj_cache.h | 24 +- src/rgw/services/svc_sys_obj_core.cc | 2 + src/rgw/services/svc_sys_obj_core.h | 28 +- src/rgw/services/svc_sys_obj_core_types.h | 4 +- src/rgw/services/svc_tier_rados.cc | 2 + src/rgw/services/svc_tier_rados.h | 34 +-- src/rgw/services/svc_user.h | 16 +- src/rgw/services/svc_user_rados.cc | 2 + src/rgw/services/svc_user_rados.h | 32 +- src/rgw/services/svc_zone.cc | 1 + src/rgw/services/svc_zone.h | 48 +-- src/rgw/services/svc_zone_utils.cc | 2 + src/rgw/services/svc_zone_utils.h | 8 +- 254 files changed, 2241 insertions(+), 2005 deletions(-) diff --git a/src/rgw/cls_fifo_legacy.cc b/src/rgw/cls_fifo_legacy.cc index 80af90055255a..6c752814b1594 100644 --- a/src/rgw/cls_fifo_legacy.cc +++ b/src/rgw/cls_fifo_legacy.cc @@ -404,7 +404,7 @@ std::optional FIFO::to_marker(std::string_view s) } auto pos = s.find(':'); - if (pos == string::npos) { + if (pos == s.npos) { return std::nullopt; } @@ -1222,7 +1222,7 @@ int FIFO::read_meta(const DoutPrefixProvider *dpp, std::uint64_t tid, optional_y std::uint32_t _phs; std::uint32_t _peo; - auto r = get_meta(dpp, ioctx, oid, nullopt, &_info, &_phs, &_peo, tid, y); + auto r = get_meta(dpp, ioctx, oid, std::nullopt, &_info, &_phs, &_peo, tid, y); if (r < 0) { ldpp_dout(dpp, -1) << __PRETTY_FUNCTION__ << ":" << __LINE__ << " get_meta failed: r=" << r << " tid=" << tid << dendl; diff --git a/src/rgw/librgw.cc b/src/rgw/librgw.cc index 2ea361eeb2728..89f79a13de358 100644 --- a/src/rgw/librgw.cc +++ b/src/rgw/librgw.cc @@ -69,6 +69,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + bool global_stop = false; static void handle_sigterm(int signum) diff --git a/src/rgw/rgw_acl.cc b/src/rgw/rgw_acl.cc index a87cd8e2b1e5c..413b88a9b76d9 100644 --- a/src/rgw/rgw_acl.cc +++ b/src/rgw/rgw_acl.cc @@ -15,6 +15,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + bool operator==(const ACLPermission& lhs, const ACLPermission& rhs) { return lhs.flags == rhs.flags; } diff --git a/src/rgw/rgw_acl.h b/src/rgw/rgw_acl.h index 89257fe783da0..6fc16c7800326 100644 --- a/src/rgw/rgw_acl.h +++ b/src/rgw/rgw_acl.h @@ -67,7 +67,7 @@ public: DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); friend bool operator==(const ACLPermission& lhs, const ACLPermission& rhs); friend bool operator!=(const ACLPermission& lhs, const ACLPermission& rhs); @@ -96,7 +96,7 @@ public: DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); friend bool operator==(const ACLGranteeType& lhs, const ACLGranteeType& rhs); friend bool operator!=(const ACLGranteeType& lhs, const ACLGranteeType& rhs); @@ -116,12 +116,12 @@ class ACLGrant protected: ACLGranteeType type; rgw_user id; - string email; + std::string email; mutable rgw_user email_id; ACLPermission permission; - string name; + std::string name; ACLGroupTypeEnum group; - string url_spec; + std::string url_spec; public: ACLGrant() : group(ACL_GROUP_NONE) {} @@ -161,15 +161,15 @@ public: ACLPermission& get_permission() { return permission; } const ACLPermission& get_permission() const { return permission; } ACLGroupTypeEnum get_group() const { return group; } - const string& get_referer() const { return url_spec; } + const std::string& get_referer() const { return url_spec; } void encode(bufferlist& bl) const { ENCODE_START(5, 3, bl); encode(type, bl); - string s; + std::string s; id.to_str(s); encode(s, bl); - string uri; + std::string uri; encode(uri, bl); encode(email, bl); encode(permission, bl); @@ -182,10 +182,10 @@ public: void decode(bufferlist::const_iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl); decode(type, bl); - string s; + std::string s; decode(s, bl); id.from_str(s); - string uri; + std::string uri; decode(uri, bl); decode(email, bl); decode(permission, bl); @@ -205,11 +205,11 @@ public: DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); - ACLGroupTypeEnum uri_to_group(string& uri); + ACLGroupTypeEnum uri_to_group(std::string& uri); - void set_canon(const rgw_user& _id, const string& _name, const uint32_t perm) { + void set_canon(const rgw_user& _id, const std::string& _name, const uint32_t perm) { type.set(ACL_TYPE_CANON_USER); id = _id; name = _name; @@ -318,9 +318,9 @@ protected: CephContext *cct; /* FIXME: in the feature we should consider switching to uint32_t also * in data structures. */ - map acl_user_map; - map acl_group_map; - list referer_list; + std::map acl_user_map; + std::map acl_group_map; + std::list referer_list; ACLGrantMap grant_map; void _add_grant(ACLGrant *grant); public: @@ -371,7 +371,7 @@ public: DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); void add_grant(ACLGrant *grant); void remove_canon_user_grant(rgw_user& user_id); @@ -379,7 +379,7 @@ public: ACLGrantMap& get_grant_map() { return grant_map; } const ACLGrantMap& get_grant_map() const { return grant_map; } - void create_default(const rgw_user& id, string name) { + void create_default(const rgw_user& id, std::string name) { acl_user_map.clear(); acl_group_map.clear(); referer_list.clear(); @@ -398,7 +398,7 @@ class ACLOwner { protected: rgw_user id; - string display_name; + std::string display_name; public: ACLOwner() {} ACLOwner(const rgw_user& _id) : id(_id) {} @@ -406,7 +406,7 @@ public: void encode(bufferlist& bl) const { ENCODE_START(3, 2, bl); - string s; + std::string s; id.to_str(s); encode(s, bl); encode(display_name, bl); @@ -414,7 +414,7 @@ public: } void decode(bufferlist::const_iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl); - string s; + std::string s; decode(s, bl); id.from_str(s); decode(display_name, bl); @@ -422,14 +422,14 @@ public: } void dump(Formatter *f) const; void decode_json(JSONObj *obj); - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); void set_id(const rgw_user& _id) { id = _id; } - void set_name(const string& name) { display_name = name; } + void set_name(const std::string& name) { display_name = name; } rgw_user& get_id() { return id; } const rgw_user& get_id() const { return id; } - string& get_display_name() { return display_name; } - const string& get_display_name() const { return display_name; } + std::string& get_display_name() { return display_name; } + const std::string& get_display_name() const { return display_name; } friend bool operator==(const ACLOwner& lhs, const ACLOwner& rhs); friend bool operator!=(const ACLOwner& lhs, const ACLOwner& rhs); }; @@ -477,7 +477,7 @@ public: DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); void decode_owner(bufferlist::const_iterator& bl) { // sometimes we only need that, should be faster DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl); decode(owner, bl); @@ -489,7 +489,7 @@ public: return owner; } - void create_default(const rgw_user& id, string& name) { + void create_default(const rgw_user& id, std::string& name) { acl.create_default(id, name); owner.set_id(id); owner.set_name(name); @@ -501,7 +501,7 @@ public: return acl; } - virtual bool compare_group_name(string& id, ACLGroupTypeEnum group) { return false; } + virtual bool compare_group_name(std::string& id, ACLGroupTypeEnum group) { return false; } bool is_public(const DoutPrefixProvider *dpp) const; friend bool operator==(const RGWAccessControlPolicy& lhs, const RGWAccessControlPolicy& rhs); diff --git a/src/rgw/rgw_acl_s3.cc b/src/rgw/rgw_acl_s3.cc index 316125935fc79..82496e753433b 100644 --- a/src/rgw/rgw_acl_s3.cc +++ b/src/rgw/rgw_acl_s3.cc @@ -19,6 +19,8 @@ #define RGW_URI_ALL_USERS "http://acs.amazonaws.com/groups/global/AllUsers" #define RGW_URI_AUTH_USERS "http://acs.amazonaws.com/groups/global/AuthenticatedUsers" +using namespace std; + static string rgw_uri_all_users = RGW_URI_ALL_USERS; static string rgw_uri_auth_users = RGW_URI_AUTH_USERS; diff --git a/src/rgw/rgw_acl_s3.h b/src/rgw/rgw_acl_s3.h index c4afad4c30f04..657fb1f671659 100644 --- a/src/rgw/rgw_acl_s3.h +++ b/src/rgw/rgw_acl_s3.h @@ -23,7 +23,7 @@ public: ~ACLPermission_S3() override {} bool xml_end(const char *el) override; - void to_xml(ostream& out); + void to_xml(std::ostream& out); }; class ACLGrantee_S3 : public ACLGrantee, public XMLObj @@ -42,12 +42,12 @@ public: ACLGrant_S3() {} ~ACLGrant_S3() override {} - void to_xml(CephContext *cct, ostream& out); + void to_xml(CephContext *cct, std::ostream& out); bool xml_end(const char *el) override; bool xml_start(const char *el, const char **attr); - static ACLGroupTypeEnum uri_to_group(string& uri); - static bool group_to_uri(ACLGroupTypeEnum group, string& uri); + static ACLGroupTypeEnum uri_to_group(std::string& uri); + static bool group_to_uri(ACLGroupTypeEnum group, std::string& uri); }; class RGWAccessControlList_S3 : public RGWAccessControlList, public XMLObj @@ -57,9 +57,9 @@ public: ~RGWAccessControlList_S3() override {} bool xml_end(const char *el) override; - void to_xml(ostream& out); + void to_xml(std::ostream& out); - int create_canned(ACLOwner& owner, ACLOwner& bucket_owner, const string& canned_acl); + int create_canned(ACLOwner& owner, ACLOwner& bucket_owner, const std::string& canned_acl); int create_from_grants(std::list& grants); }; @@ -70,7 +70,7 @@ public: ~ACLOwner_S3() override {} bool xml_end(const char *el) override; - void to_xml(ostream& out); + void to_xml(std::ostream& out); }; class RGWEnv; @@ -83,12 +83,12 @@ public: bool xml_end(const char *el) override; - void to_xml(ostream& out); + void to_xml(std::ostream& out); int rebuild(const DoutPrefixProvider *dpp, rgw::sal::Store* store, ACLOwner *owner, RGWAccessControlPolicy& dest, std::string &err_msg); - bool compare_group_name(string& id, ACLGroupTypeEnum group) override; + bool compare_group_name(std::string& id, ACLGroupTypeEnum group) override; - virtual int create_canned(ACLOwner& _owner, ACLOwner& bucket_owner, const string& canned_acl) { + virtual int create_canned(ACLOwner& _owner, ACLOwner& bucket_owner, const std::string& canned_acl) { RGWAccessControlList_S3& _acl = static_cast(acl); if (_owner.get_id() == rgw_user("anonymous")) { owner = bucket_owner; diff --git a/src/rgw/rgw_acl_swift.cc b/src/rgw/rgw_acl_swift.cc index 175590caac029..f02eb2dbfa71d 100644 --- a/src/rgw/rgw_acl_swift.cc +++ b/src/rgw/rgw_acl_swift.cc @@ -24,6 +24,8 @@ #define SWIFT_GROUP_ALL_USERS ".r:*" +using namespace std; + static int parse_list(const char* uid_list, std::vector& uids) /* out */ { diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 2f8cb246dca45..d69a9e99f6aee 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -74,6 +74,8 @@ extern "C" { #define SECRET_KEY_LEN 40 #define PUBLIC_ID_LEN 20 +using namespace std; + static rgw::sal::Store* store = NULL; static const DoutPrefixProvider* dpp() { diff --git a/src/rgw/rgw_arn.cc b/src/rgw/rgw_arn.cc index d8b4ed39c7422..fddc3d769cc26 100644 --- a/src/rgw/rgw_arn.cc +++ b/src/rgw/rgw_arn.cc @@ -5,6 +5,8 @@ #include "rgw_common.h" #include +using namespace std; + namespace rgw { namespace { diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc index 5ef28d862aa2d..daad86eb1ff24 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -51,6 +51,8 @@ auto make_stack_allocator() { return boost::context::protected_fixedsize_stack{512*1024}; } +using namespace std; + template class StreamIO : public rgw::asio::ClientIO { CephContext* const cct; diff --git a/src/rgw/rgw_auth.cc b/src/rgw/rgw_auth.cc index 897c9c2487d96..daf4535d1ad0a 100644 --- a/src/rgw/rgw_auth.cc +++ b/src/rgw/rgw_auth.cc @@ -17,6 +17,7 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; namespace rgw { namespace auth { diff --git a/src/rgw/rgw_auth.h b/src/rgw/rgw_auth.h index c4660c4de0fca..92c3a20b69bee 100644 --- a/src/rgw/rgw_auth.h +++ b/src/rgw/rgw_auth.h @@ -75,12 +75,12 @@ public: virtual uint32_t get_identity_type() const = 0; /* Name of Account */ - virtual string get_acct_name() const = 0; + virtual std::string get_acct_name() const = 0; /* Subuser of Account */ - virtual string get_subuser() const = 0; + virtual std::string get_subuser() const = 0; - virtual string get_role_tenant() const { return ""; } + virtual std::string get_role_tenant() const { return ""; } }; inline std::ostream& operator<<(std::ostream& out, @@ -367,21 +367,21 @@ class WebIdentityApplier : public IdentityApplier { protected: CephContext* const cct; rgw::sal::Store* store; - string role_session; - string role_tenant; + std::string role_session; + std::string role_tenant; rgw::web_idp::WebTokenClaims token_claims; - string get_idp_url() const; + std::string get_idp_url() const; void create_account(const DoutPrefixProvider* dpp, const rgw_user& acct_user, - const string& display_name, + const std::string& display_name, RGWUserInfo& user_info) const; /* out */ public: WebIdentityApplier( CephContext* const cct, rgw::sal::Store* store, - const string& role_session, - const string& role_tenant, + const std::string& role_session, + const std::string& role_tenant, const rgw::web_idp::WebTokenClaims& token_claims) : cct(cct), store(store), @@ -421,11 +421,11 @@ public: return TYPE_WEB; } - string get_acct_name() const override { + std::string get_acct_name() const override { return token_claims.user_name; } - string get_subuser() const override { + std::string get_subuser() const override { return {}; } @@ -434,8 +434,8 @@ public: virtual aplptr_t create_apl_web_identity( CephContext* cct, const req_state* s, - const string& role_session, - const string& role_tenant, + const std::string& role_session, + const std::string& role_tenant, const rgw::web_idp::WebTokenClaims& token) const = 0; }; }; @@ -561,8 +561,8 @@ public: void to_str(std::ostream& out) const override; void load_acct_info(const DoutPrefixProvider* dpp, RGWUserInfo& user_info) const override; /* out */ uint32_t get_identity_type() const override { return info.acct_type; } - string get_acct_name() const override { return info.acct_name; } - string get_subuser() const override { return {}; } + std::string get_acct_name() const override { return info.acct_name; } + std::string get_subuser() const override { return {}; } struct Factory { virtual ~Factory() {} @@ -623,8 +623,8 @@ public: void to_str(std::ostream& out) const override; void load_acct_info(const DoutPrefixProvider* dpp, RGWUserInfo& user_info) const override; /* out */ uint32_t get_identity_type() const override { return TYPE_RGW; } - string get_acct_name() const override { return {}; } - string get_subuser() const override { return subuser; } + std::string get_acct_name() const override { return {}; } + std::string get_subuser() const override { return subuser; } struct Factory { virtual ~Factory() {} @@ -639,27 +639,27 @@ public: class RoleApplier : public IdentityApplier { public: struct Role { - string id; - string name; - string tenant; - vector role_policies; + std::string id; + std::string name; + std::string tenant; + std::vector role_policies; } role; protected: const rgw_user user_id; - string token_policy; - string role_session_name; - std::vector token_claims; - string token_issued_at; + std::string token_policy; + std::string role_session_name; + std::vector token_claims; + std::string token_issued_at; public: RoleApplier(CephContext* const cct, const Role& role, const rgw_user& user_id, - const string& token_policy, - const string& role_session_name, - const std::vector& token_claims, - const string& token_issued_at) + const std::string& token_policy, + const std::string& role_session_name, + const std::vector& token_claims, + const std::string& token_issued_at) : role(role), user_id(user_id), token_policy(token_policy), @@ -683,10 +683,10 @@ public: void to_str(std::ostream& out) const override; void load_acct_info(const DoutPrefixProvider* dpp, RGWUserInfo& user_info) const override; /* out */ uint32_t get_identity_type() const override { return TYPE_ROLE; } - string get_acct_name() const override { return {}; } - string get_subuser() const override { return {}; } + std::string get_acct_name() const override { return {}; } + std::string get_subuser() const override { return {}; } void modify_request_state(const DoutPrefixProvider* dpp, req_state* s) const override; - string get_role_tenant() const override { return role.tenant; } + std::string get_role_tenant() const override { return role.tenant; } struct Factory { virtual ~Factory() {} @@ -696,7 +696,7 @@ public: const rgw_user& user_id, const std::string& token_policy, const std::string& role_session, - const std::vector& token_claims, + const std::vector& token_claims, const std::string& token_issued_at) const = 0; }; }; diff --git a/src/rgw/rgw_auth_filters.h b/src/rgw/rgw_auth_filters.h index be95219ac23dc..063208fc91209 100644 --- a/src/rgw/rgw_auth_filters.h +++ b/src/rgw/rgw_auth_filters.h @@ -90,11 +90,11 @@ public: return get_decoratee().get_identity_type(); } - string get_acct_name() const override { + std::string get_acct_name() const override { return get_decoratee().get_acct_name(); } - string get_subuser() const override { + std::string get_subuser() const override { return get_decoratee().get_subuser(); } @@ -107,7 +107,7 @@ public: get_decoratee().to_str(out); } - string get_role_tenant() const override { /* in/out */ + std::string get_role_tenant() const override { /* in/out */ return get_decoratee().get_role_tenant(); } diff --git a/src/rgw/rgw_auth_keystone.cc b/src/rgw/rgw_auth_keystone.cc index 124b50793e4da..f0b29d5ca3470 100644 --- a/src/rgw/rgw_auth_keystone.cc +++ b/src/rgw/rgw_auth_keystone.cc @@ -25,6 +25,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; namespace rgw { namespace auth { diff --git a/src/rgw/rgw_auth_keystone.h b/src/rgw/rgw_auth_keystone.h index 4ad20442b96be..117708c375622 100644 --- a/src/rgw/rgw_auth_keystone.h +++ b/src/rgw/rgw_auth_keystone.h @@ -79,7 +79,7 @@ class SecretCache { token_envelope_t token; std::string secret; utime_t expires; - list::iterator lru_iter; + std::list::iterator lru_iter; }; const boost::intrusive_ptr cct; diff --git a/src/rgw/rgw_auth_s3.cc b/src/rgw/rgw_auth_s3.cc index b253c93f89f22..d6eaf7d127af8 100644 --- a/src/rgw/rgw_auth_s3.cc +++ b/src/rgw/rgw_auth_s3.cc @@ -24,6 +24,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + static const auto signed_subresources = { "acl", "cors", diff --git a/src/rgw/rgw_auth_s3.h b/src/rgw/rgw_auth_s3.h index 7c51327406542..5de9e46a5ac13 100644 --- a/src/rgw/rgw_auth_s3.h +++ b/src/rgw/rgw_auth_s3.h @@ -612,7 +612,7 @@ get_v4_canonical_headers(const req_info& info, bool force_boto2_compat); std::string gen_v4_canonical_headers(const req_info& info, - const map& extra_headers, + const std::map& extra_headers, string *signed_hdrs); extern sha256_digest_t diff --git a/src/rgw/rgw_basic_types.cc b/src/rgw/rgw_basic_types.cc index 01cca48c2185c..ed7806e6a5772 100644 --- a/src/rgw/rgw_basic_types.cc +++ b/src/rgw/rgw_basic_types.cc @@ -11,6 +11,7 @@ #include "rgw_xml.h" #include "common/ceph_json.h" +using std::ostream; using std::string; using std::stringstream; diff --git a/src/rgw/rgw_basic_types.h b/src/rgw/rgw_basic_types.h index fee9fa4b99f9b..fc155fb1c13ef 100644 --- a/src/rgw/rgw_basic_types.h +++ b/src/rgw/rgw_basic_types.h @@ -82,15 +82,15 @@ struct rgw_user { size_t pos = str.find('$'); if (pos != std::string::npos) { tenant = str.substr(0, pos); - string_view sv = str; - string_view ns_id = sv.substr(pos + 1); + std::string_view sv = str; + std::string_view ns_id = sv.substr(pos + 1); size_t ns_pos = ns_id.find('$'); if (ns_pos != std::string::npos) { - ns = string(ns_id.substr(0, ns_pos)); - id = string(ns_id.substr(ns_pos + 1)); + ns = std::string(ns_id.substr(0, ns_pos)); + id = std::string(ns_id.substr(ns_pos + 1)); } else { ns.clear(); - id = string(ns_id); + id = std::string(ns_id); } } else { tenant.clear(); @@ -599,11 +599,11 @@ public: return idp_url; } - const string& get_role_session() const { + const std::string& get_role_session() const { return u.id; } - const string& get_role() const { + const std::string& get_role() const { return u.id; } diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index b020ac2120512..bc34ec821aa70 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -57,6 +57,8 @@ #define BUCKET_TAG_TIMEOUT 30 +using namespace std; + // default number of entries to list with each bucket listing call // (use marker to bridge between calls) static constexpr size_t listing_max_entries = 1000; diff --git a/src/rgw/rgw_bucket.h b/src/rgw/rgw_bucket.h index 30e1fd76942f0..6ec09b9f667e6 100644 --- a/src/rgw/rgw_bucket.h +++ b/src/rgw/rgw_bucket.h @@ -28,7 +28,7 @@ #include "services/svc_bucket_sync.h" // define as static when RGWBucket implementation completes -extern void rgw_get_buckets_obj(const rgw_user& user_id, string& buckets_obj_id); +extern void rgw_get_buckets_obj(const rgw_user& user_id, std::string& buckets_obj_id); class RGWSI_Meta; class RGWBucketMetadataHandler; @@ -38,20 +38,20 @@ class RGWBucketCtl; class RGWZone; struct RGWZoneParams; -extern int rgw_bucket_parse_bucket_instance(const string& bucket_instance, string *bucket_name, string *bucket_id, int *shard_id); -extern int rgw_bucket_parse_bucket_key(CephContext *cct, const string& key, +extern int rgw_bucket_parse_bucket_instance(const std::string& bucket_instance, std::string *bucket_name, std::string *bucket_id, int *shard_id); +extern int rgw_bucket_parse_bucket_key(CephContext *cct, const std::string& key, rgw_bucket* bucket, int *shard_id); extern std::string rgw_make_bucket_entry_name(const std::string& tenant_name, const std::string& bucket_name); -extern void rgw_parse_url_bucket(const string& bucket, - const string& auth_tenant, - string &tenant_name, string &bucket_name); +extern void rgw_parse_url_bucket(const std::string& bucket, + const std::string& auth_tenant, + std::string &tenant_name, std::string &bucket_name); // this is used as a filter to RGWRados::cls_bucket_list_ordered; it // conforms to the type declaration of RGWRados::check_filter_t. -extern bool rgw_bucket_object_check_filter(const string& oid); +extern bool rgw_bucket_object_check_filter(const std::string& oid); void init_default_bucket_layout(CephContext *cct, rgw::BucketLayout& layout, const RGWZone& zone, @@ -60,7 +60,7 @@ void init_default_bucket_layout(CephContext *cct, rgw::BucketLayout& layout, struct RGWBucketCompleteInfo { RGWBucketInfo info; - map attrs; + std::map attrs; void dump(Formatter *f) const; void decode_json(JSONObj *obj); @@ -68,14 +68,14 @@ struct RGWBucketCompleteInfo { class RGWBucketEntryMetadataObject : public RGWMetadataObject { RGWBucketEntryPoint ep; - map attrs; + std::map attrs; public: RGWBucketEntryMetadataObject(RGWBucketEntryPoint& _ep, const obj_version& v, real_time m) : ep(_ep) { objv = v; mtime = m; set_pattrs (&attrs); } - RGWBucketEntryMetadataObject(RGWBucketEntryPoint& _ep, const obj_version& v, real_time m, std::map&& _attrs) : + RGWBucketEntryMetadataObject(RGWBucketEntryPoint& _ep, const obj_version& v, real_time m, std::map&& _attrs) : ep(_ep), attrs(std::move(_attrs)) { objv = v; mtime = m; @@ -90,7 +90,7 @@ public: return ep; } - map& get_attrs() { + std::map& get_attrs() { return attrs; } }; @@ -143,8 +143,8 @@ public: /** * Check if the user owns a bucket by the given name. */ - bool owns(string& name) { - map::iterator iter; + bool owns(std::string& name) { + std::map::iterator iter; iter = buckets.find(name); return (iter != buckets.end()); } @@ -159,8 +159,8 @@ public: /** * Remove a bucket from the user's list by name. */ - void remove(const string& name) { - map::iterator iter; + void remove(const std::string& name) { + std::map::iterator iter; iter = buckets.find(name); if (iter != buckets.end()) { buckets.erase(iter); @@ -170,7 +170,7 @@ public: /** * Get the user's buckets as a map. */ - map& get_buckets() { return buckets; } + std::map& get_buckets() { return buckets; } /** * Cleanup data structure @@ -288,10 +288,10 @@ struct RGWBucketAdminOpState { bucket_stored = true; } - void set_bucket_id(const string& bi) { + void set_bucket_id(const std::string& bi) { bucket_id = bi; } - const string& get_bucket_id() { return bucket_id; } + const std::string& get_bucket_id() { return bucket_id; } bool will_fetch_stats() { return stat_buckets; } bool will_fix_index() { return fix_index; } @@ -341,16 +341,16 @@ public: int check_index(const DoutPrefixProvider *dpp, RGWBucketAdminOpState& op_state, - map& existing_stats, - map& calculated_stats, + std::map& existing_stats, + std::map& calculated_stats, std::string *err_msg = NULL); - int chown(RGWBucketAdminOpState& op_state, const string& marker, + int chown(RGWBucketAdminOpState& op_state, const std::string& marker, optional_yield y, const DoutPrefixProvider *dpp, std::string *err_msg = NULL); int set_quota(RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, std::string *err_msg = NULL); int remove_object(const DoutPrefixProvider *dpp, RGWBucketAdminOpState& op_state, std::string *err_msg = NULL); - int policy_bl_to_stream(bufferlist& bl, ostream& o); + int policy_bl_to_stream(bufferlist& bl, std::ostream& o); int get_policy(RGWBucketAdminOpState& op_state, RGWAccessControlPolicy& policy, optional_yield y, const DoutPrefixProvider *dpp); int sync(RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, std::string *err_msg = NULL); @@ -366,11 +366,11 @@ public: static int get_policy(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, RGWAccessControlPolicy& policy, const DoutPrefixProvider *dpp); static int dump_s3_policy(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, - ostream& os, const DoutPrefixProvider *dpp); + std::ostream& os, const DoutPrefixProvider *dpp); static int unlink(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp); - static int link(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, string *err_msg = NULL); - static int chown(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, const string& marker, const DoutPrefixProvider *dpp, string *err_msg = NULL); + static int link(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, std::string *err_msg = NULL); + static int chown(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, const std::string& marker, const DoutPrefixProvider *dpp, std::string *err_msg = NULL); static int check_index(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, RGWFormatterFlusher& flusher, optional_yield y, const DoutPrefixProvider *dpp); @@ -396,14 +396,14 @@ public: static int fix_obj_expiry(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, RGWFormatterFlusher& flusher, const DoutPrefixProvider *dpp, bool dry_run = false); - static int sync_bucket(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, string *err_msg = NULL); + static int sync_bucket(rgw::sal::Store* store, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, std::string *err_msg = NULL); }; struct rgw_ep_info { RGWBucketEntryPoint &ep; - map& attrs; + std::map& attrs; RGWObjVersionTracker ep_objv; - rgw_ep_info(RGWBucketEntryPoint &ep, map& attrs) + rgw_ep_info(RGWBucketEntryPoint &ep, std::map& attrs) : ep(ep), attrs(attrs) {} }; @@ -445,7 +445,7 @@ public: struct GetParams { RGWObjVersionTracker *objv_tracker{nullptr}; real_time *mtime{nullptr}; - map *attrs{nullptr}; + std::map *attrs{nullptr}; rgw_cache_entry_info *cache_info{nullptr}; boost::optional refresh_version; std::optional bectx_params; @@ -462,7 +462,7 @@ public: return *this; } - GetParams& set_attrs(map *_attrs) { + GetParams& set_attrs(std::map *_attrs) { attrs = _attrs; return *this; } @@ -487,7 +487,7 @@ public: RGWObjVersionTracker *objv_tracker{nullptr}; ceph::real_time mtime; bool exclusive{false}; - map *attrs{nullptr}; + std::map *attrs{nullptr}; PutParams() {} @@ -506,7 +506,7 @@ public: return *this; } - PutParams& set_attrs(map *_attrs) { + PutParams& set_attrs(std::map *_attrs) { attrs = _attrs; return *this; } @@ -527,7 +527,7 @@ public: struct BucketInstance { struct GetParams { real_time *mtime{nullptr}; - map *attrs{nullptr}; + std::map *attrs{nullptr}; rgw_cache_entry_info *cache_info{nullptr}; boost::optional refresh_version; RGWObjVersionTracker *objv_tracker{nullptr}; @@ -540,7 +540,7 @@ public: return *this; } - GetParams& set_attrs(map *_attrs) { + GetParams& set_attrs(std::map *_attrs) { attrs = _attrs; return *this; } @@ -571,7 +571,7 @@ public: nullptr: orig_info was not found (new bucket instance */ ceph::real_time mtime; bool exclusive{false}; - map *attrs{nullptr}; + std::map *attrs{nullptr}; RGWObjVersionTracker *objv_tracker{nullptr}; PutParams() {} @@ -591,7 +591,7 @@ public: return *this; } - PutParams& set_attrs(map *_attrs) { + PutParams& set_attrs(std::map *_attrs) { attrs = _attrs; return *this; } @@ -662,7 +662,7 @@ public: int set_bucket_instance_attrs(RGWBucketInfo& bucket_info, - map& attrs, + std::map& attrs, RGWObjVersionTracker *objv_tracker, optional_yield y, const DoutPrefixProvider *dpp); @@ -686,7 +686,7 @@ public: const rgw_user& user_id, const std::string& display_name, const std::string& marker, optional_yield y, const DoutPrefixProvider *dpp); - int read_buckets_stats(map& m, + int read_buckets_stats(std::map& m, optional_yield y, const DoutPrefixProvider *dpp); @@ -732,7 +732,7 @@ private: RGWBucketInfo *orig_info, bool exclusive, real_time mtime, obj_version *pep_objv, - map *pattrs, + std::map *pattrs, bool create_entry_point, optional_yield, const DoutPrefixProvider *dpp); @@ -755,5 +755,5 @@ private: }; -bool rgw_find_bucket_by_id(const DoutPrefixProvider *dpp, CephContext *cct, rgw::sal::Store* store, const string& marker, - const string& bucket_id, rgw_bucket* bucket_out); +bool rgw_find_bucket_by_id(const DoutPrefixProvider *dpp, CephContext *cct, rgw::sal::Store* store, const std::string& marker, + const std::string& bucket_id, rgw_bucket* bucket_out); diff --git a/src/rgw/rgw_bucket_encryption.h b/src/rgw/rgw_bucket_encryption.h index 9df9ed527eaf9..b279e3a166ac1 100644 --- a/src/rgw/rgw_bucket_encryption.h +++ b/src/rgw/rgw_bucket_encryption.h @@ -8,17 +8,17 @@ class XMLObj; class ApplyServerSideEncryptionByDefault { - string kmsMasterKeyID; - string sseAlgorithm; + std::string kmsMasterKeyID; + std::string sseAlgorithm; public: ApplyServerSideEncryptionByDefault(): kmsMasterKeyID(""), sseAlgorithm("") {}; - const string& kms_master_key_id() const { + const std::string& kms_master_key_id() const { return kmsMasterKeyID; } - const string& sse_algorithm() const { + const std::string& sse_algorithm() const { return sseAlgorithm; } @@ -50,11 +50,11 @@ protected: public: ServerSideEncryptionConfiguration(): bucketKeyEnabled(false) {}; - const string& kms_master_key_id() const { + const std::string& kms_master_key_id() const { return applyServerSideEncryptionByDefault.kms_master_key_id(); } - const string& sse_algorithm() const { + const std::string& sse_algorithm() const { return applyServerSideEncryptionByDefault.sse_algorithm(); } @@ -90,11 +90,11 @@ protected: public: RGWBucketEncryptionConfig(): rule_exist(false) {} - const string& kms_master_key_id() const { + const std::string& kms_master_key_id() const { return rule.kms_master_key_id(); } - const string& sse_algorithm() const { + const std::string& sse_algorithm() const { return rule.sse_algorithm(); } diff --git a/src/rgw/rgw_bucket_sync.cc b/src/rgw/rgw_bucket_sync.cc index 30449e4900824..d4b937a4713b1 100644 --- a/src/rgw/rgw_bucket_sync.cc +++ b/src/rgw/rgw_bucket_sync.cc @@ -10,6 +10,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; ostream& operator<<(ostream& os, const rgw_sync_bucket_entity& e) { os << "{b=" << rgw_sync_bucket_entities::bucket_key(e.bucket) << ",z=" << e.zone.value_or(rgw_zone_id()) << ",az=" << (int)e.all_zones << "}"; diff --git a/src/rgw/rgw_bucket_sync.h b/src/rgw/rgw_bucket_sync.h index 112f71abcc1e8..76143773e8dde 100644 --- a/src/rgw/rgw_bucket_sync.h +++ b/src/rgw/rgw_bucket_sync.h @@ -65,7 +65,7 @@ struct rgw_sync_group_pipe_map { const std::vector& pipes, CB filter_cb); - pair find_pipes(const zb_pipe_map_t& m, + std::pair find_pipes(const zb_pipe_map_t& m, const rgw_zone_id& zone, std::optional b) const; @@ -81,7 +81,7 @@ struct rgw_sync_group_pipe_map { /* * find all relevant pipes in our zone that match {dest_bucket} <- {source_zone, source_bucket} */ - vector find_source_pipes(const rgw_zone_id& source_zone, + std::vector find_source_pipes(const rgw_zone_id& source_zone, std::optional source_bucket, std::optional dest_bucket) const; @@ -89,14 +89,14 @@ struct rgw_sync_group_pipe_map { * find all relevant pipes in other zones that pull from a specific * source bucket in out zone {source_bucket} -> {dest_zone, dest_bucket} */ - vector find_dest_pipes(std::optional source_bucket, + std::vector find_dest_pipes(std::optional source_bucket, const rgw_zone_id& dest_zone, std::optional dest_bucket) const; /* * find all relevant pipes from {source_zone, source_bucket} -> {dest_zone, dest_bucket} */ - vector find_pipes(const rgw_zone_id& source_zone, + std::vector find_pipes(const rgw_zone_id& source_zone, std::optional source_bucket, const rgw_zone_id& dest_zone, std::optional dest_bucket) const; @@ -140,9 +140,9 @@ public: std::list pipes; public: - using prefix_map_t = multimap; + using prefix_map_t = std::multimap; - map tag_refs; + std::map tag_refs; prefix_map_t prefix_refs; void insert(const rgw_sync_bucket_pipe& pipe); @@ -150,14 +150,14 @@ public: bool find_basic_info_without_tags(const rgw_obj_key& key, std::optional *user, std::optional *acl_translation, - std::optional *storage_class, + std::optional *storage_class, rgw_sync_pipe_params::Mode *mode, bool *need_more_info) const; bool find_obj_params(const rgw_obj_key& key, const RGWObjTags::tag_map_t& tags, rgw_sync_pipe_params *params) const; - void scan_prefixes(std::vector *prefixes) const; + void scan_prefixes(std::vector *prefixes) const; prefix_map_t::const_iterator prefix_begin() const { return prefix_refs.begin(); @@ -187,7 +187,7 @@ public: bool find_basic_info_without_tags(const rgw_obj_key& key, std::optional *user, std::optional *acl_translation, - std::optional *storage_class, + std::optional *storage_class, rgw_sync_pipe_params::Mode *mode, bool *need_more_info) const { if (!rules) { @@ -208,7 +208,7 @@ public: struct pipe_set { std::map rules; - std::multimap pipe_map; + std::multimap pipe_map; std::set handlers; @@ -242,7 +242,7 @@ private: const RGWBucketSyncFlowManager *parent{nullptr}; - map flow_groups; + std::map flow_groups; std::set all_zones; @@ -273,7 +273,7 @@ public: }; -static inline ostream& operator<<(ostream& os, const RGWBucketSyncFlowManager::endpoints_pair& e) { +static inline std::ostream& operator<<(std::ostream& os, const RGWBucketSyncFlowManager::endpoints_pair& e) { os << e.dest << " -> " << e.source; return os; } @@ -285,7 +285,7 @@ class RGWBucketSyncPolicyHandler { RGWSI_Bucket_Sync *bucket_sync_svc; rgw_zone_id zone_id; std::optional bucket_info; - std::optional > bucket_attrs; + std::optional > bucket_attrs; std::optional bucket; std::unique_ptr flow_mgr; rgw_sync_policy_info sync_policy; @@ -293,8 +293,8 @@ class RGWBucketSyncPolicyHandler { RGWBucketSyncFlowManager::pipe_set source_pipes; RGWBucketSyncFlowManager::pipe_set target_pipes; - map sources; /* source pipes by source zone id */ - map targets; /* target pipes by target zone id */ + std::map sources; /* source pipes by source zone id */ + std::map targets; /* target pipes by target zone id */ std::set source_zones; std::set target_zones; @@ -315,7 +315,7 @@ class RGWBucketSyncPolicyHandler { RGWBucketSyncPolicyHandler(const RGWBucketSyncPolicyHandler *_parent, const RGWBucketInfo& _bucket_info, - map&& _bucket_attrs); + std::map&& _bucket_attrs); RGWBucketSyncPolicyHandler(const RGWBucketSyncPolicyHandler *_parent, const rgw_bucket& _bucket, @@ -327,7 +327,7 @@ public: std::optional effective_zone = std::nullopt); RGWBucketSyncPolicyHandler *alloc_child(const RGWBucketInfo& bucket_info, - map&& bucket_attrs) const; + std::map&& bucket_attrs) const; RGWBucketSyncPolicyHandler *alloc_child(const rgw_bucket& bucket, std::optional sync_policy) const; @@ -335,8 +335,8 @@ public: void reflect(const DoutPrefixProvider *dpp, RGWBucketSyncFlowManager::pipe_set *psource_pipes, RGWBucketSyncFlowManager::pipe_set *ptarget_pipes, - map *psources, - map *ptargets, + std::map *psources, + std::map *ptargets, std::set *psource_zones, std::set *ptarget_zones, bool only_enabled) const; @@ -363,15 +363,15 @@ public: return target_zones; } - const map& get_sources() { + const std::map& get_sources() { return sources; } - multimap get_all_sources() const; - multimap get_all_dests() const; - multimap get_all_dests_in_zone(const rgw_zone_id& zone_id) const; + std::multimap get_all_sources() const; + std::multimap get_all_dests() const; + std::multimap get_all_dests_in_zone(const rgw_zone_id& zone_id) const; - const map& get_targets() { + const std::map& get_targets() { return targets; } @@ -379,7 +379,7 @@ public: return bucket_info; } - const std::optional >& get_bucket_attrs() const { + const std::optional >& get_bucket_attrs() const { return bucket_attrs; } diff --git a/src/rgw/rgw_cache.cc b/src/rgw/rgw_cache.cc index b46c26d5b9997..3a325c81c2c2a 100644 --- a/src/rgw/rgw_cache.cc +++ b/src/rgw/rgw_cache.cc @@ -8,6 +8,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; int ObjectCache::get(const DoutPrefixProvider *dpp, const string& name, ObjectCacheInfo& info, uint32_t mask, rgw_cache_entry_info *cache_info) { diff --git a/src/rgw/rgw_cache.h b/src/rgw/rgw_cache.h index 08eaffca22654..cffa6573d63e8 100644 --- a/src/rgw/rgw_cache.h +++ b/src/rgw/rgw_cache.h @@ -45,7 +45,7 @@ struct ObjectMetaInfo { DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; WRITE_CLASS_ENCODER(ObjectMetaInfo) @@ -54,8 +54,8 @@ struct ObjectCacheInfo { uint32_t flags = 0; uint64_t epoch = 0; bufferlist data; - map xattrs; - map rm_xattrs; + std::map xattrs; + std::map rm_xattrs; ObjectMetaInfo meta; obj_version version = {}; ceph::coarse_mono_time time_added; @@ -90,7 +90,7 @@ struct ObjectCacheInfo { DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; WRITE_CLASS_ENCODER(ObjectCacheInfo) @@ -99,7 +99,7 @@ struct RGWCacheNotifyInfo { rgw_raw_obj obj; ObjectCacheInfo obj_info; off_t ofs; - string ns; + std::string ns; RGWCacheNotifyInfo() : op(0), ofs(0) {} @@ -122,7 +122,7 @@ struct RGWCacheNotifyInfo { DECODE_FINISH(ibl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; WRITE_CLASS_ENCODER(RGWCacheNotifyInfo) inline std::ostream& operator <<(std::ostream& m, const RGWCacheNotifyInfo& cni) { @@ -134,48 +134,48 @@ inline std::ostream& operator <<(std::ostream& m, const RGWCacheNotifyInfo& cni) class RGWChainedCache { public: virtual ~RGWChainedCache() {} - virtual void chain_cb(const string& key, void *data) = 0; - virtual void invalidate(const string& key) = 0; + virtual void chain_cb(const std::string& key, void *data) = 0; + virtual void invalidate(const std::string& key) = 0; virtual void invalidate_all() = 0; virtual void unregistered() {} struct Entry { RGWChainedCache *cache; - const string& key; + const std::string& key; void *data; - Entry(RGWChainedCache *_c, const string& _k, void *_d) : cache(_c), key(_k), data(_d) {} + Entry(RGWChainedCache *_c, const std::string& _k, void *_d) : cache(_c), key(_k), data(_d) {} }; }; struct ObjectCacheEntry { ObjectCacheInfo info; - std::list::iterator lru_iter; + std::list::iterator lru_iter; uint64_t lru_promotion_ts; uint64_t gen; - std::vector > chained_entries; + std::vector > chained_entries; ObjectCacheEntry() : lru_promotion_ts(0), gen(0) {} }; class ObjectCache { - std::unordered_map cache_map; - std::list lru; + std::unordered_map cache_map; + std::list lru; unsigned long lru_size; unsigned long lru_counter; unsigned long lru_window; ceph::shared_mutex lock = ceph::make_shared_mutex("ObjectCache"); CephContext *cct; - vector chained_cache; + std::vector chained_cache; bool enabled; ceph::timespan expiry; - void touch_lru(const DoutPrefixProvider *dpp, const string& name, ObjectCacheEntry& entry, - std::list::iterator& lru_iter); - void remove_lru(const string& name, std::list::iterator& lru_iter); + void touch_lru(const DoutPrefixProvider *dpp, const std::string& name, ObjectCacheEntry& entry, + std::list::iterator& lru_iter); + void remove_lru(const std::string& name, std::list::iterator& lru_iter); void invalidate_lru(ObjectCacheEntry& entry); void do_invalidate_all(); diff --git a/src/rgw/rgw_client_io.h b/src/rgw/rgw_client_io.h index 41232c8ae7d7b..9626d289fc9da 100644 --- a/src/rgw/rgw_client_io.h +++ b/src/rgw/rgw_client_io.h @@ -431,7 +431,7 @@ class RGWClientIOStream : private RGWClientIOStreamBuf, public std::istream { public: explicit RGWClientIOStream(RGWRestfulIO &s) : RGWClientIOStreamBuf(s, 1, 2), - istream(static_cast(this)) { + std::istream(static_cast(this)) { } }; diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index f099590b72e00..d846aeac99a1b 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -162,6 +162,7 @@ rgw_http_errors rgw_http_iam_errors({ { ERR_INTERNAL_ERROR, {500, "ServiceFailure" }}, }); +using namespace std; using namespace ceph::crypto; rgw_err:: diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 80e6059c623f2..1a24707c358f8 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -340,9 +340,9 @@ class RGWHTTPArgs { } /** parse the received arguments */ int parse(const DoutPrefixProvider *dpp); - void append(const std::string& name, const string& val); + void append(const std::string& name, const std::string& val); /** Get the value for a specific argument parameter */ - const string& get(const std::string& name, bool *exists = NULL) const; + const std::string& get(const std::string& name, bool *exists = NULL) const; boost::optional get_optional(const std::string& name) const; int get_bool(const std::string& name, bool *val, bool *exists); @@ -401,9 +401,9 @@ class RGWHTTPArgs { } }; // RGWHTTPArgs -const char *rgw_conf_get(const map& conf_map, const char *name, const char *def_val); -int rgw_conf_get_int(const map& conf_map, const char *name, int def_val); -bool rgw_conf_get_bool(const map& conf_map, const char *name, bool def_val); +const char *rgw_conf_get(const std::map& conf_map, const char *name, const char *def_val); +int rgw_conf_get_int(const std::map& conf_map, const char *name, int def_val); +bool rgw_conf_get_bool(const std::map& conf_map, const char *name, bool def_val); class RGWEnv; @@ -422,7 +422,7 @@ public: }; class RGWEnv { - std::map env_map; + std::map env_map; RGWConf conf; public: void init(CephContext *cct); @@ -435,7 +435,7 @@ public: bool exists(const char *name) const; bool exists_prefix(const char *prefix) const; void remove(const char *name); - const std::map& get_map() const { return env_map; } + const std::map& get_map() const { return env_map; } int get_enable_ops_log() const { return conf.enable_ops_log; } @@ -468,9 +468,9 @@ class RGWAccessControlPolicy; class JSONObj; struct RGWAccessKey { - string id; // AccessKey - string key; // SecretKey - string subuser; + std::string id; // AccessKey + std::string key; // SecretKey + std::string subuser; RGWAccessKey() {} RGWAccessKey(std::string _id, std::string _key) @@ -493,8 +493,8 @@ struct RGWAccessKey { } void dump(Formatter *f) const; void dump_plain(Formatter *f) const; - void dump(Formatter *f, const string& user, bool swift) const; - static void generate_test_instances(list& o); + void dump(Formatter *f, const std::string& user, bool swift) const; + static void generate_test_instances(std::list& o); void decode_json(JSONObj *obj); void decode_json(JSONObj *obj, bool swift); @@ -502,7 +502,7 @@ struct RGWAccessKey { WRITE_CLASS_ENCODER(RGWAccessKey) struct RGWSubUser { - string name; + std::string name; uint32_t perm_mask; RGWSubUser() : perm_mask(0) {} @@ -520,8 +520,8 @@ struct RGWSubUser { DECODE_FINISH(bl); } void dump(Formatter *f) const; - void dump(Formatter *f, const string& user) const; - static void generate_test_instances(list& o); + void dump(Formatter *f, const std::string& user) const; + static void generate_test_instances(std::list& o); void decode_json(JSONObj *obj); }; @@ -529,15 +529,15 @@ WRITE_CLASS_ENCODER(RGWSubUser) class RGWUserCaps { - map caps; + std::map caps; - int get_cap(const string& cap, string& type, uint32_t *perm); - int add_cap(const string& cap); - int remove_cap(const string& cap); + int get_cap(const std::string& cap, std::string& type, uint32_t *perm); + int add_cap(const std::string& cap); + int remove_cap(const std::string& cap); public: - static int parse_cap_perm(const string& str, uint32_t *perm); - int add_from_string(const string& str); - int remove_from_string(const string& str); + static int parse_cap_perm(const std::string& str, uint32_t *perm); + int add_from_string(const std::string& str); + int remove_from_string(const std::string& str); void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); @@ -549,8 +549,8 @@ public: decode(caps, bl); DECODE_FINISH(bl); } - int check_cap(const string& cap, uint32_t perm) const; - bool is_valid_cap_type(const string& tp); + int check_cap(const std::string& cap, uint32_t perm) const; + bool is_valid_cap_type(const std::string& tp); void dump(Formatter *f) const; void dump(Formatter *f, const char *name) const; @@ -575,15 +575,15 @@ enum RGWIdentityType TYPE_WEB=5, }; -static string RGW_STORAGE_CLASS_STANDARD = "STANDARD"; +static std::string RGW_STORAGE_CLASS_STANDARD = "STANDARD"; struct rgw_placement_rule { std::string name; std::string storage_class; rgw_placement_rule() {} - rgw_placement_rule(const string& _n, const string& _sc) : name(_n), storage_class(_sc) {} - rgw_placement_rule(const rgw_placement_rule& _r, const string& _sc) : name(_r.name) { + rgw_placement_rule(const std::string& _n, const std::string& _sc) : name(_n), storage_class(_sc) {} + rgw_placement_rule(const rgw_placement_rule& _r, const std::string& _sc) : name(_r.name) { if (!_sc.empty()) { storage_class = _sc; } else { @@ -609,19 +609,19 @@ struct rgw_placement_rule { storage_class.clear(); } - void init(const string& n, const string& c) { + void init(const std::string& n, const std::string& c) { name = n; storage_class = c; } - static const string& get_canonical_storage_class(const string& storage_class) { + static const std::string& get_canonical_storage_class(const std::string& storage_class) { if (storage_class.empty()) { return RGW_STORAGE_CLASS_STANDARD; } return storage_class; } - const string& get_storage_class() const { + const std::string& get_storage_class() const { return get_canonical_storage_class(storage_class); } @@ -685,17 +685,17 @@ WRITE_CLASS_ENCODER(rgw_placement_rule) void encode_json(const char *name, const rgw_placement_rule& val, ceph::Formatter *f); void decode_json_obj(rgw_placement_rule& v, JSONObj *obj); -inline ostream& operator<<(ostream& out, const rgw_placement_rule& rule) { +inline std::ostream& operator<<(std::ostream& out, const rgw_placement_rule& rule) { return out << rule.to_str(); } struct RGWUserInfo { rgw_user user_id; - string display_name; - string user_email; - map access_keys; - map swift_keys; - map subusers; + std::string display_name; + std::string user_email; + std::map access_keys; + std::map swift_keys; + std::map subusers; __u8 suspended; int32_t max_buckets; uint32_t op_mask; @@ -703,13 +703,13 @@ struct RGWUserInfo __u8 admin; __u8 system; rgw_placement_rule default_placement; - list placement_tags; + std::list placement_tags; RGWQuotaInfo bucket_quota; - map temp_url_keys; + std::map temp_url_keys; RGWQuotaInfo user_quota; uint32_t type; - set mfa_ids; - string assumed_role_arn; + std::set mfa_ids; + std::string assumed_role_arn; RGWUserInfo() : suspended(0), @@ -720,7 +720,7 @@ struct RGWUserInfo type(TYPE_NONE) { } - RGWAccessKey* get_key(const string& access_key) { + RGWAccessKey* get_key(const std::string& access_key) { if (access_keys.empty()) return nullptr; @@ -734,10 +734,10 @@ struct RGWUserInfo void encode(bufferlist& bl) const { ENCODE_START(22, 9, bl); encode((uint64_t)0, bl); // old auid - string access_key; - string secret_key; + std::string access_key; + std::string secret_key; if (!access_keys.empty()) { - map::const_iterator iter = access_keys.begin(); + std::map::const_iterator iter = access_keys.begin(); const RGWAccessKey& k = iter->second; access_key = k.id; secret_key = k.key; @@ -746,10 +746,10 @@ struct RGWUserInfo encode(secret_key, bl); encode(display_name, bl); encode(user_email, bl); - string swift_name; - string swift_key; + std::string swift_name; + std::string swift_key; if (!swift_keys.empty()) { - map::const_iterator iter = swift_keys.begin(); + std::map::const_iterator iter = swift_keys.begin(); const RGWAccessKey& k = iter->second; swift_name = k.id; swift_key = k.key; @@ -784,8 +784,8 @@ struct RGWUserInfo uint64_t old_auid; decode(old_auid, bl); } - string access_key; - string secret_key; + std::string access_key; + std::string secret_key; decode(access_key, bl); decode(secret_key, bl); if (struct_v < 6) { @@ -797,8 +797,8 @@ struct RGWUserInfo decode(display_name, bl); decode(user_email, bl); /* We populate swift_keys map later nowadays, but we have to decode. */ - string swift_name; - string swift_key; + std::string swift_name; + std::string swift_key; if (struct_v >= 3) decode(swift_name, bl); if (struct_v >= 4) decode(swift_key, bl); if (struct_v >= 5) @@ -868,7 +868,7 @@ struct RGWUserInfo DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); void decode_json(JSONObj *obj); }; @@ -883,7 +883,7 @@ struct rgw_raw_obj { rgw_raw_obj(const rgw_pool& _pool, const std::string& _oid) { init(_pool, _oid); } - rgw_raw_obj(const rgw_pool& _pool, const std::string& _oid, const string& _loc) : loc(_loc) { + rgw_raw_obj(const rgw_pool& _pool, const std::string& _oid, const std::string& _loc) : loc(_loc) { init(_pool, _oid); } @@ -944,7 +944,7 @@ struct rgw_raw_obj { }; WRITE_CLASS_ENCODER(rgw_raw_obj) -inline ostream& operator<<(ostream& out, const rgw_raw_obj& o) { +inline std::ostream& operator<<(std::ostream& out, const rgw_raw_obj& o) { out << o.pool << ":" << o.oid; return out; } @@ -991,13 +991,13 @@ struct RGWObjVersionTracker { void generate_new_write_ver(CephContext *cct); }; -inline ostream& operator<<(ostream& out, const obj_version &v) +inline std::ostream& operator<<(std::ostream& out, const obj_version &v) { out << v.tag << ":" << v.ver; return out; } -inline ostream& operator<<(ostream& out, const RGWObjVersionTracker &ot) +inline std::ostream& operator<<(std::ostream& out, const RGWObjVersionTracker &ot) { out << "{r=" << ot.read_version << ",w=" << ot.write_version << "}"; return out; @@ -1018,7 +1018,7 @@ struct RGWBucketInfo { rgw_bucket bucket; rgw_user owner; uint32_t flags{0}; - string zonegroup; + std::string zonegroup; ceph::real_time creation_time; rgw_placement_rule placement_rule; bool has_instance_obj{false}; @@ -1042,13 +1042,13 @@ struct RGWBucketInfo { RGWBucketWebsiteConf website_conf; bool swift_versioning{false}; - string swift_ver_location; + std::string swift_ver_location; - map mdsearch_config; + std::map mdsearch_config; // resharding cls_rgw_reshard_status reshard_status{cls_rgw_reshard_status::NOT_RESHARDING}; - string new_bucket_instance_id; + std::string new_bucket_instance_id; RGWObjectLock obj_lock; @@ -1058,7 +1058,7 @@ struct RGWBucketInfo { void decode(bufferlist::const_iterator& bl); void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); void decode_json(JSONObj *obj); @@ -1135,7 +1135,7 @@ struct RGWBucketEntryPoint void dump(Formatter *f) const; void decode_json(JSONObj *obj); - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; WRITE_CLASS_ENCODER(RGWBucketEntryPoint) @@ -1182,15 +1182,15 @@ struct req_info { RGWHTTPArgs args; meta_map_t x_meta_map; - string host; + std::string host; const char *method; - string script_uri; - string request_uri; - string request_uri_aws4; - string effective_uri; - string request_params; - string domain; - string storage_class; + std::string script_uri; + std::string request_uri; + std::string request_uri_aws4; + std::string effective_uri; + std::string request_params; + std::string domain; + std::string storage_class; req_info(CephContext *cct, const RGWEnv *env); void rebuild_from(req_info& src); @@ -1200,22 +1200,22 @@ struct req_info { typedef cls_rgw_obj_key rgw_obj_index_key; struct rgw_obj_key { - string name; - string instance; - string ns; + std::string name; + std::string instance; + std::string ns; rgw_obj_key() {} // cppcheck-suppress noExplicitConstructor - rgw_obj_key(const string& n) : name(n) {} - rgw_obj_key(const string& n, const string& i) : name(n), instance(i) {} - rgw_obj_key(const string& n, const string& i, const string& _ns) : name(n), instance(i), ns(_ns) {} + rgw_obj_key(const std::string& n) : name(n) {} + rgw_obj_key(const std::string& n, const std::string& i) : name(n), instance(i) {} + rgw_obj_key(const std::string& n, const std::string& i, const std::string& _ns) : name(n), instance(i), ns(_ns) {} rgw_obj_key(const rgw_obj_index_key& k) { parse_index_key(k.name, &name, &ns); instance = k.instance; } - static void parse_index_key(const string& key, string *name, string *ns) { + static void parse_index_key(const std::string& key, std::string *name, std::string *ns) { if (key[0] != '_') { *name = key; ns->clear(); @@ -1238,19 +1238,19 @@ struct rgw_obj_key { *ns = key.substr(1, pos -1); } - void set(const string& n) { + void set(const std::string& n) { name = n; instance.clear(); ns.clear(); } - void set(const string& n, const string& i) { + void set(const std::string& n, const std::string& i) { name = n; instance = i; ns.clear(); } - void set(const string& n, const string& i, const string& _ns) { + void set(const std::string& n, const std::string& i, const std::string& _ns) { name = n; instance = i; ns = _ns; @@ -1264,11 +1264,11 @@ struct rgw_obj_key { return true; } - void set_instance(const string& i) { + void set_instance(const std::string& i) { instance = i; } - const string& get_instance() const { + const std::string& get_instance() const { return instance; } @@ -1280,17 +1280,17 @@ struct rgw_obj_key { return ns; } - string get_index_key_name() const { + std::string get_index_key_name() const { if (ns.empty()) { if (name.size() < 1 || name[0] != '_') { return name; } - return string("_") + name; + return std::string("_") + name; }; char buf[ns.size() + 16]; snprintf(buf, sizeof(buf), "_%s_", ns.c_str()); - return string(buf) + name; + return std::string(buf) + name; }; void get_index_key(rgw_obj_index_key *key) const { @@ -1298,7 +1298,7 @@ struct rgw_obj_key { key->instance = instance; } - string get_loc() const { + std::string get_loc() const { /* * For backward compatibility. Older versions used to have object locator on all objects, * however, the name was the effective object locator. This had the same effect as not @@ -1309,7 +1309,7 @@ struct rgw_obj_key { return name; } - return string(); + return {}; } bool empty() const { @@ -1328,18 +1328,18 @@ struct rgw_obj_key { return have_instance() && !have_null_instance(); } - string get_oid() const { + std::string get_oid() const { if (ns.empty() && !need_to_encode_instance()) { if (name.size() < 1 || name[0] != '_') { return name; } - return string("_") + name; + return std::string("_") + name; } - string oid = "_"; + std::string oid = "_"; oid.append(ns); if (need_to_encode_instance()) { - oid.append(string(":") + instance); + oid.append(std::string(":") + instance); } oid.append("_"); oid.append(name); @@ -1363,7 +1363,7 @@ struct rgw_obj_key { return !(k < *this); } - static void parse_ns_field(string& ns, string& instance) { + static void parse_ns_field(std::string& ns, std::string& instance) { int pos = ns.find(':'); if (pos >= 0) { instance = ns.substr(pos + 1); @@ -1375,7 +1375,7 @@ struct rgw_obj_key { // takes an oid and parses out the namespace (ns), name, and // instance - static bool parse_raw_oid(const string& oid, rgw_obj_key *key) { + static bool parse_raw_oid(const std::string& oid, rgw_obj_key *key) { key->instance.clear(); key->ns.clear(); if (oid[0] != '_') { @@ -1392,7 +1392,7 @@ struct rgw_obj_key { return false; size_t pos = oid.find('_', 2); // oid must match ^_[^_].+$ - if (pos == string::npos) + if (pos == std::string::npos) return false; key->ns = oid.substr(1, pos - 1); @@ -1410,7 +1410,7 @@ struct rgw_obj_key { * and cuts down the name to the unmangled version. If it is not * part of the given namespace, it returns false. */ - static bool oid_to_key_in_ns(const string& oid, rgw_obj_key *key, const string& ns) { + static bool oid_to_key_in_ns(const std::string& oid, rgw_obj_key *key, const std::string& ns) { bool ret = parse_raw_oid(oid, key); if (!ret) { return ret; @@ -1420,14 +1420,14 @@ struct rgw_obj_key { } /** - * Given a mangled object name and an empty namespace string, this - * function extracts the namespace into the string and sets the object + * Given a mangled object name and an empty namespace std::string, this + * function extracts the namespace into the std::string and sets the object * name to be the unmangled version. * * It returns true after successfully doing so, or * false if it fails. */ - static bool strip_namespace_from_name(string& name, string& ns, string& instance) { + static bool strip_namespace_from_name(std::string& name, std::string& ns, std::string& instance) { ns.clear(); instance.clear(); if (name[0] != '_') { @@ -1435,7 +1435,7 @@ struct rgw_obj_key { } size_t pos = name.find('_', 1); - if (pos == string::npos) { + if (pos == std::string::npos) { return false; } @@ -1450,7 +1450,7 @@ struct rgw_obj_key { } ns = name.substr(1, pos-1); - name = name.substr(pos+1, string::npos); + name = name.substr(pos+1, std::string::npos); parse_ns_field(ns, instance); return true; @@ -1475,7 +1475,7 @@ struct rgw_obj_key { void dump(Formatter *f) const; void decode_json(JSONObj *obj); - string to_str() const { + std::string to_str() const { if (instance.empty()) { return name; } @@ -1486,11 +1486,11 @@ struct rgw_obj_key { }; WRITE_CLASS_ENCODER(rgw_obj_key) -inline ostream& operator<<(ostream& out, const rgw_obj_key &o) { +inline std::ostream& operator<<(std::ostream& out, const rgw_obj_key &o) { return out << o.to_str(); } -inline ostream& operator<<(ostream& out, const rgw_obj_index_key &o) { +inline std::ostream& operator<<(std::ostream& out, const rgw_obj_index_key &o) { if (o.instance.empty()) { return out << o.name; } else { @@ -1500,8 +1500,8 @@ inline ostream& operator<<(ostream& out, const rgw_obj_index_key &o) { struct req_init_state { /* Keeps [[tenant]:]bucket until we parse the token. */ - string url_bucket; - string src_bucket; + std::string url_bucket; + std::string src_bucket; }; #include "rgw_auth.h" @@ -1518,11 +1518,11 @@ struct req_state : DoutPrefixProvider { bool content_started{false}; int format{0}; ceph::Formatter *formatter{nullptr}; - string decoded_uri; - string relative_uri; + std::string decoded_uri; + std::string relative_uri; const char *length{nullptr}; int64_t content_length{0}; - map generic_attrs; + std::map generic_attrs; rgw_err err; bool expect_cont{false}; uint64_t obj_size{0}; @@ -1532,26 +1532,26 @@ struct req_state : DoutPrefixProvider { uint32_t perm_mask{0}; /* Set once when url_bucket is parsed and not violated thereafter. */ - string account_name; + std::string account_name; - string bucket_tenant; - string bucket_name; + std::string bucket_tenant; + std::string bucket_name; std::unique_ptr bucket; std::unique_ptr object; - string src_tenant_name; - string src_bucket_name; + std::string src_tenant_name; + std::string src_bucket_name; std::unique_ptr src_object; ACLOwner bucket_owner; ACLOwner owner; - string zonegroup_name; - string zonegroup_endpoint; - string bucket_instance_id; + std::string zonegroup_name; + std::string zonegroup_endpoint; + std::string bucket_instance_id; int bucket_instance_shard_id{-1}; - string redirect_zone_endpoint; + std::string redirect_zone_endpoint; - string redirect; + std::string redirect; real_time bucket_mtime; std::map bucket_attrs; @@ -1601,13 +1601,13 @@ struct req_state : DoutPrefixProvider { rgw::IAM::Environment env; boost::optional iam_policy; boost::optional bucket_access_conf; - vector iam_user_policies; + std::vector iam_user_policies; /* Is the request made by an user marked as a system one? * Being system user means we also have the admin status. */ bool system_request{false}; - string canned_acl; + std::string canned_acl; bool has_acl_header{false}; bool local_source{false}; /* source is local */ @@ -1615,11 +1615,11 @@ struct req_state : DoutPrefixProvider { /* Content-Disposition override for TempURL of Swift API. */ struct { - string override; - string fallback; + std::string override; + std::string fallback; } content_disp; - string host_id; + std::string host_id; req_info info; req_init_state init_state; @@ -1630,9 +1630,9 @@ struct req_state : DoutPrefixProvider { Clock::duration time_elapsed() const { return Clock::now() - time; } RGWObjectCtx *obj_ctx{nullptr}; - string dialect; - string req_id; - string trans_id; + std::string dialect; + std::string req_id; + std::string trans_id; uint64_t id; RGWObjTags tagset; @@ -1643,9 +1643,9 @@ struct req_state : DoutPrefixProvider { optional_yield yield{null_yield}; //token claims from STS token for ops log (can be used for Keystone token also) - std::vector token_claims; + std::vector token_claims; - vector session_policies; + std::vector session_policies; req_state(CephContext* _cct, RGWEnv* e, uint64_t id); ~req_state(); @@ -1661,7 +1661,7 @@ struct req_state : DoutPrefixProvider { }; void set_req_state_err(struct req_state*, int); -void set_req_state_err(struct req_state*, int, const string&); +void set_req_state_err(struct req_state*, int, const std::string&); void set_req_state_err(struct rgw_err&, int, const int); void dump(struct req_state*); @@ -1707,7 +1707,7 @@ struct RGWBucketEnt { ENCODE_START(7, 5, bl); uint64_t s = size; __u32 mt = ceph::real_clock::to_time_t(creation_time); - string empty_str; // originally had the bucket name here, but we encode bucket later + std::string empty_str; // originally had the bucket name here, but we encode bucket later encode(empty_str, bl); encode(s, bl); encode(mt, bl); @@ -1723,7 +1723,7 @@ struct RGWBucketEnt { DECODE_START_LEGACY_COMPAT_LEN(7, 5, 5, bl); __u32 mt; uint64_t s; - string empty_str; // backward compatibility + std::string empty_str; // backward compatibility decode(empty_str, bl); decode(s, bl); decode(mt, bl); @@ -1745,7 +1745,7 @@ struct RGWBucketEnt { DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; WRITE_CLASS_ENCODER(RGWBucketEnt) @@ -1767,11 +1767,11 @@ struct rgw_obj { bucket = b; key.set(name); } - void init(const rgw_bucket& b, const std::string& name, const string& i, const string& n) { + void init(const rgw_bucket& b, const std::string& name, const std::string& i, const std::string& n) { bucket = b; key.set(name, i, n); } - void init_ns(const rgw_bucket& b, const std::string& name, const string& n) { + void init_ns(const rgw_bucket& b, const std::string& name, const std::string& n) { bucket = b; key.name = name; key.instance.clear(); @@ -1786,11 +1786,11 @@ struct rgw_obj { key = k; } - string get_oid() const { + std::string get_oid() const { return key.get_oid(); } - const string& get_hash_object() const { + const std::string& get_hash_object() const { return index_hash_source.empty() ? key.name : index_hash_source; } @@ -1814,7 +1814,7 @@ struct rgw_obj { void decode(bufferlist::const_iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN(6, 3, 3, bl); if (struct_v < 6) { - string s; + std::string s; decode(bucket.name, bl); /* bucket.name */ decode(s, bl); /* loc */ decode(key.ns, bl); @@ -1848,7 +1848,7 @@ struct rgw_obj { DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); bool operator==(const rgw_obj& o) const { return (key == o.key) && @@ -1879,13 +1879,13 @@ struct rgw_obj { WRITE_CLASS_ENCODER(rgw_obj) struct rgw_cache_entry_info { - string cache_locator; + std::string cache_locator; uint64_t gen; rgw_cache_entry_info() : gen(0) {} }; -inline ostream& operator<<(ostream& out, const rgw_obj &o) { +inline std::ostream& operator<<(std::ostream& out, const rgw_obj &o) { return out << o.bucket.name << ":" << o.get_oid(); } @@ -1955,7 +1955,7 @@ static inline int rgw_str_to_bool(const char *s, int def_val) strcasecmp(s, "1") == 0); } -static inline void append_rand_alpha(CephContext *cct, const string& src, string& dest, int len) +static inline void append_rand_alpha(CephContext *cct, const std::string& src, std::string& dest, int len) { dest = src; char buf[len + 1]; @@ -2002,15 +2002,15 @@ void rgw_add_amz_meta_header( const std::string& k, const std::string& v); -extern string rgw_string_unquote(const string& s); -extern void parse_csv_string(const string& ival, vector& ovals); -extern int parse_key_value(string& in_str, string& key, string& val); -extern int parse_key_value(string& in_str, const char *delim, string& key, string& val); +extern std::string rgw_string_unquote(const std::string& s); +extern void parse_csv_string(const std::string& ival, std::vector& ovals); +extern int parse_key_value(std::string& in_str, std::string& key, std::string& val); +extern int parse_key_value(std::string& in_str, const char *delim, std::string& key, std::string& val); -extern boost::optional> +extern boost::optional> parse_key_value(const std::string_view& in_str, const std::string_view& delim); -extern boost::optional> +extern boost::optional> parse_key_value(const std::string_view& in_str); @@ -2018,12 +2018,12 @@ parse_key_value(const std::string_view& in_str); extern int parse_time(const char *time_str, real_time *time); extern bool parse_rfc2616(const char *s, struct tm *t); extern bool parse_iso8601(const char *s, struct tm *t, uint32_t *pns = NULL, bool extended_format = true); -extern string rgw_trim_whitespace(const string& src); +extern std::string rgw_trim_whitespace(const std::string& src); extern std::string_view rgw_trim_whitespace(const std::string_view& src); -extern string rgw_trim_quotes(const string& val); +extern std::string rgw_trim_quotes(const std::string& val); extern void rgw_to_iso8601(const real_time& t, char *dest, int buf_size); -extern void rgw_to_iso8601(const real_time& t, string *dest); +extern void rgw_to_iso8601(const real_time& t, std::string *dest); extern std::string rgw_to_asctime(const utime_t& t); struct perm_state_base { @@ -2112,7 +2112,7 @@ bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, /** Check if the req_state's user has the necessary permissions * to do the requested action */ -rgw::IAM::Effect eval_identity_or_session_policies(const vector& user_policies, +rgw::IAM::Effect eval_identity_or_session_policies(const std::vector& user_policies, const rgw::IAM::Environment& env, boost::optional id, const uint64_t op, @@ -2120,8 +2120,8 @@ rgw::IAM::Effect eval_identity_or_session_policies(const vector& user_policies, - const vector& session_policies, + const std::vector& user_policies, + const std::vector& session_policies, const rgw::ARN& res, const uint64_t op); bool verify_user_permission_no_policy(const DoutPrefixProvider* dpp, @@ -2142,8 +2142,8 @@ bool verify_bucket_permission( RGWAccessControlPolicy * const user_acl, RGWAccessControlPolicy * const bucket_acl, const boost::optional& bucket_policy, - const vector& identity_policies, - const vector& session_policies, + const std::vector& identity_policies, + const std::vector& session_policies, const uint64_t op); bool verify_bucket_permission(const DoutPrefixProvider* dpp, struct req_state * const s, const uint64_t op); bool verify_bucket_permission_no_policy( @@ -2165,8 +2165,8 @@ extern bool verify_object_permission( RGWAccessControlPolicy * const bucket_acl, RGWAccessControlPolicy * const object_acl, const boost::optional& bucket_policy, - const vector& identity_policies, - const vector& session_policies, + const std::vector& identity_policies, + const std::vector& session_policies, const uint64_t op); extern bool verify_object_permission(const DoutPrefixProvider* dpp, struct req_state *s, uint64_t op); extern bool verify_object_permission_no_policy( @@ -2185,11 +2185,11 @@ extern int verify_object_lock( const bool bypass_governance_mode); /** Convert an input URL into a sane object name - * by converting %-escaped strings into characters, etc*/ -extern void rgw_uri_escape_char(char c, string& dst); + * by converting %-escaped std::strings into characters, etc*/ +extern void rgw_uri_escape_char(char c, std::string& dst); extern std::string url_decode(const std::string_view& src_str, bool in_query = false); -extern void url_encode(const std::string& src, string& dst, +extern void url_encode(const std::string& src, std::string& dst, bool encode_slash = true); extern std::string url_encode(const std::string& src, bool encode_slash = true); extern std::string url_remove_prefix(const std::string& url); // Removes hhtp, https and www from url @@ -2268,7 +2268,7 @@ extern void calc_hash_sha256_update_stream(ceph::crypto::SHA256* hash, extern std::string calc_hash_sha256_close_stream(ceph::crypto::SHA256** phash); extern std::string calc_hash_sha256_restart_stream(ceph::crypto::SHA256** phash); -extern int rgw_parse_op_type_list(const string& str, uint32_t *perm); +extern int rgw_parse_op_type_list(const std::string& str, uint32_t *perm); static constexpr uint32_t MATCH_POLICY_ACTION = 0x01; static constexpr uint32_t MATCH_POLICY_RESOURCE = 0x02; @@ -2278,14 +2278,14 @@ static constexpr uint32_t MATCH_POLICY_STRING = 0x08; extern bool match_policy(std::string_view pattern, std::string_view input, uint32_t flag); -extern string camelcase_dash_http_attr(const string& orig); -extern string lowercase_dash_http_attr(const string& orig); +extern std::string camelcase_dash_http_attr(const std::string& orig); +extern std::string lowercase_dash_http_attr(const std::string& orig); void rgw_setup_saved_curl_handles(); void rgw_release_all_curl_handles(); -static inline void rgw_escape_str(const string& s, char esc_char, - char special_char, string *dest) +static inline void rgw_escape_str(const std::string& s, char esc_char, + char special_char, std::string *dest) { const char *src = s.c_str(); char dest_buf[s.size() * 2 + 1]; @@ -2302,9 +2302,9 @@ static inline void rgw_escape_str(const string& s, char esc_char, *dest = dest_buf; } -static inline ssize_t rgw_unescape_str(const string& s, ssize_t ofs, +static inline ssize_t rgw_unescape_str(const std::string& s, ssize_t ofs, char esc_char, char special_char, - string *dest) + std::string *dest) { const char *src = s.c_str(); char dest_buf[s.size() + 1]; @@ -2329,13 +2329,13 @@ static inline ssize_t rgw_unescape_str(const string& s, ssize_t ofs, } *destp = '\0'; *dest = dest_buf; - return string::npos; + return std::string::npos; } -static inline string rgw_bl_str(ceph::buffer::list& raw) +static inline std::string rgw_bl_str(ceph::buffer::list& raw) { size_t len = raw.length(); - string s(raw.c_str(), len); + std::string s(raw.c_str(), len); while (len && !s[len - 1]) { --len; s.resize(len); diff --git a/src/rgw/rgw_compression.cc b/src/rgw/rgw_compression.cc index 1255734b6d7ae..e49502711714c 100644 --- a/src/rgw/rgw_compression.cc +++ b/src/rgw/rgw_compression.cc @@ -5,6 +5,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + int rgw_compression_info_from_attr(const bufferlist& attr, bool& need_decompress, RGWCompressionInfo& cs_info) diff --git a/src/rgw/rgw_compression.h b/src/rgw/rgw_compression.h index 6e5d17c2232ab..8e8717b0df2c0 100644 --- a/src/rgw/rgw_compression.h +++ b/src/rgw/rgw_compression.h @@ -14,7 +14,7 @@ int rgw_compression_info_from_attr(const bufferlist& attr, bool& need_decompress, RGWCompressionInfo& cs_info); -int rgw_compression_info_from_attrset(const map& attrs, +int rgw_compression_info_from_attrset(const std::map& attrs, bool& need_decompress, RGWCompressionInfo& cs_info); @@ -24,7 +24,7 @@ class RGWGetObj_Decompress : public RGWGetObj_Filter CompressorRef compressor; RGWCompressionInfo* cs_info; bool partial_content; - vector::iterator first_block, last_block; + std::vector::iterator first_block, last_block; off_t q_ofs, q_len; uint64_t cur_ofs; bufferlist waiting; @@ -55,7 +55,7 @@ public: int process(bufferlist&& data, uint64_t logical_offset) override; bool is_compressed() { return compressed; } - vector& get_compression_blocks() { return blocks; } + std::vector& get_compression_blocks() { return blocks; } boost::optional get_compressor_message() { return compressor_message; } }; /* RGWPutObj_Compress */ diff --git a/src/rgw/rgw_compression_types.h b/src/rgw/rgw_compression_types.h index e5d98a3d53e6b..776f8e10b2054 100644 --- a/src/rgw/rgw_compression_types.h +++ b/src/rgw/rgw_compression_types.h @@ -42,10 +42,10 @@ struct compression_block { WRITE_CLASS_ENCODER(compression_block) struct RGWCompressionInfo { - string compression_type; + std::string compression_type; uint64_t orig_size; boost::optional compressor_message; - vector blocks; + std::vector blocks; RGWCompressionInfo() : compression_type("none"), orig_size(0) {} RGWCompressionInfo(const RGWCompressionInfo& cs_info) : compression_type(cs_info.compression_type), diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index 1946ab1c0f43d..96f2ddabd0768 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -13,6 +13,7 @@ #define dout_subsys ceph_subsys_rgw #define dout_context g_ceph_context +using namespace std; class RGWCompletionManager::WaitContext : public Context { RGWCompletionManager *manager; diff --git a/src/rgw/rgw_coroutine.h b/src/rgw/rgw_coroutine.h index f77efe143a176..1a9fa62cd3214 100644 --- a/src/rgw/rgw_coroutine.h +++ b/src/rgw/rgw_coroutine.h @@ -44,10 +44,10 @@ class RGWCompletionManager : public RefCountedObject { rgw_io_id io_id; void *user_info; }; - list complete_reqs; - set complete_reqs_set; + std::list complete_reqs; + std::set complete_reqs_set; using NotifierRef = boost::intrusive_ptr; - set cns; + std::set cns; ceph::mutex lock = ceph::make_mutex("RGWCompletionManager::lock"); ceph::condition_variable cond; @@ -56,7 +56,7 @@ class RGWCompletionManager : public RefCountedObject { std::atomic going_down = { false }; - map waiters; + std::map waiters; class WaitContext; @@ -152,7 +152,7 @@ public: struct RGWCoroutinesEnv { uint64_t run_context; RGWCoroutinesManager *manager; - list *scheduled_stacks; + std::list *scheduled_stacks; RGWCoroutinesStack *stack; RGWCoroutinesEnv() : run_context(0), manager(NULL), scheduled_stacks(NULL), stack(NULL) {} @@ -165,7 +165,7 @@ enum RGWCoroutineState { }; struct rgw_spawned_stacks { - vector entries; + std::vector entries; rgw_spawned_stacks() {} @@ -174,9 +174,8 @@ struct rgw_spawned_stacks { } void inherit(rgw_spawned_stacks *source) { - for (vector::iterator iter = source->entries.begin(); - iter != source->entries.end(); ++iter) { - add_pending(*iter); + for (auto* entry : source->entries) { + add_pending(entry); } source->entries.clear(); } @@ -189,9 +188,9 @@ class RGWCoroutine : public RefCountedObject, public boost::asio::coroutine { struct StatusItem { utime_t timestamp; - string status; + std::string status; - StatusItem(utime_t& t, const string& s) : timestamp(t), status(s) {} + StatusItem(utime_t& t, const std::string& s) : timestamp(t), status(s) {} void dump(Formatter *f) const; }; @@ -205,16 +204,16 @@ class RGWCoroutine : public RefCountedObject, public boost::asio::coroutine { int max_history; utime_t timestamp; - stringstream status; + std::stringstream status; explicit Status(CephContext *_cct) : cct(_cct), max_history(MAX_COROUTINE_HISTORY) {} - deque history; + std::deque history; - stringstream& set_status(); + std::stringstream& set_status(); } status; - stringstream description; + std::stringstream description; protected: bool _yield_ret; @@ -239,7 +238,7 @@ protected: rgw_spawned_stacks spawned; - stringstream error_stream; + std::stringstream error_stream; int set_state(int s, int ret = 0) { retcode = ret; @@ -255,18 +254,18 @@ protected: void set_io_blocked(bool flag); void reset_description() { - description.str(string()); + description.str(std::string()); } - stringstream& set_description() { + std::stringstream& set_description() { return description; } - stringstream& set_status() { + std::stringstream& set_status() { return status.set_status(); } - stringstream& set_status(const string& s) { - stringstream& status = set_status(); + std::stringstream& set_status(const std::string& s) { + std::stringstream& status = set_status(); status << s; return status; } @@ -283,8 +282,8 @@ public: bool is_done() { return (state == RGWCoroutine_Done || state == RGWCoroutine_Error); } bool is_error() { return (state == RGWCoroutine_Error); } - stringstream& log_error() { return error_stream; } - string error_str() { + std::stringstream& log_error() { return error_stream; } + std::string error_str() { return error_stream.str(); } @@ -324,7 +323,7 @@ public: void wait_for_child(); - virtual string to_str() const; + virtual std::string to_str() const; RGWCoroutinesStack *get_stack() const { return stack; @@ -347,7 +346,7 @@ public: void io_complete(const rgw_io_id& io_id); }; -ostream& operator<<(ostream& out, const RGWCoroutine& cr); +std::ostream& operator<<(std::ostream& out, const RGWCoroutine& cr); #define yield_until_true(x) \ do { \ @@ -393,7 +392,7 @@ do { \ template class RGWConsumerCR : public RGWCoroutine { - list product; + std::list product; public: explicit RGWConsumerCR(CephContext *_cct) : RGWCoroutine(_cct) {} @@ -418,7 +417,7 @@ public: } void receive(const T& p, bool wakeup = true); - void receive(list& l, bool wakeup = true); + void receive(std::list& l, bool wakeup = true); }; class RGWCoroutinesStack : public RefCountedObject { @@ -431,17 +430,17 @@ class RGWCoroutinesStack : public RefCountedObject { RGWCoroutinesManager *ops_mgr; - list ops; - list::iterator pos; + std::list ops; + std::list::iterator pos; rgw_spawned_stacks spawned; RGWCoroutinesStack *preallocated_stack{nullptr}; - set blocked_by_stack; - set blocking_stacks; + std::set blocked_by_stack; + std::set blocking_stacks; - map io_finish_ids; + std::map io_finish_ids; rgw_io_id io_blocked_id; bool done_flag; @@ -531,7 +530,7 @@ public: return retcode; } - string error_str(); + std::string error_str(); void call(RGWCoroutine *next_op); RGWCoroutinesStack *spawn(RGWCoroutine *next_op, bool wait); @@ -577,7 +576,7 @@ public: }; template -void RGWConsumerCR::receive(list& l, bool wakeup) +void RGWConsumerCR::receive(std::list& l, bool wakeup) { product.splice(product.end(), l); if (wakeup) { @@ -598,11 +597,11 @@ void RGWConsumerCR::receive(const T& p, bool wakeup) class RGWCoroutinesManagerRegistry : public RefCountedObject, public AdminSocketHook { CephContext *cct; - set managers; + std::set managers; ceph::shared_mutex lock = ceph::make_shared_mutex("RGWCoroutinesRegistry::lock"); - string admin_command; + std::string admin_command; public: explicit RGWCoroutinesManagerRegistry(CephContext *_cct) : cct(_cct) {} @@ -611,7 +610,7 @@ public: void add(RGWCoroutinesManager *mgr); void remove(RGWCoroutinesManager *mgr); - int hook_to_admin_command(const string& command); + int hook_to_admin_command(const std::string& command); int call(std::string_view command, const cmdmap_t& cmdmap, Formatter *f, std::ostream& ss, @@ -625,7 +624,7 @@ class RGWCoroutinesManager { std::atomic going_down = { false }; std::atomic run_context_count = { 0 }; - map > run_contexts; + std::map > run_contexts; std::atomic max_io_id = { 0 }; std::atomic max_stack_id = { 0 }; @@ -635,7 +634,7 @@ class RGWCoroutinesManager { RGWIOIDProvider io_id_provider; - void handle_unblocked_stack(set& context_stacks, list& scheduled_stacks, + void handle_unblocked_stack(std::set& context_stacks, std::list& scheduled_stacks, RGWCompletionManager::io_completion& io, int *waiting_count); protected: RGWCompletionManager *completion_mgr; @@ -643,7 +642,7 @@ protected: int ops_window; - string id; + std::string id; void put_completion_notifier(RGWAioCompletionNotifier *cn); public: @@ -656,7 +655,7 @@ public: } virtual ~RGWCoroutinesManager(); - int run(const DoutPrefixProvider *dpp, list& ops); + int run(const DoutPrefixProvider *dpp, std::list& ops); int run(const DoutPrefixProvider *dpp, RGWCoroutine *op); void stop() { bool expected = false; @@ -682,7 +681,7 @@ public: void set_sleeping(RGWCoroutine *cr, bool flag); void io_complete(RGWCoroutine *cr, const rgw_io_id& io_id); - virtual string get_id(); + virtual std::string get_id(); void dump(Formatter *f) const; RGWIOIDProvider& get_io_id_provider() { diff --git a/src/rgw/rgw_cors.cc b/src/rgw/rgw_cors.cc index 94d08f7ae3b9c..83ba079b2509d 100644 --- a/src/rgw/rgw_cors.cc +++ b/src/rgw/rgw_cors.cc @@ -30,13 +30,13 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + void RGWCORSRule::dump_origins() { unsigned num_origins = allowed_origins.size(); dout(10) << "Allowed origins : " << num_origins << dendl; - for(set::iterator it = allowed_origins.begin(); - it != allowed_origins.end(); - ++it) { - dout(10) << *it << "," << dendl; + for(auto& origin : allowed_origins) { + dout(10) << origin << "," << dendl; } } diff --git a/src/rgw/rgw_cors.h b/src/rgw/rgw_cors.h index 6679900953b6d..1620795e8b480 100644 --- a/src/rgw/rgw_cors.h +++ b/src/rgw/rgw_cors.h @@ -41,15 +41,15 @@ protected: uint32_t max_age; uint8_t allowed_methods; std::string id; - std::set allowed_hdrs; /* If you change this, you need to discard lowercase_allowed_hdrs */ - std::set lowercase_allowed_hdrs; /* Not built until needed in RGWCORSRule::is_header_allowed */ - std::set allowed_origins; - std::list exposable_hdrs; + std::set allowed_hdrs; /* If you change this, you need to discard lowercase_allowed_hdrs */ + std::set lowercase_allowed_hdrs; /* Not built until needed in RGWCORSRule::is_header_allowed */ + std::set allowed_origins; + std::list exposable_hdrs; public: RGWCORSRule() : max_age(CORS_MAX_AGE_INVALID),allowed_methods(0) {} - RGWCORSRule(std::set& o, std::set& h, - std::list& e, uint8_t f, uint32_t a) + RGWCORSRule(std::set& o, std::set& h, + std::list& e, uint8_t f, uint32_t a) :max_age(a), allowed_methods(f), allowed_hdrs(h), @@ -116,7 +116,7 @@ class RGWCORSConfiguration bool is_empty() { return rules.empty(); } - void get_origins_list(const char *origin, std::list& origins); + void get_origins_list(const char *origin, std::list& origins); RGWCORSRule * host_name_rule(const char *origin); void erase_host_name_rule(std::string& origin); void dump(); diff --git a/src/rgw/rgw_cors_s3.cc b/src/rgw/rgw_cors_s3.cc index 0275156d2c90d..ba68487e27583 100644 --- a/src/rgw/rgw_cors_s3.cc +++ b/src/rgw/rgw_cors_s3.cc @@ -27,6 +27,7 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; void RGWCORSRule_S3::to_xml(XMLFormatter& f) { diff --git a/src/rgw/rgw_cors_s3.h b/src/rgw/rgw_cors_s3.h index bc69c513b6883..f4ec8a1f95bff 100644 --- a/src/rgw/rgw_cors_s3.h +++ b/src/rgw/rgw_cors_s3.h @@ -45,7 +45,7 @@ class RGWCORSConfiguration_S3 : public RGWCORSConfiguration, public XMLObj ~RGWCORSConfiguration_S3() override {} bool xml_end(const char *el) override; - void to_xml(ostream& out); + void to_xml(std::ostream& out); }; class RGWCORSXMLParser_S3 : public RGWXMLParser diff --git a/src/rgw/rgw_cors_swift.h b/src/rgw/rgw_cors_swift.h index 4bb103a467d82..3eff9bea32be5 100644 --- a/src/rgw/rgw_cors_swift.h +++ b/src/rgw/rgw_cors_swift.h @@ -31,8 +31,8 @@ class RGWCORSConfiguration_SWIFT : public RGWCORSConfiguration ~RGWCORSConfiguration_SWIFT() {} int create_update(const char *allow_origins, const char *allow_headers, const char *expose_headers, const char *max_age) { - set o, h; - list e; + std::set o, h; + std::list e; unsigned long a = CORS_MAX_AGE_INVALID; uint8_t flags = RGW_CORS_ALL; diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index fd33e6889b581..48bcee629184b 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -22,6 +22,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + bool RGWAsyncRadosProcessor::RGWWQ::_enqueue(RGWAsyncRadosRequest *req) { if (processor->is_going_down()) { return false; diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index aa8d2d89aaa35..cb9d0f09408f5 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -69,7 +69,7 @@ public: class RGWAsyncRadosProcessor { - deque m_req_queue; + std::deque m_req_queue; std::atomic going_down = { false }; protected: CephContext *cct; @@ -330,7 +330,7 @@ public: bool want_attrs, bool raw_attrs); bufferlist bl; - map attrs; + std::map attrs; RGWObjVersionTracker objv_tracker; }; @@ -356,14 +356,14 @@ class RGWAsyncPutSystemObjAttrs : public RGWAsyncRadosRequest { const DoutPrefixProvider *dpp; RGWSI_SysObj *svc; rgw_raw_obj obj; - map attrs; + std::map attrs; protected: int _send_request(const DoutPrefixProvider *dpp) override; public: RGWAsyncPutSystemObjAttrs(const DoutPrefixProvider *dpp, RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWSI_SysObj *_svc, RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj, - map _attrs); + std::map _attrs); RGWObjVersionTracker objv_tracker; }; @@ -371,8 +371,8 @@ public: class RGWAsyncLockSystemObj : public RGWAsyncRadosRequest { rgw::sal::RadosStore* store; rgw_raw_obj obj; - string lock_name; - string cookie; + std::string lock_name; + std::string cookie; uint32_t duration_secs; protected: @@ -380,21 +380,21 @@ protected: public: RGWAsyncLockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore* _store, RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj, - const string& _name, const string& _cookie, uint32_t _duration_secs); + const std::string& _name, const std::string& _cookie, uint32_t _duration_secs); }; class RGWAsyncUnlockSystemObj : public RGWAsyncRadosRequest { rgw::sal::RadosStore* store; rgw_raw_obj obj; - string lock_name; - string cookie; + std::string lock_name; + std::string cookie; protected: int _send_request(const DoutPrefixProvider *dpp) override; public: RGWAsyncUnlockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, rgw::sal::RadosStore* _store, RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj, - const string& _name, const string& _cookie); + const std::string& _name, const std::string& _cookie); }; template @@ -483,14 +483,14 @@ class RGWSimpleRadosReadAttrsCR : public RGWSimpleCoroutine { RGWSI_SysObj *svc; rgw_raw_obj obj; - map *pattrs; + std::map *pattrs; bool raw_attrs; RGWObjVersionTracker* objv_tracker; RGWAsyncGetSystemObj *req = nullptr; public: RGWSimpleRadosReadAttrsCR(const DoutPrefixProvider *_dpp, RGWAsyncRadosProcessor *_async_rados, RGWSI_SysObj *_svc, - const rgw_raw_obj& _obj, map *_pattrs, + const rgw_raw_obj& _obj, std::map *_pattrs, bool _raw_attrs, RGWObjVersionTracker* objv_tracker = nullptr) : RGWSimpleCoroutine(_svc->ctx()), dpp(_dpp), @@ -568,14 +568,14 @@ class RGWSimpleRadosWriteAttrsCR : public RGWSimpleCoroutine { RGWObjVersionTracker *objv_tracker; rgw_raw_obj obj; - map attrs; + std::map attrs; RGWAsyncPutSystemObjAttrs *req = nullptr; public: RGWSimpleRadosWriteAttrsCR(const DoutPrefixProvider *_dpp, RGWAsyncRadosProcessor *_async_rados, RGWSI_SysObj *_svc, const rgw_raw_obj& _obj, - map _attrs, + std::map _attrs, RGWObjVersionTracker *objv_tracker = nullptr) : RGWSimpleCoroutine(_svc->ctx()), dpp(_dpp), async_rados(_async_rados), svc(_svc), objv_tracker(objv_tracker), obj(_obj), @@ -609,7 +609,7 @@ public: class RGWRadosSetOmapKeysCR : public RGWSimpleCoroutine { rgw::sal::RadosStore* store; - map entries; + std::map entries; rgw_rados_ref ref; @@ -620,7 +620,7 @@ class RGWRadosSetOmapKeysCR : public RGWSimpleCoroutine { public: RGWRadosSetOmapKeysCR(rgw::sal::RadosStore* _store, const rgw_raw_obj& _obj, - map& _entries); + std::map& _entries); int send_request(const DoutPrefixProvider *dpp) override; int request_complete() override; @@ -636,7 +636,7 @@ class RGWRadosGetOmapKeysCR : public RGWSimpleCoroutine { using ResultPtr = std::shared_ptr; RGWRadosGetOmapKeysCR(rgw::sal::RadosStore* _store, const rgw_raw_obj& _obj, - const string& _marker, int _max_entries, + const std::string& _marker, int _max_entries, ResultPtr result); int send_request(const DoutPrefixProvider *dpp) override; @@ -645,7 +645,7 @@ class RGWRadosGetOmapKeysCR : public RGWSimpleCoroutine { private: rgw::sal::RadosStore* store; rgw_raw_obj obj; - string marker; + std::string marker; int max_entries; ResultPtr result; boost::intrusive_ptr cn; @@ -661,7 +661,7 @@ class RGWRadosGetOmapValsCR : public RGWSimpleCoroutine { using ResultPtr = std::shared_ptr; RGWRadosGetOmapValsCR(rgw::sal::RadosStore* _store, const rgw_raw_obj& _obj, - const string& _marker, int _max_entries, + const std::string& _marker, int _max_entries, ResultPtr result); int send_request(const DoutPrefixProvider *dpp) override; @@ -670,7 +670,7 @@ class RGWRadosGetOmapValsCR : public RGWSimpleCoroutine { private: rgw::sal::RadosStore* store; rgw_raw_obj obj; - string marker; + std::string marker; int max_entries; ResultPtr result; boost::intrusive_ptr cn; @@ -681,7 +681,7 @@ class RGWRadosRemoveOmapKeysCR : public RGWSimpleCoroutine { rgw_rados_ref ref; - set keys; + std::set keys; rgw_raw_obj obj; @@ -690,7 +690,7 @@ class RGWRadosRemoveOmapKeysCR : public RGWSimpleCoroutine { public: RGWRadosRemoveOmapKeysCR(rgw::sal::RadosStore* _store, const rgw_raw_obj& _obj, - const set& _keys); + const std::set& _keys); int send_request(const DoutPrefixProvider *dpp) override; @@ -715,8 +715,8 @@ public: class RGWSimpleRadosLockCR : public RGWSimpleCoroutine { RGWAsyncRadosProcessor *async_rados; rgw::sal::RadosStore* store; - string lock_name; - string cookie; + std::string lock_name; + std::string cookie; uint32_t duration; rgw_raw_obj obj; @@ -726,8 +726,8 @@ class RGWSimpleRadosLockCR : public RGWSimpleCoroutine { public: RGWSimpleRadosLockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store, const rgw_raw_obj& _obj, - const string& _lock_name, - const string& _cookie, + const std::string& _lock_name, + const std::string& _cookie, uint32_t _duration); ~RGWSimpleRadosLockCR() override { request_cleanup(); @@ -748,8 +748,8 @@ public: class RGWSimpleRadosUnlockCR : public RGWSimpleCoroutine { RGWAsyncRadosProcessor *async_rados; rgw::sal::RadosStore* store; - string lock_name; - string cookie; + std::string lock_name; + std::string cookie; rgw_raw_obj obj; @@ -758,8 +758,8 @@ class RGWSimpleRadosUnlockCR : public RGWSimpleCoroutine { public: RGWSimpleRadosUnlockCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store, const rgw_raw_obj& _obj, - const string& _lock_name, - const string& _cookie); + const std::string& _lock_name, + const std::string& _cookie); ~RGWSimpleRadosUnlockCR() override { request_cleanup(); } @@ -771,7 +771,7 @@ public: #define OMAP_APPEND_MAX_ENTRIES_DEFAULT 100 -class RGWOmapAppend : public RGWConsumerCR { +class RGWOmapAppend : public RGWConsumerCR { RGWAsyncRadosProcessor *async_rados; rgw::sal::RadosStore* store; @@ -780,9 +780,9 @@ class RGWOmapAppend : public RGWConsumerCR { bool going_down; int num_pending_entries; - list pending_entries; + std::list pending_entries; - map entries; + std::map entries; uint64_t window_size; uint64_t total_entries; @@ -792,7 +792,7 @@ public: uint64_t _window_size = OMAP_APPEND_MAX_ENTRIES_DEFAULT); int operate(const DoutPrefixProvider *dpp) override; void flush_pending(); - bool append(const string& s); + bool append(const std::string& s); bool finish(); uint64_t get_total_entries() { @@ -811,9 +811,9 @@ class RGWShardedOmapCRManager { int num_shards; - vector shards; + std::vector shards; public: - RGWShardedOmapCRManager(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store, RGWCoroutine *_op, int _num_shards, const rgw_pool& pool, const string& oid_prefix) + RGWShardedOmapCRManager(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store, RGWCoroutine *_op, int _num_shards, const rgw_pool& pool, const std::string& oid_prefix) : async_rados(_async_rados), store(_store), op(_op), num_shards(_num_shards) { shards.reserve(num_shards); @@ -833,13 +833,13 @@ public: } } - bool append(const string& entry, int shard_id) { + bool append(const std::string& entry, int shard_id) { return shards[shard_id]->append(entry); } bool finish() { bool success = true; - for (vector::iterator iter = shards.begin(); iter != shards.end(); ++iter) { - success &= ((*iter)->finish() && (!(*iter)->is_error())); + for (auto& append_op : shards) { + success &= (append_op->finish() && (!append_op->is_error())); } return success; } @@ -863,7 +863,7 @@ public: : RGWAsyncRadosRequest(caller, cn), store(_store), bucket(bucket), dpp(dpp) {} RGWBucketInfo bucket_info; - map attrs; + std::map attrs; }; class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine { @@ -871,7 +871,7 @@ class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine { rgw::sal::RadosStore* store; rgw_bucket bucket; RGWBucketInfo *bucket_info; - map *pattrs; + std::map *pattrs; const DoutPrefixProvider *dpp; RGWAsyncGetBucketInstanceInfo *req{nullptr}; @@ -880,7 +880,7 @@ public: // rgw_bucket constructor RGWGetBucketInstanceInfoCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store, const rgw_bucket& _bucket, RGWBucketInfo *_bucket_info, - map *_pattrs, const DoutPrefixProvider *dpp) + std::map *_pattrs, const DoutPrefixProvider *dpp) : RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados), store(_store), bucket(_bucket), bucket_info(_bucket_info), pattrs(_pattrs), dpp(dpp) {} ~RGWGetBucketInstanceInfoCR() override { @@ -1073,9 +1073,9 @@ class RGWAsyncStatRemoteObj : public RGWAsyncRadosRequest { ceph::real_time *pmtime; uint64_t *psize; - string *petag; - map *pattrs; - map *pheaders; + std::string *petag; + std::map *pattrs; + std::map *pheaders; protected: int _send_request(const DoutPrefixProvider *dpp) override; @@ -1086,9 +1086,9 @@ public: const rgw_obj_key& _key, ceph::real_time *_pmtime, uint64_t *_psize, - string *_petag, - map *_pattrs, - map *_pheaders) : RGWAsyncRadosRequest(caller, cn), store(_store), + std::string *_petag, + std::map *_pattrs, + std::map *_pheaders) : RGWAsyncRadosRequest(caller, cn), store(_store), source_zone(_source_zone), src_bucket(_src_bucket), key(_key), @@ -1110,9 +1110,9 @@ class RGWStatRemoteObjCR : public RGWSimpleCoroutine { ceph::real_time *pmtime; uint64_t *psize; - string *petag; - map *pattrs; - map *pheaders; + std::string *petag; + std::map *pattrs; + std::map *pheaders; RGWAsyncStatRemoteObj *req; @@ -1123,9 +1123,9 @@ public: const rgw_obj_key& _key, ceph::real_time *_pmtime, uint64_t *_psize, - string *_petag, - map *_pattrs, - map *_pheaders) : RGWSimpleCoroutine(_store->ctx()), cct(_store->ctx()), + std::string *_petag, + std::map *_pattrs, + std::map *_pheaders) : RGWSimpleCoroutine(_store->ctx()), cct(_store->ctx()), async_rados(_async_rados), store(_store), source_zone(_source_zone), src_bucket(_src_bucket), @@ -1169,11 +1169,11 @@ class RGWAsyncRemoveObj : public RGWAsyncRadosRequest { RGWBucketInfo bucket_info; rgw_obj_key key; - string owner; - string owner_display_name; + std::string owner; + std::string owner_display_name; bool versioned; uint64_t versioned_epoch; - string marker_version_id; + std::string marker_version_id; bool del_if_older; ceph::real_time timestamp; @@ -1187,8 +1187,8 @@ public: const rgw_zone_id& _source_zone, RGWBucketInfo& _bucket_info, const rgw_obj_key& _key, - const string& _owner, - const string& _owner_display_name, + const std::string& _owner, + const std::string& _owner_display_name, bool _versioned, uint64_t _versioned_epoch, bool _delete_marker, @@ -1227,8 +1227,8 @@ class RGWRemoveObjCR : public RGWSimpleCoroutine { bool versioned; uint64_t versioned_epoch; bool delete_marker; - string owner; - string owner_display_name; + std::string owner; + std::string owner_display_name; bool del_if_older; real_time timestamp; @@ -1244,8 +1244,8 @@ public: const rgw_obj_key& _key, bool _versioned, uint64_t _versioned_epoch, - string *_owner, - string *_owner_display_name, + std::string *_owner, + std::string *_owner_display_name, bool _delete_marker, real_time *_timestamp, rgw_zone_set *_zones_trace) : RGWSimpleCoroutine(_store->ctx()), dpp(_dpp), cct(_store->ctx()), @@ -1299,8 +1299,8 @@ class RGWContinuousLeaseCR : public RGWCoroutine { const rgw_raw_obj obj; - const string lock_name; - const string cookie; + const std::string lock_name; + const std::string cookie; int interval; bool going_down{ false }; @@ -1313,7 +1313,7 @@ class RGWContinuousLeaseCR : public RGWCoroutine { public: RGWContinuousLeaseCR(RGWAsyncRadosProcessor *_async_rados, rgw::sal::RadosStore* _store, const rgw_raw_obj& _obj, - const string& _lock_name, int _interval, RGWCoroutine *_caller) + const std::string& _lock_name, int _interval, RGWCoroutine *_caller) : RGWCoroutine(_store->ctx()), async_rados(_async_rados), store(_store), obj(_obj), lock_name(_lock_name), cookie(RGWSimpleRadosLockCR::gen_random_cookie(cct)), @@ -1345,14 +1345,14 @@ public: class RGWRadosTimelogAddCR : public RGWSimpleCoroutine { const DoutPrefixProvider *dpp; rgw::sal::RadosStore* store; - list entries; + std::list entries; - string oid; + std::string oid; boost::intrusive_ptr cn; public: - RGWRadosTimelogAddCR(const DoutPrefixProvider *dpp, rgw::sal::RadosStore* _store, const string& _oid, + RGWRadosTimelogAddCR(const DoutPrefixProvider *dpp, rgw::sal::RadosStore* _store, const std::string& _oid, const cls_log_entry& entry); int send_request(const DoutPrefixProvider *dpp) override; diff --git a/src/rgw/rgw_cr_rest.cc b/src/rgw/rgw_cr_rest.cc index f290d11929e31..bc013b3c74835 100644 --- a/src/rgw/rgw_cr_rest.cc +++ b/src/rgw/rgw_cr_rest.cc @@ -13,6 +13,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + RGWCRHTTPGetDataCB::RGWCRHTTPGetDataCB(RGWCoroutinesEnv *_env, RGWCoroutine *_cr, RGWHTTPStreamRWRequest *_req) : env(_env), cr(_cr), req(_req) { io_id = req->get_io_id(RGWHTTPClient::HTTPCLIENT_IO_READ |RGWHTTPClient::HTTPCLIENT_IO_CONTROL); req->set_in_cb(this); diff --git a/src/rgw/rgw_cr_rest.h b/src/rgw/rgw_cr_rest.h index 914eebee02de2..59045305edfa0 100644 --- a/src/rgw/rgw_cr_rest.h +++ b/src/rgw/rgw_cr_rest.h @@ -14,8 +14,8 @@ struct rgw_rest_obj { rgw_obj_key key; uint64_t content_len; - std::map attrs; - std::map custom_attrs; + std::map attrs; + std::map custom_attrs; RGWAccessControlPolicy acls; void init(const rgw_obj_key& _key) { @@ -28,27 +28,27 @@ class RGWReadRawRESTResourceCR : public RGWSimpleCoroutine { protected: RGWRESTConn *conn; RGWHTTPManager *http_manager; - string path; + std::string path; param_vec_t params; param_vec_t extra_headers; public: boost::intrusive_ptr http_op; RGWReadRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, - RGWHTTPManager *_http_manager, const string& _path, + RGWHTTPManager *_http_manager, const std::string& _path, rgw_http_param_pair *params, bufferlist *_result) : RGWSimpleCoroutine(_cct), result(_result), conn(_conn), http_manager(_http_manager), path(_path), params(make_param_list(params)) {} RGWReadRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, - RGWHTTPManager *_http_manager, const string& _path, + RGWHTTPManager *_http_manager, const std::string& _path, rgw_http_param_pair *params) : RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager), path(_path), params(make_param_list(params)) {} RGWReadRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, - RGWHTTPManager *_http_manager, const string& _path, + RGWHTTPManager *_http_manager, const std::string& _path, rgw_http_param_pair *params, param_vec_t &hdrs) : RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager), path(_path), params(make_param_list(params)), @@ -56,7 +56,7 @@ public: {} RGWReadRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, - RGWHTTPManager *_http_manager, const string& _path, + RGWHTTPManager *_http_manager, const std::string& _path, rgw_http_param_pair *params, std::map *hdrs) : RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager), @@ -123,13 +123,13 @@ class RGWReadRESTResourceCR : public RGWReadRawRESTResourceCR { T *result; public: RGWReadRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, - RGWHTTPManager *_http_manager, const string& _path, + RGWHTTPManager *_http_manager, const std::string& _path, rgw_http_param_pair *params, T *_result) : RGWReadRawRESTResourceCR(_cct, _conn, _http_manager, _path, params), result(_result) {} RGWReadRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, - RGWHTTPManager *_http_manager, const string& _path, + RGWHTTPManager *_http_manager, const std::string& _path, rgw_http_param_pair *params, std::map *hdrs, T *_result) @@ -147,11 +147,11 @@ class RGWSendRawRESTResourceCR: public RGWSimpleCoroutine { protected: RGWRESTConn *conn; RGWHTTPManager *http_manager; - string method; - string path; + std::string method; + std::string path; param_vec_t params; param_vec_t headers; - map *attrs; + std::map *attrs; T *result; E *err_result; bufferlist input_bl; @@ -161,9 +161,9 @@ class RGWSendRawRESTResourceCR: public RGWSimpleCoroutine { public: RGWSendRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, RGWHTTPManager *_http_manager, - const string& _method, const string& _path, + const std::string& _method, const std::string& _path, rgw_http_param_pair *_params, - map *_attrs, + std::map *_attrs, bufferlist& _input, T *_result, bool _send_content_length, E *_err_result = nullptr) @@ -175,8 +175,8 @@ class RGWSendRawRESTResourceCR: public RGWSimpleCoroutine { RGWSendRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, RGWHTTPManager *_http_manager, - const string& _method, const string& _path, - rgw_http_param_pair *_params, map *_attrs, + const std::string& _method, const std::string& _path, + rgw_http_param_pair *_params, std::map *_attrs, T *_result, E *_err_result = nullptr) : RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager), method(_method), path(_path), params(make_param_list(_params)), headers(make_param_list(_attrs)), attrs(_attrs), result(_result), @@ -236,8 +236,8 @@ class RGWSendRESTResourceCR : public RGWSendRawRESTResourceCR { public: RGWSendRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, RGWHTTPManager *_http_manager, - const string& _method, const string& _path, - rgw_http_param_pair *_params, map *_attrs, + const std::string& _method, const std::string& _path, + rgw_http_param_pair *_params, std::map *_attrs, S& _input, T *_result, E *_err_result = nullptr) : RGWSendRawRESTResourceCR(_cct, _conn, _http_manager, _method, _path, _params, _attrs, _result, _err_result) { @@ -256,7 +256,7 @@ class RGWPostRESTResourceCR : public RGWSendRESTResourceCR { public: RGWPostRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, RGWHTTPManager *_http_manager, - const string& _path, + const std::string& _path, rgw_http_param_pair *_params, S& _input, T *_result, E *_err_result = nullptr) : RGWSendRESTResourceCR(_cct, _conn, _http_manager, @@ -270,7 +270,7 @@ class RGWPutRawRESTResourceCR: public RGWSendRawRESTResourceCR { public: RGWPutRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, RGWHTTPManager *_http_manager, - const string& _path, + const std::string& _path, rgw_http_param_pair *_params, bufferlist& _input, T *_result, E *_err_result = nullptr) : RGWSendRawRESTResourceCR(_cct, _conn, _http_manager, "PUT", _path, @@ -283,9 +283,9 @@ class RGWPostRawRESTResourceCR: public RGWSendRawRESTResourceCR { public: RGWPostRawRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, RGWHTTPManager *_http_manager, - const string& _path, + const std::string& _path, rgw_http_param_pair *_params, - map * _attrs, + std::map * _attrs, bufferlist& _input, T *_result, E *_err_result = nullptr) : RGWSendRawRESTResourceCR(_cct, _conn, _http_manager, "POST", _path, @@ -299,7 +299,7 @@ class RGWPutRESTResourceCR : public RGWSendRESTResourceCR { public: RGWPutRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, RGWHTTPManager *_http_manager, - const string& _path, + const std::string& _path, rgw_http_param_pair *_params, S& _input, T *_result, E *_err_result = nullptr) : RGWSendRESTResourceCR(_cct, _conn, _http_manager, @@ -309,9 +309,9 @@ public: RGWPutRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, RGWHTTPManager *_http_manager, - const string& _path, + const std::string& _path, rgw_http_param_pair *_params, - map *_attrs, + std::map *_attrs, S& _input, T *_result, E *_err_result = nullptr) : RGWSendRESTResourceCR(_cct, _conn, _http_manager, "PUT", _path, @@ -323,7 +323,7 @@ public: class RGWDeleteRESTResourceCR : public RGWSimpleCoroutine { RGWRESTConn *conn; RGWHTTPManager *http_manager; - string path; + std::string path; param_vec_t params; boost::intrusive_ptr http_op; @@ -331,7 +331,7 @@ class RGWDeleteRESTResourceCR : public RGWSimpleCoroutine { public: RGWDeleteRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, RGWHTTPManager *_http_manager, - const string& _path, + const std::string& _path, rgw_http_param_pair *_params) : RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager), path(_path), params(make_param_list(_params)) @@ -423,9 +423,9 @@ protected: public: virtual int init(const DoutPrefixProvider *dpp) = 0; virtual int read(bufferlist *data, uint64_t max, bool *need_retry) = 0; /* reentrant */ - virtual int decode_rest_obj(map& headers, bufferlist& extra_data) = 0; + virtual int decode_rest_obj(std::map& headers, bufferlist& extra_data) = 0; virtual bool has_attrs() = 0; - virtual void get_attrs(std::map *attrs) = 0; + virtual void get_attrs(std::map *attrs) = 0; virtual ~RGWStreamReadResourceCRF() = default; }; @@ -471,7 +471,7 @@ protected: } range; ceph::real_time mtime; - string etag; + std::string etag; public: RGWStreamReadHTTPResourceCRF(CephContext *_cct, @@ -488,9 +488,9 @@ public: int init(const DoutPrefixProvider *dpp) override; int read(bufferlist *data, uint64_t max, bool *need_retry) override; /* reentrant */ - int decode_rest_obj(map& headers, bufferlist& extra_data) override; + int decode_rest_obj(std::map& headers, bufferlist& extra_data) override; bool has_attrs() override; - void get_attrs(std::map *attrs) override; + void get_attrs(std::map *attrs) override; bool is_done(); virtual bool need_extra_data() { return false; } @@ -524,7 +524,7 @@ protected: struct multipart_info { bool is_multipart{false}; - string upload_id; + std::string upload_id; int part_num{0}; uint64_t part_size; } multipart; @@ -555,13 +555,13 @@ public: void write_drain_notify(uint64_t pending_size); int drain_writes(bool *need_retry) override; /* reentrant */ - virtual void handle_headers(const std::map& headers) {} + virtual void handle_headers(const std::map& headers) {} void set_req(RGWHTTPStreamRWRequest *r) { req = r; } - void set_multipart(const string& upload_id, int part_num, uint64_t part_size) { + void set_multipart(const std::string& upload_id, int part_num, uint64_t part_size) { multipart.is_multipart = true; multipart.upload_id = upload_id; multipart.part_num = part_num; @@ -572,7 +572,7 @@ public: class RGWStreamSpliceCR : public RGWCoroutine { CephContext *cct; RGWHTTPManager *http_manager; - string url; + std::string url; std::shared_ptr in_crf; std::shared_ptr out_crf; bufferlist bl; diff --git a/src/rgw/rgw_cr_tools.cc b/src/rgw/rgw_cr_tools.cc index 2d54386b5d370..27806e1649348 100644 --- a/src/rgw/rgw_cr_tools.cc +++ b/src/rgw/rgw_cr_tools.cc @@ -15,6 +15,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + template<> int RGWUserCreateCR::Request::_send_request(const DoutPrefixProvider *dpp) { diff --git a/src/rgw/rgw_cr_tools.h b/src/rgw/rgw_cr_tools.h index 0e5038b86f949..ebdbfeb51b7f2 100644 --- a/src/rgw/rgw_cr_tools.h +++ b/src/rgw/rgw_cr_tools.h @@ -36,8 +36,8 @@ struct rgw_get_user_info_params { using RGWGetUserInfoCR = RGWSimpleAsyncCR; struct rgw_get_bucket_info_params { - string tenant; - string bucket_name; + std::string tenant; + std::string bucket_name; }; struct rgw_get_bucket_info_result { @@ -47,7 +47,7 @@ struct rgw_get_bucket_info_result { using RGWGetBucketInfoCR = RGWSimpleAsyncCR; struct rgw_bucket_create_local_params { - shared_ptr user_info; + std::shared_ptr user_info; std::string bucket_name; rgw_placement_rule placement_rule; }; @@ -58,8 +58,8 @@ struct rgw_object_simple_put_params { RGWDataAccess::BucketRef bucket; rgw_obj_key key; bufferlist data; - map attrs; - std::optional user_data; + std::map attrs; + std::optional user_data; }; using RGWObjectSimplePutCR = RGWSimpleWriteOnlyAsyncCR; diff --git a/src/rgw/rgw_crypt.cc b/src/rgw/rgw_crypt.cc index 319d06d0c8254..fe82ecd40a6c1 100644 --- a/src/rgw/rgw_crypt.cc +++ b/src/rgw/rgw_crypt.cc @@ -27,9 +27,9 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; using namespace rgw; - template class canonical_char_sorter { private: diff --git a/src/rgw/rgw_crypt.h b/src/rgw/rgw_crypt.h index 96e52afaa54b1..f5f46522560e6 100644 --- a/src/rgw/rgw_crypt.h +++ b/src/rgw/rgw_crypt.h @@ -150,7 +150,7 @@ int rgw_s3_prepare_decrypt(struct req_state* s, std::map& crypt_http_responses); -static inline void set_attr(map& attrs, +static inline void set_attr(std::map& attrs, const char* key, std::string_view value) { @@ -159,7 +159,7 @@ static inline void set_attr(map& attrs, attrs[key] = std::move(bl); } -static inline std::string get_str_attribute(map& attrs, +static inline std::string get_str_attribute(std::map& attrs, const char *name) { auto iter = attrs.find(name); diff --git a/src/rgw/rgw_d3n_datacache.cc b/src/rgw/rgw_d3n_datacache.cc index b3eefa40bf327..5cf98b0bcfc42 100644 --- a/src/rgw/rgw_d3n_datacache.cc +++ b/src/rgw/rgw_d3n_datacache.cc @@ -20,7 +20,7 @@ namespace efs = std::experimental::filesystem; #define dout_subsys ceph_subsys_rgw - +using namespace std; int D3nCacheAioWriteRequest::d3n_prepare_libaio_write_op(bufferlist& bl, unsigned int len, string oid, string cache_location) { diff --git a/src/rgw/rgw_d3n_datacache.h b/src/rgw/rgw_d3n_datacache.h index 2d62ae4dea2c3..5d3537f3b1484 100644 --- a/src/rgw/rgw_d3n_datacache.h +++ b/src/rgw/rgw_d3n_datacache.h @@ -24,8 +24,8 @@ struct D3nChunkDataInfo : public LRUObject { CephContext *cct; uint64_t size; time_t access_time; - string address; - string oid; + std::string address; + std::string oid; bool complete; struct D3nChunkDataInfo* lru_prev; struct D3nChunkDataInfo* lru_next; @@ -37,11 +37,11 @@ struct D3nChunkDataInfo : public LRUObject { } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; struct D3nCacheAioWriteRequest { - string oid; + std::string oid; void *data; int fd; struct aiocb *cb; @@ -49,7 +49,7 @@ struct D3nCacheAioWriteRequest { CephContext *cct; D3nCacheAioWriteRequest(CephContext *_cct) : cct(_cct) {} - int d3n_prepare_libaio_write_op(bufferlist& bl, unsigned int len, string oid, string cache_location); + int d3n_prepare_libaio_write_op(bufferlist& bl, unsigned int len, std::string oid, std::string cache_location); ~D3nCacheAioWriteRequest() { ::close(fd); @@ -63,8 +63,8 @@ struct D3nCacheAioWriteRequest { struct D3nDataCache { private: - std::unordered_map d3n_cache_map; - std::set d3n_outstanding_write_list; + std::unordered_map d3n_cache_map; + std::set d3n_outstanding_write_list; std::mutex d3n_cache_lock; std::mutex d3n_eviction_lock; @@ -95,8 +95,8 @@ public: std::string cache_location; - bool get(const string& oid, const off_t len); - void put(bufferlist& bl, unsigned int len, string& obj_key); + bool get(const std::string& oid, const off_t len); + void put(bufferlist& bl, unsigned int len, std::string& obj_key); int d3n_io_write(bufferlist& bl, unsigned int len, std::string oid); int d3n_libaio_create_write_request(bufferlist& bl, unsigned int len, std::string oid); void d3n_libaio_write_completion_cb(D3nCacheAioWriteRequest* c); @@ -171,7 +171,7 @@ int D3nRGWDataCache::get_obj_iterate_cb(const DoutPrefixProvider *dpp, const lsubdout(g_ceph_context, rgw_datacache, 30) << "D3nDataCache::" << __func__ << "(): is head object : " << is_head_obj << dendl; librados::ObjectReadOperation op; struct get_obj_data* d = static_cast(arg); - string oid, key; + std::string oid, key; if (is_head_obj) { // only when reading from the head object do we need to do the atomic test diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index f43fdc96cf4eb..4f37e3603f373 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -44,6 +44,8 @@ #undef dout_prefix #define dout_prefix (*_dout << "data sync: ") +using namespace std; + static string datalog_sync_status_oid_prefix = "datalog.sync-status"; static string datalog_sync_status_shard_prefix = "datalog.sync-status.shard"; static string datalog_sync_full_sync_index_prefix = "data.full-sync.index"; diff --git a/src/rgw/rgw_data_sync.h b/src/rgw/rgw_data_sync.h index 5dadf04f290db..d307dce82f230 100644 --- a/src/rgw/rgw_data_sync.h +++ b/src/rgw/rgw_data_sync.h @@ -50,7 +50,7 @@ struct rgw_bucket_sync_pair_info { rgw_bucket_shard dest_bs; }; -inline ostream& operator<<(ostream& out, const rgw_bucket_sync_pair_info& p) { +inline std::ostream& operator<<(std::ostream& out, const rgw_bucket_sync_pair_info& p) { if (p.source_bs.bucket == p.dest_bs.bucket) { return out << p.source_bs; } @@ -65,16 +65,16 @@ inline ostream& operator<<(ostream& out, const rgw_bucket_sync_pair_info& p) { struct rgw_bucket_sync_pipe { rgw_bucket_sync_pair_info info; RGWBucketInfo source_bucket_info; - map source_bucket_attrs; + std::map source_bucket_attrs; RGWBucketInfo dest_bucket_info; - map dest_bucket_attrs; + std::map dest_bucket_attrs; RGWBucketSyncFlowManager::pipe_rules_ref& get_rules() { return info.handler.rules; } }; -inline ostream& operator<<(ostream& out, const rgw_bucket_sync_pipe& p) { +inline std::ostream& operator<<(std::ostream& out, const rgw_bucket_sync_pipe& p) { return out << p.info; } @@ -117,7 +117,7 @@ struct rgw_data_sync_info { } void dump(Formatter *f) const { - string s; + std::string s; switch ((SyncState)state) { case StateInit: s = "init"; @@ -161,8 +161,8 @@ struct rgw_data_sync_marker { IncrementalSync = 1, }; uint16_t state; - string marker; - string next_step_marker; + std::string marker; + std::string next_step_marker; uint64_t total_entries; uint64_t pos; real_time timestamp; @@ -233,7 +233,7 @@ WRITE_CLASS_ENCODER(rgw_data_sync_marker) struct rgw_data_sync_status { rgw_data_sync_info sync_info; - map sync_markers; + std::map sync_markers; rgw_data_sync_status() {} @@ -264,16 +264,16 @@ struct rgw_data_sync_status { WRITE_CLASS_ENCODER(rgw_data_sync_status) struct rgw_datalog_entry { - string key; + std::string key; ceph::real_time timestamp; void decode_json(JSONObj *obj); }; struct rgw_datalog_shard_data { - string marker; + std::string marker; bool truncated; - vector entries; + std::vector entries; void decode_json(JSONObj *obj); }; @@ -282,11 +282,11 @@ class RGWAsyncRadosProcessor; class RGWDataSyncControlCR; struct rgw_bucket_entry_owner { - string id; - string display_name; + std::string id; + std::string display_name; rgw_bucket_entry_owner() {} - rgw_bucket_entry_owner(const string& _id, const string& _display_name) : id(_id), display_name(_display_name) {} + rgw_bucket_entry_owner(const std::string& _id, const std::string& _display_name) : id(_id), display_name(_display_name) {} void decode_json(JSONObj *obj); }; @@ -326,8 +326,8 @@ struct RGWDataSyncEnv { counters = _counters; } - string shard_obj_name(int shard_id); - string status_oid(); + std::string shard_obj_name(int shard_id); + std::string status_oid(); }; struct RGWDataSyncCtx { @@ -377,15 +377,15 @@ public: void finish(); int read_log_info(const DoutPrefixProvider *dpp, rgw_datalog_info *log_info); - int read_source_log_shards_info(const DoutPrefixProvider *dpp, map *shards_info); - int read_source_log_shards_next(const DoutPrefixProvider *dpp, map shard_markers, map *result); + int read_source_log_shards_info(const DoutPrefixProvider *dpp, std::map *shards_info); + int read_source_log_shards_next(const DoutPrefixProvider *dpp, std::map shard_markers, std::map *result); int read_sync_status(const DoutPrefixProvider *dpp, rgw_data_sync_status *sync_status); - int read_recovering_shards(const DoutPrefixProvider *dpp, const int num_shards, set& recovering_shards); - int read_shard_status(const DoutPrefixProvider *dpp, int shard_id, set& lagging_buckets,set& recovering_buckets, rgw_data_sync_marker* sync_marker, const int max_entries); + int read_recovering_shards(const DoutPrefixProvider *dpp, const int num_shards, std::set& recovering_shards); + int read_shard_status(const DoutPrefixProvider *dpp, int shard_id, std::set& lagging_buckets,std::set& recovering_buckets, rgw_data_sync_marker* sync_marker, const int max_entries); int init_sync_status(const DoutPrefixProvider *dpp, int num_shards); int run_sync(const DoutPrefixProvider *dpp, int num_shards); - void wakeup(int shard_id, set& keys); + void wakeup(int shard_id, std::set& keys); }; class RGWDataSyncStatusManager : public DoutPrefixProvider { @@ -399,10 +399,10 @@ class RGWDataSyncStatusManager : public DoutPrefixProvider { RGWRemoteDataLog source_log; - string source_status_oid; - string source_shard_status_oid_prefix; + std::string source_status_oid; + std::string source_shard_status_oid_prefix; - map shard_objs; + std::map shard_objs; int num_shards; @@ -424,18 +424,18 @@ public: int init(const DoutPrefixProvider *dpp); void finalize(); - static string shard_obj_name(const rgw_zone_id& source_zone, int shard_id); - static string sync_status_oid(const rgw_zone_id& source_zone); + static std::string shard_obj_name(const rgw_zone_id& source_zone, int shard_id); + static std::string sync_status_oid(const rgw_zone_id& source_zone); int read_sync_status(const DoutPrefixProvider *dpp, rgw_data_sync_status *sync_status) { return source_log.read_sync_status(dpp, sync_status); } - int read_recovering_shards(const DoutPrefixProvider *dpp, const int num_shards, set& recovering_shards) { + int read_recovering_shards(const DoutPrefixProvider *dpp, const int num_shards, std::set& recovering_shards) { return source_log.read_recovering_shards(dpp, num_shards, recovering_shards); } - int read_shard_status(const DoutPrefixProvider *dpp, int shard_id, set& lagging_buckets, set& recovering_buckets, rgw_data_sync_marker *sync_marker, const int max_entries) { + int read_shard_status(const DoutPrefixProvider *dpp, int shard_id, std::set& lagging_buckets, std::set& recovering_buckets, rgw_data_sync_marker *sync_marker, const int max_entries) { return source_log.read_shard_status(dpp, shard_id, lagging_buckets, recovering_buckets,sync_marker, max_entries); } int init_sync_status(const DoutPrefixProvider *dpp) { return source_log.init_sync_status(dpp, num_shards); } @@ -443,16 +443,16 @@ public: int read_log_info(const DoutPrefixProvider *dpp, rgw_datalog_info *log_info) { return source_log.read_log_info(dpp, log_info); } - int read_source_log_shards_info(const DoutPrefixProvider *dpp, map *shards_info) { + int read_source_log_shards_info(const DoutPrefixProvider *dpp, std::map *shards_info) { return source_log.read_source_log_shards_info(dpp, shards_info); } - int read_source_log_shards_next(const DoutPrefixProvider *dpp, map shard_markers, map *result) { + int read_source_log_shards_next(const DoutPrefixProvider *dpp, std::map shard_markers, std::map *result) { return source_log.read_source_log_shards_next(dpp, shard_markers, result); } int run(const DoutPrefixProvider *dpp) { return source_log.run_sync(dpp, num_shards); } - void wakeup(int shard_id, set& keys) { return source_log.wakeup(shard_id, keys); } + void wakeup(int shard_id, std::set& keys) { return source_log.wakeup(shard_id, keys); } void stop() { source_log.finish(); } @@ -472,7 +472,7 @@ struct rgw_bucket_shard_full_sync_marker { rgw_bucket_shard_full_sync_marker() : count(0) {} - void encode_attr(map& attrs); + void encode_attr(std::map& attrs); void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); @@ -494,10 +494,10 @@ struct rgw_bucket_shard_full_sync_marker { WRITE_CLASS_ENCODER(rgw_bucket_shard_full_sync_marker) struct rgw_bucket_shard_inc_sync_marker { - string position; + std::string position; ceph::real_time timestamp; - void encode_attr(map& attrs); + void encode_attr(std::map& attrs); void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); @@ -532,9 +532,9 @@ struct rgw_bucket_shard_sync_info { rgw_bucket_shard_full_sync_marker full_marker; rgw_bucket_shard_inc_sync_marker inc_marker; - void decode_from_attrs(CephContext *cct, map& attrs); - void encode_all_attrs(map& attrs); - void encode_state_attr(map& attrs); + void decode_from_attrs(CephContext *cct, std::map& attrs); + void encode_all_attrs(std::map& attrs); + void encode_state_attr(std::map& attrs); void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); @@ -561,9 +561,9 @@ struct rgw_bucket_shard_sync_info { WRITE_CLASS_ENCODER(rgw_bucket_shard_sync_info) struct rgw_bucket_index_marker_info { - string bucket_ver; - string master_ver; - string max_marker; + std::string bucket_ver; + std::string master_ver; + std::string max_marker; bool syncstopped{false}; void decode_json(JSONObj *obj) { @@ -583,7 +583,7 @@ class RGWRemoteBucketManager { RGWRESTConn *conn{nullptr}; rgw_zone_id source_zone; - vector sync_pairs; + std::vector sync_pairs; RGWDataSyncCtx sc; rgw_bucket_shard_sync_info init_status; @@ -638,12 +638,12 @@ class RGWBucketPipeSyncStatusManager : public DoutPrefixProvider { rgw_bucket dest_bucket; - vector source_mgrs; + std::vector source_mgrs; - string source_status_oid; - string source_shard_status_oid_prefix; + std::string source_status_oid; + std::string source_shard_status_oid_prefix; - map sync_status; + std::map sync_status; rgw_raw_obj status_obj; int num_shards; @@ -657,11 +657,11 @@ public: int init(const DoutPrefixProvider *dpp); - map& get_sync_status() { return sync_status; } + std::map& get_sync_status() { return sync_status; } int init_sync_status(const DoutPrefixProvider *dpp); - static string status_oid(const rgw_zone_id& source_zone, const rgw_bucket_sync_pair_info& bs); - static string obj_status_oid(const rgw_bucket_sync_pipe& sync_pipe, + static std::string status_oid(const rgw_zone_id& source_zone, const rgw_bucket_sync_pair_info& bs); + static std::string obj_status_oid(const rgw_bucket_sync_pipe& sync_pipe, const rgw_zone_id& source_zone, const rgw::sal::Object* obj); /* specific source obj sync status, can be used by sync modules */ diff --git a/src/rgw/rgw_datalog.cc b/src/rgw/rgw_datalog.cc index ce2f4134bab10..670dcacf76f65 100644 --- a/src/rgw/rgw_datalog.cc +++ b/src/rgw/rgw_datalog.cc @@ -204,7 +204,7 @@ public: return r; } std::string_view max_marker() const override { - return "99999999"sv; + return "99999999"; } int is_empty(const DoutPrefixProvider *dpp) override { for (auto shard = 0u; shard < oids.size(); ++shard) { @@ -321,7 +321,7 @@ public: fifo.meta(dpp, m, null_yield); auto p = m.head_part_num; if (p < 0) { - info->marker = ""s; + info->marker = ""; info->last_update = ceph::real_clock::zero(); return 0; } diff --git a/src/rgw/rgw_datalog.h b/src/rgw/rgw_datalog.h index cdf4102f16c71..85ce61b8112bf 100644 --- a/src/rgw/rgw_datalog.h +++ b/src/rgw/rgw_datalog.h @@ -175,10 +175,10 @@ class RGWDataChangesLog { const int num_shards; std::string get_prefix() { auto prefix = cct->_conf->rgw_data_log_obj_prefix; - return prefix.empty() ? prefix : "data_log"s; + return prefix.empty() ? prefix : "data_log"; } std::string metadata_log_oid() { - return get_prefix() + "generations_metadata"s; + return get_prefix() + "generations_metadata"; } std::string prefix; diff --git a/src/rgw/rgw_dencoder.cc b/src/rgw/rgw_dencoder.cc index 5a5865495d970..3ed328c9071cd 100644 --- a/src/rgw/rgw_dencoder.cc +++ b/src/rgw/rgw_dencoder.cc @@ -14,6 +14,8 @@ #include "common/Formatter.h" +using namespace std; + static string shadow_ns = RGW_OBJ_NS_SHADOW; static void init_bucket(rgw_bucket *b, const char *t, const char *n, const char *dp, const char *ip, const char *m, const char *id) diff --git a/src/rgw/rgw_env.cc b/src/rgw/rgw_env.cc index 4e714d097a2e3..bb45ee8d36aa1 100644 --- a/src/rgw/rgw_env.cc +++ b/src/rgw/rgw_env.cc @@ -12,6 +12,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + void RGWEnv::init(CephContext *cct) { conf.init(cct); diff --git a/src/rgw/rgw_es_main.cc b/src/rgw/rgw_es_main.cc index c07a660227391..e503d4a685746 100644 --- a/src/rgw/rgw_es_main.cc +++ b/src/rgw/rgw_es_main.cc @@ -12,6 +12,7 @@ #include "common/ceph_json.h" #include "rgw_es_query.h" +using namespace std; int main(int argc, char *argv[]) { diff --git a/src/rgw/rgw_es_query.cc b/src/rgw/rgw_es_query.cc index 57a51634d4414..16105d599c513 100644 --- a/src/rgw/rgw_es_query.cc +++ b/src/rgw/rgw_es_query.cc @@ -15,6 +15,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + bool pop_front(list& l, string *s) { if (l.empty()) { diff --git a/src/rgw/rgw_es_query.h b/src/rgw/rgw_es_query.h index 1f9dc6928af48..27cc36d75260e 100644 --- a/src/rgw/rgw_es_query.h +++ b/src/rgw/rgw_es_query.h @@ -7,22 +7,22 @@ #include "rgw_string.h" class ESQueryStack { - list l; - list::iterator iter; + std::list l; + std::list::iterator iter; public: - explicit ESQueryStack(list& src) { + explicit ESQueryStack(std::list& src) { assign(src); } ESQueryStack() {} - void assign(list& src) { + void assign(std::list& src) { l.swap(src); iter = l.begin(); } - bool peek(string *dest) { + bool peek(std::string *dest) { if (done()) { return false; } @@ -30,7 +30,7 @@ public: return true; } - bool pop(string *dest) { + bool pop(std::string *dest) { bool valid = peek(dest); if (!valid) { return false; @@ -45,11 +45,11 @@ public: }; class ESInfixQueryParser { - string query; + std::string query; int size; const char *str; int pos{0}; - list args; + std::list args; void skip_whitespace(const char *str, int size, int& pos); bool get_next_token(bool (*filter)(char)); @@ -61,8 +61,8 @@ class ESInfixQueryParser { bool parse_close_bracket(); public: - explicit ESInfixQueryParser(const string& _query) : query(_query), size(query.size()), str(query.c_str()) {} - bool parse(list *result); + explicit ESInfixQueryParser(const std::string& _query) : query(_query), size(query.size()), str(query.c_str()) {} + bool parse(std::list *result); }; class ESQueryNode; @@ -75,11 +75,11 @@ struct ESEntityTypeMap { ES_ENTITY_DATE = 3, }; - map m; + std::map m; - explicit ESEntityTypeMap(map& _m) : m(_m) {} + explicit ESEntityTypeMap(std::map& _m) : m(_m) {} - bool find(const string& entity, EntityType *ptype) { + bool find(const std::string& entity, EntityType *ptype) { auto i = m.find(entity); if (i != m.end()) { *ptype = i->second; @@ -96,27 +96,30 @@ class ESQueryCompiler { ESQueryStack stack; ESQueryNode *query_root{nullptr}; - string custom_prefix; + std::string custom_prefix; - bool convert(list& infix, string *perr); + bool convert(std::list& infix, std::string *perr); - list > eq_conds; + std::list > eq_conds; ESEntityTypeMap *generic_type_map{nullptr}; ESEntityTypeMap *custom_type_map{nullptr}; - map *field_aliases = nullptr; - set *restricted_fields = nullptr; + std::map *field_aliases = nullptr; + std::set *restricted_fields = nullptr; public: - ESQueryCompiler(const string& query, list > *prepend_eq_conds, const string& _custom_prefix) : parser(query), custom_prefix(_custom_prefix) { + ESQueryCompiler(const std::string& query, + std::list > *prepend_eq_conds, + const std::string& _custom_prefix) + : parser(query), custom_prefix(_custom_prefix) { if (prepend_eq_conds) { eq_conds = std::move(*prepend_eq_conds); } } ~ESQueryCompiler(); - bool compile(string *perr); + bool compile(std::string *perr); void dump(Formatter *f) const; void set_generic_type_map(ESEntityTypeMap *entity_map) { @@ -126,7 +129,7 @@ public: ESEntityTypeMap *get_generic_type_map() { return generic_type_map; } - const string& get_custom_prefix() { return custom_prefix; } + const std::string& get_custom_prefix() { return custom_prefix; } void set_custom_type_map(ESEntityTypeMap *entity_map) { custom_type_map = entity_map; @@ -136,11 +139,11 @@ public: return custom_type_map; } - void set_field_aliases(map *fa) { + void set_field_aliases(std::map *fa) { field_aliases = fa; } - string unalias_field(const string& field) { + std::string unalias_field(const std::string& field) { if (!field_aliases) { return field; } @@ -152,11 +155,11 @@ public: return i->second; } - void set_restricted_fields(set *rf) { + void set_restricted_fields(std::set *rf) { restricted_fields = rf; } - bool is_restricted(const string& f) { + bool is_restricted(const std::string& f) { return (restricted_fields && restricted_fields->find(f) != restricted_fields->end()); } }; diff --git a/src/rgw/rgw_etag_verifier.h b/src/rgw/rgw_etag_verifier.h index a94c6065feb8b..75a0e3e4724da 100644 --- a/src/rgw/rgw_etag_verifier.h +++ b/src/rgw/rgw_etag_verifier.h @@ -26,14 +26,14 @@ class ETagVerifier : public rgw::putobj::Pipe protected: CephContext* cct; MD5 hash; - string calculated_etag; + std::string calculated_etag; public: ETagVerifier(CephContext* cct_, rgw::sal::DataProcessor *next) : Pipe(next), cct(cct_) {} virtual void calculate_etag() = 0; - string get_calculated_etag() { return calculated_etag;} + std::string get_calculated_etag() { return calculated_etag;} }; /* ETagVerifier */ diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index d56c6e599fe74..48474c9fecc08 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -34,6 +34,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; using namespace rgw; namespace rgw { diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index fc42887fe24d5..0ccd2a5794189 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -376,7 +376,7 @@ namespace rgw { } directory* get_directory() { - return get(&variant_type); + return boost::get(&variant_type); } size_t get_size() const { return state.size; } @@ -1429,6 +1429,8 @@ public: } bool eof() { + using boost::get; + if (unlikely(cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15))) { bool is_offset = unlikely(! get(&offset)) || @@ -1573,11 +1575,11 @@ public: class DirIterator { - vector& objs; - vector::iterator obj_iter; + std::vector& objs; + std::vector::iterator obj_iter; - map& common_prefixes; - map::iterator cp_iter; + std::map& common_prefixes; + std::map::iterator cp_iter; boost::optional obj_sref; boost::optional cp_sref; @@ -1585,8 +1587,8 @@ public: public: - DirIterator(vector& objs, - map& common_prefixes) + DirIterator(std::vector& objs, + std::map& common_prefixes) : objs(objs), common_prefixes(common_prefixes), _skip_cp(false) { obj_iter = objs.begin(); @@ -1668,11 +1670,11 @@ public: return cp_sref.get(); } - vector::iterator& get_obj_iter() { + std::vector::iterator& get_obj_iter() { return obj_iter; } - map::iterator& get_cp_iter() { + std::map::iterator& get_cp_iter() { return cp_iter; } @@ -1757,6 +1759,8 @@ public: } bool eof() { + using boost::get; + if (unlikely(cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15))) { bool is_offset = unlikely(! get(&offset)) || diff --git a/src/rgw/rgw_formats.cc b/src/rgw/rgw_formats.cc index f9c0b98574300..3affb5f141425 100644 --- a/src/rgw/rgw_formats.cc +++ b/src/rgw/rgw_formats.cc @@ -25,6 +25,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + RGWFormatter_Plain::RGWFormatter_Plain(const bool ukv) : use_kv(ukv) { diff --git a/src/rgw/rgw_formats.h b/src/rgw/rgw_formats.h index d9c833fc9843f..d7e47259d5839 100644 --- a/src/rgw/rgw_formats.h +++ b/src/rgw/rgw_formats.h @@ -30,7 +30,7 @@ public: void output_header() override {}; void output_footer() override {}; void enable_line_break() override {}; - void flush(ostream& os) override; + void flush(std::ostream& os) override; void reset() override; void open_array_section(std::string_view name) override; @@ -116,13 +116,13 @@ public: }; class RGWStreamFlusher : public RGWFormatterFlusher { - ostream& os; + std::ostream& os; protected: void do_flush() override { formatter->flush(os); } public: - RGWStreamFlusher(Formatter *f, ostream& _os) : RGWFormatterFlusher(f), os(_os) {} + RGWStreamFlusher(Formatter *f, std::ostream& _os) : RGWFormatterFlusher(f), os(_os) {} }; class RGWNullFlusher : public RGWFormatterFlusher { diff --git a/src/rgw/rgw_frontend.cc b/src/rgw/rgw_frontend.cc index fbde27ae6cf25..ea5cbbafefb19 100644 --- a/src/rgw/rgw_frontend.cc +++ b/src/rgw/rgw_frontend.cc @@ -12,6 +12,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + int RGWFrontendConfig::parse_config(const string& config, std::multimap& config_map) { diff --git a/src/rgw/rgw_frontend.h b/src/rgw/rgw_frontend.h index 1a1b5a7cfcf79..a648489ac910d 100644 --- a/src/rgw/rgw_frontend.h +++ b/src/rgw/rgw_frontend.h @@ -44,7 +44,7 @@ public: void set_default_config(RGWFrontendConfig& def_conf); - std::optional get_val(const std::string& key); + std::optional get_val(const std::string& key); bool get_val(const std::string& key, const std::string& def_val, @@ -156,7 +156,7 @@ public: pprocess = pp; - string uid_str; + std::string uid_str; conf->get_val("uid", "", &uid_str); if (uid_str.empty()) { derr << "ERROR: uid param must be specified for loadgen frontend" @@ -174,7 +174,7 @@ public: return ret; } - map::iterator aiter = user->get_info().access_keys.begin(); + auto aiter = user->get_info().access_keys.begin(); if (aiter == user->get_info().access_keys.end()) { derr << "ERROR: user has no S3 access keys set" << dendl; return -EINVAL; diff --git a/src/rgw/rgw_gc.cc b/src/rgw/rgw_gc.cc index 6e907c5dbf974..d59cc65b4b2b2 100644 --- a/src/rgw/rgw_gc.cc +++ b/src/rgw/rgw_gc.cc @@ -22,6 +22,7 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; using namespace librados; static string gc_oid_prefix = "gc"; diff --git a/src/rgw/rgw_gc.h b/src/rgw/rgw_gc.h index 2345db85146ed..f66b0be89c848 100644 --- a/src/rgw/rgw_gc.h +++ b/src/rgw/rgw_gc.h @@ -23,12 +23,12 @@ class RGWGC : public DoutPrefixProvider { CephContext *cct; RGWRados *store; int max_objs; - string *obj_names; + std::string *obj_names; std::atomic down_flag = { false }; static constexpr uint64_t seed = 8675309; - int tag_index(const string& tag); + int tag_index(const std::string& tag); class GCWorker : public Thread { const DoutPrefixProvider *dpp; @@ -50,22 +50,22 @@ public: stop_processor(); finalize(); } - vector transitioned_objects_cache; - int send_chain(cls_rgw_obj_chain& chain, const string& tag); + std::vector transitioned_objects_cache; + int send_chain(cls_rgw_obj_chain& chain, const std::string& tag); // asynchronously defer garbage collection on an object that's still being read - int async_defer_chain(const string& tag, const cls_rgw_obj_chain& info); + int async_defer_chain(const std::string& tag, const cls_rgw_obj_chain& info); // callback for when async_defer_chain() fails with ECANCELED void on_defer_canceled(const cls_rgw_gc_obj_info& info); - int remove(int index, const std::vector& tags, librados::AioCompletion **pc); + int remove(int index, const std::vector& tags, librados::AioCompletion **pc); int remove(int index, int num_entries); void initialize(CephContext *_cct, RGWRados *_store); void finalize(); - int list(int *index, string& marker, uint32_t max, bool expired_only, std::list& result, bool *truncated, bool& processing_queue); + int list(int *index, std::string& marker, uint32_t max, bool expired_only, std::list& result, bool *truncated, bool& processing_queue); void list_init(int *index) { *index = 0; } int process(int index, int process_max_secs, bool expired_only, RGWGCIOManager& io_manager); diff --git a/src/rgw/rgw_http_client.cc b/src/rgw/rgw_http_client.cc index 059a2091bbde1..0e3c79d8562c6 100644 --- a/src/rgw/rgw_http_client.cc +++ b/src/rgw/rgw_http_client.cc @@ -24,6 +24,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + RGWHTTPManager *rgw_http_manager; struct RGWCurlHandle; diff --git a/src/rgw/rgw_http_client.h b/src/rgw/rgw_http_client.h index 355e4181df93b..d20b28cf4f940 100644 --- a/src/rgw/rgw_http_client.h +++ b/src/rgw/rgw_http_client.h @@ -12,8 +12,8 @@ #include -using param_pair_t = pair; -using param_vec_t = vector; +using param_pair_t = std::pair; +using param_vec_t = std::vector; void rgw_http_client_init(CephContext *cct); void rgw_http_client_cleanup(); @@ -40,11 +40,11 @@ class RGWHTTPClient : public RGWIOProvider, bool verify_ssl; // Do not validate self signed certificates, default to false - string ca_path; + std::string ca_path; - string client_cert; + std::string client_cert; - string client_key; + std::string client_key; std::atomic stopped { 0 }; @@ -52,12 +52,12 @@ class RGWHTTPClient : public RGWIOProvider, protected: CephContext *cct; - string method; - string url; + std::string method; + std::string url; - string protocol; - string host; - string resource_prefix; + std::string protocol; + std::string host; + std::string resource_prefix; size_t send_len{0}; @@ -114,14 +114,14 @@ public: virtual ~RGWHTTPClient(); explicit RGWHTTPClient(CephContext *cct, - const string& _method, - const string& _url); + const std::string& _method, + const std::string& _url); std::ostream& gen_prefix(std::ostream& out) const override; - void append_header(const string& name, const string& val) { - headers.push_back(pair(name, val)); + void append_header(const std::string& name, const std::string& val) { + headers.push_back(std::pair(name, val)); } void set_send_length(size_t len) { @@ -159,15 +159,15 @@ public: rgw_http_req_data *get_req_data() { return req_data; } - string to_str(); + std::string to_str(); int get_req_retcode(); - void set_url(const string& _url) { + void set_url(const std::string& _url) { url = _url; } - void set_method(const string& _method) { + void set_method(const std::string& _method) { method = _method; } @@ -179,15 +179,15 @@ public: return user_info; } - void set_ca_path(const string& _ca_path) { + void set_ca_path(const std::string& _ca_path) { ca_path = _ca_path; } - void set_client_cert(const string& _client_cert) { + void set_client_cert(const std::string& _client_cert) { client_cert = _client_cert; } - void set_client_key(const string& _client_key) { + void set_client_key(const std::string& _client_key) { client_key = _client_key; } }; @@ -200,8 +200,8 @@ public: typedef std::set header_spec_t; RGWHTTPHeadersCollector(CephContext * const cct, - const string& method, - const string& url, + const std::string& method, + const std::string& url, const header_spec_t &relevant_headers) : RGWHTTPClient(cct, method, url), relevant_headers(relevant_headers) { @@ -232,8 +232,8 @@ class RGWHTTPTransceiver : public RGWHTTPHeadersCollector { public: RGWHTTPTransceiver(CephContext * const cct, - const string& method, - const string& url, + const std::string& method, + const std::string& url, bufferlist * const read_bl, const header_spec_t intercept_headers = {}) : RGWHTTPHeadersCollector(cct, method, url, intercept_headers), @@ -242,8 +242,8 @@ public: } RGWHTTPTransceiver(CephContext * const cct, - const string& method, - const string& url, + const std::string& method, + const std::string& url, bufferlist * const read_bl, const bool verify_ssl, const header_spec_t intercept_headers = {}) @@ -294,10 +294,10 @@ class RGWHTTPManager { std::atomic is_stopped { 0 }; ceph::shared_mutex reqs_lock = ceph::make_shared_mutex("RGWHTTPManager::reqs_lock"); - map reqs; - list unregistered_reqs; - list reqs_change_state; - map complete_reqs; + std::map reqs; + std::list unregistered_reqs; + std::list reqs_change_state; + std::map complete_reqs; int64_t num_reqs = 0; int64_t max_threaded_req = 0; int thread_pipe[2]; diff --git a/src/rgw/rgw_iam_policy.cc b/src/rgw/rgw_iam_policy.cc index 686601d3ac7bb..b14ce57ab0799 100644 --- a/src/rgw/rgw_iam_policy.cc +++ b/src/rgw/rgw_iam_policy.cc @@ -22,7 +22,9 @@ constexpr int dout_subsys = ceph_subsys_rgw; } using std::bitset; +using std::dec; using std::find; +using std::hex; using std::int64_t; using std::move; using std::pair; diff --git a/src/rgw/rgw_iam_policy.h b/src/rgw/rgw_iam_policy.h index d609716c43b8e..4e1adc5a1f155 100644 --- a/src/rgw/rgw_iam_policy.h +++ b/src/rgw/rgw_iam_policy.h @@ -457,7 +457,7 @@ struct Statement { Effect eval_conditions(const Environment& e) const; }; -std::ostream& operator <<(ostream& m, const Statement& s); +std::ostream& operator <<(std::ostream& m, const Statement& s); struct PolicyParseException : public std::exception { rapidjson::ParseResult pr; @@ -489,7 +489,7 @@ struct Policy { Effect eval_conditions(const Environment& e) const; template - bool has_conditional(const string& conditional, F p) const { + bool has_conditional(const std::string& conditional, F p) const { for (const auto&s: statements){ if (std::any_of(s.conditions.begin(), s.conditions.end(), [&](const Condition& c) { return c.has_key_p(conditional, p);})) @@ -498,16 +498,16 @@ struct Policy { return false; } - bool has_conditional(const string& c) const { + bool has_conditional(const std::string& c) const { return has_conditional(c, Condition::ci_equal_to()); } - bool has_partial_conditional(const string& c) const { + bool has_partial_conditional(const std::string& c) const { return has_conditional(c, Condition::ci_starts_with()); } }; -std::ostream& operator <<(ostream& m, const Policy& p); +std::ostream& operator <<(std::ostream& m, const Policy& p); bool is_public(const Policy& p); } diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index d8d14bb2f2cdf..45d5ee4506634 100644 --- a/src/rgw/rgw_json_enc.cc +++ b/src/rgw/rgw_json_enc.cc @@ -24,6 +24,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + void encode_json(const char *name, const obj_version& v, Formatter *f) { f->open_object_section(name); diff --git a/src/rgw/rgw_jsonparser.cc b/src/rgw/rgw_jsonparser.cc index 057572d980f87..6541630b286d3 100644 --- a/src/rgw/rgw_jsonparser.cc +++ b/src/rgw/rgw_jsonparser.cc @@ -16,6 +16,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; void dump_array(JSONObj *obj) { diff --git a/src/rgw/rgw_keystone.cc b/src/rgw/rgw_keystone.cc index e9c14bd13a0a7..32502bec06f0d 100644 --- a/src/rgw/rgw_keystone.cc +++ b/src/rgw/rgw_keystone.cc @@ -23,6 +23,8 @@ #define dout_subsys ceph_subsys_rgw #define PKI_ANS1_PREFIX "MII" +using namespace std; + bool rgw_is_pki_token(const string& token) { return token.compare(0, sizeof(PKI_ANS1_PREFIX) - 1, PKI_ANS1_PREFIX) == 0; diff --git a/src/rgw/rgw_keystone.h b/src/rgw/rgw_keystone.h index 574cae19cd3b3..c5707b6a7f42d 100644 --- a/src/rgw/rgw_keystone.h +++ b/src/rgw/rgw_keystone.h @@ -16,9 +16,9 @@ #include -bool rgw_is_pki_token(const string& token); -void rgw_get_token_id(const string& token, string& token_id); -static inline std::string rgw_get_token_id(const string& token) +bool rgw_is_pki_token(const std::string& token); +void rgw_get_token_id(const std::string& token, std::string& token_id); +static inline std::string rgw_get_token_id(const std::string& token) { std::string token_id; rgw_get_token_id(token, token_id); @@ -98,8 +98,8 @@ public: class RGWKeystoneHTTPTransceiver : public RGWHTTPTransceiver { public: RGWKeystoneHTTPTransceiver(CephContext * const cct, - const string& method, - const string& url, + const std::string& method, + const std::string& url, bufferlist * const token_body_bl) : RGWHTTPTransceiver(cct, method, url, token_body_bl, cct->_conf->rgw_keystone_verify_ssl, @@ -135,22 +135,22 @@ class TokenEnvelope { public: class Domain { public: - string id; - string name; + std::string id; + std::string name; void decode_json(JSONObj *obj); }; class Project { public: Domain domain; - string id; - string name; + std::string id; + std::string name; void decode_json(JSONObj *obj); }; class Token { public: Token() : expires(0) { } - string id; + std::string id; time_t expires; Project tenant_v2; void decode_json(JSONObj *obj); @@ -158,24 +158,24 @@ public: class Role { public: - string id; - string name; + std::string id; + std::string name; void decode_json(JSONObj *obj); }; class User { public: - string id; - string name; + std::string id; + std::string name; Domain domain; - list roles_v2; + std::list roles_v2; void decode_json(JSONObj *obj); }; Token token; Project project; User user; - list roles; + std::list roles; void decode_v3(JSONObj* obj); void decode_v2(JSONObj* obj); @@ -191,7 +191,7 @@ public: const std::string& get_project_name() const {return project.name;}; const std::string& get_user_id() const {return user.id;}; const std::string& get_user_name() const {return user.name;}; - bool has_role(const string& r) const; + bool has_role(const std::string& r) const; bool expired() const { const uint64_t now = ceph_clock_now().sec(); return now >= static_cast(get_expires()); @@ -206,7 +206,7 @@ public: class TokenCache { struct token_entry { TokenEnvelope token; - list::iterator lru_iter; + std::list::iterator lru_iter; }; std::atomic down_flag = { false }; diff --git a/src/rgw/rgw_kms.cc b/src/rgw/rgw_kms.cc index dcdcf875115db..9b62c689795db 100644 --- a/src/rgw/rgw_kms.cc +++ b/src/rgw/rgw_kms.cc @@ -22,6 +22,7 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; using namespace rgw; #ifndef FORTEST_VIRTUAL diff --git a/src/rgw/rgw_kms.h b/src/rgw/rgw_kms.h index e06b8038b173a..f4e750699120f 100644 --- a/src/rgw/rgw_kms.h +++ b/src/rgw/rgw_kms.h @@ -32,10 +32,10 @@ static const std::string RGW_SSE_KMS_KMIP_SE_KV = "kv"; * \return */ int make_actual_key_from_kms(CephContext *cct, - map& attrs, + std::map& attrs, std::string& actual_key); int reconstitute_actual_key_from_kms(CephContext *cct, - map& attrs, + std::map& attrs, std::string& actual_key); /** diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 1931dd4d78ba3..a495cdb6e4984 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -42,6 +42,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + const char* LC_STATUS[] = { "UNINITIAL", "PROCESSING", diff --git a/src/rgw/rgw_lc.h b/src/rgw/rgw_lc.h index e34e77d2d0033..7c4f404a8819c 100644 --- a/src/rgw/rgw_lc.h +++ b/src/rgw/rgw_lc.h @@ -27,8 +27,8 @@ #define HASH_PRIME 7877 #define MAX_ID_LEN 255 -static string lc_oid_prefix = "lc"; -static string lc_index_lock_name = "lc_process"; +static std::string lc_oid_prefix = "lc"; +static std::string lc_index_lock_name = "lc_process"; extern const char* LC_STATUS[]; @@ -42,12 +42,12 @@ typedef enum { class LCExpiration { protected: - string days; + std::string days; //At present only current object has expiration date - string date; + std::string date; public: LCExpiration() {} - LCExpiration(const string& _days, const string& _date) : days(_days), date(_date) {} + LCExpiration(const std::string& _days, const std::string& _date) : days(_days), date(_date) {} void encode(bufferlist& bl) const { ENCODE_START(3, 2, bl); @@ -65,16 +65,16 @@ public: } void dump(Formatter *f) const; // static void generate_test_instances(list& o); - void set_days(const string& _days) { days = _days; } - string get_days_str() const { + void set_days(const std::string& _days) { days = _days; } + std::string get_days_str() const { return days; } int get_days() const {return atoi(days.c_str()); } bool has_days() const { return !days.empty(); } - void set_date(const string& _date) { date = _date; } - string get_date() const { + void set_date(const std::string& _date) { date = _date; } + std::string get_date() const { return date; } bool has_date() const { @@ -98,20 +98,20 @@ WRITE_CLASS_ENCODER(LCExpiration) class LCTransition { protected: - string days; - string date; - string storage_class; + std::string days; + std::string date; + std::string storage_class; public: int get_days() const { return atoi(days.c_str()); } - string get_date() const { + std::string get_date() const { return date; } - string get_storage_class() const { + std::string get_storage_class() const { return storage_class; } @@ -216,15 +216,15 @@ WRITE_CLASS_ENCODER(LCFilter) class LCRule { protected: - string id; - string prefix; - string status; + std::string id; + std::string prefix; + std::string status; LCExpiration expiration; LCExpiration noncur_expiration; LCExpiration mp_expiration; LCFilter filter; - map transitions; - map noncur_transitions; + std::map transitions; + std::map noncur_transitions; bool dm_expiration = false; public: @@ -232,11 +232,11 @@ public: LCRule(){}; ~LCRule(){}; - const string& get_id() const { + const std::string& get_id() const { return id; } - const string& get_status() const { + const std::string& get_status() const { return status; } @@ -248,7 +248,7 @@ public: status = (flag ? "Enabled" : "Disabled"); } - const string& get_prefix() const { + const std::string& get_prefix() const { return prefix; } @@ -272,23 +272,23 @@ public: return dm_expiration; } - const map& get_transitions() const { + const std::map& get_transitions() const { return transitions; } - const map& get_noncur_transitions() const { + const std::map& get_noncur_transitions() const { return noncur_transitions; } - void set_id(const string& _id) { + void set_id(const std::string& _id) { id = _id; } - void set_prefix(const string& _prefix) { + void set_prefix(const std::string& _prefix) { prefix = _prefix; } - void set_status(const string& _status) { + void set_status(const std::string& _status) { status = _status; } @@ -368,7 +368,7 @@ struct transition_action { int days; boost::optional date; - string storage_class; + std::string storage_class; transition_action() : days(0) {} void dump(Formatter *f) const { if (!date) { @@ -383,7 +383,7 @@ struct transition_action /* XXX why not LCRule? */ struct lc_op { - string id; + std::string id; bool status{false}; bool dm_expiration{false}; int expiration{0}; @@ -391,8 +391,8 @@ struct lc_op int mp_expiration{0}; boost::optional expiration_date; boost::optional obj_tags; - map transitions; - map noncur_transitions; + std::map transitions; + std::map noncur_transitions; /* ctors are nice */ lc_op() = delete; @@ -407,8 +407,8 @@ class RGWLifecycleConfiguration { protected: CephContext *cct; - multimap prefix_map; - multimap rule_map; + std::multimap prefix_map; + std::multimap rule_map; bool _add_rule(const LCRule& rule); bool has_same_action(const lc_op& first, const lc_op& second); public: @@ -421,7 +421,7 @@ public: virtual ~RGWLifecycleConfiguration() {} -// int get_perm(string& id, int perm_mask); +// int get_perm(std::string& id, int perm_mask); // int get_group_perm(ACLGroupTypeEnum group, int perm_mask); void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); @@ -431,7 +431,7 @@ public: void decode(bufferlist::const_iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); decode(rule_map, bl); - multimap::iterator iter; + std::multimap::iterator iter; for (iter = rule_map.begin(); iter != rule_map.end(); ++iter) { LCRule& rule = iter->second; _add_rule(rule); @@ -439,7 +439,7 @@ public: DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); void add_rule(const LCRule& rule); @@ -447,10 +447,10 @@ public: bool valid(); - multimap& get_rule_map() { return rule_map; } - multimap& get_prefix_map() { return prefix_map; } + std::multimap& get_rule_map() { return rule_map; } + std::multimap& get_prefix_map() { return prefix_map; } /* - void create_default(string id, string name) { + void create_default(std::string id, std::string name) { ACLGrant grant; grant.set_canon(id, name, RGW_PERM_FULL_CONTROL); add_grant(&grant); @@ -464,9 +464,9 @@ class RGWLC : public DoutPrefixProvider { rgw::sal::Store* store; std::unique_ptr sal_lc; int max_objs{0}; - string *obj_names{nullptr}; + std::string *obj_names{nullptr}; std::atomic down_flag = { false }; - string cookie; + std::string cookie; public: @@ -516,10 +516,10 @@ public: bool if_already_run_today(time_t start_date); bool expired_session(time_t started); time_t thread_stop_at(); - int list_lc_progress(string& marker, uint32_t max_entries, - vector&, int& index); + int list_lc_progress(std::string& marker, uint32_t max_entries, + std::vector&, int& index); int bucket_lc_prepare(int index, LCWorker* worker); - int bucket_lc_process(string& shard_id, LCWorker* worker, time_t stop_at, + int bucket_lc_process(std::string& shard_id, LCWorker* worker, time_t stop_at, bool once); int bucket_lc_post(int index, int max_lock_sec, rgw::sal::Lifecycle::LCEntry& entry, int& result, LCWorker* worker); @@ -540,7 +540,7 @@ public: private: int handle_multipart_expiration(rgw::sal::Bucket* target, - const multimap& prefix_map, + const std::multimap& prefix_map, LCWorker* worker, time_t stop_at, bool once); }; diff --git a/src/rgw/rgw_lc_s3.cc b/src/rgw/rgw_lc_s3.cc index 57a996f0cf821..536323d74821c 100644 --- a/src/rgw/rgw_lc_s3.cc +++ b/src/rgw/rgw_lc_s3.cc @@ -14,6 +14,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + static bool check_date(const string& _date) { boost::optional date = ceph::from_iso_8601(_date); diff --git a/src/rgw/rgw_lc_s3.h b/src/rgw/rgw_lc_s3.h index 5aa9c8e8c4961..0fe093df9ea0f 100644 --- a/src/rgw/rgw_lc_s3.h +++ b/src/rgw/rgw_lc_s3.h @@ -27,7 +27,7 @@ private: bool dm_expiration{false}; public: LCExpiration_S3() {} - LCExpiration_S3(string _days, string _date, bool _dm_expiration) : LCExpiration(_days, _date), dm_expiration(_dm_expiration) {} + LCExpiration_S3(std::string _days, std::string _date, bool _dm_expiration) : LCExpiration(_days, _date), dm_expiration(_dm_expiration) {} void dump_xml(Formatter *f) const; void decode_xml(XMLObj *obj); diff --git a/src/rgw/rgw_ldap.cc b/src/rgw/rgw_ldap.cc index 27b2c24af4d29..7ad6b74b13988 100644 --- a/src/rgw/rgw_ldap.cc +++ b/src/rgw/rgw_ldap.cc @@ -14,6 +14,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + std::string parse_rgw_ldap_bindpw(CephContext* ctx) { string ldap_bindpw; diff --git a/src/rgw/rgw_lib.h b/src/rgw/rgw_lib.h index 836e4f0f6acc2..710c76c803158 100644 --- a/src/rgw/rgw_lib.h +++ b/src/rgw/rgw_lib.h @@ -51,7 +51,7 @@ namespace rgw { std::ostream& gen_prefix(std::ostream& out) const { return out << "lib rgw: "; } int init(); - int init(vector& args); + int init(std::vector& args); int stop(); }; diff --git a/src/rgw/rgw_lib_frontend.h b/src/rgw/rgw_lib_frontend.h index 461befd6bad71..625952d335df0 100644 --- a/src/rgw/rgw_lib_frontend.h +++ b/src/rgw/rgw_lib_frontend.h @@ -59,7 +59,7 @@ namespace rgw { lsubdout(g_ceph_context, rgw, 10) << __func__ << " enqueue request req=" - << hex << req << dec << dendl; + << std::hex << req << std::dec << dendl; req_throttle.get(1); req_wq.queue(req); diff --git a/src/rgw/rgw_loadgen.cc b/src/rgw/rgw_loadgen.cc index 22c133864b721..015057e9c79bc 100644 --- a/src/rgw/rgw_loadgen.cc +++ b/src/rgw/rgw_loadgen.cc @@ -11,6 +11,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + void RGWLoadGenRequestEnv::set_date(utime_t& tm) { date_str = rgw_to_asctime(tm); diff --git a/src/rgw/rgw_loadgen_process.cc b/src/rgw/rgw_loadgen_process.cc index a83ae89f0bc39..547e74ef4b984 100644 --- a/src/rgw/rgw_loadgen_process.cc +++ b/src/rgw/rgw_loadgen_process.cc @@ -16,6 +16,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + extern void signal_shutdown(); void RGWLoadGenProcess::checkpoint() diff --git a/src/rgw/rgw_log.cc b/src/rgw/rgw_log.cc index b35baf76756ea..b2c4e8093264c 100644 --- a/src/rgw/rgw_log.cc +++ b/src/rgw/rgw_log.cc @@ -18,6 +18,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + static void set_param_str(struct req_state *s, const char *name, string& str) { const char *p = s->info.env->get(name); diff --git a/src/rgw/rgw_log.h b/src/rgw/rgw_log.h index dd2454fd2cc97..2469282b33012 100644 --- a/src/rgw/rgw_log.h +++ b/src/rgw/rgw_log.h @@ -19,25 +19,25 @@ struct rgw_log_entry { rgw_user object_owner; rgw_user bucket_owner; - string bucket; + std::string bucket; Clock::time_point time; - string remote_addr; - string user; + std::string remote_addr; + std::string user; rgw_obj_key obj; - string op; - string uri; - string http_status; - string error_code; + std::string op; + std::string uri; + std::string http_status; + std::string error_code; uint64_t bytes_sent = 0; uint64_t bytes_received = 0; uint64_t obj_size = 0; Clock::duration total_time{}; - string user_agent; - string referrer; - string bucket_id; + std::string user_agent; + std::string referrer; + std::string bucket_id; headers_map x_headers; - string trans_id; - std::vector token_claims; + std::string trans_id; + std::vector token_claims; uint32_t identity_type; void encode(bufferlist &bl) const { @@ -128,7 +128,7 @@ struct rgw_log_entry { DECODE_FINISH(p); } void dump(ceph::Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; WRITE_CLASS_ENCODER(rgw_log_entry) @@ -151,7 +151,7 @@ public: class RGWREST; int rgw_log_op(rgw::sal::Store* store, RGWREST* const rest, struct req_state* s, - const string& op_name, OpsLogSocket* olog); + const std::string& op_name, OpsLogSocket* olog); void rgw_log_usage_init(CephContext* cct, rgw::sal::Store* store); void rgw_log_usage_finalize(); void rgw_format_ops_log_entry(struct rgw_log_entry& entry, diff --git a/src/rgw/rgw_log_backing.cc b/src/rgw/rgw_log_backing.cc index 415ad1363d528..7c9dafe7e4494 100644 --- a/src/rgw/rgw_log_backing.cc +++ b/src/rgw/rgw_log_backing.cc @@ -8,6 +8,7 @@ #include "rgw_tools.h" #include "cls_fifo_legacy.h" +using namespace std::chrono_literals; namespace cb = ceph::buffer; static constexpr auto dout_subsys = ceph_subsys_rgw; @@ -165,7 +166,7 @@ bs::error_code log_remove(const DoutPrefixProvider *dpp, rados::cls::fifo::info info; uint32_t part_header_size = 0, part_entry_overhead = 0; - auto r = rgw::cls::fifo::get_meta(dpp, ioctx, oid, nullopt, &info, + auto r = rgw::cls::fifo::get_meta(dpp, ioctx, oid, std::nullopt, &info, &part_header_size, &part_entry_overhead, 0, y, true); if (r == -ENOENT) continue; diff --git a/src/rgw/rgw_log_backing.h b/src/rgw/rgw_log_backing.h index 599ea4bd1030b..3fa67d7418bb7 100644 --- a/src/rgw/rgw_log_backing.h +++ b/src/rgw/rgw_log_backing.h @@ -242,7 +242,7 @@ inline std::string gencursor(uint64_t gen_id, std::string_view cursor) { inline std::pair cursorgen(std::string_view cursor_) { if (cursor_.empty()) { - return { 0, ""sv }; + return { 0, "" }; } std::string_view cursor = cursor_; if (cursor[0] != 'G') { diff --git a/src/rgw/rgw_lua.cc b/src/rgw/rgw_lua.cc index bd08f06bcd99b..9c74d84649029 100644 --- a/src/rgw/rgw_lua.cc +++ b/src/rgw/rgw_lua.cc @@ -142,7 +142,7 @@ int add_package(const DoutPrefixProvider *dpp, rgw::sal::Store* store, optional_ int remove_package(const DoutPrefixProvider *dpp, rgw::sal::Store* store, optional_yield y, const std::string& package_name) { librados::ObjectWriteOperation op; size_t pos = package_name.find(" "); - if (pos != string::npos) { + if (pos != package_name.npos) { // remove specfic version of the the package op.omap_rm_keys(std::set({package_name})); auto ret = rgw_rados_operate(dpp, *(static_cast(store)->getRados()->get_lc_pool_ctx()), diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index cf9295a88899b..aa3fdd4fc9b0d 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -62,6 +62,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + namespace { TracepointProvider::Traits rgw_op_tracepoint_traits("librgw_op_tp.so", "rgw_op_tracing"); diff --git a/src/rgw/rgw_mdlog.h b/src/rgw/rgw_mdlog.h index ae16cc5e673d3..abc590a3e4635 100644 --- a/src/rgw/rgw_mdlog.h +++ b/src/rgw/rgw_mdlog.h @@ -26,7 +26,7 @@ #define META_LOG_OBJ_PREFIX "meta.log." struct RGWMetadataLogInfo { - string marker; + std::string marker; real_time last_update; void dump(Formatter *f) const; @@ -66,7 +66,7 @@ class RGWMetadataLogInfoCompletion : public RefCountedObject { class RGWMetadataLog { CephContext *cct; - const string prefix; + const std::string prefix; struct Svc { RGWSI_Zone *zone{nullptr}; @@ -80,7 +80,7 @@ class RGWMetadataLog { } RWLock lock; - set modified_shards; + std::set modified_shards; void mark_modified(int shard_id); public: @@ -96,23 +96,23 @@ public: } - void get_shard_oid(int id, string& oid) const { + void get_shard_oid(int id, std::string& oid) const { char buf[16]; snprintf(buf, sizeof(buf), "%d", id); oid = prefix + buf; } - int add_entry(const DoutPrefixProvider *dpp, const string& hash_key, const string& section, const string& key, bufferlist& bl); - int get_shard_id(const string& hash_key, int *shard_id); - int store_entries_in_shard(const DoutPrefixProvider *dpp, list& entries, int shard_id, librados::AioCompletion *completion); + int add_entry(const DoutPrefixProvider *dpp, const std::string& hash_key, const std::string& section, const std::string& key, bufferlist& bl); + int get_shard_id(const std::string& hash_key, int *shard_id); + int store_entries_in_shard(const DoutPrefixProvider *dpp, std::list& entries, int shard_id, librados::AioCompletion *completion); struct LogListCtx { int cur_shard; - string marker; + std::string marker; real_time from_time; real_time end_time; - string cur_oid; + std::string cur_oid; bool done; @@ -120,25 +120,25 @@ public: }; void init_list_entries(int shard_id, const real_time& from_time, - const real_time& end_time, const string& marker, + const real_time& end_time, const std::string& marker, void **handle); void complete_list_entries(void *handle); int list_entries(const DoutPrefixProvider *dpp, void *handle, int max_entries, - list& entries, - string *out_marker, + std::list& entries, + std::string *out_marker, bool *truncated); - int trim(const DoutPrefixProvider *dpp, int shard_id, const real_time& from_time, const real_time& end_time, const string& start_marker, const string& end_marker); + int trim(const DoutPrefixProvider *dpp, int shard_id, const real_time& from_time, const real_time& end_time, const std::string& start_marker, const std::string& end_marker); int get_info(const DoutPrefixProvider *dpp, int shard_id, RGWMetadataLogInfo *info); int get_info_async(const DoutPrefixProvider *dpp, int shard_id, RGWMetadataLogInfoCompletion *completion); - int lock_exclusive(const DoutPrefixProvider *dpp, int shard_id, timespan duration, string&zone_id, string& owner_id); - int unlock(const DoutPrefixProvider *dpp, int shard_id, string& zone_id, string& owner_id); + int lock_exclusive(const DoutPrefixProvider *dpp, int shard_id, timespan duration, std::string&zone_id, std::string& owner_id); + int unlock(const DoutPrefixProvider *dpp, int shard_id, std::string& zone_id, std::string& owner_id); - int update_shards(list& shards); + int update_shards(std::list& shards); - void read_clear_modified(set &modified); + void read_clear_modified(std::set &modified); }; struct LogStatusDump { diff --git a/src/rgw/rgw_meta_sync_status.h b/src/rgw/rgw_meta_sync_status.h index 22dbe6479bb86..6272b471db01b 100644 --- a/src/rgw/rgw_meta_sync_status.h +++ b/src/rgw/rgw_meta_sync_status.h @@ -54,8 +54,8 @@ struct rgw_meta_sync_marker { IncrementalSync = 1, }; uint16_t state; - string marker; - string next_step_marker; + std::string marker; + std::string next_step_marker; uint64_t total_entries; uint64_t pos; real_time timestamp; @@ -97,7 +97,7 @@ WRITE_CLASS_ENCODER(rgw_meta_sync_marker) struct rgw_meta_sync_status { rgw_meta_sync_info sync_info; - map sync_markers; + std::map sync_markers; rgw_meta_sync_status() {} diff --git a/src/rgw/rgw_metadata.cc b/src/rgw/rgw_metadata.cc index c6cf81ef2fc66..f036bf5485d3e 100644 --- a/src/rgw/rgw_metadata.cc +++ b/src/rgw/rgw_metadata.cc @@ -27,6 +27,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + const std::string RGWMetadataLogHistory::oid = "meta.history"; void LogStatusDump::dump(Formatter *f) const { diff --git a/src/rgw/rgw_metadata.h b/src/rgw/rgw_metadata.h index 299bf391b3547..e27fe27af233e 100644 --- a/src/rgw/rgw_metadata.h +++ b/src/rgw/rgw_metadata.h @@ -33,17 +33,17 @@ class RGWMetadataObject { protected: obj_version objv; ceph::real_time mtime; - std::map *pattrs{nullptr}; + std::map *pattrs{nullptr}; public: RGWMetadataObject() {} virtual ~RGWMetadataObject() {} obj_version& get_version(); real_time& get_mtime() { return mtime; } - void set_pattrs(std::map *_pattrs) { + void set_pattrs(std::map *_pattrs) { pattrs = _pattrs; } - std::map *get_pattrs() { + std::map *get_pattrs() { return pattrs; } @@ -61,7 +61,7 @@ protected: public: RGWMetadataHandler() {} virtual ~RGWMetadataHandler() {} - virtual string get_type() = 0; + virtual std::string get_type() = 0; void base_init(CephContext *_cct) { cct = _cct; @@ -69,17 +69,17 @@ public: virtual RGWMetadataObject *get_meta_obj(JSONObj *jo, const obj_version& objv, const ceph::real_time& mtime) = 0; - virtual int get(string& entry, RGWMetadataObject **obj, optional_yield, const DoutPrefixProvider *dpp) = 0; - virtual int put(string& entry, + virtual int get(std::string& entry, RGWMetadataObject **obj, optional_yield, const DoutPrefixProvider *dpp) = 0; + virtual int put(std::string& entry, RGWMetadataObject *obj, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp, RGWMDLogSyncType type, bool from_remote_zone) = 0; - virtual int remove(string& entry, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp) = 0; + virtual int remove(std::string& entry, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp) = 0; - virtual int mutate(const string& entry, + virtual int mutate(const std::string& entry, const ceph::real_time& mtime, RGWObjVersionTracker *objv_tracker, optional_yield y, @@ -87,13 +87,13 @@ public: RGWMDLogStatus op_type, std::function f) = 0; - virtual int list_keys_init(const DoutPrefixProvider *dpp, const string& marker, void **phandle) = 0; - virtual int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, list& keys, bool *truncated) = 0; + virtual int list_keys_init(const DoutPrefixProvider *dpp, const std::string& marker, void **phandle) = 0; + virtual int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, std::list& keys, bool *truncated) = 0; virtual void list_keys_complete(void *handle) = 0; - virtual string get_marker(void *handle) = 0; + virtual std::string get_marker(void *handle) = 0; - virtual int get_shard_id(const string& entry, int *shard_id) { + virtual int get_shard_id(const std::string& entry, int *shard_id) { *shard_id = 0; return 0; } @@ -111,13 +111,13 @@ public: protected: RGWSI_MetaBackend_Handler *be_handler; - virtual int do_get(RGWSI_MetaBackend_Handler::Op *op, string& entry, RGWMetadataObject **obj, optional_yield y, const DoutPrefixProvider *dpp) = 0; - virtual int do_put(RGWSI_MetaBackend_Handler::Op *op, string& entry, RGWMetadataObject *obj, + virtual int do_get(RGWSI_MetaBackend_Handler::Op *op, std::string& entry, RGWMetadataObject **obj, optional_yield y, const DoutPrefixProvider *dpp) = 0; + virtual int do_put(RGWSI_MetaBackend_Handler::Op *op, std::string& entry, RGWMetadataObject *obj, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp, RGWMDLogSyncType type, bool from_remote_zone) = 0; virtual int do_put_operate(Put *put_op, const DoutPrefixProvider *dpp); - virtual int do_remove(RGWSI_MetaBackend_Handler::Op *op, string& entry, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp) = 0; + virtual int do_remove(RGWSI_MetaBackend_Handler::Op *op, std::string& entry, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp) = 0; public: RGWMetadataHandler_GenericMetaBE() {} @@ -136,7 +136,7 @@ public: protected: RGWMetadataHandler_GenericMetaBE *handler; RGWSI_MetaBackend_Handler::Op *op; - string& entry; + std::string& entry; RGWMetadataObject *obj; RGWObjVersionTracker& objv_tracker; RGWMDLogSyncType apply_type; @@ -148,7 +148,7 @@ public: } public: Put(RGWMetadataHandler_GenericMetaBE *_handler, RGWSI_MetaBackend_Handler::Op *_op, - string& _entry, RGWMetadataObject *_obj, + std::string& _entry, RGWMetadataObject *_obj, RGWObjVersionTracker& _objv_tracker, optional_yield _y, RGWMDLogSyncType _type, bool from_remote_zone); @@ -168,11 +168,11 @@ public: } }; - int get(string& entry, RGWMetadataObject **obj, optional_yield, const DoutPrefixProvider *dpp) override; - int put(string& entry, RGWMetadataObject *obj, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp, RGWMDLogSyncType type, bool from_remote_zone) override; - int remove(string& entry, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp) override; + int get(std::string& entry, RGWMetadataObject **obj, optional_yield, const DoutPrefixProvider *dpp) override; + int put(std::string& entry, RGWMetadataObject *obj, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp, RGWMDLogSyncType type, bool from_remote_zone) override; + int remove(std::string& entry, RGWObjVersionTracker& objv_tracker, optional_yield, const DoutPrefixProvider *dpp) override; - int mutate(const string& entry, + int mutate(const std::string& entry, const ceph::real_time& mtime, RGWObjVersionTracker *objv_tracker, optional_yield y, @@ -180,10 +180,10 @@ public: RGWMDLogStatus op_type, std::function f) override; - int get_shard_id(const string& entry, int *shard_id) override; + int get_shard_id(const std::string& entry, int *shard_id) override; int list_keys_init(const DoutPrefixProvider *dpp, const std::string& marker, void **phandle) override; - int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, std::list& keys, bool *truncated) override; + int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, std::list& keys, bool *truncated) override; void list_keys_complete(void *handle) override; std::string get_marker(void *handle) override; @@ -226,27 +226,27 @@ class RGWMetadataManager { CephContext *cct; RGWSI_Meta *meta_svc; - map handlers; + std::map handlers; std::unique_ptr md_top_handler; - int find_handler(const string& metadata_key, RGWMetadataHandler **handler, string& entry); + int find_handler(const std::string& metadata_key, RGWMetadataHandler **handler, std::string& entry); int register_handler(RGWMetadataHandler *handler); public: RGWMetadataManager(RGWSI_Meta *_meta_svc); ~RGWMetadataManager(); - RGWMetadataHandler *get_handler(const string& type); + RGWMetadataHandler *get_handler(const std::string& type); - int get(string& metadata_key, Formatter *f, optional_yield y, const DoutPrefixProvider *dpp); - int put(string& metadata_key, bufferlist& bl, optional_yield y, + int get(std::string& metadata_key, Formatter *f, optional_yield y, const DoutPrefixProvider *dpp); + int put(std::string& metadata_key, bufferlist& bl, optional_yield y, const DoutPrefixProvider *dpp, RGWMDLogSyncType sync_mode, bool from_remote_zone, obj_version *existing_version = NULL); - int remove(string& metadata_key, optional_yield y, const DoutPrefixProvider *dpp); + int remove(std::string& metadata_key, optional_yield y, const DoutPrefixProvider *dpp); - int mutate(const string& metadata_key, + int mutate(const std::string& metadata_key, const ceph::real_time& mtime, RGWObjVersionTracker *objv_tracker, optional_yield y, @@ -254,20 +254,20 @@ public: RGWMDLogStatus op_type, std::function f); - int list_keys_init(const DoutPrefixProvider *dpp, const string& section, void **phandle); - int list_keys_init(const DoutPrefixProvider *dpp, const string& section, const string& marker, void **phandle); - int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, list& keys, bool *truncated); + int list_keys_init(const DoutPrefixProvider *dpp, const std::string& section, void **phandle); + int list_keys_init(const DoutPrefixProvider *dpp, const std::string& section, const std::string& marker, void **phandle); + int list_keys_next(const DoutPrefixProvider *dpp, void *handle, int max, std::list& keys, bool *truncated); void list_keys_complete(void *handle); - string get_marker(void *handle); + std::string get_marker(void *handle); void dump_log_entry(cls_log_entry& entry, Formatter *f); - void get_sections(list& sections); + void get_sections(std::list& sections); - void parse_metadata_key(const string& metadata_key, string& type, string& entry); + void parse_metadata_key(const std::string& metadata_key, std::string& type, std::string& entry); - int get_shard_id(const string& section, const string& key, int *shard_id); + int get_shard_id(const std::string& section, const std::string& key, int *shard_id); }; class RGWMetadataHandlerPut_SObj : public RGWMetadataHandler_GenericMetaBE::Put @@ -279,7 +279,7 @@ protected: public: RGWMetadataHandlerPut_SObj(RGWMetadataHandler_GenericMetaBE *handler, RGWSI_MetaBackend_Handler::Op *op, - string& entry, RGWMetadataObject *obj, RGWObjVersionTracker& objv_tracker, + std::string& entry, RGWMetadataObject *obj, RGWObjVersionTracker& objv_tracker, optional_yield y, RGWMDLogSyncType type, bool from_remote_zone); ~RGWMetadataHandlerPut_SObj(); diff --git a/src/rgw/rgw_multi.cc b/src/rgw/rgw_multi.cc index b6edef13e72e9..ecb0979e379ab 100644 --- a/src/rgw/rgw_multi.cc +++ b/src/rgw/rgw_multi.cc @@ -19,7 +19,7 @@ #define dout_subsys ceph_subsys_rgw - +using namespace std; bool RGWMultiPart::xml_end(const char *el) { diff --git a/src/rgw/rgw_multi.h b/src/rgw/rgw_multi.h index 7174dfbb80c7f..668b12080194b 100644 --- a/src/rgw/rgw_multi.h +++ b/src/rgw/rgw_multi.h @@ -23,7 +23,7 @@ struct RGWUploadPartInfo { uint32_t num; uint64_t size; uint64_t accounted_size{0}; - string etag; + std::string etag; ceph::real_time modified; RGWObjManifest manifest; RGWCompressionInfo cs_info; @@ -58,7 +58,7 @@ struct RGWUploadPartInfo { DECODE_FINISH(bl); } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; WRITE_CLASS_ENCODER(RGWUploadPartInfo) @@ -69,19 +69,19 @@ public: ~RGWMultiCompleteUpload() override {} bool xml_end(const char *el) override; - std::map parts; + std::map parts; }; class RGWMultiPart : public XMLObj { - string etag; + std::string etag; int num; public: RGWMultiPart() : num(0) {} ~RGWMultiPart() override {} bool xml_end(const char *el) override; - string& get_etag() { return etag; } + std::string& get_etag() { return etag; } int get_num() { return num; } }; @@ -107,6 +107,6 @@ public: virtual ~RGWMultiXMLParser() override; }; -extern bool is_v2_upload_id(const string& upload_id); +extern bool is_v2_upload_id(const std::string& upload_id); #endif diff --git a/src/rgw/rgw_multi_del.cc b/src/rgw/rgw_multi_del.cc index 03485e6221303..443ffd60a8a1b 100644 --- a/src/rgw/rgw_multi_del.cc +++ b/src/rgw/rgw_multi_del.cc @@ -12,7 +12,7 @@ #define dout_subsys ceph_subsys_rgw - +using namespace std; bool RGWMultiDelObject::xml_end(const char *el) { diff --git a/src/rgw/rgw_multi_del.h b/src/rgw/rgw_multi_del.h index 976caec633ef1..6187aae37e8d3 100644 --- a/src/rgw/rgw_multi_del.h +++ b/src/rgw/rgw_multi_del.h @@ -29,15 +29,15 @@ public: class RGWMultiDelObject : public XMLObj { - string key; - string version_id; + std::string key; + std::string version_id; public: RGWMultiDelObject() {} ~RGWMultiDelObject() override {} bool xml_end(const char *el) override; - const string& get_key() { return key; } - const string& get_version_id() { return version_id; } + const std::string& get_key() { return key; } + const std::string& get_version_id() { return version_id; } }; class RGWMultiDelKey : public XMLObj diff --git a/src/rgw/rgw_multiparser.cc b/src/rgw/rgw_multiparser.cc index 46cedee52510d..a8778abd9a08b 100644 --- a/src/rgw/rgw_multiparser.cc +++ b/src/rgw/rgw_multiparser.cc @@ -12,7 +12,8 @@ #define dout_subsys ceph_subsys_rgw - +using namespace std; + int main(int argc, char **argv) { RGWMultiXMLParser parser; diff --git a/src/rgw/rgw_obj_manifest.cc b/src/rgw/rgw_obj_manifest.cc index ca5aa7e7505e9..227e1dda759ad 100644 --- a/src/rgw/rgw_obj_manifest.cc +++ b/src/rgw/rgw_obj_manifest.cc @@ -10,6 +10,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + int RGWObjManifest::generator::create_next(uint64_t ofs) { if (ofs < last_ofs) /* only going forward */ diff --git a/src/rgw/rgw_obj_manifest.h b/src/rgw/rgw_obj_manifest.h index f2567fddf66a6..45b9aaea0ef34 100644 --- a/src/rgw/rgw_obj_manifest.h +++ b/src/rgw/rgw_obj_manifest.h @@ -114,7 +114,7 @@ struct RGWObjManifestRule { uint64_t start_ofs; uint64_t part_size; /* each part size, 0 if there's no part size, meaning it's unlimited */ uint64_t stripe_max_size; /* underlying obj max size */ - string override_prefix; + std::string override_prefix; RGWObjManifestRule() : start_part_num(0), start_ofs(0), part_size(0), stripe_max_size(0) {} RGWObjManifestRule(uint32_t _start_part_num, uint64_t _start_ofs, uint64_t _part_size, uint64_t _stripe_max_size) : @@ -147,7 +147,7 @@ WRITE_CLASS_ENCODER(RGWObjManifestRule) class RGWObjManifest { protected: bool explicit_objs{false}; /* really old manifest? */ - map objs; + std::map objs; uint64_t obj_size{0}; @@ -156,16 +156,16 @@ protected: rgw_placement_rule head_placement_rule; uint64_t max_head_size{0}; - string prefix; + std::string prefix; rgw_bucket_placement tail_placement; /* might be different than the original bucket, as object might have been copied across pools */ - map rules; + std::map rules; - string tail_instance; /* tail object's instance */ + std::string tail_instance; /* tail object's instance */ void convert_to_explicit(const DoutPrefixProvider *dpp, const RGWZoneGroup& zonegroup, const RGWZoneParams& zone_params); int append_explicit(const DoutPrefixProvider *dpp, RGWObjManifest& m, const RGWZoneGroup& zonegroup, const RGWZoneParams& zone_params); - void append_rules(RGWObjManifest& m, map::iterator& iter, string *override_prefix); + void append_rules(RGWObjManifest& m, std::map::iterator& iter, std::string *override_prefix); public: @@ -187,19 +187,19 @@ public: return *this; } - map& get_explicit_objs() { + std::map& get_explicit_objs() { return objs; } - void set_explicit(uint64_t _size, map& _objs) { + void set_explicit(uint64_t _size, std::map& _objs) { explicit_objs = true; objs.swap(_objs); set_obj_size(_size); } void get_implicit_location(uint64_t cur_part_id, uint64_t cur_stripe, uint64_t ofs, - string *override_prefix, rgw_obj_select *location) const; + std::string *override_prefix, rgw_obj_select *location) const; void set_trivial_rule(uint64_t tail_ofs, uint64_t stripe_max_size) { RGWObjManifestRule rule(0, tail_ofs, 0, stripe_max_size); @@ -253,7 +253,7 @@ public: } else { explicit_objs = true; if (!objs.empty()) { - map::iterator iter = objs.begin(); + std::map::iterator iter = objs.begin(); obj = iter->second.loc; head_size = iter->second.size; max_head_size = head_size; @@ -312,7 +312,7 @@ public: } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); int append(const DoutPrefixProvider *dpp, RGWObjManifest& m, const RGWZoneGroup& zonegroup, const RGWZoneParams& zone_params); @@ -370,19 +370,19 @@ public: return head_placement_rule; } - void set_prefix(const string& _p) { + void set_prefix(const std::string& _p) { prefix = _p; } - const string& get_prefix() const { + const std::string& get_prefix() const { return prefix; } - void set_tail_instance(const string& _ti) { + void set_tail_instance(const std::string& _ti) { tail_instance = _ti; } - const string& get_tail_instance() const { + const std::string& get_tail_instance() const { return tail_instance; } @@ -416,13 +416,13 @@ public: int cur_part_id = 0; int cur_stripe = 0; - string cur_override_prefix; + std::string cur_override_prefix; rgw_obj_select location; - map::const_iterator rule_iter; - map::const_iterator next_rule_iter; - map::const_iterator explicit_iter; + std::map::const_iterator rule_iter; + std::map::const_iterator next_rule_iter; + std::map::const_iterator explicit_iter; void update_explicit_pos(); @@ -507,9 +507,9 @@ public: int cur_part_id; int cur_stripe; uint64_t cur_stripe_size; - string cur_oid; + std::string cur_oid; - string oid_prefix; + std::string oid_prefix; rgw_obj_select cur_obj; diff --git a/src/rgw/rgw_object_expirer_core.cc b/src/rgw/rgw_object_expirer_core.cc index 0b9b60f888add..370001bff9939 100644 --- a/src/rgw/rgw_object_expirer_core.cc +++ b/src/rgw/rgw_object_expirer_core.cc @@ -43,6 +43,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + static string objexp_lock_name = "gc_process"; static string objexp_hint_get_shardname(int shard_num) diff --git a/src/rgw/rgw_object_expirer_core.h b/src/rgw/rgw_object_expirer_core.h index db73f5e5fb0da..68b65653ba47b 100644 --- a/src/rgw/rgw_object_expirer_core.h +++ b/src/rgw/rgw_object_expirer_core.h @@ -32,6 +32,8 @@ #include "rgw_sal.h" #include "rgw_sal_rados.h" +using namespace std; + class RGWSI_RADOS; class RGWSI_Zone; class RGWBucketInfo; diff --git a/src/rgw/rgw_object_lock.cc b/src/rgw/rgw_object_lock.cc index 5c0119befaa10..0c57793fec952 100644 --- a/src/rgw/rgw_object_lock.cc +++ b/src/rgw/rgw_object_lock.cc @@ -3,6 +3,8 @@ // #include "rgw_object_lock.h" +using namespace std; + void DefaultRetention::decode_xml(XMLObj *obj) { RGWXMLDecoder::decode_xml("Mode", mode, obj, true); if (mode.compare("GOVERNANCE") != 0 && mode.compare("COMPLIANCE") != 0) { diff --git a/src/rgw/rgw_object_lock.h b/src/rgw/rgw_object_lock.h index cabb1c766d0f5..997c660e4cd11 100644 --- a/src/rgw/rgw_object_lock.h +++ b/src/rgw/rgw_object_lock.h @@ -12,7 +12,7 @@ class DefaultRetention { protected: - string mode; + std::string mode; int days; int years; @@ -27,7 +27,7 @@ public: return years; } - string get_mode() const { + std::string get_mode() const { return mode; } @@ -65,7 +65,7 @@ public: return defaultRetention.get_years(); } - string get_mode() const { + std::string get_mode() const { return defaultRetention.get_mode(); } @@ -104,7 +104,7 @@ public: return rule.get_years(); } - string get_mode() const { + std::string get_mode() const { return rule.get_mode(); } @@ -148,17 +148,17 @@ WRITE_CLASS_ENCODER(RGWObjectLock) class RGWObjectRetention { protected: - string mode; + std::string mode; ceph::real_time retain_until_date; public: RGWObjectRetention() {} - RGWObjectRetention(string _mode, ceph::real_time _date): mode(_mode), retain_until_date(_date) {} + RGWObjectRetention(std::string _mode, ceph::real_time _date): mode(_mode), retain_until_date(_date) {} - void set_mode(string _mode) { + void set_mode(std::string _mode) { mode = _mode; } - string get_mode() const { + std::string get_mode() const { return mode; } @@ -192,15 +192,15 @@ WRITE_CLASS_ENCODER(RGWObjectRetention) class RGWObjectLegalHold { protected: - string status; + std::string status; public: RGWObjectLegalHold() {} - RGWObjectLegalHold(string _status): status(_status) {} - void set_status(string _status) { + RGWObjectLegalHold(std::string _status): status(_status) {} + void set_status(std::string _status) { status = _status; } - string get_status() const { + std::string get_status() const { return status; } diff --git a/src/rgw/rgw_oidc_provider.cc b/src/rgw/rgw_oidc_provider.cc index 3e86a12173a9d..da6d73e23f7b6 100644 --- a/src/rgw/rgw_oidc_provider.cc +++ b/src/rgw/rgw_oidc_provider.cc @@ -24,6 +24,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + namespace rgw { namespace sal { const string RGWOIDCProvider::oidc_url_oid_prefix = "oidc_url."; diff --git a/src/rgw/rgw_oidc_provider.h b/src/rgw/rgw_oidc_provider.h index a25920add7b78..c3b794df0d62a 100644 --- a/src/rgw/rgw_oidc_provider.h +++ b/src/rgw/rgw_oidc_provider.h @@ -30,8 +30,8 @@ protected: std::string arn; std::string creation_date; std::string tenant; - vector client_ids; - vector thumbprints; + std::vector client_ids; + std::vector thumbprints; int get_tenant_url_from_arn(std::string& tenant, std::string& url); virtual int store_url(const DoutPrefixProvider *dpp, const std::string& url, bool exclusive, optional_yield y) = 0; @@ -57,8 +57,8 @@ public: RGWOIDCProvider(std::string provider_url, std::string tenant, - vector client_ids, - vector thumbprints) + std::vector client_ids, + std::vector thumbprints) : provider_url(std::move(provider_url)), tenant(std::move(tenant)), client_ids(std::move(client_ids)), @@ -105,8 +105,8 @@ public: const std::string& get_provider_url() const { return provider_url; } const std::string& get_arn() const { return arn; } const std::string& get_create_date() const { return creation_date; } - const vector& get_client_ids() const { return client_ids;} - const vector& get_thumbprints() const { return thumbprints; } + const std::vector& get_client_ids() const { return client_ids;} + const std::vector& get_thumbprints() const { return thumbprints; } int create(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y); virtual int delete_obj(const DoutPrefixProvider *dpp, optional_yield y) = 0; diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 0dd50daed30df..4cb9bed0197c1 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -77,6 +77,7 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; using namespace librados; using ceph::crypto::MD5; using boost::optional; diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index ceae60a0f932f..20bddbed1dc55 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -79,7 +79,7 @@ int rgw_op_get_bucket_policy_from_attr(const DoutPrefixProvider *dpp, CephContext *cct, rgw::sal::Store* store, RGWBucketInfo& bucket_info, - map& bucket_attrs, + std::map& bucket_attrs, RGWAccessControlPolicy *policy, optional_yield y); @@ -112,7 +112,7 @@ public: virtual int authorize(const DoutPrefixProvider* dpp, optional_yield y) = 0; virtual int postauth_init(optional_yield y) = 0; virtual int error_handler(int err_no, std::string* error_content, optional_yield y); - virtual void dump(const string& code, const string& message) const {} + virtual void dump(const std::string& code, const std::string& message) const {} virtual bool supports_quota() { return true; @@ -236,7 +236,7 @@ public: this->dialect_handler = dialect_handler; } int read_bucket_cors(); - bool generate_cors_headers(string& origin, string& method, string& headers, string& exp_headers, unsigned *max_age); + bool generate_cors_headers(std::string& origin, std::string& method, std::string& headers, std::string& exp_headers, unsigned *max_age); virtual int verify_params() { return 0; } virtual bool prefetch_data() { return false; } @@ -267,7 +267,7 @@ public: virtual uint32_t op_mask() { return 0; } - virtual int error_handler(int err_no, string *error_content, optional_yield y); + virtual int error_handler(int err_no, std::string *error_content, optional_yield y); // implements DoutPrefixProvider std::ostream& gen_prefix(std::ostream& out) const override; @@ -351,9 +351,9 @@ protected: bool skip_decrypt{false}; utime_t gc_invalidate_time; bool is_slo; - string lo_etag; + std::string lo_etag; bool rgwx_stat; /* extended rgw stat operation */ - string version_id; + std::string version_id; // compression attrs RGWCompressionInfo cs_info; @@ -620,7 +620,7 @@ public: } bool verify_permission(RGWBucketInfo& binfo, - map& battrs, + std::map& battrs, ACLOwner& bucket_owner /* out */, optional_yield y); bool delete_single(const acct_path_t& path, optional_yield y); @@ -652,7 +652,7 @@ public: dmc::client_id dmclock_client() override { return dmc::client_id::data; } }; -inline ostream& operator<<(ostream& out, const RGWBulkDelete::acct_path_t &o) { +inline std::ostream& operator<<(std::ostream& out, const RGWBulkDelete::acct_path_t &o) { return out << o.bucket_name << "/" << o.obj_key; } @@ -847,14 +847,14 @@ public: class RGWGetUsage : public RGWOp { protected: bool sent_data; - string start_date; - string end_date; + std::string start_date; + std::string end_date; int show_log_entries; int show_log_sum; - map categories; - map usage; - map summary_map; - map buckets_usage; + std::map categories; + std::map usage; + std::map summary_map; + std::map buckets_usage; cls_user_header header; RGWStorageStats stats; public: @@ -892,17 +892,17 @@ public: class RGWListBucket : public RGWOp { protected: - string prefix; + std::string prefix; rgw_obj_key marker; rgw_obj_key next_marker; rgw_obj_key end_marker; - string max_keys; - string delimiter; - string encoding_type; + std::string max_keys; + std::string delimiter; + std::string encoding_type; bool list_versions; int max; - vector objs; - map common_prefixes; + std::vector objs; + std::map common_prefixes; int default_max; bool is_truncated; @@ -1067,7 +1067,7 @@ public: class RGWCreateBucket : public RGWOp { protected: RGWAccessControlPolicy policy; - string location_constraint; + std::string location_constraint; rgw_placement_rule placement_rule; RGWBucketInfo info; obj_version ep_objv; @@ -1076,8 +1076,8 @@ protected: bool obj_lock_enabled; RGWCORSConfiguration cors_config; boost::optional swift_ver_location; - map attrs; - set rmattr_names; + std::map attrs; + std::set rmattr_names; bufferlist in_data; @@ -1124,8 +1124,8 @@ public: }; struct rgw_slo_entry { - string path; - string etag; + std::string path; + std::string etag; uint64_t size_bytes; rgw_slo_entry() : size_bytes(0) {} @@ -1151,7 +1151,7 @@ struct rgw_slo_entry { WRITE_CLASS_ENCODER(rgw_slo_entry) struct RGWSLOInfo { - vector entries; + std::vector entries; uint64_t total_size; /* in memory only */ @@ -1187,13 +1187,13 @@ protected: std::string copy_source; const char *copy_source_range; RGWBucketInfo copy_source_bucket_info; - string copy_source_tenant_name; - string copy_source_bucket_name; - string copy_source_object_name; - string copy_source_version_id; + std::string copy_source_tenant_name; + std::string copy_source_bucket_name; + std::string copy_source_object_name; + std::string copy_source_version_id; off_t copy_source_range_fst; off_t copy_source_range_lst; - string etag; + std::string etag; bool chunked_upload; RGWAccessControlPolicy policy; std::unique_ptr obj_tags; @@ -1202,10 +1202,10 @@ protected: rgw::sal::Attrs attrs; ceph::real_time mtime; uint64_t olh_epoch; - string version_id; + std::string version_id; bufferlist bl_aux; - map crypt_http_responses; - string user_data; + std::map crypt_http_responses; + std::string user_data; std::string multipart_upload_id; std::string multipart_part_str; @@ -1264,7 +1264,7 @@ public: /* this is for cases when copying data from other object */ virtual int get_decrypt_filter(std::unique_ptr* filter, RGWGetObj_Filter* cb, - map& attrs, + std::map& attrs, bufferlist* manifest_bl) { *filter = nullptr; return 0; @@ -1294,9 +1294,9 @@ protected: off_t ofs; const char *supplied_md5_b64; const char *supplied_etag; - string etag; + std::string etag; RGWAccessControlPolicy policy; - map attrs; + std::map attrs; boost::optional delete_at; /* Must be called after get_data() or the result is undefined. */ @@ -1368,9 +1368,9 @@ public: virtual int get_params(optional_yield y) = 0; void send_response() override = 0; - virtual void filter_out_temp_url(map& add_attrs, - const set& rmattr_names, - map& temp_url_keys); + virtual void filter_out_temp_url(std::map& add_attrs, + const std::set& rmattr_names, + std::map& temp_url_keys); const char* name() const override { return "put_account_metadata"; } RGWOpType get_type() override { return RGW_OP_PUT_METADATA_ACCOUNT; } uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } @@ -1379,7 +1379,7 @@ public: class RGWPutMetadataBucket : public RGWOp { protected: rgw::sal::Attrs attrs; - set rmattr_names; + std::set rmattr_names; bool has_policy, has_cors; uint32_t policy_rw_mask; RGWAccessControlPolicy policy; @@ -1443,7 +1443,7 @@ class RGWDeleteObj : public RGWOp { protected: bool delete_marker; bool multipart_delete; - string version_id; + std::string version_id; ceph::real_time unmod_since; /* if unmodified since */ bool no_precondition_error; std::unique_ptr deleter; @@ -1494,21 +1494,21 @@ protected: ceph::real_time *mod_ptr; ceph::real_time *unmod_ptr; rgw::sal::Attrs attrs; - string src_tenant_name, src_bucket_name, src_obj_name; + std::string src_tenant_name, src_bucket_name, src_obj_name; std::unique_ptr src_bucket; std::unique_ptr src_object; - string dest_tenant_name, dest_bucket_name, dest_obj_name; + std::string dest_tenant_name, dest_bucket_name, dest_obj_name; std::unique_ptr dest_bucket; std::unique_ptr dest_object; ceph::real_time src_mtime; ceph::real_time mtime; rgw::sal::AttrsMod attrs_mod; - string source_zone; - string etag; + std::string source_zone; + std::string etag; off_t last_ofs; - string version_id; + std::string version_id; uint64_t olh_epoch; boost::optional delete_at; @@ -1547,7 +1547,7 @@ public: } static bool parse_copy_location(const std::string_view& src, - string& bucket_name, + std::string& bucket_name, rgw_obj_key& object, struct req_state *s); @@ -1580,7 +1580,7 @@ public: class RGWGetACLs : public RGWOp { protected: - string acls; + std::string acls; public: RGWGetACLs() {} @@ -1608,7 +1608,7 @@ public: void pre_exec() override; void execute(optional_yield y) override; - virtual int get_policy_from_state(rgw::sal::Store* store, struct req_state *s, stringstream& ss) { return 0; } + virtual int get_policy_from_state(rgw::sal::Store* store, struct req_state *s, std::stringstream& ss) { return 0; } virtual int get_params(optional_yield y) = 0; void send_response() override = 0; const char* name() const override { return "put_acls"; } @@ -1637,7 +1637,7 @@ class RGWPutLC : public RGWOp { protected: bufferlist data; const char *content_md5; - string cookie; + std::string cookie; public: RGWPutLC() { @@ -1658,7 +1658,7 @@ public: void pre_exec() override; void execute(optional_yield y) override; -// virtual int get_policy_from_state(RGWRados* store, struct req_state *s, stringstream& ss) { return 0; } +// virtual int get_policy_from_state(RGWRados* store, struct req_state *s, std::stringstream& ss) { return 0; } virtual int get_params(optional_yield y) = 0; void send_response() override = 0; const char* name() const override { return "put_lifecycle"; } @@ -1741,7 +1741,7 @@ public: int verify_permission(optional_yield y) override {return 0;} int validate_cors_request(RGWCORSConfiguration *cc); void execute(optional_yield y) override; - void get_response_params(string& allowed_hdrs, string& exp_hdrs, unsigned *max_age); + void get_response_params(std::string& allowed_hdrs, std::string& exp_hdrs, unsigned *max_age); void send_response() override = 0; const char* name() const override { return "options_cors"; } RGWOpType get_type() override { return RGW_OP_OPTIONS_CORS; } @@ -1830,7 +1830,7 @@ public: class RGWInitMultipart : public RGWOp { protected: - string upload_id; + std::string upload_id; RGWAccessControlPolicy policy; ceph::real_time mtime; @@ -1850,14 +1850,14 @@ public: const char* name() const override { return "init_multipart"; } RGWOpType get_type() override { return RGW_OP_INIT_MULTIPART; } uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } - virtual int prepare_encryption(map& attrs) { return 0; } + virtual int prepare_encryption(std::map& attrs) { return 0; } }; class RGWCompleteMultipart : public RGWOp { protected: - string upload_id; - string etag; - string version_id; + std::string upload_id; + std::string etag; + std::string version_id; bufferlist data; rgw::sal::MPSerializer* serializer; @@ -1894,7 +1894,7 @@ public: class RGWListMultipart : public RGWOp { protected: - string upload_id; + std::string upload_id; std::unique_ptr upload; int max_parts; int marker; @@ -1925,16 +1925,16 @@ public: class RGWListBucketMultiparts : public RGWOp { protected: - string prefix; - string marker_meta; - string marker_key; - string marker_upload_id; - string next_marker_key; - string next_marker_upload_id; + std::string prefix; + std::string marker_meta; + std::string marker_key; + std::string marker_upload_id; + std::string next_marker_key; + std::string next_marker_upload_id; int max_uploads; - string delimiter; - vector> uploads; - map common_prefixes; + std::string delimiter; + std::vector> uploads; + std::map common_prefixes; bool is_truncated; int default_max; bool encode_url {false}; @@ -2037,7 +2037,7 @@ public: virtual void send_status() = 0; virtual void begin_response() = 0; virtual void send_partial_response(rgw_obj_key& key, bool delete_marker, - const string& marker_version_id, int ret) = 0; + const std::string& marker_version_id, int ret) = 0; virtual void end_response() = 0; const char* name() const override { return "multi_object_delete"; } RGWOpType get_type() override { return RGW_OP_DELETE_MULTI_OBJ; } @@ -2061,22 +2061,22 @@ extern int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::St struct req_state *s, bool prefetch_data, optional_yield y); extern void rgw_build_iam_environment(rgw::sal::Store* store, struct req_state* s); -extern vector get_iam_user_policy_from_attr(CephContext* cct, - map& attrs, - const string& tenant); +extern std::vector get_iam_user_policy_from_attr(CephContext* cct, + std::map& attrs, + const std::string& tenant); inline int get_system_versioning_params(req_state *s, uint64_t *olh_epoch, - string *version_id) + std::string *version_id) { if (!s->system_request) { return 0; } if (olh_epoch) { - string epoch_str = s->info.args.get(RGW_SYS_PARAM_PREFIX "versioned-epoch"); + std::string epoch_str = s->info.args.get(RGW_SYS_PARAM_PREFIX "versioned-epoch"); if (!epoch_str.empty()) { - string err; + std::string err; *olh_epoch = strict_strtol(epoch_str.c_str(), 10, &err); if (!err.empty()) { ldpp_subdout(s, rgw, 0) << "failed to parse versioned-epoch param" @@ -2188,7 +2188,7 @@ inline int rgw_get_request_metadata(const DoutPrefixProvider *dpp, } /* rgw_get_request_metadata */ inline void encode_delete_at_attr(boost::optional delete_at, - map& attrs) + std::map& attrs) { if (delete_at == boost::none) { return; @@ -2199,7 +2199,7 @@ inline void encode_delete_at_attr(boost::optional delete_at, attrs[RGW_ATTR_DELETE_AT] = delatbl; } /* encode_delete_at_attr */ -inline void encode_obj_tags_attr(RGWObjTags* obj_tags, map& attrs) +inline void encode_obj_tags_attr(RGWObjTags* obj_tags, std::map& attrs) { if (obj_tags == nullptr){ // we assume the user submitted a tag format which we couldn't parse since @@ -2214,11 +2214,11 @@ inline void encode_obj_tags_attr(RGWObjTags* obj_tags, map& } inline int encode_dlo_manifest_attr(const char * const dlo_manifest, - map& attrs) + std::map& attrs) { - string dm = dlo_manifest; + std::string dm = dlo_manifest; - if (dm.find('/') == string::npos) { + if (dm.find('/') == std::string::npos) { return -EINVAL; } @@ -2229,7 +2229,7 @@ inline int encode_dlo_manifest_attr(const char * const dlo_manifest, return 0; } /* encode_dlo_manifest_attr */ -inline void complete_etag(MD5& hash, string *etag) +inline void complete_etag(MD5& hash, std::string *etag) { char etag_buf[CEPH_CRYPTO_MD5_DIGESTSIZE]; char etag_buf_str[CEPH_CRYPTO_MD5_DIGESTSIZE * 2 + 16]; @@ -2272,7 +2272,7 @@ public: class RGWSetAttrs : public RGWOp { protected: - map attrs; + std::map attrs; public: RGWSetAttrs() {} @@ -2594,7 +2594,7 @@ public: }; inline int parse_value_and_bound( - const string &input, + const std::string &input, int &output, const long lower_bound, const long upper_bound, diff --git a/src/rgw/rgw_opa.cc b/src/rgw/rgw_opa.cc index 14f67676104f4..68f874a5d724e 100644 --- a/src/rgw/rgw_opa.cc +++ b/src/rgw/rgw_opa.cc @@ -7,6 +7,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + int rgw_opa_authorize(RGWOp *& op, req_state * const s) { diff --git a/src/rgw/rgw_orphan.cc b/src/rgw/rgw_orphan.cc index 921b226738948..711164dc8e211 100644 --- a/src/rgw/rgw_orphan.cc +++ b/src/rgw/rgw_orphan.cc @@ -22,6 +22,8 @@ #define DEFAULT_NUM_SHARDS 64 +using namespace std; + static string obj_fingerprint(const string& oid, const char *force_ns = NULL) { ssize_t pos = oid.find('_'); diff --git a/src/rgw/rgw_orphan.h b/src/rgw/rgw_orphan.h index 8dd03a47c1da7..e51dfe6d3f64f 100644 --- a/src/rgw/rgw_orphan.h +++ b/src/rgw/rgw_orphan.h @@ -40,11 +40,11 @@ enum RGWOrphanSearchStageId { struct RGWOrphanSearchStage { RGWOrphanSearchStageId stage; int shard; - string marker; + std::string marker; RGWOrphanSearchStage() : stage(ORPHAN_SEARCH_STAGE_UNKNOWN), shard(0) {} explicit RGWOrphanSearchStage(RGWOrphanSearchStageId _stage) : stage(_stage), shard(0) {} - RGWOrphanSearchStage(RGWOrphanSearchStageId _stage, int _shard, const string& _marker) : stage(_stage), shard(_shard), marker(_marker) {} + RGWOrphanSearchStage(RGWOrphanSearchStageId _stage, int _shard, const std::string& _marker) : stage(_stage), shard(_shard), marker(_marker) {} void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); @@ -69,7 +69,7 @@ struct RGWOrphanSearchStage { WRITE_CLASS_ENCODER(RGWOrphanSearchStage) struct RGWOrphanSearchInfo { - string job_name; + std::string job_name; rgw_pool pool; uint16_t num_shards; utime_t start_time; @@ -86,7 +86,7 @@ struct RGWOrphanSearchInfo { void decode(bufferlist::const_iterator& bl) { DECODE_START(2, bl); decode(job_name, bl); - string s; + std::string s; decode(s, bl); pool.from_str(s); decode(num_shards, bl); @@ -126,7 +126,7 @@ class RGWOrphanStore { rgw::sal::Store* store; librados::IoCtx ioctx; - string oid; + std::string oid; public: explicit RGWOrphanStore(rgw::sal::Store* _store) : store(_store), oid(RGW_ORPHAN_INDEX_OID) {} @@ -135,14 +135,14 @@ public: int init(const DoutPrefixProvider *dpp); - int read_job(const string& job_name, RGWOrphanSearchState& state); - int write_job(const string& job_name, const RGWOrphanSearchState& state); - int remove_job(const string& job_name); - int list_jobs(map &job_list); + int read_job(const std::string& job_name, RGWOrphanSearchState& state); + int write_job(const std::string& job_name, const RGWOrphanSearchState& state); + int remove_job(const std::string& job_name); + int list_jobs(std::map &job_list); - int store_entries(const DoutPrefixProvider *dpp, const string& oid, const map& entries); - int read_entries(const string& oid, const string& marker, map *entries, bool *truncated); + int store_entries(const DoutPrefixProvider *dpp, const std::string& oid, const std::map& entries); + int read_entries(const std::string& oid, const std::string& marker, std::map *entries, bool *truncated); }; @@ -154,11 +154,11 @@ class RGWOrphanSearch { RGWOrphanSearchInfo search_info; RGWOrphanSearchStage search_stage; - map all_objs_index; - map buckets_instance_index; - map linked_objs_index; + std::map all_objs_index; + std::map buckets_instance_index; + std::map linked_objs_index; - string index_objs_prefix; + std::string index_objs_prefix; uint16_t max_concurrent_ios; uint64_t stale_secs; @@ -167,22 +167,22 @@ class RGWOrphanSearch { bool detailed_mode; struct log_iter_info { - string oid; - list::iterator cur; - list::iterator end; + std::string oid; + std::list::iterator cur; + std::list::iterator end; }; - int log_oids(const DoutPrefixProvider *dpp, map& log_shards, map >& oids); + int log_oids(const DoutPrefixProvider *dpp, std::map& log_shards, std::map >& oids); #define RGW_ORPHANSEARCH_HASH_PRIME 7877 - int orphan_shard(const string& str) { + int orphan_shard(const std::string& str) { return ceph_str_hash_linux(str.c_str(), str.size()) % RGW_ORPHANSEARCH_HASH_PRIME % search_info.num_shards; } - int handle_stat_result(const DoutPrefixProvider *dpp, map >& oids, rgw::sal::Object::StatOp::Result& result); - int pop_and_handle_stat_op(const DoutPrefixProvider *dpp, map >& oids, std::deque>& ops); + int handle_stat_result(const DoutPrefixProvider *dpp, std::map >& oids, rgw::sal::Object::StatOp::Result& result); + int pop_and_handle_stat_op(const DoutPrefixProvider *dpp, std::map >& oids, std::deque>& ops); - int remove_index(map& index); + int remove_index(std::map& index); public: RGWOrphanSearch(rgw::sal::Store* _store, int _max_ios, uint64_t _stale_secs) : store(_store), orphan_store(store), max_concurrent_ios(_max_ios), stale_secs(_stale_secs) {} @@ -193,13 +193,13 @@ public: return orphan_store.write_job(search_info.job_name, state); } - int init(const DoutPrefixProvider *dpp, const string& job_name, RGWOrphanSearchInfo *info, bool _detailed_mode=false); + int init(const DoutPrefixProvider *dpp, const std::string& job_name, RGWOrphanSearchInfo *info, bool _detailed_mode=false); - int create(const string& job_name, int num_shards); + int create(const std::string& job_name, int num_shards); int build_all_oids_index(const DoutPrefixProvider *dpp); int build_buckets_instance_index(const DoutPrefixProvider *dpp); - int build_linked_oids_for_bucket(const DoutPrefixProvider *dpp, const string& bucket_instance_id, map >& oids); + int build_linked_oids_for_bucket(const DoutPrefixProvider *dpp, const std::string& bucket_instance_id, std::map >& oids); int build_linked_oids_index(const DoutPrefixProvider *dpp); int compare_oid_indexes(const DoutPrefixProvider *dpp); @@ -263,7 +263,7 @@ class RGWRadosList { rgw::sal::Object::StatOp::Result& result, std::string& bucket_name, rgw_obj_key& obj_key, - std::set& obj_oids); + std::set& obj_oids); int pop_and_handle_stat_op(const DoutPrefixProvider *dpp, RGWObjectCtx& obj_ctx, std::deque>& ops); diff --git a/src/rgw/rgw_policy_s3.cc b/src/rgw/rgw_policy_s3.cc index a697365f2a552..e017cc8871d91 100644 --- a/src/rgw/rgw_policy_s3.cc +++ b/src/rgw/rgw_policy_s3.cc @@ -11,6 +11,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + class RGWPolicyCondition { protected: string v1; diff --git a/src/rgw/rgw_policy_s3.h b/src/rgw/rgw_policy_s3.h index b88d539370d73..14ad6c4e3af19 100644 --- a/src/rgw/rgw_policy_s3.h +++ b/src/rgw/rgw_policy_s3.h @@ -19,10 +19,10 @@ class RGWPolicyEnv { std::map vars; public: - void add_var(const string& name, const string& value); - bool get_var(const string& name, string& val); - bool get_value(const string& s, string& val, std::map& checked_vars); - bool match_policy_vars(map& policy_vars, string& err_msg); + void add_var(const std::string& name, const std::string& value); + bool get_var(const std::string& name, std::string& val); + bool get_value(const std::string& s, std::string& val, std::map& checked_vars); + bool match_policy_vars(std::map& policy_vars, std::string& err_msg); }; class RGWPolicyCondition; @@ -30,9 +30,9 @@ class RGWPolicyCondition; class RGWPolicy { uint64_t expires; - string expiration_str; + std::string expiration_str; std::list conditions; - std::list > var_checks; + std::list > var_checks; std::map checked_vars; public: @@ -42,18 +42,18 @@ public: RGWPolicy() : expires(0), min_length(0), max_length(LLONG_MAX) {} ~RGWPolicy(); - int set_expires(const string& e); + int set_expires(const std::string& e); void set_var_checked(const std::string& var) { checked_vars[var] = true; } - int add_condition(const std::string& op, const std::string& first, const std::string& second, string& err_msg); + int add_condition(const std::string& op, const std::string& first, const std::string& second, std::string& err_msg); void add_simple_check(const std::string& var, const std::string& value) { - var_checks.push_back(pair(var, value)); + var_checks.emplace_back(var, value); } - int check(RGWPolicyEnv *env, string& err_msg); - int from_json(bufferlist& bl, string& err_msg); + int check(RGWPolicyEnv *env, std::string& err_msg); + int from_json(bufferlist& bl, std::string& err_msg); }; #endif diff --git a/src/rgw/rgw_process.cc b/src/rgw/rgw_process.cc index f7fc8dbbe65c8..b5e886b6915b0 100644 --- a/src/rgw/rgw_process.cc +++ b/src/rgw/rgw_process.cc @@ -22,6 +22,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; using rgw::dmclock::Scheduler; void RGWProcess::RGWWQ::_dump_queue() diff --git a/src/rgw/rgw_process.h b/src/rgw/rgw_process.h index e3d2330fb80b9..f8a97d16c29d4 100644 --- a/src/rgw/rgw_process.h +++ b/src/rgw/rgw_process.h @@ -44,7 +44,7 @@ class RGWFrontendConfig; class RGWRequest; class RGWProcess { - deque m_req_queue; + std::deque m_req_queue; protected: CephContext *cct; rgw::sal::Store* store; @@ -157,7 +157,7 @@ public: void run() override; void checkpoint(); void handle_request(const DoutPrefixProvider *dpp, RGWRequest* req) override; - void gen_request(const string& method, const string& resource, + void gen_request(const std::string& method, const std::string& resource, int content_length, std::atomic* fail_flag); void set_access_key(RGWAccessKey& key) { access_key = key; } diff --git a/src/rgw/rgw_public_access.cc b/src/rgw/rgw_public_access.cc index 2e1315a26d42d..6298bb306d87f 100644 --- a/src/rgw/rgw_public_access.cc +++ b/src/rgw/rgw_public_access.cc @@ -20,7 +20,7 @@ void PublicAccessBlockConfiguration::dump_xml(Formatter *f) const { } -ostream& operator<< (ostream& os, const PublicAccessBlockConfiguration& access_conf) +std::ostream& operator<< (std::ostream& os, const PublicAccessBlockConfiguration& access_conf) { os << std::boolalpha << "BlockPublicAcls: " << access_conf.block_public_acls() << std::endl diff --git a/src/rgw/rgw_public_access.h b/src/rgw/rgw_public_access.h index c7d68c8c30cd4..87d2a16a32b7f 100644 --- a/src/rgw/rgw_public_access.h +++ b/src/rgw/rgw_public_access.h @@ -64,4 +64,4 @@ class PublicAccessBlockConfiguration { void dump_xml(Formatter *f) const; }; WRITE_CLASS_ENCODER(PublicAccessBlockConfiguration) -ostream& operator<< (ostream& os, const PublicAccessBlockConfiguration& access_conf); +std::ostream& operator<< (std::ostream& os, const PublicAccessBlockConfiguration& access_conf); diff --git a/src/rgw/rgw_pubsub.cc b/src/rgw/rgw_pubsub.cc index 8cc89e9efe812..1d9778aa51d17 100644 --- a/src/rgw/rgw_pubsub.cc +++ b/src/rgw/rgw_pubsub.cc @@ -15,6 +15,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; void set_event_id(std::string& id, const std::string& hash, const utime_t& ts) { char buf[64]; const auto len = snprintf(buf, sizeof(buf), "%010ld.%06ld.%s", (long)ts.sec(), (long)ts.usec(), hash.c_str()); diff --git a/src/rgw/rgw_pubsub.h b/src/rgw/rgw_pubsub.h index ba86bbe845ee2..56c6f2ed4691a 100644 --- a/src/rgw/rgw_pubsub.h +++ b/src/rgw/rgw_pubsub.h @@ -472,7 +472,7 @@ struct rgw_pubsub_topic { DECODE_FINISH(bl); } - string to_str() const { + std::string to_str() const { return user.tenant + "/" + name; } @@ -517,7 +517,7 @@ struct rgw_pubsub_topic_filter { void encode(bufferlist& bl) const { ENCODE_START(3, 1, bl); encode(topic, bl); - // events are stored as a vector of strings + // events are stored as a vector of std::strings std::vector tmp_events; const auto converter = s3_id.empty() ? rgw::notify::to_ceph_string : rgw::notify::to_string; std::transform(events.begin(), events.end(), std::back_inserter(tmp_events), converter); @@ -530,7 +530,7 @@ struct rgw_pubsub_topic_filter { void decode(bufferlist::const_iterator& bl) { DECODE_START(3, bl); decode(topic, bl); - // events are stored as a vector of strings + // events are stored as a vector of std::strings events.clear(); std::vector tmp_events; decode(tmp_events, bl); @@ -607,7 +607,7 @@ class RGWPubSub return pubsub_oid_prefix + tenant + ".bucket." + bucket.name + "/" + bucket.marker; } - std::string sub_meta_oid(const string& name) const { + std::string sub_meta_oid(const std::string& name) const { return pubsub_oid_prefix + tenant + ".sub." + name; } @@ -657,13 +657,13 @@ public: // for S3 compliant notifications the version with: s3_filter and notif_name should be used // return -ENOENT if the topic does not exists // return 0 on success, error code otherwise - int create_notification(const DoutPrefixProvider *dpp, const string& topic_name, const rgw::notify::EventTypeList& events, optional_yield y); - int create_notification(const DoutPrefixProvider *dpp, const string& topic_name, const rgw::notify::EventTypeList& events, OptionalFilter s3_filter, const std::string& notif_name, optional_yield y); + int create_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, const rgw::notify::EventTypeList& events, optional_yield y); + int create_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, const rgw::notify::EventTypeList& events, OptionalFilter s3_filter, const std::string& notif_name, optional_yield y); // remove a topic and filter from bucket // if the topic does not exists on the bucket it is a no-op (considered success) // return -ENOENT if the topic does not exists // return 0 on success, error code otherwise - int remove_notification(const DoutPrefixProvider *dpp, const string& topic_name, optional_yield y); + int remove_notification(const DoutPrefixProvider *dpp, const std::string& topic_name, optional_yield y); // remove all notifications (and autogenerated topics) associated with the bucket // return 0 on success or if no topic was associated with the bucket, error code otherwise int remove_notifications(const DoutPrefixProvider *dpp, optional_yield y); @@ -688,15 +688,15 @@ public: virtual ~Sub() = default; - int subscribe(const DoutPrefixProvider *dpp, const string& topic_name, const rgw_pubsub_sub_dest& dest, optional_yield y, + int subscribe(const DoutPrefixProvider *dpp, const std::string& topic_name, const rgw_pubsub_sub_dest& dest, optional_yield y, const std::string& s3_id=""); - int unsubscribe(const DoutPrefixProvider *dpp, const string& topic_name, optional_yield y); + int unsubscribe(const DoutPrefixProvider *dpp, const std::string& topic_name, optional_yield y); int get_conf(rgw_pubsub_sub_config* result); static const int DEFAULT_MAX_EVENTS = 100; // followint virtual methods should only be called in derived - virtual int list_events(const DoutPrefixProvider *dpp, const string& marker, int max_events) {ceph_assert(false);} - virtual int remove_event(const DoutPrefixProvider *dpp, const string& event_id) {ceph_assert(false);} + virtual int list_events(const DoutPrefixProvider *dpp, const std::string& marker, int max_events) {ceph_assert(false);} + virtual int remove_event(const DoutPrefixProvider *dpp, const std::string& event_id) {ceph_assert(false);} virtual void dump(Formatter* f) const {ceph_assert(false);} }; @@ -712,12 +712,12 @@ public: } list; public: - SubWithEvents(RGWPubSub *_ps, const string& _sub) : Sub(_ps, _sub) {} + SubWithEvents(RGWPubSub *_ps, const std::string& _sub) : Sub(_ps, _sub) {} virtual ~SubWithEvents() = default; - int list_events(const DoutPrefixProvider *dpp, const string& marker, int max_events) override; - int remove_event(const DoutPrefixProvider *dpp, const string& event_id) override; + int list_events(const DoutPrefixProvider *dpp, const std::string& marker, int max_events) override; + int remove_event(const DoutPrefixProvider *dpp, const std::string& event_id) override; void dump(Formatter* f) const override; }; @@ -728,11 +728,11 @@ public: return std::make_shared(this, bucket); } - SubRef get_sub(const string& sub) { + SubRef get_sub(const std::string& sub) { return std::make_shared(this, sub); } - SubRef get_sub_with_events(const string& sub) { + SubRef get_sub_with_events(const std::string& sub) { auto tmpsub = Sub(this, sub); rgw_pubsub_sub_config conf; if (tmpsub.get_conf(&conf) < 0) { @@ -747,7 +747,7 @@ public: void get_meta_obj(rgw_raw_obj *obj) const; void get_bucket_meta_obj(const rgw_bucket& bucket, rgw_raw_obj *obj) const; - void get_sub_meta_obj(const string& name, rgw_raw_obj *obj) const; + void get_sub_meta_obj(const std::string& name, rgw_raw_obj *obj) const; // get all topics (per tenant, if used)) and populate them into "result" // return 0 on success or if no topics exist, error code otherwise @@ -755,23 +755,23 @@ public: // get a topic with its subscriptions by its name and populate it into "result" // return -ENOENT if the topic does not exists // return 0 on success, error code otherwise - int get_topic(const string& name, rgw_pubsub_topic_subs *result); + int get_topic(const std::string& name, rgw_pubsub_topic_subs *result); // get a topic with by its name and populate it into "result" // return -ENOENT if the topic does not exists // return 0 on success, error code otherwise - int get_topic(const string& name, rgw_pubsub_topic *result); + int get_topic(const std::string& name, rgw_pubsub_topic *result); // create a topic with a name only // if the topic already exists it is a no-op (considered success) // return 0 on success, error code otherwise - int create_topic(const DoutPrefixProvider *dpp, const string& name, optional_yield y); + int create_topic(const DoutPrefixProvider *dpp, const std::string& name, optional_yield y); // create a topic with push destination information and ARN // if the topic already exists the destination and ARN values may be updated (considered succsess) // return 0 on success, error code otherwise - int create_topic(const DoutPrefixProvider *dpp, const string& name, const rgw_pubsub_sub_dest& dest, const std::string& arn, const std::string& opaque_data, optional_yield y); + int create_topic(const DoutPrefixProvider *dpp, const std::string& name, const rgw_pubsub_sub_dest& dest, const std::string& arn, const std::string& opaque_data, optional_yield y); // remove a topic according to its name // if the topic does not exists it is a no-op (considered success) // return 0 on success, error code otherwise - int remove_topic(const DoutPrefixProvider *dpp, const string& name, optional_yield y); + int remove_topic(const DoutPrefixProvider *dpp, const std::string& name, optional_yield y); }; diff --git a/src/rgw/rgw_putobj_processor.cc b/src/rgw/rgw_putobj_processor.cc index d6bb52b712857..afe33b7026c34 100644 --- a/src/rgw/rgw_putobj_processor.cc +++ b/src/rgw/rgw_putobj_processor.cc @@ -22,6 +22,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + namespace rgw::putobj { int HeadObjectProcessor::process(bufferlist&& data, uint64_t logical_offset) diff --git a/src/rgw/rgw_putobj_processor.h b/src/rgw/rgw_putobj_processor.h index 77cb4f7c2f88a..b376b26ce16b6 100644 --- a/src/rgw/rgw_putobj_processor.h +++ b/src/rgw/rgw_putobj_processor.h @@ -244,7 +244,7 @@ class MultipartObjectProcessor : public ManifestObjectProcessor { uint64_t position; uint64_t cur_size; uint64_t *cur_accounted_size; - string cur_etag; + std::string cur_etag; const std::string unique_tag; RGWObjManifest *cur_manifest; @@ -265,10 +265,10 @@ class MultipartObjectProcessor : public ManifestObjectProcessor { unique_tag(unique_tag), cur_manifest(nullptr) {} int prepare(optional_yield y) override; - int complete(size_t accounted_size, const string& etag, + int complete(size_t accounted_size, const std::string& etag, ceph::real_time *mtime, ceph::real_time set_mtime, - map& attrs, ceph::real_time delete_at, - const char *if_match, const char *if_nomatch, const string *user_data, + std::map& attrs, ceph::real_time delete_at, + const char *if_match, const char *if_nomatch, const std::string *user_data, rgw_zone_set *zones_trace, bool *canceled, optional_yield y) override; }; diff --git a/src/rgw/rgw_quota.cc b/src/rgw/rgw_quota.cc index ba5b79e5f90a6..bc74b485ad936 100644 --- a/src/rgw/rgw_quota.cc +++ b/src/rgw/rgw_quota.cc @@ -35,6 +35,7 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; struct RGWQuotaCacheStats { RGWStorageStats stats; diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 6df125049d906..9d3870b0e2d27 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -65,7 +65,7 @@ struct get_obj_data; #define RGW_OBJ_NS_MULTIPART "multipart" #define RGW_OBJ_NS_SHADOW "shadow" -static inline void prepend_bucket_marker(const rgw_bucket& bucket, const string& orig_oid, string& oid) +static inline void prepend_bucket_marker(const rgw_bucket& bucket, const std::string& orig_oid, std::string& oid) { if (bucket.marker.empty() || orig_oid.empty()) { oid = orig_oid; @@ -76,11 +76,11 @@ static inline void prepend_bucket_marker(const rgw_bucket& bucket, const string& } } -static inline void get_obj_bucket_and_oid_loc(const rgw_obj& obj, string& oid, string& locator) +static inline void get_obj_bucket_and_oid_loc(const rgw_obj& obj, std::string& oid, std::string& locator) { const rgw_bucket& bucket = obj.bucket; prepend_bucket_marker(bucket, obj.get_oid(), oid); - const string& loc = obj.key.get_loc(); + const std::string& loc = obj.key.get_loc(); if (!loc.empty()) { prepend_bucket_marker(bucket, loc, locator); } else { @@ -88,7 +88,10 @@ static inline void get_obj_bucket_and_oid_loc(const rgw_obj& obj, string& oid, s } } -int rgw_policy_from_attrset(const DoutPrefixProvider *dpp, CephContext *cct, map& attrset, RGWAccessControlPolicy *policy); +int rgw_policy_from_attrset(const DoutPrefixProvider *dpp, + CephContext *cct, + std::map& attrset, + RGWAccessControlPolicy *policy); struct RGWOLHInfo { rgw_obj target; @@ -109,7 +112,7 @@ struct RGWOLHInfo { decode(removed, bl); DECODE_FINISH(bl); } - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); void dump(Formatter *f) const; }; WRITE_CLASS_ENCODER(RGWOLHInfo) @@ -136,7 +139,7 @@ struct RGWOLHPendingInfo { WRITE_CLASS_ENCODER(RGWOLHPendingInfo) struct RGWUsageBatch { - map m; + std::map m; void insert(ceph::real_time& t, rgw_usage_log_entry& entry, bool *account) { bool exists = m.find(t) != m.end(); @@ -170,11 +173,11 @@ struct RGWObjState { uint64_t epoch{0}; bufferlist obj_tag; bufferlist tail_tag; - string write_tag; + std::string write_tag; bool fake_tag{false}; std::optional manifest; - string shadow_obj; + std::string shadow_obj; bool has_data{false}; bufferlist data; bool prefetch_data{false}; @@ -188,14 +191,14 @@ struct RGWObjState { RGWObjVersionTracker objv_tracker; - map attrset; + std::map attrset; RGWObjState(); RGWObjState(const RGWObjState& rhs); ~RGWObjState(); - bool get_attr(string name, bufferlist& dest) { - map::iterator iter = attrset.find(name); + bool get_attr(std::string name, bufferlist& dest) { + auto iter = attrset.find(name); if (iter != attrset.end()) { dest = iter->second; return true; @@ -212,7 +215,7 @@ public: const rgw_obj_key& source_key, const RGWBucketInfo& dest_bucket_info, std::optional dest_placement_rule, - const map& obj_attrs, + const std::map& obj_attrs, std::optional *poverride_owner, const rgw_placement_rule **prule) = 0; }; @@ -227,7 +230,7 @@ public: const rgw_obj_key& source_key, const RGWBucketInfo& dest_bucket_info, std::optional dest_placement_rule, - const map& obj_attrs, + const std::map& obj_attrs, std::optional *poverride_owner, const rgw_placement_rule **prule) override; }; @@ -275,7 +278,7 @@ struct RGWRawObjState { RGWObjVersionTracker objv_tracker; - map attrset; + std::map attrset; RGWRawObjState() {} RGWRawObjState(const RGWRawObjState& rhs) : obj (rhs.obj) { has_attrs = rhs.has_attrs; @@ -309,9 +312,9 @@ struct RGWListRawObjsCtx { }; struct objexp_hint_entry { - string tenant; - string bucket_name; - string bucket_id; + std::string tenant; + std::string bucket_name; + std::string bucket_id; rgw_obj_key obj_key; ceph::real_time exp_time; @@ -341,7 +344,7 @@ struct objexp_hint_entry { } void dump(Formatter *f) const; - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; WRITE_CLASS_ENCODER(objexp_hint_entry) @@ -366,7 +369,7 @@ class RGWChainedCacheImpl; struct bucket_info_entry { RGWBucketInfo info; real_time mtime; - map attrs; + std::map attrs; }; struct tombstone_entry; @@ -422,7 +425,7 @@ class RGWRados RGWDataNotifier *data_notifier; RGWMetaSyncProcessorThread *meta_sync_processor_thread; RGWSyncTraceManager *sync_tracer = nullptr; - map data_sync_processor_threads; + std::map data_sync_processor_threads; boost::optional bucket_trim; RGWSyncLogTrimThread *sync_log_trimmer{nullptr}; @@ -455,10 +458,10 @@ class RGWRados librados::ObjectOperation& op, RGWObjState **state, optional_yield y); int update_placement_map(); - int store_bucket_info(RGWBucketInfo& info, map *pattrs, RGWObjVersionTracker *objv_tracker, bool exclusive); + int store_bucket_info(RGWBucketInfo& info, std::map *pattrs, RGWObjVersionTracker *objv_tracker, bool exclusive); void remove_rgw_head_obj(librados::ObjectWriteOperation& op); - void cls_obj_check_prefix_exist(librados::ObjectOperation& op, const string& prefix, bool fail_if_exist); + void cls_obj_check_prefix_exist(librados::ObjectOperation& op, const std::string& prefix, bool fail_if_exist); void cls_obj_check_mtime(librados::ObjectOperation& op, const real_time& mtime, bool high_precision_time, RGWCheckMTimeType type); protected: CephContext *cct; @@ -582,7 +585,7 @@ public: * AmazonS3 errors contain a HostId string, but is an opaque base64 blob; we * try to be more transparent. This has a wrapper so we can update it when zonegroup/zone are changed. */ - string host_id; + std::string host_id; RGWReshard *reshard; std::shared_ptr reshard_wait; @@ -611,14 +614,14 @@ public: int get_raw_obj_ref(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, rgw_rados_ref *ref); - int list_raw_objects_init(const DoutPrefixProvider *dpp, const rgw_pool& pool, const string& marker, RGWListRawObjsCtx *ctx); - int list_raw_objects_next(const DoutPrefixProvider *dpp, const string& prefix_filter, int max, - RGWListRawObjsCtx& ctx, list& oids, + int list_raw_objects_init(const DoutPrefixProvider *dpp, const rgw_pool& pool, const std::string& marker, RGWListRawObjsCtx *ctx); + int list_raw_objects_next(const DoutPrefixProvider *dpp, const std::string& prefix_filter, int max, + RGWListRawObjsCtx& ctx, std::list& oids, bool *is_truncated); - int list_raw_objects(const DoutPrefixProvider *dpp, const rgw_pool& pool, const string& prefix_filter, int max, - RGWListRawObjsCtx& ctx, list& oids, + int list_raw_objects(const DoutPrefixProvider *dpp, const rgw_pool& pool, const std::string& prefix_filter, int max, + RGWListRawObjsCtx& ctx, std::list& oids, bool *is_truncated); - string list_raw_objs_get_cursor(RGWListRawObjsCtx& ctx); + std::string list_raw_objs_get_cursor(RGWListRawObjsCtx& ctx); CephContext *ctx() { return cct; } /** do all necessary setup of the storage device */ @@ -634,41 +637,41 @@ public: int initialize(const DoutPrefixProvider *dpp); void finalize(); - int register_to_service_map(const DoutPrefixProvider *dpp, const string& daemon_type, const map& meta); + int register_to_service_map(const DoutPrefixProvider *dpp, const std::string& daemon_type, const std::map& meta); int update_service_map(const DoutPrefixProvider *dpp, std::map&& status); /// list logs - int log_list_init(const DoutPrefixProvider *dpp, const string& prefix, RGWAccessHandle *handle); - int log_list_next(RGWAccessHandle handle, string *name); + int log_list_init(const DoutPrefixProvider *dpp, const std::string& prefix, RGWAccessHandle *handle); + int log_list_next(RGWAccessHandle handle, std::string *name); /// remove log - int log_remove(const DoutPrefixProvider *dpp, const string& name); + int log_remove(const DoutPrefixProvider *dpp, const std::string& name); /// show log - int log_show_init(const DoutPrefixProvider *dpp, const string& name, RGWAccessHandle *handle); + int log_show_init(const DoutPrefixProvider *dpp, const std::string& name, RGWAccessHandle *handle); int log_show_next(const DoutPrefixProvider *dpp, RGWAccessHandle handle, rgw_log_entry *entry); // log bandwidth info - int log_usage(const DoutPrefixProvider *dpp, map& usage_info); - int read_usage(const DoutPrefixProvider *dpp, const rgw_user& user, const string& bucket_name, uint64_t start_epoch, uint64_t end_epoch, - uint32_t max_entries, bool *is_truncated, RGWUsageIter& read_iter, map& usage_info); + int read_usage(const DoutPrefixProvider *dpp, const rgw_user& user, const std::string& bucket_name, uint64_t start_epoch, uint64_t end_epoch, + uint32_t max_entries, bool *is_truncated, RGWUsageIter& read_iter, std::map& usage); - int trim_usage(const DoutPrefixProvider *dpp, const rgw_user& user, const string& bucket_name, uint64_t start_epoch, uint64_t end_epoch); + int trim_usage(const DoutPrefixProvider *dpp, const rgw_user& user, const std::string& bucket_name, uint64_t start_epoch, uint64_t end_epoch); int clear_usage(const DoutPrefixProvider *dpp); int create_pool(const DoutPrefixProvider *dpp, const rgw_pool& pool); - void create_bucket_id(string *bucket_id); + void create_bucket_id(std::string *bucket_id); bool get_obj_data_pool(const rgw_placement_rule& placement_rule, const rgw_obj& obj, rgw_pool *pool); bool obj_to_raw(const rgw_placement_rule& placement_rule, const rgw_obj& obj, rgw_raw_obj *raw_obj); int create_bucket(const RGWUserInfo& owner, rgw_bucket& bucket, - const string& zonegroup_id, + const std::string& zonegroup_id, const rgw_placement_rule& placement_rule, - const string& swift_ver_location, + const std::string& swift_ver_location, const RGWQuotaInfo * pquota_info, - map& attrs, + std::map& attrs, RGWBucketInfo& bucket_info, obj_version *pobjv, obj_version *pep_objv, @@ -714,7 +717,7 @@ public: int get_state(const DoutPrefixProvider *dpp, RGWObjState **pstate, bool follow_olh, optional_yield y, bool assume_noent = false); void invalidate_state(); - int prepare_atomic_modification(const DoutPrefixProvider *dpp, librados::ObjectWriteOperation& op, bool reset_obj, const string *ptag, + int prepare_atomic_modification(const DoutPrefixProvider *dpp, librados::ObjectWriteOperation& op, bool reset_obj, const std::string *ptag, const char *ifmatch, const char *ifnomatch, bool removal_op, bool modify_tail, optional_yield y); int complete_atomic_modification(const DoutPrefixProvider *dpp); @@ -764,7 +767,7 @@ public: RGWRados::Object *source; struct GetObjState { - map io_ctxs; + std::map io_ctxs; rgw_pool cur_pool; librados::IoCtx *cur_ioctx{nullptr}; rgw_obj obj; @@ -788,7 +791,7 @@ public: struct Params { ceph::real_time *lastmod; uint64_t *obj_size; - map *attrs; + std::map *attrs; rgw_obj *target_obj; Params() : lastmod(nullptr), obj_size(nullptr), attrs(nullptr), @@ -809,11 +812,11 @@ public: struct MetaParams { ceph::real_time *mtime; - map* rmattrs; + std::map* rmattrs; const bufferlist *data; RGWObjManifest *manifest; - const string *ptag; - list *remove_objs; + const std::string *ptag; + std::list *remove_objs; ceph::real_time set_mtime; rgw_user owner; RGWObjCategory category; @@ -823,7 +826,7 @@ public: std::optional olh_epoch; ceph::real_time delete_at; bool canceled; - const string *user_data; + const std::string *user_data; rgw_zone_set *zones_trace; bool modify_tail; bool completeMultipart; @@ -839,11 +842,11 @@ public: int _do_write_meta(const DoutPrefixProvider *dpp, uint64_t size, uint64_t accounted_size, - map& attrs, + std::map& attrs, bool modify_tail, bool assume_noent, void *index_op, optional_yield y); int write_meta(const DoutPrefixProvider *dpp, uint64_t size, uint64_t accounted_size, - map& attrs, optional_yield y); + std::map& attrs, optional_yield y); int write_data(const char *data, uint64_t ofs, uint64_t len, bool exclusive); const req_state* get_req_state() { return (req_state *)target->get_ctx().get_private(); @@ -858,9 +861,9 @@ public: int versioning_status; // versioning flags defined in enum RGWBucketFlags ACLOwner obj_owner; // needed for creation of deletion marker uint64_t olh_epoch; - string marker_version_id; + std::string marker_version_id; uint32_t bilog_flags; - list *remove_objs; + std::list *remove_objs; ceph::real_time expiration_time; ceph::real_time unmod_since; ceph::real_time mtime; /* for setting delete marker mtime */ @@ -874,7 +877,7 @@ public: struct DeleteResult { bool delete_marker; - string version_id; + std::string version_id; DeleteResult() : delete_marker(false) {} } result; @@ -892,7 +895,7 @@ public: std::optional manifest; uint64_t size{0}; struct timespec mtime {}; - map attrs; + std::map attrs; } result; struct State { @@ -927,7 +930,7 @@ public: rgw_bucket& get_bucket() { return bucket; } RGWBucketInfo& get_bucket_info() { return bucket_info; } - int update_bucket_id(const string& new_bucket_id, const DoutPrefixProvider *dpp); + int update_bucket_id(const std::string& new_bucket_id, const DoutPrefixProvider *dpp); int get_shard_id() { return shard_id; } void set_shard_id(int id) { @@ -936,7 +939,7 @@ public: class UpdateIndex { RGWRados::Bucket *target; - string optag; + std::string optag; rgw_obj obj; uint16_t bilog_flags{0}; BucketShard bs; @@ -986,20 +989,20 @@ public: zones_trace = _zones_trace; } - int prepare(const DoutPrefixProvider *dpp, RGWModifyOp, const string *write_tag, optional_yield y); + int prepare(const DoutPrefixProvider *dpp, RGWModifyOp, const std::string *write_tag, optional_yield y); int complete(const DoutPrefixProvider *dpp, int64_t poolid, uint64_t epoch, uint64_t size, uint64_t accounted_size, ceph::real_time& ut, - const string& etag, const string& content_type, - const string& storage_class, + const std::string& etag, const std::string& content_type, + const std::string& storage_class, bufferlist *acl_bl, RGWObjCategory category, - list *remove_objs, const string *user_data = nullptr, bool appendable = false); + std::list *remove_objs, const std::string *user_data = nullptr, bool appendable = false); int complete_del(const DoutPrefixProvider *dpp, int64_t poolid, uint64_t epoch, ceph::real_time& removed_mtime, /* mtime of removed object */ - list *remove_objs); + std::list *remove_objs); int cancel(const DoutPrefixProvider *dpp); - const string *get_optag() { return &optag; } + const std::string *get_optag() { return &optag; } bool is_prepared() { return prepared; } }; // class UpdateIndex @@ -1015,25 +1018,25 @@ public: int list_objects_ordered(const DoutPrefixProvider *dpp, int64_t max, - vector *result, - map *common_prefixes, + std::vector *result, + std::map *common_prefixes, bool *is_truncated, optional_yield y); int list_objects_unordered(const DoutPrefixProvider *dpp, int64_t max, - vector *result, - map *common_prefixes, + std::vector *result, + std::map *common_prefixes, bool *is_truncated, optional_yield y); public: struct Params { - string prefix; - string delim; + std::string prefix; + std::string delim; rgw_obj_key marker; rgw_obj_key end_marker; - string ns; + std::string ns; bool enforce_ns; RGWAccessListFilter *filter; bool list_versions; @@ -1050,8 +1053,8 @@ public: explicit List(RGWRados::Bucket *_target) : target(_target) {} int list_objects(const DoutPrefixProvider *dpp, int64_t max, - vector *result, - map *common_prefixes, + std::vector *result, + std::map *common_prefixes, bool *is_truncated, optional_yield y) { if (params.allow_unordered) { @@ -1090,7 +1093,7 @@ public: const DoutPrefixProvider *dpp); /* in/out */ int copy_obj_to_remote_dest(const DoutPrefixProvider *dpp, RGWObjState *astate, - map& src_attrs, + std::map& src_attrs, RGWRados::Object::Read& read_op, const rgw_user& user_id, rgw::sal::Object* dest_obj, @@ -1120,11 +1123,11 @@ public: bool high_precision_time, const char *if_match, const char *if_nomatch, - map *pattrs, - map *pheaders, - string *version_id, - string *ptag, - string *petag); + std::map *pattrs, + std::map *pheaders, + std::string *version_id, + std::string *ptag, + std::string *petag); int fetch_remote_obj(RGWObjectCtx& obj_ctx, const rgw_user& user_id, @@ -1148,8 +1151,8 @@ public: RGWObjCategory category, std::optional olh_epoch, ceph::real_time delete_at, - string *ptag, - string *petag, + std::string *ptag, + std::string *petag, void (*progress_cb)(off_t, void *), void *progress_data, const DoutPrefixProvider *dpp, @@ -1188,13 +1191,13 @@ public: const char *if_nomatch, AttrsMod attrs_mod, bool copy_if_newer, - map& attrs, + std::map& attrs, RGWObjCategory category, uint64_t olh_epoch, ceph::real_time delete_at, - string *version_id, - string *ptag, - string *petag, + std::string *version_id, + std::string *ptag, + std::string *petag, void (*progress_cb)(off_t, void *), void *progress_data, const DoutPrefixProvider *dpp, @@ -1207,10 +1210,10 @@ public: rgw::sal::Object* dest_obj, ceph::real_time *mtime, ceph::real_time set_mtime, - map& attrs, + std::map& attrs, uint64_t olh_epoch, ceph::real_time delete_at, - string *petag, + std::string *petag, const DoutPrefixProvider *dpp, optional_yield y); @@ -1232,8 +1235,10 @@ public: */ int delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& objv_tracker, optional_yield y, const DoutPrefixProvider *dpp, bool check_empty = true); - void wakeup_meta_sync_shards(set& shard_ids); - void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, const rgw_zone_id& source_zone, map >& shard_ids); + void wakeup_meta_sync_shards(std::set& shard_ids); + void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, + const rgw_zone_id& source_zone, + std::map >& shard_ids); RGWMetaSyncStatusManager* get_meta_sync_manager(); RGWDataSyncStatusManager* get_data_sync_manager(const rgw_zone_id& source_zone); @@ -1268,8 +1273,8 @@ public: int set_attr(const DoutPrefixProvider *dpp, void *ctx, const RGWBucketInfo& bucket_info, rgw_obj& obj, const char *name, bufferlist& bl); int set_attrs(const DoutPrefixProvider *dpp, void *ctx, const RGWBucketInfo& bucket_info, rgw_obj& obj, - map& attrs, - map* rmattrs, + std::map& attrs, + std::map* rmattrs, optional_yield y); int get_obj_state(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj, RGWObjState **state, @@ -1299,7 +1304,7 @@ public: int raw_obj_stat(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, uint64_t *psize, ceph::real_time *pmtime, uint64_t *epoch, - map *attrs, bufferlist *first_chunk, + std::map *attrs, bufferlist *first_chunk, RGWObjVersionTracker *objv_tracker, optional_yield y); int obj_operate(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, librados::ObjectWriteOperation *op); @@ -1311,29 +1316,29 @@ public: const RGWBucketInfo& bucket_info, std::function call); int block_while_resharding(RGWRados::BucketShard *bs, - string *new_bucket_id, + std::string *new_bucket_id, const RGWBucketInfo& bucket_info, optional_yield y, const DoutPrefixProvider *dpp); void bucket_index_guard_olh_op(const DoutPrefixProvider *dpp, RGWObjState& olh_state, librados::ObjectOperation& op); - int olh_init_modification(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, string *op_tag); - int olh_init_modification_impl(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, string *op_tag); + int olh_init_modification(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, std::string *op_tag); + int olh_init_modification_impl(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, std::string *op_tag); int bucket_index_link_olh(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& olh_state, const rgw_obj& obj_instance, bool delete_marker, - const string& op_tag, struct rgw_bucket_dir_entry_meta *meta, + const std::string& op_tag, struct rgw_bucket_dir_entry_meta *meta, uint64_t olh_epoch, ceph::real_time unmod_since, bool high_precision_time, rgw_zone_set *zones_trace = nullptr, bool log_data_change = false); - int bucket_index_unlink_instance(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj_instance, const string& op_tag, const string& olh_tag, uint64_t olh_epoch, rgw_zone_set *zones_trace = nullptr); + int bucket_index_unlink_instance(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj_instance, const std::string& op_tag, const std::string& olh_tag, uint64_t olh_epoch, rgw_zone_set *zones_trace = nullptr); int bucket_index_read_olh_log(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& obj_instance, uint64_t ver_marker, - map > *log, bool *is_truncated); + std::map > *log, bool *is_truncated); int bucket_index_trim_olh_log(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& obj_state, const rgw_obj& obj_instance, uint64_t ver); int bucket_index_clear_olh(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& obj_instance); int apply_olh_log(const DoutPrefixProvider *dpp, RGWObjectCtx& ctx, RGWObjState& obj_state, const RGWBucketInfo& bucket_info, const rgw_obj& obj, - bufferlist& obj_tag, map >& log, + bufferlist& obj_tag, std::map >& log, uint64_t *plast_ver, rgw_zone_set *zones_trace = nullptr); int update_olh(const DoutPrefixProvider *dpp, RGWObjectCtx& obj_ctx, RGWObjState *state, const RGWBucketInfo& bucket_info, const rgw_obj& obj, rgw_zone_set *zones_trace = nullptr); int set_olh(const DoutPrefixProvider *dpp, RGWObjectCtx& obj_ctx, const RGWBucketInfo& bucket_info, const rgw_obj& target_obj, bool delete_marker, rgw_bucket_dir_entry_meta *meta, @@ -1344,15 +1349,15 @@ public: int unlink_obj_instance(const DoutPrefixProvider *dpp, RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, const rgw_obj& target_obj, uint64_t olh_epoch, optional_yield y, rgw_zone_set *zones_trace = nullptr); - void check_pending_olh_entries(const DoutPrefixProvider *dpp, map& pending_entries, map *rm_pending_entries); - int remove_olh_pending_entries(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, map& pending_attrs); + void check_pending_olh_entries(const DoutPrefixProvider *dpp, std::map& pending_entries, std::map *rm_pending_entries); + int remove_olh_pending_entries(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjState& state, const rgw_obj& olh_obj, std::map& pending_attrs); int follow_olh(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWObjectCtx& ctx, RGWObjState *state, const rgw_obj& olh_obj, rgw_obj *target); int get_olh(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, RGWOLHInfo *olh); void gen_rand_obj_instance_name(rgw_obj_key *target_key); void gen_rand_obj_instance_name(rgw_obj *target); - int update_containers_stats(map& m, const DoutPrefixProvider *dpp); + int update_containers_stats(std::map& m, const DoutPrefixProvider *dpp); int append_async(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, size_t size, bufferlist& bl); public: @@ -1365,22 +1370,22 @@ public: rctx->set_prefetch_data(obj); } int decode_policy(const DoutPrefixProvider *dpp, bufferlist& bl, ACLOwner *owner); - int get_bucket_stats(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, int shard_id, string *bucket_ver, string *master_ver, - map& stats, string *max_marker, bool* syncstopped = NULL); + int get_bucket_stats(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, int shard_id, std::string *bucket_ver, std::string *master_ver, + std::map& stats, std::string *max_marker, bool* syncstopped = NULL); int get_bucket_stats_async(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, int shard_id, RGWGetBucketStats_CB *cb); - int put_bucket_instance_info(RGWBucketInfo& info, bool exclusive, ceph::real_time mtime, map *pattrs, const DoutPrefixProvider *dpp); + int put_bucket_instance_info(RGWBucketInfo& info, bool exclusive, ceph::real_time mtime, std::map *pattrs, const DoutPrefixProvider *dpp); /* xxx dang obj_ctx -> svc */ - int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const string& meta_key, RGWBucketInfo& info, ceph::real_time *pmtime, map *pattrs, optional_yield y, const DoutPrefixProvider *dpp); - int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info, ceph::real_time *pmtime, map *pattrs, optional_yield y, const DoutPrefixProvider *dpp); + int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const std::string& meta_key, RGWBucketInfo& info, ceph::real_time *pmtime, std::map *pattrs, optional_yield y, const DoutPrefixProvider *dpp); + int get_bucket_instance_info(RGWSysObjectCtx& obj_ctx, const rgw_bucket& bucket, RGWBucketInfo& info, ceph::real_time *pmtime, std::map *pattrs, optional_yield y, const DoutPrefixProvider *dpp); - static void make_bucket_entry_name(const string& tenant_name, const string& bucket_name, string& bucket_entry); + static void make_bucket_entry_name(const std::string& tenant_name, const std::string& bucket_name, std::string& bucket_entry); int get_bucket_info(RGWServices *svc, - const string& tenant_name, const string& bucket_name, + const std::string& tenant_name, const std::string& bucket_name, RGWBucketInfo& info, ceph::real_time *pmtime, optional_yield y, - const DoutPrefixProvider *dpp, map *pattrs = NULL); + const DoutPrefixProvider *dpp, std::map *pattrs = NULL); // Returns 0 on successful refresh. Returns error code if there was // an error or the version stored on the OSD is the same as that @@ -1389,20 +1394,20 @@ public: int try_refresh_bucket_info(RGWBucketInfo& info, ceph::real_time *pmtime, const DoutPrefixProvider *dpp, - map *pattrs = nullptr); + std::map *pattrs = nullptr); int put_linked_bucket_info(RGWBucketInfo& info, bool exclusive, ceph::real_time mtime, obj_version *pep_objv, - map *pattrs, bool create_entry_point, + std::map *pattrs, bool create_entry_point, const DoutPrefixProvider *dpp); - int cls_obj_prepare_op(const DoutPrefixProvider *dpp, BucketShard& bs, RGWModifyOp op, string& tag, rgw_obj& obj, uint16_t bilog_flags, optional_yield y, rgw_zone_set *zones_trace = nullptr); - int cls_obj_complete_op(BucketShard& bs, const rgw_obj& obj, RGWModifyOp op, string& tag, int64_t pool, uint64_t epoch, - rgw_bucket_dir_entry& ent, RGWObjCategory category, list *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr); - int cls_obj_complete_add(BucketShard& bs, const rgw_obj& obj, string& tag, int64_t pool, uint64_t epoch, rgw_bucket_dir_entry& ent, - RGWObjCategory category, list *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr); - int cls_obj_complete_del(BucketShard& bs, string& tag, int64_t pool, uint64_t epoch, rgw_obj& obj, - ceph::real_time& removed_mtime, list *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr); - int cls_obj_complete_cancel(BucketShard& bs, string& tag, rgw_obj& obj, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr); + int cls_obj_prepare_op(const DoutPrefixProvider *dpp, BucketShard& bs, RGWModifyOp op, std::string& tag, rgw_obj& obj, uint16_t bilog_flags, optional_yield y, rgw_zone_set *zones_trace = nullptr); + int cls_obj_complete_op(BucketShard& bs, const rgw_obj& obj, RGWModifyOp op, std::string& tag, int64_t pool, uint64_t epoch, + rgw_bucket_dir_entry& ent, RGWObjCategory category, std::list *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr); + int cls_obj_complete_add(BucketShard& bs, const rgw_obj& obj, std::string& tag, int64_t pool, uint64_t epoch, rgw_bucket_dir_entry& ent, + RGWObjCategory category, std::list *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr); + int cls_obj_complete_del(BucketShard& bs, std::string& tag, int64_t pool, uint64_t epoch, rgw_obj& obj, + ceph::real_time& removed_mtime, std::list *remove_objs, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr); + int cls_obj_complete_cancel(BucketShard& bs, std::string& tag, rgw_obj& obj, uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr); int cls_obj_set_bucket_tag_timeout(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, uint64_t timeout); using ent_map_t = @@ -1414,8 +1419,8 @@ public: RGWBucketInfo& bucket_info, const int shard_id, const rgw_obj_index_key& start_after, - const string& prefix, - const string& delimiter, + const std::string& prefix, + const std::string& delimiter, const uint32_t num_entries, const bool list_versions, const uint16_t exp_factor, // 0 means ignore @@ -1429,15 +1434,19 @@ public: RGWBucketInfo& bucket_info, int shard_id, const rgw_obj_index_key& start_after, - const string& prefix, + const std::string& prefix, uint32_t num_entries, bool list_versions, - vector& ent_list, + std::vector& ent_list, bool *is_truncated, rgw_obj_index_key *last_entry, optional_yield y, check_filter_t = nullptr); - int cls_bucket_head(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, int shard_id, vector& headers, map *bucket_instance_ids = NULL); + int cls_bucket_head(const DoutPrefixProvider *dpp, + const RGWBucketInfo& bucket_info, + int shard_id, + std::vector& headers, + std::map *bucket_instance_ids = NULL); int cls_bucket_head_async(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, int shard_id, RGWGetDirHeader_CB *ctx, int *num_aio); int bi_get_instance(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw_obj& obj, rgw_bucket_dir_entry *dirent); @@ -1446,53 +1455,60 @@ public: void bi_put(librados::ObjectWriteOperation& op, BucketShard& bs, rgw_cls_bi_entry& entry); int bi_put(BucketShard& bs, rgw_cls_bi_entry& entry); int bi_put(const DoutPrefixProvider *dpp, rgw_bucket& bucket, rgw_obj& obj, rgw_cls_bi_entry& entry); - int bi_list(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, int shard_id, const string& filter_obj, const string& marker, uint32_t max, list *entries, bool *is_truncated); - int bi_list(BucketShard& bs, const string& filter_obj, const string& marker, uint32_t max, list *entries, bool *is_truncated); - int bi_list(const DoutPrefixProvider *dpp, rgw_bucket& bucket, const string& obj_name, const string& marker, uint32_t max, - list *entries, bool *is_truncated); + int bi_list(const DoutPrefixProvider *dpp, + const RGWBucketInfo& bucket_info, + int shard_id, + const std::string& filter_obj, + const std::string& marker, + uint32_t max, + std::list *entries, + bool *is_truncated); + int bi_list(BucketShard& bs, const std::string& filter_obj, const std::string& marker, uint32_t max, std::list *entries, bool *is_truncated); + int bi_list(const DoutPrefixProvider *dpp, rgw_bucket& bucket, const std::string& obj_name, const std::string& marker, uint32_t max, + std::list *entries, bool *is_truncated); int bi_remove(const DoutPrefixProvider *dpp, BucketShard& bs); - int cls_obj_usage_log_add(const DoutPrefixProvider *dpp, const string& oid, rgw_usage_log_info& info); - int cls_obj_usage_log_read(const DoutPrefixProvider *dpp, const string& oid, const string& user, const string& bucket, uint64_t start_epoch, - uint64_t end_epoch, uint32_t max_entries, string& read_iter, map& usage, bool *is_truncated); - int cls_obj_usage_log_trim(const DoutPrefixProvider *dpp, const string& oid, const string& user, const string& bucket, uint64_t start_epoch, + int cls_obj_usage_log_add(const DoutPrefixProvider *dpp, const std::string& oid, rgw_usage_log_info& info); + int cls_obj_usage_log_read(const DoutPrefixProvider *dpp, const std::string& oid, const std::string& user, const std::string& bucket, uint64_t start_epoch, + uint64_t end_epoch, uint32_t max_entries, std::string& read_iter, + std::map& usage, bool *is_truncated); + int cls_obj_usage_log_trim(const DoutPrefixProvider *dpp, const std::string& oid, const std::string& user, const std::string& bucket, uint64_t start_epoch, uint64_t end_epoch); - int cls_obj_usage_log_clear(const DoutPrefixProvider *dpp, string& oid); + int cls_obj_usage_log_clear(const DoutPrefixProvider *dpp, std::string& oid); - int get_target_shard_id(const rgw::bucket_index_normal_layout& layout, const string& obj_key, int *shard_id); + int get_target_shard_id(const rgw::bucket_index_normal_layout& layout, const std::string& obj_key, int *shard_id); - int lock_exclusive(const rgw_pool& pool, const string& oid, ceph::timespan& duration, rgw_zone_id& zone_id, string& owner_id); - int unlock(const rgw_pool& pool, const string& oid, rgw_zone_id& zone_id, string& owner_id); + int lock_exclusive(const rgw_pool& pool, const std::string& oid, ceph::timespan& duration, rgw_zone_id& zone_id, std::string& owner_id); + int unlock(const rgw_pool& pool, const std::string& oid, rgw_zone_id& zone_id, std::string& owner_id); void update_gc_chain(const DoutPrefixProvider *dpp, rgw_obj& head_obj, RGWObjManifest& manifest, cls_rgw_obj_chain *chain); - int send_chain_to_gc(cls_rgw_obj_chain& chain, const string& tag); - void delete_objs_inline(const DoutPrefixProvider *dpp, cls_rgw_obj_chain& chain, const string& tag); - int gc_operate(const DoutPrefixProvider *dpp, string& oid, librados::ObjectWriteOperation *op); + int send_chain_to_gc(cls_rgw_obj_chain& chain, const std::string& tag); + void delete_objs_inline(const DoutPrefixProvider *dpp, cls_rgw_obj_chain& chain, const std::string& tag); + int gc_operate(const DoutPrefixProvider *dpp, std::string& oid, librados::ObjectWriteOperation *op); int gc_aio_operate(const std::string& oid, librados::AioCompletion *c, librados::ObjectWriteOperation *op); - int gc_operate(const DoutPrefixProvider *dpp, string& oid, librados::ObjectReadOperation *op, bufferlist *pbl); + int gc_operate(const DoutPrefixProvider *dpp, std::string& oid, librados::ObjectReadOperation *op, bufferlist *pbl); - int list_gc_objs(int *index, string& marker, uint32_t max, bool expired_only, std::list& result, bool *truncated, bool& processing_queue); + int list_gc_objs(int *index, std::string& marker, uint32_t max, bool expired_only, std::list& result, bool *truncated, bool& processing_queue); int process_gc(bool expired_only); bool process_expire_objects(const DoutPrefixProvider *dpp); int defer_gc(const DoutPrefixProvider *dpp, void *ctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj, optional_yield y); int process_lc(); - int list_lc_progress(string& marker, uint32_t max_entries, - vector& progress_map, int& index); + int list_lc_progress(std::string& marker, uint32_t max_entries, + std::vector& progress_map, int& index); int bucket_check_index(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, - map *existing_stats, - map *calculated_stats); + std::map *existing_stats, + std::map *calculated_stats); int bucket_rebuild_index(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info); int bucket_set_reshard(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const cls_rgw_bucket_instance_entry& entry); - int remove_objs_from_index(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, list& oid_list); + int remove_objs_from_index(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, std::list& oid_list); int move_rados_obj(const DoutPrefixProvider *dpp, librados::IoCtx& src_ioctx, - const string& src_oid, const string& src_locator, + const std::string& src_oid, const std::string& src_locator, librados::IoCtx& dst_ioctx, - const string& dst_oid, const string& dst_locator); + const std::string& dst_oid, const std::string& dst_locator); int fix_head_obj_locator(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, bool copy_obj, bool remove_bad, rgw_obj_key& key); int fix_tail_obj_locator(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, rgw_obj_key& key, bool fix, bool *need_fix, optional_yield y); @@ -1509,9 +1525,9 @@ public: librados::Rados* get_rados_handle(); - int delete_raw_obj_aio(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, list& handles); + int delete_raw_obj_aio(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, std::list& handles); int delete_obj_aio(const DoutPrefixProvider *dpp, const rgw_obj& obj, RGWBucketInfo& info, RGWObjState *astate, - list& handles, bool keep_index_consistent, + std::list& handles, bool keep_index_consistent, optional_yield y); private: @@ -1552,14 +1568,14 @@ public: * ctx: context object to use for the iteration * Returns: 0 on success, -ERR# otherwise. */ - int pool_iterate_begin(const DoutPrefixProvider *dpp, const rgw_pool& pool, const string& cursor, RGWPoolIterCtx& ctx); + int pool_iterate_begin(const DoutPrefixProvider *dpp, const rgw_pool& pool, const std::string& cursor, RGWPoolIterCtx& ctx); /** * Get pool iteration position * ctx: context object to use for the iteration - * Returns: string representation of position + * Returns: std::string representation of position */ - string pool_iterate_get_cursor(RGWPoolIterCtx& ctx); + std::string pool_iterate_get_cursor(RGWPoolIterCtx& ctx); /** * Iterate over pool return object names, use optional filter @@ -1570,7 +1586,8 @@ public: * filter: if not NULL, will be used to filter returned objects * Returns: 0 on success, -ERR# otherwise. */ - int pool_iterate(const DoutPrefixProvider *dpp, RGWPoolIterCtx& ctx, uint32_t num, vector& objs, + int pool_iterate(const DoutPrefixProvider *dpp, RGWPoolIterCtx& ctx, uint32_t num, + std::vector& objs, bool *is_truncated, RGWAccessListFilter *filter); uint64_t next_bucket_id(); @@ -1601,7 +1618,7 @@ struct get_obj_data { } D3nGetObjData d3n_get_data; - atomic_bool d3n_bypass_cache_write{false}; + std::atomic_bool d3n_bypass_cache_write{false}; int flush(rgw::AioResultList&& results); diff --git a/src/rgw/rgw_request.h b/src/rgw/rgw_request.h index 23d791008eead..8a9005047e8ac 100644 --- a/src/rgw/rgw_request.h +++ b/src/rgw/rgw_request.h @@ -29,12 +29,12 @@ struct RGWRequest }; /* RGWRequest */ struct RGWLoadGenRequest : public RGWRequest { - string method; - string resource; + std::string method; + std::string resource; int content_length; std::atomic* fail_flag = nullptr; -RGWLoadGenRequest(uint64_t req_id, const string& _m, const string& _r, int _cl, +RGWLoadGenRequest(uint64_t req_id, const std::string& _m, const std::string& _r, int _cl, std::atomic *ff) : RGWRequest(req_id), method(_m), resource(_r), content_length(_cl), fail_flag(ff) {} diff --git a/src/rgw/rgw_reshard.cc b/src/rgw/rgw_reshard.cc index 7e1a0396c47b5..78c96d14c3932 100644 --- a/src/rgw/rgw_reshard.cc +++ b/src/rgw/rgw_reshard.cc @@ -23,6 +23,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + const string reshard_oid_prefix = "reshard."; const string reshard_lock_name = "reshard_process"; const string bucket_instance_lock_name = "bucket_instance_lock"; diff --git a/src/rgw/rgw_reshard.h b/src/rgw/rgw_reshard.h index 67205bb71c33b..0cfca38bfb7b4 100644 --- a/src/rgw/rgw_reshard.h +++ b/src/rgw/rgw_reshard.h @@ -75,7 +75,7 @@ private: rgw::sal::RadosStore* store; RGWBucketInfo bucket_info; - std::map bucket_attrs; + std::map bucket_attrs; RGWBucketReshardLock reshard_lock; RGWBucketReshardLock* outer_reshard_lock; @@ -91,7 +91,7 @@ private: RGWBucketInfo& new_bucket_info, int max_entries, bool verbose, - ostream *os, + std::ostream *os, Formatter *formatter, const DoutPrefixProvider *dpp); public: @@ -100,11 +100,11 @@ public: // manage RGWBucketReshard(rgw::sal::RadosStore* _store, const RGWBucketInfo& _bucket_info, - const std::map& _bucket_attrs, + const std::map& _bucket_attrs, RGWBucketReshardLock* _outer_reshard_lock); int execute(int num_shards, int max_op_entries, const DoutPrefixProvider *dpp, - bool verbose = false, ostream *out = nullptr, + bool verbose = false, std::ostream *out = nullptr, Formatter *formatter = nullptr, RGWReshard *reshard_log = nullptr); int get_status(const DoutPrefixProvider *dpp, std::list *status); @@ -123,10 +123,10 @@ public: static int set_resharding_status(const DoutPrefixProvider *dpp, rgw::sal::RadosStore* store, const RGWBucketInfo& bucket_info, - const string& new_instance_id, + const std::string& new_instance_id, int32_t num_shards, cls_rgw_reshard_status status); - int set_resharding_status(const DoutPrefixProvider *dpp, const string& new_instance_id, + int set_resharding_status(const DoutPrefixProvider *dpp, const std::string& new_instance_id, int32_t num_shards, cls_rgw_reshard_status status) { return set_resharding_status(dpp, store, bucket_info, @@ -197,15 +197,15 @@ public: private: rgw::sal::RadosStore* store; - string lock_name; + std::string lock_name; rados::cls::lock::Lock instance_lock; int num_logshards; bool verbose; - ostream *out; + std::ostream *out; Formatter *formatter; - void get_logshard_oid(int shard_num, string *shard); + void get_logshard_oid(int shard_num, std::string *shard); protected: class ReshardWorker : public Thread, public DoutPrefixProvider { CephContext *cct; @@ -230,17 +230,17 @@ protected: ReshardWorker *worker = nullptr; std::atomic down_flag = { false }; - string get_logshard_key(const string& tenant, const string& bucket_name); - void get_bucket_logshard_oid(const string& tenant, const string& bucket_name, string *oid); + std::string get_logshard_key(const std::string& tenant, const std::string& bucket_name); + void get_bucket_logshard_oid(const std::string& tenant, const std::string& bucket_name, std::string *oid); public: - RGWReshard(rgw::sal::RadosStore* _store, bool _verbose = false, ostream *_out = nullptr, Formatter *_formatter = nullptr); + RGWReshard(rgw::sal::RadosStore* _store, bool _verbose = false, std::ostream *_out = nullptr, Formatter *_formatter = nullptr); int add(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry); int update(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const RGWBucketInfo& new_bucket_info); int get(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry); int remove(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry); - int list(const DoutPrefixProvider *dpp, int logshard_num, string& marker, uint32_t max, std::list& entries, bool *is_truncated); - int clear_bucket_resharding(const DoutPrefixProvider *dpp, const string& bucket_instance_oid, cls_rgw_reshard_entry& entry); + int list(const DoutPrefixProvider *dpp, int logshard_num, std::string& marker, uint32_t max, std::list& entries, bool *is_truncated); + int clear_bucket_resharding(const DoutPrefixProvider *dpp, const std::string& bucket_instance_oid, cls_rgw_reshard_entry& entry); /* reshard thread */ int process_single_logshard(int logshard_num, const DoutPrefixProvider *dpp); diff --git a/src/rgw/rgw_resolve.cc b/src/rgw/rgw_resolve.cc index 8971d60515cde..b6f258ee0e8f1 100644 --- a/src/rgw/rgw_resolve.cc +++ b/src/rgw/rgw_resolve.cc @@ -18,6 +18,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; RGWResolver::~RGWResolver() { } diff --git a/src/rgw/rgw_resolve.h b/src/rgw/rgw_resolve.h index 2c845ff729063..92e09220cc6a0 100644 --- a/src/rgw/rgw_resolve.h +++ b/src/rgw/rgw_resolve.h @@ -16,7 +16,7 @@ class RGWResolver { public: ~RGWResolver(); RGWResolver(); - int resolve_cname(const string& hostname, string& cname, bool *found); + int resolve_cname(const std::string& hostname, std::string& cname, bool *found); }; diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index dc1135d9bfd53..a07bd2500b9b5 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -32,6 +32,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + struct rgw_http_status_code { int code; const char *name; diff --git a/src/rgw/rgw_rest.h b/src/rgw/rgw_rest.h index db4ceb14bad63..c2129e8e74517 100644 --- a/src/rgw/rgw_rest.h +++ b/src/rgw/rgw_rest.h @@ -75,24 +75,24 @@ std::tuple rgw_rest_get_json_input_keep_data(CephContext *cct, class RESTArgs { public: - static int get_string(struct req_state *s, const string& name, - const string& def_val, string *val, + static int get_string(struct req_state *s, const std::string& name, + const std::string& def_val, std::string *val, bool *existed = NULL); - static int get_uint64(struct req_state *s, const string& name, + static int get_uint64(struct req_state *s, const std::string& name, uint64_t def_val, uint64_t *val, bool *existed = NULL); - static int get_int64(struct req_state *s, const string& name, + static int get_int64(struct req_state *s, const std::string& name, int64_t def_val, int64_t *val, bool *existed = NULL); - static int get_uint32(struct req_state *s, const string& name, + static int get_uint32(struct req_state *s, const std::string& name, uint32_t def_val, uint32_t *val, bool *existed = NULL); - static int get_int32(struct req_state *s, const string& name, + static int get_int32(struct req_state *s, const std::string& name, int32_t def_val, int32_t *val, bool *existed = NULL); - static int get_time(struct req_state *s, const string& name, + static int get_time(struct req_state *s, const std::string& name, const utime_t& def_val, utime_t *val, bool *existed = NULL); - static int get_epoch(struct req_state *s, const string& name, + static int get_epoch(struct req_state *s, const std::string& name, uint64_t def_val, uint64_t *epoch, bool *existed = NULL); - static int get_bool(struct req_state *s, const string& name, bool def_val, + static int get_bool(struct req_state *s, const std::string& name, bool def_val, bool *val, bool *existed = NULL); }; @@ -556,8 +556,8 @@ public: RGWHandler_REST() {} ~RGWHandler_REST() override {} - static int validate_bucket_name(const string& bucket); - static int validate_object_name(const string& object); + static int validate_bucket_name(const std::string& bucket); + static int validate_object_name(const std::string& object); static int reallocate_formatter(struct req_state *s, int type); int init_permissions(RGWOp* op, optional_yield y) override; @@ -664,7 +664,7 @@ public: mgr.put_handler(handler); } - void register_resource(string resource, RGWRESTMgr *m, + void register_resource(std::string resource, RGWRESTMgr *m, bool register_empty = false) { if (!register_empty && resource.empty()) return; @@ -690,8 +690,8 @@ public: static constexpr int64_t NO_CONTENT_LENGTH = -1; static constexpr int64_t CHUNKED_TRANSFER_ENCODING = -2; -extern void dump_errno(int http_ret, string& out); -extern void dump_errno(const struct rgw_err &err, string& out); +extern void dump_errno(int http_ret, std::string& out); +extern void dump_errno(const struct rgw_err &err, std::string& out); extern void dump_errno(struct req_state *s); extern void dump_errno(struct req_state *s, int http_ret); extern void end_header(struct req_state *s, @@ -703,7 +703,7 @@ extern void end_header(struct req_state *s, bool force_no_error = false); extern void dump_start(struct req_state *s); extern void list_all_buckets_start(struct req_state *s); -extern void dump_owner(struct req_state *s, const rgw_user& id, string& name, +extern void dump_owner(struct req_state *s, const rgw_user& id, std::string& name, const char *section = NULL); extern void dump_header(struct req_state* s, const std::string_view& name, @@ -804,7 +804,7 @@ extern void list_all_buckets_end(struct req_state *s); extern void dump_time(struct req_state *s, const char *name, real_time *t); extern std::string dump_time_to_str(const real_time& t); extern void dump_bucket_from_state(struct req_state *s); -extern void dump_redirect(struct req_state *s, const string& redirect); +extern void dump_redirect(struct req_state *s, const std::string& redirect); extern bool is_valid_url(const char *url); extern void dump_access_control(struct req_state *s, const char *origin, const char *meth, diff --git a/src/rgw/rgw_rest_bucket.cc b/src/rgw/rgw_rest_bucket.cc index 18eb322815892..8dcb0aac5f7b4 100644 --- a/src/rgw/rgw_rest_bucket.cc +++ b/src/rgw/rgw_rest_bucket.cc @@ -13,6 +13,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; class RGWOp_Bucket_Info : public RGWRESTOp { diff --git a/src/rgw/rgw_rest_client.cc b/src/rgw/rgw_rest_client.cc index dfb6a75002940..3cb888cdf7b2c 100644 --- a/src/rgw/rgw_rest_client.cc +++ b/src/rgw/rgw_rest_client.cc @@ -14,6 +14,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + int RGWHTTPSimpleRequest::get_status() { int retcode = get_req_retcode(); diff --git a/src/rgw/rgw_rest_client.h b/src/rgw/rgw_rest_client.h index 8412b2e283df6..4ffdb2cfe8ebc 100644 --- a/src/rgw/rgw_rest_client.h +++ b/src/rgw/rgw_rest_client.h @@ -15,7 +15,7 @@ protected: using unique_lock = std::unique_lock; std::mutex out_headers_lock; - map out_headers; + std::map out_headers; param_vec_t params; bufferlist::iterator *send_iter; @@ -23,11 +23,11 @@ protected: size_t max_response; /* we need this as we don't stream out response */ bufferlist response; - virtual int handle_header(const string& name, const string& val); - void get_params_str(map& extra_args, string& dest); + virtual int handle_header(const std::string& name, const std::string& val); + void get_params_str(std::map& extra_args, std::string& dest); public: - RGWHTTPSimpleRequest(CephContext *_cct, const string& _method, const string& _url, + RGWHTTPSimpleRequest(CephContext *_cct, const std::string& _method, const std::string& _url, param_vec_t *_headers, param_vec_t *_params) : RGWHTTPClient(_cct, _method, _url), http_status(0), status(0), send_iter(NULL), @@ -52,7 +52,7 @@ public: bufferlist& get_response() { return response; } - void get_out_headers(map *pheaders); /* modifies out_headers */ + void get_out_headers(std::map *pheaders); /* modifies out_headers */ int get_http_status() { return http_status; } int get_status(); @@ -61,7 +61,7 @@ public: class RGWRESTSimpleRequest : public RGWHTTPSimpleRequest { std::optional api_name; public: - RGWRESTSimpleRequest(CephContext *_cct, const string& _method, const string& _url, + RGWRESTSimpleRequest(CephContext *_cct, const std::string& _method, const std::string& _url, param_vec_t *_headers, param_vec_t *_params, std::optional _api_name) : RGWHTTPSimpleRequest(_cct, _method, _url, _headers, _params), api_name(_api_name) {} @@ -79,25 +79,25 @@ class RGWRESTGenerateHTTPHeaders : public DoutPrefix { CephContext *cct; RGWEnv *new_env; req_info *new_info; - string region; - string service; - string method; - string url; - string resource; + std::string region; + std::string service; + std::string method; + std::string url; + std::string resource; public: RGWRESTGenerateHTTPHeaders(CephContext *_cct, RGWEnv *_env, req_info *_info); - void init(const string& method, const string& host, - const string& resource_prefix, const string& url, - const string& resource, const param_vec_t& params, - std::optional api_name); - void set_extra_headers(const map& extra_headers); - int set_obj_attrs(const DoutPrefixProvider *dpp, map& rgw_attrs); - void set_http_attrs(const map& http_attrs); + void init(const std::string& method, const std::string& host, + const std::string& resource_prefix, const std::string& url, + const std::string& resource, const param_vec_t& params, + std::optional api_name); + void set_extra_headers(const std::map& extra_headers); + int set_obj_attrs(const DoutPrefixProvider *dpp, std::map& rgw_attrs); + void set_http_attrs(const std::map& http_attrs); void set_policy(RGWAccessControlPolicy& policy); int sign(const DoutPrefixProvider *dpp, RGWAccessKey& key, const bufferlist *opt_content); - const string& get_url() { return url; } + const std::string& get_url() { return url; } }; class RGWHTTPStreamRWRequest : public RGWHTTPSimpleRequest { @@ -122,7 +122,7 @@ private: protected: bufferlist outbl; - int handle_header(const string& name, const string& val) override; + int handle_header(const std::string& name, const std::string& val) override; public: int send_data(void *ptr, size_t len, bool *pause) override; int receive_data(void *ptr, size_t len, bool *pause) override; @@ -139,10 +139,10 @@ public: } }; - RGWHTTPStreamRWRequest(CephContext *_cct, const string& _method, const string& _url, + RGWHTTPStreamRWRequest(CephContext *_cct, const std::string& _method, const std::string& _url, param_vec_t *_headers, param_vec_t *_params) : RGWHTTPSimpleRequest(_cct, _method, _url, _headers, _params) { } - RGWHTTPStreamRWRequest(CephContext *_cct, const string& _method, const string& _url, ReceiveCB *_cb, + RGWHTTPStreamRWRequest(CephContext *_cct, const std::string& _method, const std::string& _url, ReceiveCB *_cb, param_vec_t *_headers, param_vec_t *_params) : RGWHTTPSimpleRequest(_cct, _method, _url, _headers, _params), cb(_cb) { } @@ -167,11 +167,11 @@ public: void finish_write(); int complete_request(optional_yield y, - string *etag = nullptr, + std::string *etag = nullptr, real_time *mtime = nullptr, uint64_t *psize = nullptr, - map *pattrs = nullptr, - map *pheaders = nullptr); + std::map *pattrs = nullptr, + std::map *pheaders = nullptr); }; class RGWRESTStreamRWRequest : public RGWHTTPStreamRWRequest { @@ -181,10 +181,10 @@ class RGWRESTStreamRWRequest : public RGWHTTPStreamRWRequest { req_info new_info; protected: - std::optional api_name; + std::optional api_name; HostStyle host_style; public: - RGWRESTStreamRWRequest(CephContext *_cct, const string& _method, const string& _url, RGWHTTPStreamRWRequest::ReceiveCB *_cb, + RGWRESTStreamRWRequest(CephContext *_cct, const std::string& _method, const std::string& _url, RGWHTTPStreamRWRequest::ReceiveCB *_cb, param_vec_t *_headers, param_vec_t *_params, std::optional _api_name, HostStyle _host_style = PathStyle) : RGWHTTPStreamRWRequest(_cct, _method, _url, _cb, _headers, _params), @@ -193,41 +193,41 @@ public: } virtual ~RGWRESTStreamRWRequest() override {} - int send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey *key, map& extra_headers, const string& resource, bufferlist *send_data = nullptr /* optional input data */); - int send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey& key, map& extra_headers, const rgw_obj& obj); + int send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey *key, std::map& extra_headers, const std::string& resource, bufferlist *send_data = nullptr /* optional input data */); + int send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey& key, std::map& extra_headers, const rgw_obj& obj); int send(RGWHTTPManager *mgr); - int send_request(const DoutPrefixProvider *dpp, RGWAccessKey& key, map& extra_headers, const rgw_obj& obj, RGWHTTPManager *mgr); - int send_request(const DoutPrefixProvider *dpp, RGWAccessKey *key, map& extra_headers, const string& resource, RGWHTTPManager *mgr, bufferlist *send_data = nullptr /* optional input data */); + int send_request(const DoutPrefixProvider *dpp, RGWAccessKey& key, std::map& extra_headers, const rgw_obj& obj, RGWHTTPManager *mgr); + int send_request(const DoutPrefixProvider *dpp, RGWAccessKey *key, std::map& extra_headers, const std::string& resource, RGWHTTPManager *mgr, bufferlist *send_data = nullptr /* optional input data */); void add_params(param_vec_t *params); private: - int do_send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey *key, map& extra_headers, const string& resource, bufferlist *send_data = nullptr /* optional input data */); + int do_send_prepare(const DoutPrefixProvider *dpp, RGWAccessKey *key, std::map& extra_headers, const std::string& resource, bufferlist *send_data = nullptr /* optional input data */); }; class RGWRESTStreamReadRequest : public RGWRESTStreamRWRequest { public: - RGWRESTStreamReadRequest(CephContext *_cct, const string& _url, ReceiveCB *_cb, param_vec_t *_headers, + RGWRESTStreamReadRequest(CephContext *_cct, const std::string& _url, ReceiveCB *_cb, param_vec_t *_headers, param_vec_t *_params, std::optional _api_name, HostStyle _host_style = PathStyle) : RGWRESTStreamRWRequest(_cct, "GET", _url, _cb, _headers, _params, _api_name, _host_style) {} }; class RGWRESTStreamHeadRequest : public RGWRESTStreamRWRequest { public: - RGWRESTStreamHeadRequest(CephContext *_cct, const string& _url, ReceiveCB *_cb, param_vec_t *_headers, + RGWRESTStreamHeadRequest(CephContext *_cct, const std::string& _url, ReceiveCB *_cb, param_vec_t *_headers, param_vec_t *_params, std::optional _api_name) : RGWRESTStreamRWRequest(_cct, "HEAD", _url, _cb, _headers, _params, _api_name) {} }; class RGWRESTStreamS3PutObj : public RGWHTTPStreamRWRequest { - std::optional api_name; + std::optional api_name; HostStyle host_style; RGWGetDataCB *out_cb; RGWEnv new_env; req_info new_info; RGWRESTGenerateHTTPHeaders headers_gen; public: - RGWRESTStreamS3PutObj(CephContext *_cct, const string& _method, const string& _url, param_vec_t *_headers, + RGWRESTStreamS3PutObj(CephContext *_cct, const std::string& _method, const std::string& _url, param_vec_t *_headers, param_vec_t *_params, std::optional _api_name, HostStyle _host_style) : RGWHTTPStreamRWRequest(_cct, _method, _url, nullptr, _headers, _params), api_name(_api_name), host_style(_host_style), @@ -235,12 +235,12 @@ public: ~RGWRESTStreamS3PutObj() override; void send_init(rgw::sal::Object* obj); - void send_ready(const DoutPrefixProvider *dpp, RGWAccessKey& key, map& rgw_attrs); - void send_ready(const DoutPrefixProvider *dpp, RGWAccessKey& key, const map& http_attrs, + void send_ready(const DoutPrefixProvider *dpp, RGWAccessKey& key, std::map& rgw_attrs); + void send_ready(const DoutPrefixProvider *dpp, RGWAccessKey& key, const std::map& http_attrs, RGWAccessControlPolicy& policy); void send_ready(const DoutPrefixProvider *dpp, RGWAccessKey& key); - void put_obj_init(const DoutPrefixProvider *dpp, RGWAccessKey& key, rgw::sal::Object* obj, map& attrs); + void put_obj_init(const DoutPrefixProvider *dpp, RGWAccessKey& key, rgw::sal::Object* obj, std::map& attrs); RGWGetDataCB *get_out_cb() { return out_cb; } }; diff --git a/src/rgw/rgw_rest_config.cc b/src/rgw/rgw_rest_config.cc index 299ed28eb6ba3..f0b7c60bce38b 100644 --- a/src/rgw/rgw_rest_config.cc +++ b/src/rgw/rgw_rest_config.cc @@ -30,6 +30,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + void RGWOp_ZoneGroupMap_Get::execute(optional_yield y) { op_ret = zonegroup_map.read(this, g_ceph_context, static_cast(store)->svc()->sysobj, y); if (op_ret < 0) { diff --git a/src/rgw/rgw_rest_conn.cc b/src/rgw/rgw_rest_conn.cc index 04293d64c7987..ff966d6ff3f76 100644 --- a/src/rgw/rgw_rest_conn.cc +++ b/src/rgw/rgw_rest_conn.cc @@ -10,6 +10,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + RGWRESTConn::RGWRESTConn(CephContext *_cct, RGWSI_Zone *zone_svc, const string& _remote_id, const list& remote_endpoints, diff --git a/src/rgw/rgw_rest_conn.h b/src/rgw/rgw_rest_conn.h index fefa56ca0266f..e0e1b12abe5d7 100644 --- a/src/rgw/rgw_rest_conn.h +++ b/src/rgw/rgw_rest_conn.h @@ -41,14 +41,14 @@ struct rgw_http_param_pair { inline void append_param_list(param_vec_t& params, const rgw_http_param_pair* pp) { while (pp && pp->key) { - string k = pp->key; - string v = (pp->val ? pp->val : ""); + std::string k = pp->key; + std::string v = (pp->val ? pp->val : ""); params.emplace_back(make_pair(std::move(k), std::move(v))); ++pp; } } -// copy a null-terminated rgw_http_param_pair list into a list of string pairs +// copy a null-terminated rgw_http_param_pair list into a list of std::string pairs inline param_vec_t make_param_list(const rgw_http_param_pair* pp) { param_vec_t params; @@ -56,7 +56,7 @@ inline param_vec_t make_param_list(const rgw_http_param_pair* pp) return params; } -inline param_vec_t make_param_list(const map *pp) +inline param_vec_t make_param_list(const std::map *pp) { param_vec_t params; if (!pp) { @@ -71,11 +71,11 @@ inline param_vec_t make_param_list(const map *pp) class RGWRESTConn { CephContext *cct; - vector endpoints; + std::vector endpoints; RGWAccessKey key; - string self_zone_group; - string remote_id; - std::optional api_name; + std::string self_zone_group; + std::string remote_id; + std::optional api_name; HostStyle host_style; std::atomic counter = { 0 }; @@ -83,29 +83,29 @@ public: RGWRESTConn(CephContext *_cct, RGWSI_Zone *zone_svc, - const string& _remote_id, - const list& endpoints, - std::optional _api_name, + const std::string& _remote_id, + const std::list& endpoints, + std::optional _api_name, HostStyle _host_style = PathStyle); RGWRESTConn(CephContext *_cct, rgw::sal::Store* store, - const string& _remote_id, - const list& endpoints, - std::optional _api_name, + const std::string& _remote_id, + const std::list& endpoints, + std::optional _api_name, HostStyle _host_style = PathStyle); RGWRESTConn(CephContext *_cct, RGWSI_Zone *zone_svc, - const string& _remote_id, - const list& endpoints, + const std::string& _remote_id, + const std::list& endpoints, RGWAccessKey _cred, - std::optional _api_name, + std::optional _api_name, HostStyle _host_style = PathStyle); RGWRESTConn(CephContext *_cct, rgw::sal::Store* store, - const string& _remote_id, - const list& endpoints, + const std::string& _remote_id, + const std::list& endpoints, RGWAccessKey _cred, - std::optional _api_name, + std::optional _api_name, HostStyle _host_style = PathStyle); // custom move needed for atomic @@ -113,19 +113,19 @@ public: RGWRESTConn& operator=(RGWRESTConn&& other); virtual ~RGWRESTConn() = default; - int get_url(string& endpoint); - string get_url(); - const string& get_self_zonegroup() { + int get_url(std::string& endpoint); + std::string get_url(); + const std::string& get_self_zonegroup() { return self_zone_group; } - const string& get_remote_id() { + const std::string& get_remote_id() { return remote_id; } RGWAccessKey& get_key() { return key; } - std::optional get_api_name() const { + std::optional get_api_name() const { return api_name; } @@ -138,7 +138,7 @@ public: } size_t get_endpoint_count() const { return endpoints.size(); } - virtual void populate_params(param_vec_t& params, const rgw_user *uid, const string& zonegroup); + virtual void populate_params(param_vec_t& params, const rgw_user *uid, const std::string& zonegroup); /* sync request */ int forward(const DoutPrefixProvider *dpp, const rgw_user& uid, req_info& info, obj_version *objv, size_t max_response, bufferlist *inbl, bufferlist *outbl, optional_yield y); @@ -147,8 +147,8 @@ public: /* async requests */ int put_obj_send_init(rgw::sal::Object* obj, const rgw_http_param_pair *extra_params, RGWRESTStreamS3PutObj **req); int put_obj_async_init(const DoutPrefixProvider *dpp, const rgw_user& uid, rgw::sal::Object* obj, - map& attrs, RGWRESTStreamS3PutObj **req); - int complete_request(RGWRESTStreamS3PutObj *req, string& etag, + std::map& attrs, RGWRESTStreamS3PutObj **req); + int complete_request(RGWRESTStreamS3PutObj *req, std::string& etag, ceph::real_time *mtime, optional_yield y); struct get_obj_params { @@ -158,7 +158,7 @@ public: const ceph::real_time *unmod_ptr{nullptr}; bool high_precision_time{true}; - string etag; + std::string etag; uint32_t mod_zone_id{0}; uint64_t mod_pg_ver{0}; @@ -184,41 +184,41 @@ public: bool prepend_metadata, bool get_op, bool rgwx_stat, bool sync_manifest, bool skip_decrypt, bool send, RGWHTTPStreamRWRequest::ReceiveCB *cb, RGWRESTStreamRWRequest **req); int complete_request(RGWRESTStreamRWRequest *req, - string *etag, + std::string *etag, ceph::real_time *mtime, uint64_t *psize, - map *pattrs, - map *pheaders, + std::map *pattrs, + std::map *pheaders, optional_yield y); int get_resource(const DoutPrefixProvider *dpp, - const string& resource, + const std::string& resource, param_vec_t *extra_params, - map* extra_headers, + std::map* extra_headers, bufferlist& bl, bufferlist *send_data, RGWHTTPManager *mgr, optional_yield y); template - int get_json_resource(const DoutPrefixProvider *dpp, const string& resource, param_vec_t *params, + int get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, param_vec_t *params, bufferlist *in_data, optional_yield y, T& t); template - int get_json_resource(const DoutPrefixProvider *dpp, const string& resource, param_vec_t *params, + int get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, param_vec_t *params, optional_yield y, T& t); template - int get_json_resource(const DoutPrefixProvider *dpp, const string& resource, const rgw_http_param_pair *pp, + int get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, const rgw_http_param_pair *pp, optional_yield y, T& t); private: - void populate_zonegroup(param_vec_t& params, const string& zonegroup) { + void populate_zonegroup(param_vec_t& params, const std::string& zonegroup) { if (!zonegroup.empty()) { params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "zonegroup", zonegroup)); } } void populate_uid(param_vec_t& params, const rgw_user *uid) { if (uid) { - string uid_str = uid->to_str(); + std::string uid_str = uid->to_str(); if (!uid->empty()){ params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "uid", uid_str)); } @@ -230,20 +230,20 @@ class S3RESTConn : public RGWRESTConn { public: - S3RESTConn(CephContext *_cct, RGWSI_Zone *svc_zone, const string& _remote_id, const list& endpoints, std::optional _api_name, HostStyle _host_style = PathStyle) : + S3RESTConn(CephContext *_cct, RGWSI_Zone *svc_zone, const std::string& _remote_id, const std::list& endpoints, std::optional _api_name, HostStyle _host_style = PathStyle) : RGWRESTConn(_cct, svc_zone, _remote_id, endpoints, _api_name, _host_style) {} - S3RESTConn(CephContext *_cct, rgw::sal::Store* store, const string& _remote_id, const list& endpoints, std::optional _api_name, HostStyle _host_style = PathStyle) : + S3RESTConn(CephContext *_cct, rgw::sal::Store* store, const std::string& _remote_id, const std::list& endpoints, std::optional _api_name, HostStyle _host_style = PathStyle) : RGWRESTConn(_cct, store, _remote_id, endpoints, _api_name, _host_style) {} - S3RESTConn(CephContext *_cct, RGWSI_Zone *svc_zone, const string& _remote_id, const list& endpoints, RGWAccessKey _cred, std::optional _api_name, HostStyle _host_style = PathStyle): + S3RESTConn(CephContext *_cct, RGWSI_Zone *svc_zone, const std::string& _remote_id, const std::list& endpoints, RGWAccessKey _cred, std::optional _api_name, HostStyle _host_style = PathStyle): RGWRESTConn(_cct, svc_zone, _remote_id, endpoints, _cred, _api_name, _host_style) {} - S3RESTConn(CephContext *_cct, rgw::sal::Store* store, const string& _remote_id, const list& endpoints, RGWAccessKey _cred, std::optional _api_name, HostStyle _host_style = PathStyle): + S3RESTConn(CephContext *_cct, rgw::sal::Store* store, const std::string& _remote_id, const std::list& endpoints, RGWAccessKey _cred, std::optional _api_name, HostStyle _host_style = PathStyle): RGWRESTConn(_cct, store, _remote_id, endpoints, _cred, _api_name, _host_style) {} ~S3RESTConn() override = default; - void populate_params(param_vec_t& params, const rgw_user *uid, const string& zonegroup) override { + void populate_params(param_vec_t& params, const rgw_user *uid, const std::string& zonegroup) override { // do not populate any params in S3 REST Connection. return; } @@ -251,7 +251,7 @@ public: template -int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const string& resource, param_vec_t *params, +int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, param_vec_t *params, bufferlist *in_data, optional_yield y, T& t) { bufferlist bl; @@ -269,14 +269,14 @@ int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const string& } template -int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const string& resource, param_vec_t *params, +int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, param_vec_t *params, optional_yield y, T& t) { return get_json_resource(dpp, resource, params, nullptr, y, t); } template -int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const string& resource, const rgw_http_param_pair *pp, +int RGWRESTConn::get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, const rgw_http_param_pair *pp, optional_yield y, T& t) { param_vec_t params = make_param_list(pp); @@ -296,9 +296,9 @@ public: class RGWRESTReadResource : public RefCountedObject, public RGWIOProvider { CephContext *cct; RGWRESTConn *conn; - string resource; + std::string resource; param_vec_t params; - map headers; + std::map headers; bufferlist bl; RGWStreamIntoBufferlist cb; @@ -309,13 +309,13 @@ class RGWRESTReadResource : public RefCountedObject, public RGWIOProvider { public: RGWRESTReadResource(RGWRESTConn *_conn, - const string& _resource, + const std::string& _resource, const rgw_http_param_pair *pp, param_vec_t *extra_headers, RGWHTTPManager *_mgr); RGWRESTReadResource(RGWRESTConn *_conn, - const string& _resource, + const std::string& _resource, param_vec_t& _params, param_vec_t *extra_headers, RGWHTTPManager *_mgr); @@ -340,7 +340,7 @@ public: int aio_read(const DoutPrefixProvider *dpp); - string to_str() { + std::string to_str() { return req.to_str(); } @@ -416,10 +416,10 @@ int RGWRESTReadResource::wait(T *dest, optional_yield y) class RGWRESTSendResource : public RefCountedObject, public RGWIOProvider { CephContext *cct; RGWRESTConn *conn; - string method; - string resource; + std::string method; + std::string resource; param_vec_t params; - map headers; + std::map headers; bufferlist bl; RGWStreamIntoBufferlist cb; @@ -430,15 +430,15 @@ class RGWRESTSendResource : public RefCountedObject, public RGWIOProvider { public: RGWRESTSendResource(RGWRESTConn *_conn, - const string& _method, - const string& _resource, + const std::string& _method, + const std::string& _resource, const rgw_http_param_pair *pp, param_vec_t *extra_headers, RGWHTTPManager *_mgr); RGWRESTSendResource(RGWRESTConn *_conn, - const string& _method, - const string& _resource, + const std::string& _method, + const std::string& _resource, param_vec_t& params, param_vec_t *extra_headers, RGWHTTPManager *_mgr); @@ -461,7 +461,7 @@ public: int aio_send(const DoutPrefixProvider *dpp, bufferlist& bl); - string to_str() { + std::string to_str() { return req.to_str(); } @@ -512,14 +512,14 @@ int RGWRESTSendResource::wait(T *dest, optional_yield y, E *err_result) class RGWRESTPostResource : public RGWRESTSendResource { public: RGWRESTPostResource(RGWRESTConn *_conn, - const string& _resource, + const std::string& _resource, const rgw_http_param_pair *pp, param_vec_t *extra_headers, RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "POST", _resource, pp, extra_headers, _mgr) {} RGWRESTPostResource(RGWRESTConn *_conn, - const string& _resource, + const std::string& _resource, param_vec_t& params, param_vec_t *extra_headers, RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "POST", _resource, @@ -530,14 +530,14 @@ public: class RGWRESTPutResource : public RGWRESTSendResource { public: RGWRESTPutResource(RGWRESTConn *_conn, - const string& _resource, + const std::string& _resource, const rgw_http_param_pair *pp, param_vec_t *extra_headers, RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "PUT", _resource, pp, extra_headers, _mgr) {} RGWRESTPutResource(RGWRESTConn *_conn, - const string& _resource, + const std::string& _resource, param_vec_t& params, param_vec_t *extra_headers, RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "PUT", _resource, @@ -548,14 +548,14 @@ public: class RGWRESTDeleteResource : public RGWRESTSendResource { public: RGWRESTDeleteResource(RGWRESTConn *_conn, - const string& _resource, + const std::string& _resource, const rgw_http_param_pair *pp, param_vec_t *extra_headers, RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "DELETE", _resource, pp, extra_headers, _mgr) {} RGWRESTDeleteResource(RGWRESTConn *_conn, - const string& _resource, + const std::string& _resource, param_vec_t& params, param_vec_t *extra_headers, RGWHTTPManager *_mgr) : RGWRESTSendResource(_conn, "DELETE", _resource, diff --git a/src/rgw/rgw_rest_iam.cc b/src/rgw/rgw_rest_iam.cc index 9a95cdb254fb3..bbc2e412f5a50 100644 --- a/src/rgw/rgw_rest_iam.cc +++ b/src/rgw/rgw_rest_iam.cc @@ -16,6 +16,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + void RGWHandler_REST_IAM::rgw_iam_parse_input() { if (post_body.size() > 0) { diff --git a/src/rgw/rgw_rest_iam.h b/src/rgw/rgw_rest_iam.h index 4d3b6b0af3d98..0822f6f7e6893 100644 --- a/src/rgw/rgw_rest_iam.h +++ b/src/rgw/rgw_rest_iam.h @@ -9,14 +9,15 @@ class RGWHandler_REST_IAM : public RGWHandler_REST { const rgw::auth::StrategyRegistry& auth_registry; - const string& post_body; + const std::string& post_body; RGWOp *op_post() override; void rgw_iam_parse_input(); public: static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format); - RGWHandler_REST_IAM(const rgw::auth::StrategyRegistry& auth_registry, const string& post_body="") + RGWHandler_REST_IAM(const rgw::auth::StrategyRegistry& auth_registry, + const std::string& post_body="") : RGWHandler_REST(), auth_registry(auth_registry), post_body(post_body) {} diff --git a/src/rgw/rgw_rest_log.cc b/src/rgw/rgw_rest_log.cc index 58d37703a261e..348c3952dbfb1 100644 --- a/src/rgw/rgw_rest_log.cc +++ b/src/rgw/rgw_rest_log.cc @@ -37,6 +37,8 @@ #define LOG_CLASS_LIST_MAX_ENTRIES (1000) #define dout_subsys ceph_subsys_rgw +using namespace std; + void RGWOp_MDLog_List::execute(optional_yield y) { string period = s->info.args.get("period"); string shard = s->info.args.get("id"); diff --git a/src/rgw/rgw_rest_log.h b/src/rgw/rgw_rest_log.h index 58d8b563cd255..9068165b64550 100644 --- a/src/rgw/rgw_rest_log.h +++ b/src/rgw/rgw_rest_log.h @@ -34,7 +34,7 @@ public: return check_caps(s->user->get_caps()); } void send_response() override; - virtual void send_response(list& entries, string& marker); + virtual void send_response(std::list& entries, std::string& marker); virtual void send_response_end(); void execute(optional_yield y) override; const char* name() const override { @@ -43,9 +43,9 @@ public: }; class RGWOp_BILog_Info : public RGWRESTOp { - string bucket_ver; - string master_ver; - string max_marker; + std::string bucket_ver; + std::string master_ver; + std::string max_marker; bool syncstopped; public: RGWOp_BILog_Info() : bucket_ver(), master_ver(), syncstopped(false) {} @@ -79,8 +79,8 @@ public: }; class RGWOp_MDLog_List : public RGWRESTOp { - list entries; - string last_marker; + std::list entries; + std::string last_marker; bool truncated; public: RGWOp_MDLog_List() : truncated(false) {} diff --git a/src/rgw/rgw_rest_metadata.cc b/src/rgw/rgw_rest_metadata.cc index 1d84ee399d0ad..52303b871dcca 100644 --- a/src/rgw/rgw_rest_metadata.cc +++ b/src/rgw/rgw_rest_metadata.cc @@ -30,6 +30,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + static inline void frame_metadata_key(req_state *s, string& out) { bool exists; string key = s->info.args.get("key", &exists); diff --git a/src/rgw/rgw_rest_metadata.h b/src/rgw/rgw_rest_metadata.h index 13691ac3a2076..dd512c8ea768f 100644 --- a/src/rgw/rgw_rest_metadata.h +++ b/src/rgw/rgw_rest_metadata.h @@ -52,7 +52,7 @@ public: class RGWOp_Metadata_Put : public RGWRESTOp { int get_data(bufferlist& bl); - string update_status; + std::string update_status; obj_version ondisk_version; public: RGWOp_Metadata_Put() {} diff --git a/src/rgw/rgw_rest_oidc_provider.cc b/src/rgw/rgw_rest_oidc_provider.cc index 21d35e2c33d18..1a4dca23c8adc 100644 --- a/src/rgw/rgw_rest_oidc_provider.cc +++ b/src/rgw/rgw_rest_oidc_provider.cc @@ -20,6 +20,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + int RGWRestOIDCProvider::verify_permission(optional_yield y) { if (s->auth.identity->is_anonymous()) { diff --git a/src/rgw/rgw_rest_oidc_provider.h b/src/rgw/rgw_rest_oidc_provider.h index b75dcc799f66d..33535c6b5123d 100644 --- a/src/rgw/rgw_rest_oidc_provider.h +++ b/src/rgw/rgw_rest_oidc_provider.h @@ -8,10 +8,10 @@ class RGWRestOIDCProvider : public RGWRESTOp { protected: - vector client_ids; - vector thumbprints; - string provider_url; //'iss' field in JWT - string provider_arn; + std::vector client_ids; + std::vector thumbprints; + std::string provider_url; //'iss' field in JWT + std::string provider_arn; public: int verify_permission(optional_yield y) override; void send_response() override; diff --git a/src/rgw/rgw_rest_pubsub.cc b/src/rgw/rgw_rest_pubsub.cc index 418f41c029c45..32fd0b581a40a 100644 --- a/src/rgw/rgw_rest_pubsub.cc +++ b/src/rgw/rgw_rest_pubsub.cc @@ -21,6 +21,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + static const char* AWS_SNS_NS("https://sns.amazonaws.com/doc/2010-03-31/"); // command (AWS compliant): diff --git a/src/rgw/rgw_rest_pubsub_common.h b/src/rgw/rgw_rest_pubsub_common.h index f42a40e2fd1e5..a702cf3420414 100644 --- a/src/rgw/rgw_rest_pubsub_common.h +++ b/src/rgw/rgw_rest_pubsub_common.h @@ -82,7 +82,7 @@ public: // delete a topic class RGWPSDeleteTopicOp : public RGWDefaultResponseOp { protected: - string topic_name; + std::string topic_name; std::optional ps; virtual int get_params() = 0; @@ -229,7 +229,7 @@ public: class RGWPSCreateNotifOp : public RGWDefaultResponseOp { protected: std::optional ps; - string bucket_name; + std::string bucket_name; RGWBucketInfo bucket_info; virtual int get_params() = 0; diff --git a/src/rgw/rgw_rest_realm.cc b/src/rgw/rgw_rest_realm.cc index 24925c55e890b..6f4ebee800200 100644 --- a/src/rgw/rgw_rest_realm.cc +++ b/src/rgw/rgw_rest_realm.cc @@ -15,6 +15,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + // reject 'period push' if we would have to fetch too many intermediate periods static const uint32_t PERIOD_HISTORY_FETCH_MAX = 64; diff --git a/src/rgw/rgw_rest_role.cc b/src/rgw/rgw_rest_role.cc index 18dd15f7374c9..6ae8e67d1ed18 100644 --- a/src/rgw/rgw_rest_role.cc +++ b/src/rgw/rgw_rest_role.cc @@ -19,6 +19,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + int RGWRestRole::verify_permission(optional_yield y) { if (s->auth.identity->is_anonymous()) { diff --git a/src/rgw/rgw_rest_role.h b/src/rgw/rgw_rest_role.h index 4dc04186dc41a..30bf0446bb8a2 100644 --- a/src/rgw/rgw_rest_role.h +++ b/src/rgw/rgw_rest_role.h @@ -10,13 +10,13 @@ class RGWRestRole : public RGWRESTOp { protected: - string role_name; - string role_path; - string trust_policy; - string policy_name; - string perm_policy; - string path_prefix; - string max_session_duration; + std::string role_name; + std::string role_path; + std::string trust_policy; + std::string policy_name; + std::string perm_policy; + std::string path_prefix; + std::string max_session_duration; std::unique_ptr _role; public: int verify_permission(optional_yield y) override; diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 8b671454cfaef..4ca77ee6ddf5f 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -70,11 +70,10 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; using namespace rgw; using namespace ceph::crypto; -using std::get; - void list_all_buckets_start(struct req_state *s) { s->formatter->open_array_section_in_ns("ListAllMyBucketsResult", XMLNS_AWS_S3); diff --git a/src/rgw/rgw_rest_s3.h b/src/rgw/rgw_rest_s3.h index 7e2d787cf9797..fd539a2553b23 100644 --- a/src/rgw/rgw_rest_s3.h +++ b/src/rgw/rgw_rest_s3.h @@ -170,8 +170,8 @@ class RGWListBucket_ObjStore_S3v2 : public RGWListBucket_ObjStore_S3 { bool fetchOwner; bool start_after_exist; bool continuation_token_exist; - string startAfter; - string continuation_token; + std::string startAfter; + std::string continuation_token; public: RGWListBucket_ObjStore_S3v2() : fetchOwner(false) { } @@ -281,7 +281,7 @@ public: rgw::sal::DataProcessor *cb) override; int get_decrypt_filter(std::unique_ptr* filter, RGWGetObj_Filter* cb, - map& attrs, + std::map& attrs, bufferlist* manifest_bl) override; }; @@ -291,7 +291,7 @@ class RGWPostObj_ObjStore_S3 : public RGWPostObj_ObjStore { std::string content_type; RGWPolicyEnv env; RGWPolicy post_policy; - map crypt_http_responses; + std::map crypt_http_responses; const rgw::auth::StrategyRegistry* auth_registry_ptr = nullptr; @@ -355,7 +355,7 @@ public: RGWPutACLs_ObjStore_S3() {} ~RGWPutACLs_ObjStore_S3() override {} - int get_policy_from_state(rgw::sal::Store* store, struct req_state *s, stringstream& ss) override; + int get_policy_from_state(rgw::sal::Store* store, struct req_state *s, std::stringstream& ss) override; void send_response() override; int get_params(optional_yield y) override; }; @@ -470,7 +470,7 @@ public: int get_params(optional_yield y) override; void send_response() override; - int prepare_encryption(map& attrs) override; + int prepare_encryption(std::map& attrs) override; }; class RGWCompleteMultipart_ObjStore_S3 : public RGWCompleteMultipart_ObjStore { @@ -517,7 +517,7 @@ public: void send_status() override; void begin_response() override; void send_partial_response(rgw_obj_key& key, bool delete_marker, - const string& marker_version_id, int ret) override; + const std::string& marker_version_id, int ret) override; void end_response() override; }; @@ -632,8 +632,8 @@ public: } ~RGWHandler_Auth_S3() override = default; - static int validate_bucket_name(const string& bucket); - static int validate_object_name(const string& bucket); + static int validate_bucket_name(const std::string& bucket); + static int validate_object_name(const std::string& bucket); int init(rgw::sal::Store* store, struct req_state *s, @@ -827,7 +827,7 @@ static inline bool looks_like_ip_address(const char *bucket) return (num_periods == 3); } -inline int valid_s3_object_name(const string& name) { +inline int valid_s3_object_name(const std::string& name) { if (name.size() > 1024) { return -ERR_INVALID_OBJECT_NAME; } @@ -837,7 +837,7 @@ inline int valid_s3_object_name(const string& name) { return 0; } -inline int valid_s3_bucket_name(const string& name, bool relaxed=false) +inline int valid_s3_bucket_name(const std::string& name, bool relaxed=false) { // This function enforces Amazon's spec for bucket names. // (The requirements, not the recommendations.) diff --git a/src/rgw/rgw_rest_s3website.h b/src/rgw/rgw_rest_s3website.h index 36bf6f94a0406..33d816aed30a1 100644 --- a/src/rgw/rgw_rest_s3website.h +++ b/src/rgw/rgw_rest_s3website.h @@ -35,13 +35,13 @@ protected: RGWOp *op_copy() override { return NULL; } RGWOp *op_options() override { return NULL; } - int serve_errordoc(const DoutPrefixProvider *dpp, int http_ret, const string &errordoc_key, optional_yield y); + int serve_errordoc(const DoutPrefixProvider *dpp, int http_ret, const std::string &errordoc_key, optional_yield y); public: using RGWHandler_REST_S3::RGWHandler_REST_S3; ~RGWHandler_REST_S3Website() override = default; int init(rgw::sal::Store* store, req_state *s, rgw::io::BasicClient* cio) override; - int error_handler(int err_no, string *error_content, optional_yield y) override; + int error_handler(int err_no, std::string *error_content, optional_yield y) override; }; class RGWHandler_REST_Service_S3Website : public RGWHandler_REST_S3Website { diff --git a/src/rgw/rgw_rest_sts.cc b/src/rgw/rgw_rest_sts.cc index 7d51d699b6467..561bb4322fd53 100644 --- a/src/rgw/rgw_rest_sts.cc +++ b/src/rgw/rgw_rest_sts.cc @@ -41,6 +41,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + namespace rgw::auth::sts { bool diff --git a/src/rgw/rgw_rest_sts.h b/src/rgw/rgw_rest_sts.h index 396b3cbe52b94..741072fe82998 100644 --- a/src/rgw/rgw_rest_sts.h +++ b/src/rgw/rgw_rest_sts.h @@ -25,20 +25,20 @@ class WebTokenEngine : public rgw::auth::Engine { bool is_applicable(const std::string& token) const noexcept; - bool is_client_id_valid(vector& client_ids, const string& client_id) const; + bool is_client_id_valid(std::vector& client_ids, const std::string& client_id) const; - bool is_cert_valid(const vector& thumbprints, const string& cert) const; + bool is_cert_valid(const std::vector& thumbprints, const std::string& cert) const; - std::unique_ptr get_provider(const DoutPrefixProvider *dpp, const string& role_arn, const string& iss) const; + std::unique_ptr get_provider(const DoutPrefixProvider *dpp, const std::string& role_arn, const std::string& iss) const; - std::string get_role_tenant(const string& role_arn) const; + std::string get_role_tenant(const std::string& role_arn) const; - std::string get_cert_url(const string& iss, const DoutPrefixProvider *dpp,optional_yield y) const; + std::string get_cert_url(const std::string& iss, const DoutPrefixProvider *dpp,optional_yield y) const; boost::optional get_from_jwt(const DoutPrefixProvider* dpp, const std::string& token, const req_state* const s, optional_yield y) const; - void validate_signature (const DoutPrefixProvider* dpp, const jwt::decoded_jwt& decoded, const string& algorithm, const string& iss, const vector& thumbprints, optional_yield y) const; + void validate_signature (const DoutPrefixProvider* dpp, const jwt::decoded_jwt& decoded, const std::string& algorithm, const std::string& iss, const std::vector& thumbprints, optional_yield y) const; result_t authenticate(const DoutPrefixProvider* dpp, const std::string& token, @@ -82,8 +82,8 @@ class DefaultStrategy : public rgw::auth::Strategy, aplptr_t create_apl_web_identity( CephContext* cct, const req_state* s, - const string& role_session, - const string& role_tenant, + const std::string& role_session, + const std::string& role_tenant, const rgw::web_idp::WebTokenClaims& token) const override { auto apl = rgw::auth::add_sysreq(cct, store, s, rgw::auth::WebIdentityApplier(cct, store, role_session, role_tenant, token)); @@ -123,14 +123,14 @@ public: class RGWSTSAssumeRoleWithWebIdentity : public RGWREST_STS { protected: - string duration; - string providerId; - string policy; - string roleArn; - string roleSessionName; - string sub; - string aud; - string iss; + std::string duration; + std::string providerId; + std::string policy; + std::string roleArn; + std::string roleSessionName; + std::string sub; + std::string aud; + std::string iss; public: RGWSTSAssumeRoleWithWebIdentity() = default; void execute(optional_yield y) override; @@ -141,13 +141,13 @@ public: class RGWSTSAssumeRole : public RGWREST_STS { protected: - string duration; - string externalId; - string policy; - string roleArn; - string roleSessionName; - string serialNumber; - string tokenCode; + std::string duration; + std::string externalId; + std::string policy; + std::string roleArn; + std::string roleSessionName; + std::string serialNumber; + std::string tokenCode; public: RGWSTSAssumeRole() = default; void execute(optional_yield y) override; @@ -158,9 +158,9 @@ public: class RGWSTSGetSessionToken : public RGWREST_STS { protected: - string duration; - string serialNumber; - string tokenCode; + std::string duration; + std::string serialNumber; + std::string tokenCode; public: RGWSTSGetSessionToken() = default; void execute(optional_yield y) override; @@ -180,14 +180,14 @@ public: class RGWHandler_REST_STS : public RGWHandler_REST { const rgw::auth::StrategyRegistry& auth_registry; - const string& post_body; + const std::string& post_body; RGWOp *op_post() override; void rgw_sts_parse_input(); public: static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format); - RGWHandler_REST_STS(const rgw::auth::StrategyRegistry& auth_registry, const string& post_body="") + RGWHandler_REST_STS(const rgw::auth::StrategyRegistry& auth_registry, const std::string& post_body="") : RGWHandler_REST(), auth_registry(auth_registry), post_body(post_body) {} diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index 832dbb8795dda..17f8850b05a55 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -39,6 +39,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + int RGWListBuckets_ObjStore_SWIFT::get_params(optional_yield y) { prefix = s->info.args.get("prefix"); diff --git a/src/rgw/rgw_rest_swift.h b/src/rgw/rgw_rest_swift.h index ffc84ed6e3f93..e799a44c65ba6 100644 --- a/src/rgw/rgw_rest_swift.h +++ b/src/rgw/rgw_rest_swift.h @@ -65,7 +65,7 @@ public: }; class RGWListBucket_ObjStore_SWIFT : public RGWListBucket_ObjStore { - string path; + std::string path; public: RGWListBucket_ObjStore_SWIFT() { default_max = 10000; @@ -78,7 +78,7 @@ public: }; class RGWStatAccount_ObjStore_SWIFT : public RGWStatAccount_ObjStore { - map attrs; + std::map attrs; public: RGWStatAccount_ObjStore_SWIFT() { } @@ -116,7 +116,7 @@ public: }; class RGWPutObj_ObjStore_SWIFT : public RGWPutObj_ObjStore { - string lo_etag; + std::string lo_etag; public: RGWPutObj_ObjStore_SWIFT() {} ~RGWPutObj_ObjStore_SWIFT() override {} @@ -235,10 +235,10 @@ protected: struct info { bool is_admin_info; - function list_data; + std::function list_data; }; - static const vector> swift_info; + static const std::vector> swift_info; public: RGWInfo_ObjStore_SWIFT() {} ~RGWInfo_ObjStore_SWIFT() override {} @@ -393,7 +393,7 @@ public: } ~RGWHandler_REST_SWIFT() override = default; - int validate_bucket_name(const string& bucket); + int validate_bucket_name(const std::string& bucket); int init(rgw::sal::Store* store, struct req_state *s, rgw::io::BasicClient *cio) override; int authorize(const DoutPrefixProvider *dpp, optional_yield y) override; diff --git a/src/rgw/rgw_rest_usage.cc b/src/rgw/rgw_rest_usage.cc index 0535269b82907..1de0abdd9a55c 100644 --- a/src/rgw/rgw_rest_usage.cc +++ b/src/rgw/rgw_rest_usage.cc @@ -10,6 +10,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + class RGWOp_Usage_Get : public RGWRESTOp { public: diff --git a/src/rgw/rgw_rest_user.cc b/src/rgw/rgw_rest_user.cc index 38ff4e1267ee5..37c13003ec536 100644 --- a/src/rgw/rgw_rest_user.cc +++ b/src/rgw/rgw_rest_user.cc @@ -17,6 +17,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + class RGWOp_User_List : public RGWRESTOp { public: diff --git a/src/rgw/rgw_rest_user_policy.cc b/src/rgw/rgw_rest_user_policy.cc index 4e98406511c83..a552f3b2b2a2e 100644 --- a/src/rgw/rgw_rest_user_policy.cc +++ b/src/rgw/rgw_rest_user_policy.cc @@ -20,6 +20,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; using rgw::IAM::Policy; void RGWRestUserPolicy::dump(Formatter *f) const diff --git a/src/rgw/rgw_rest_user_policy.h b/src/rgw/rgw_rest_user_policy.h index b8627f335c2b1..4a123456ecf18 100644 --- a/src/rgw/rgw_rest_user_policy.h +++ b/src/rgw/rgw_rest_user_policy.h @@ -7,9 +7,9 @@ class RGWRestUserPolicy : public RGWRESTOp { protected: static constexpr int MAX_POLICY_NAME_LEN = 128; - string policy_name; - string user_name; - string policy; + std::string policy_name; + std::string user_name; + std::string policy; bool validate_input(); diff --git a/src/rgw/rgw_role.cc b/src/rgw/rgw_role.cc index 78ad6327e834d..804fa892d831d 100644 --- a/src/rgw/rgw_role.cc +++ b/src/rgw/rgw_role.cc @@ -24,6 +24,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + namespace rgw { namespace sal { const string RGWRole::role_name_oid_prefix = "role_names."; diff --git a/src/rgw/rgw_role.h b/src/rgw/rgw_role.h index e94fde18ffde0..0563db8a27ff4 100644 --- a/src/rgw/rgw_role.h +++ b/src/rgw/rgw_role.h @@ -34,7 +34,7 @@ protected: std::string arn; std::string creation_date; std::string trust_policy; - map perm_policy_map; + std::map perm_policy_map; std::string tenant; uint64_t max_session_duration; @@ -120,7 +120,7 @@ public: int update(const DoutPrefixProvider *dpp, optional_yield y); void update_trust_policy(std::string& trust_policy); void set_perm_policy(const std::string& policy_name, const std::string& perm_policy); - vector get_role_policy_names(); + std::vector get_role_policy_names(); int get_role_policy(const DoutPrefixProvider* dpp, const std::string& policy_name, std::string& perm_policy); int delete_policy(const DoutPrefixProvider* dpp, const std::string& policy_name); void dump(Formatter *f) const; diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index a48b09353da7d..0c12348b44e20 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -68,12 +68,12 @@ struct RGWClusterStat { class RGWGetBucketStats_CB : public RefCountedObject { protected: rgw_bucket bucket; - map* stats; + std::map* stats; public: explicit RGWGetBucketStats_CB(const rgw_bucket& _bucket) : bucket(_bucket), stats(NULL) {} ~RGWGetBucketStats_CB() override {} virtual void handle_response(int r) = 0; - virtual void set_response(map* _stats) { + virtual void set_response(std::map* _stats) { stats = _stats; } }; @@ -210,12 +210,12 @@ class Store { virtual void get_raw_obj(const rgw_placement_rule& placement_rule, const rgw_obj& obj, rgw_raw_obj* raw_obj) = 0; virtual int get_raw_chunk_size(const DoutPrefixProvider* dpp, const rgw_raw_obj& obj, uint64_t* chunk_size) = 0; - virtual int log_usage(const DoutPrefixProvider *dpp, map& usage_info) = 0; + virtual int log_usage(const DoutPrefixProvider *dpp, std::map& usage_info) = 0; virtual int log_op(const DoutPrefixProvider *dpp, std::string& oid, bufferlist& bl) = 0; virtual int register_to_service_map(const DoutPrefixProvider *dpp, const std::string& daemon_type, - const map& meta) = 0; + const std::map& meta) = 0; virtual void get_quota(RGWQuotaInfo& bucket_quota, RGWQuotaInfo& user_quota) = 0; - virtual int set_buckets_enabled(const DoutPrefixProvider* dpp, vector& buckets, bool enabled) = 0; + virtual int set_buckets_enabled(const DoutPrefixProvider* dpp, std::vector& buckets, bool enabled) = 0; virtual uint64_t get_new_req_id() = 0; virtual int get_sync_policy_handler(const DoutPrefixProvider* dpp, std::optional zone, @@ -223,17 +223,17 @@ class Store { RGWBucketSyncPolicyHandlerRef* phandler, optional_yield y) = 0; virtual RGWDataSyncStatusManager* get_data_sync_manager(const rgw_zone_id& source_zone) = 0; - virtual void wakeup_meta_sync_shards(set& shard_ids) = 0; - virtual void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, const rgw_zone_id& source_zone, map >& shard_ids) = 0; + virtual void wakeup_meta_sync_shards(std::set& shard_ids) = 0; + virtual void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, const rgw_zone_id& source_zone, std::map >& shard_ids) = 0; virtual int clear_usage(const DoutPrefixProvider *dpp) = 0; virtual int read_all_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch, uint32_t max_entries, bool* is_truncated, RGWUsageIter& usage_iter, - map& usage) = 0; + std::map& usage) = 0; virtual int trim_all_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) = 0; virtual int get_config_key_val(std::string name, bufferlist* bl) = 0; virtual int meta_list_keys_init(const DoutPrefixProvider *dpp, const std::string& section, const std::string& marker, void** phandle) = 0; - virtual int meta_list_keys_next(const DoutPrefixProvider *dpp, void* handle, int max, list& keys, bool* truncated) = 0; + virtual int meta_list_keys_next(const DoutPrefixProvider *dpp, void* handle, int max, std::list& keys, bool* truncated) = 0; virtual void meta_list_keys_complete(void* handle) = 0; virtual std::string meta_get_marker(void* handle) = 0; virtual int meta_remove(const DoutPrefixProvider* dpp, std::string& metadata_key, optional_yield y) = 0; @@ -250,11 +250,11 @@ class Store { optional_yield y, const std::string& path_prefix, const std::string& tenant, - vector>& roles) = 0; + std::vector>& roles) = 0; virtual std::unique_ptr get_oidc_provider() = 0; virtual int get_oidc_providers(const DoutPrefixProvider *dpp, const std::string& tenant, - vector>& providers) = 0; + std::vector>& providers) = 0; virtual std::unique_ptr get_multipart_upload(Bucket* bucket, const std::string& oid, std::optional upload_id=std::nullopt, ceph::real_time mtime=real_clock::now()) = 0; virtual std::unique_ptr get_append_writer(const DoutPrefixProvider *dpp, optional_yield y, @@ -324,7 +324,7 @@ class User { virtual int complete_flush_stats(const DoutPrefixProvider *dpp, optional_yield y) = 0; virtual int read_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch, uint32_t max_entries, bool* is_truncated, RGWUsageIter& usage_iter, - map& usage) = 0; + std::map& usage) = 0; virtual int trim_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) = 0; virtual RGWObjVersionTracker& get_version_tracker() { return objv_tracker; } virtual Attrs& get_attrs() { return attrs; } @@ -337,12 +337,12 @@ class User { /* dang temporary; will be removed when User is complete */ RGWUserInfo& get_info() { return info; } - friend inline ostream& operator<<(ostream& out, const User& u) { + friend inline std::ostream& operator<<(std::ostream& out, const User& u) { out << u.info.user_id; return out; } - friend inline ostream& operator<<(ostream& out, const User* u) { + friend inline std::ostream& operator<<(std::ostream& out, const User* u) { if (!u) out << ""; else @@ -350,7 +350,7 @@ class User { return out; } - friend inline ostream& operator<<(ostream& out, const std::unique_ptr& p) { + friend inline std::ostream& operator<<(std::ostream& out, const std::unique_ptr& p) { out << p.get(); return out; } @@ -381,8 +381,8 @@ class Bucket { int shard_id{RGW_NO_SHARD}; }; struct ListResults { - vector objs; - map common_prefixes; + std::vector objs; + std::map common_prefixes; bool is_truncated{false}; rgw_obj_key next_marker; }; @@ -450,7 +450,7 @@ class Bucket { virtual int try_refresh_info(const DoutPrefixProvider* dpp, ceph::real_time* pmtime) = 0; virtual int read_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch, uint32_t max_entries, bool* is_truncated, RGWUsageIter& usage_iter, - map& usage) = 0; + std::map& usage) = 0; virtual int trim_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) = 0; virtual int remove_objs_from_index(const DoutPrefixProvider *dpp, std::list& objs_to_unlink) = 0; virtual int check_index(const DoutPrefixProvider *dpp, std::map& existing_stats, std::map& calculated_stats) = 0; @@ -482,27 +482,27 @@ class Bucket { virtual std::unique_ptr clone() = 0; virtual int list_multiparts(const DoutPrefixProvider *dpp, - const string& prefix, - string& marker, - const string& delim, + const std::string& prefix, + std::string& marker, + const std::string& delim, const int& max_uploads, - vector>& uploads, - map *common_prefixes, + std::vector>& uploads, + std::map *common_prefixes, bool *is_truncated) = 0; virtual int abort_multiparts(const DoutPrefixProvider *dpp, CephContext *cct, - string& prefix, string& delim) = 0; + std::string& prefix, std::string& delim) = 0; /* dang - This is temporary, until the API is completed */ rgw_bucket& get_key() { return info.bucket; } RGWBucketInfo& get_info() { return info; } - friend inline ostream& operator<<(ostream& out, const Bucket& b) { + friend inline std::ostream& operator<<(std::ostream& out, const Bucket& b) { out << b.info.bucket; return out; } - friend inline ostream& operator<<(ostream& out, const Bucket* b) { + friend inline std::ostream& operator<<(std::ostream& out, const Bucket* b) { if (!b) out << ""; else @@ -510,7 +510,7 @@ class Bucket { return out; } - friend inline ostream& operator<<(ostream& out, const std::unique_ptr& p) { + friend inline std::ostream& operator<<(std::ostream& out, const std::unique_ptr& p) { out << p.get(); return out; } @@ -551,7 +551,7 @@ public: return *this; }; - map>& get_buckets() { return buckets; } + std::map>& get_buckets() { return buckets; } bool is_truncated(void) const { return truncated; } void set_truncated(bool trunc) { truncated = trunc; } void add(std::unique_ptr bucket) { @@ -650,7 +650,7 @@ class Object { uint64_t olh_epoch{0}; std::string marker_version_id; uint32_t bilog_flags{0}; - list* remove_objs{nullptr}; + std::list* remove_objs{nullptr}; ceph::real_time expiration_time; ceph::real_time unmod_since; ceph::real_time mtime; @@ -820,20 +820,20 @@ class Object { const std::string &get_instance() const { return key.instance; } bool have_instance(void) { return key.have_instance(); } - friend inline ostream& operator<<(ostream& out, const Object& o) { + friend inline std::ostream& operator<<(std::ostream& out, const Object& o) { if (o.bucket) out << o.bucket << ":"; out << o.key; return out; } - friend inline ostream& operator<<(ostream& out, const Object* o) { + friend inline std::ostream& operator<<(std::ostream& out, const Object* o) { if (!o) out << ""; else out << *o; return out; } - friend inline ostream& operator<<(ostream& out, const std::unique_ptr& p) { + friend inline std::ostream& operator<<(std::ostream& out, const std::unique_ptr& p) { out << p.get(); return out; } @@ -880,8 +880,8 @@ public: RGWObjectCtx* obj_ctx) = 0; virtual int complete(const DoutPrefixProvider* dpp, CephContext* cct, std::string& etag, RGWObjManifest& manifest, - map& part_etags, - list& remove_objs, + std::map& part_etags, + std::list& remove_objs, uint64_t& accounted_size, bool& compressed, RGWCompressionInfo& cs_info, off_t& ofs) = 0; @@ -895,20 +895,20 @@ public: uint64_t part_num, const std::string& part_num_str) = 0; - friend inline ostream& operator<<(ostream& out, const MultipartUpload& u) { + friend inline std::ostream& operator<<(std::ostream& out, const MultipartUpload& u) { out << u.get_meta(); if (!u.get_upload_id().empty()) out << ":" << u.get_upload_id(); return out; } - friend inline ostream& operator<<(ostream& out, const MultipartUpload* u) { + friend inline std::ostream& operator<<(std::ostream& out, const MultipartUpload* u) { if (!u) out << ""; else out << *u; return out; } - friend inline ostream& operator<<(ostream& out, const + friend inline std::ostream& operator<<(std::ostream& out, const std::unique_ptr& p) { out << p.get(); return out; @@ -965,7 +965,7 @@ public: virtual int get_next_entry(const std::string& oid, std::string& marker, LCEntry& entry) = 0; virtual int set_entry(const std::string& oid, const LCEntry& entry) = 0; virtual int list_entries(const std::string& oid, const std::string& marker, - uint32_t max_entries, vector& entries) = 0; + uint32_t max_entries, std::vector& entries) = 0; virtual int rm_entry(const std::string& oid, const LCEntry& entry) = 0; virtual int get_head(const std::string& oid, LCHead& head) = 0; virtual int put_head(const std::string& oid, const LCHead& head) = 0; diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 8b5ff1fbc92b2..a943d06842bf6 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -45,6 +45,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + static string mp_ns = RGW_OBJ_NS_MULTIPART; namespace rgw::sal { diff --git a/src/rgw/rgw_sal_rados.h b/src/rgw/rgw_sal_rados.h index 7d51e24637e95..b2c8a46251dac 100644 --- a/src/rgw/rgw_sal_rados.h +++ b/src/rgw/rgw_sal_rados.h @@ -65,7 +65,7 @@ class RadosUser : public User { virtual int complete_flush_stats(const DoutPrefixProvider *dpp, optional_yield y) override; virtual int read_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch, uint32_t max_entries, bool* is_truncated, RGWUsageIter& usage_iter, - map& usage) override; + std::map& usage) override; virtual int trim_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) override; virtual int load_user(const DoutPrefixProvider* dpp, optional_yield y) override; @@ -325,7 +325,7 @@ class RadosBucket : public Bucket { virtual int try_refresh_info(const DoutPrefixProvider* dpp, ceph::real_time* pmtime) override; virtual int read_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch, uint32_t max_entries, bool* is_truncated, RGWUsageIter& usage_iter, - map& usage) override; + std::map& usage) override; virtual int trim_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) override; virtual int remove_objs_from_index(const DoutPrefixProvider *dpp, std::list& objs_to_unlink) override; virtual int check_index(const DoutPrefixProvider *dpp, std::map& existing_stats, std::map& calculated_stats) override; @@ -336,16 +336,16 @@ class RadosBucket : public Bucket { return std::make_unique(*this); } virtual int list_multiparts(const DoutPrefixProvider *dpp, - const string& prefix, - string& marker, - const string& delim, + const std::string& prefix, + std::string& marker, + const std::string& delim, const int& max_uploads, - vector>& uploads, - map *common_prefixes, + std::vector>& uploads, + std::map *common_prefixes, bool *is_truncated) override; virtual int abort_multiparts(const DoutPrefixProvider *dpp, CephContext *cct, - string& prefix, string& delim) override; + std::string& prefix, std::string& delim) override; private: int link(const DoutPrefixProvider* dpp, User* new_user, optional_yield y, bool update_entrypoint = true, RGWObjVersionTracker* objv = nullptr); @@ -432,12 +432,12 @@ class RadosStore : public Store { virtual void get_raw_obj(const rgw_placement_rule& placement_rule, const rgw_obj& obj, rgw_raw_obj* raw_obj) override; virtual int get_raw_chunk_size(const DoutPrefixProvider* dpp, const rgw_raw_obj& obj, uint64_t* chunk_size) override; - virtual int log_usage(const DoutPrefixProvider *dpp, map& usage_info) override; + virtual int log_usage(const DoutPrefixProvider *dpp, std::map& usage_info) override; virtual int log_op(const DoutPrefixProvider *dpp, std::string& oid, bufferlist& bl) override; virtual int register_to_service_map(const DoutPrefixProvider *dpp, const std::string& daemon_type, - const map& meta) override; + const std::map& meta) override; virtual void get_quota(RGWQuotaInfo& bucket_quota, RGWQuotaInfo& user_quota) override; - virtual int set_buckets_enabled(const DoutPrefixProvider* dpp, vector& buckets, bool enabled) override; + virtual int set_buckets_enabled(const DoutPrefixProvider* dpp, std::vector& buckets, bool enabled) override; virtual uint64_t get_new_req_id() override { return rados->get_new_req_id(); } virtual int get_sync_policy_handler(const DoutPrefixProvider* dpp, std::optional zone, @@ -445,38 +445,38 @@ class RadosStore : public Store { RGWBucketSyncPolicyHandlerRef* phandler, optional_yield y) override; virtual RGWDataSyncStatusManager* get_data_sync_manager(const rgw_zone_id& source_zone) override; - virtual void wakeup_meta_sync_shards(set& shard_ids) override { rados->wakeup_meta_sync_shards(shard_ids); } - virtual void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, const rgw_zone_id& source_zone, map >& shard_ids) override { rados->wakeup_data_sync_shards(dpp, source_zone, shard_ids); } + virtual void wakeup_meta_sync_shards(std::set& shard_ids) override { rados->wakeup_meta_sync_shards(shard_ids); } + virtual void wakeup_data_sync_shards(const DoutPrefixProvider *dpp, const rgw_zone_id& source_zone, std::map >& shard_ids) override { rados->wakeup_data_sync_shards(dpp, source_zone, shard_ids); } virtual int clear_usage(const DoutPrefixProvider *dpp) override { return rados->clear_usage(dpp); } virtual int read_all_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch, uint32_t max_entries, bool* is_truncated, RGWUsageIter& usage_iter, - map& usage) override; + std::map& usage) override; virtual int trim_all_usage(const DoutPrefixProvider *dpp, uint64_t start_epoch, uint64_t end_epoch) override; virtual int get_config_key_val(std::string name, bufferlist* bl) override; virtual int meta_list_keys_init(const DoutPrefixProvider *dpp, const std::string& section, const std::string& marker, void** phandle) override; - virtual int meta_list_keys_next(const DoutPrefixProvider *dpp, void* handle, int max, list& keys, bool* truncated) override; + virtual int meta_list_keys_next(const DoutPrefixProvider *dpp, void* handle, int max, std::list& keys, bool* truncated) override; virtual void meta_list_keys_complete(void* handle) override; virtual std::string meta_get_marker(void* handle) override; virtual int meta_remove(const DoutPrefixProvider* dpp, std::string& metadata_key, optional_yield y) override; virtual const RGWSyncModuleInstanceRef& get_sync_module() { return rados->get_sync_module(); } virtual std::string get_host_id() { return rados->host_id; } virtual std::unique_ptr get_lua_script_manager() override; - virtual std::unique_ptr get_role(string name, - string tenant, - string path="", - string trust_policy="", - string max_session_duration_str="") override; + virtual std::unique_ptr get_role(std::string name, + std::string tenant, + std::string path="", + std::string trust_policy="", + std::string max_session_duration_str="") override; virtual std::unique_ptr get_role(std::string id) override; virtual int get_roles(const DoutPrefixProvider *dpp, optional_yield y, const std::string& path_prefix, const std::string& tenant, - vector>& roles) override; + std::vector>& roles) override; virtual std::unique_ptr get_oidc_provider() override; virtual int get_oidc_providers(const DoutPrefixProvider *dpp, const std::string& tenant, - vector>& providers) override; + std::vector>& providers) override; virtual std::unique_ptr get_multipart_upload(Bucket* bucket, const std::string& oid, std::optional upload_id=std::nullopt, ceph::real_time mtime=real_clock::now()) override; virtual std::unique_ptr get_append_writer(const DoutPrefixProvider *dpp, optional_yield y, @@ -564,8 +564,8 @@ public: RGWObjectCtx* obj_ctx) override; virtual int complete(const DoutPrefixProvider* dpp, CephContext* cct, std::string& etag, RGWObjManifest& manifest, - map& part_etags, - list& remove_objs, + std::map& part_etags, + std::list& remove_objs, uint64_t& accounted_size, bool& compressed, RGWCompressionInfo& cs_info, off_t& ofs) override; virtual int get_info(const DoutPrefixProvider *dpp, optional_yield y, RGWObjectCtx* obj_ctx, rgw_placement_rule** rule, rgw::sal::Attrs* attrs = nullptr) override; @@ -616,7 +616,7 @@ public: virtual int get_next_entry(const std::string& oid, std::string& marker, LCEntry& entry) override; virtual int set_entry(const std::string& oid, const LCEntry& entry) override; virtual int list_entries(const std::string& oid, const std::string& marker, - uint32_t max_entries, vector& entries) override; + uint32_t max_entries, std::vector& entries) override; virtual int rm_entry(const std::string& oid, const LCEntry& entry) override; virtual int get_head(const std::string& oid, LCHead& head) override; virtual int put_head(const std::string& oid, const LCHead& head) override; @@ -629,7 +629,7 @@ class RadosNotification : public Notification { public: RadosNotification(const DoutPrefixProvider *_dpp, RadosStore* _store, Object* _obj, req_state* _s, - rgw::notify::EventType _type, const std::string* object_name=nullptr) : + rgw::notify::EventType _type, const std::string* object_name=nullptr) : Notification(_obj, _type), store(_store), res(_dpp, _store, _s, _obj, object_name) { } ~RadosNotification() = default; diff --git a/src/rgw/rgw_service.cc b/src/rgw/rgw_service.cc index 9bedbb23ad68e..874c2e3e3b340 100644 --- a/src/rgw/rgw_service.cc +++ b/src/rgw/rgw_service.cc @@ -37,6 +37,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + RGWServices_Def::RGWServices_Def() = default; RGWServices_Def::~RGWServices_Def() { diff --git a/src/rgw/rgw_sts.cc b/src/rgw/rgw_sts.cc index 4f58d8326f200..fdaec2f6991dc 100644 --- a/src/rgw/rgw_sts.cc +++ b/src/rgw/rgw_sts.cc @@ -30,6 +30,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + namespace STS { void Credentials::dump(Formatter *f) const diff --git a/src/rgw/rgw_sts.h b/src/rgw/rgw_sts.h index 9730c2a1185c0..6be5633488af5 100644 --- a/src/rgw/rgw_sts.h +++ b/src/rgw/rgw_sts.h @@ -23,19 +23,19 @@ protected: uint64_t MAX_DURATION_IN_SECS; CephContext* cct; uint64_t duration; - string err_msg; - string iamPolicy; - string roleArn; - string roleSessionName; + std::string err_msg; + std::string iamPolicy; + std::string roleArn; + std::string roleSessionName; public: AssumeRoleRequestBase(CephContext* cct, - const string& duration, - const string& iamPolicy, - const string& roleArn, - const string& roleSessionName); - const string& getRoleARN() const { return roleArn; } - const string& getRoleSessionName() const { return roleSessionName; } - const string& getPolicy() const {return iamPolicy; } + const std::string& duration, + const std::string& iamPolicy, + const std::string& roleArn, + const std::string& roleSessionName); + const std::string& getRoleARN() const { return roleArn; } + const std::string& getRoleSessionName() const { return roleSessionName; } + const std::string& getPolicy() const {return iamPolicy; } static const uint64_t& getMaxPolicySize() { return MAX_POLICY_SIZE; } void setMaxDuration(const uint64_t& maxDuration) { MAX_DURATION_IN_SECS = maxDuration; } const uint64_t& getDuration() const { return duration; } @@ -45,27 +45,27 @@ public: class AssumeRoleWithWebIdentityRequest : public AssumeRoleRequestBase { static constexpr uint64_t MIN_PROVIDER_ID_LEN = 4; static constexpr uint64_t MAX_PROVIDER_ID_LEN = 2048; - string providerId; - string iamPolicy; - string iss; - string sub; - string aud; + std::string providerId; + std::string iamPolicy; + std::string iss; + std::string sub; + std::string aud; public: AssumeRoleWithWebIdentityRequest( CephContext* cct, - const string& duration, - const string& providerId, - const string& iamPolicy, - const string& roleArn, - const string& roleSessionName, - const string& iss, - const string& sub, - const string& aud) + const std::string& duration, + const std::string& providerId, + const std::string& iamPolicy, + const std::string& roleArn, + const std::string& roleSessionName, + const std::string& iss, + const std::string& sub, + const std::string& aud) : AssumeRoleRequestBase(cct, duration, iamPolicy, roleArn, roleSessionName), providerId(providerId), iss(iss), sub(sub), aud(aud) {} - const string& getProviderId() const { return providerId; } - const string& getIss() const { return iss; } - const string& getAud() const { return aud; } - const string& getSub() const { return sub; } + const std::string& getProviderId() const { return providerId; } + const std::string& getIss() const { return iss; } + const std::string& getAud() const { return aud; } + const std::string& getSub() const { return sub; } int validate_input() const; }; @@ -75,18 +75,18 @@ class AssumeRoleRequest : public AssumeRoleRequestBase { static constexpr uint64_t MIN_SERIAL_NUMBER_SIZE = 9; static constexpr uint64_t MAX_SERIAL_NUMBER_SIZE = 256; static constexpr uint64_t TOKEN_CODE_SIZE = 6; - string externalId; - string serialNumber; - string tokenCode; + std::string externalId; + std::string serialNumber; + std::string tokenCode; public: AssumeRoleRequest(CephContext* cct, - const string& duration, - const string& externalId, - const string& iamPolicy, - const string& roleArn, - const string& roleSessionName, - const string& serialNumber, - const string& tokenCode) + const std::string& duration, + const std::string& externalId, + const std::string& iamPolicy, + const std::string& roleArn, + const std::string& roleSessionName, + const std::string& serialNumber, + const std::string& tokenCode) : AssumeRoleRequestBase(cct, duration, iamPolicy, roleArn, roleSessionName), externalId(externalId), serialNumber(serialNumber), tokenCode(tokenCode){} int validate_input() const; @@ -97,44 +97,44 @@ protected: static constexpr uint64_t MIN_DURATION_IN_SECS = 900; static constexpr uint64_t DEFAULT_DURATION_IN_SECS = 3600; uint64_t duration; - string serialNumber; - string tokenCode; + std::string serialNumber; + std::string tokenCode; public: - GetSessionTokenRequest(const string& duration, const string& serialNumber, const string& tokenCode); + GetSessionTokenRequest(const std::string& duration, const std::string& serialNumber, const std::string& tokenCode); const uint64_t& getDuration() const { return duration; } static const uint64_t& getMinDuration() { return MIN_DURATION_IN_SECS; } }; class AssumedRoleUser { - string arn; - string assumeRoleId; + std::string arn; + std::string assumeRoleId; public: int generateAssumedRoleUser( CephContext* cct, rgw::sal::Store* store, - const string& roleId, + const std::string& roleId, const rgw::ARN& roleArn, - const string& roleSessionName); - const string& getARN() const { return arn; } - const string& getAssumeRoleId() const { return assumeRoleId; } + const std::string& roleSessionName); + const std::string& getARN() const { return arn; } + const std::string& getAssumeRoleId() const { return assumeRoleId; } void dump(Formatter *f) const; }; struct SessionToken { - string access_key_id; - string secret_access_key; - string expiration; - string policy; - string roleId; + std::string access_key_id; + std::string secret_access_key; + std::string expiration; + std::string policy; + std::string roleId; rgw_user user; - string acct_name; + std::string acct_name; uint32_t perm_mask; bool is_admin; uint32_t acct_type; - string role_session; - std::vector token_claims; - string issued_at; + std::string role_session; + std::vector token_claims; + std::string issued_at; SessionToken() {} @@ -185,23 +185,23 @@ WRITE_CLASS_ENCODER(SessionToken) class Credentials { static constexpr int MAX_ACCESS_KEY_LEN = 20; static constexpr int MAX_SECRET_KEY_LEN = 40; - string accessKeyId; - string expiration; - string secretAccessKey; - string sessionToken; + std::string accessKeyId; + std::string expiration; + std::string secretAccessKey; + std::string sessionToken; public: int generateCredentials(CephContext* cct, const uint64_t& duration, - const boost::optional& policy, - const boost::optional& roleId, - const boost::optional& role_session, - const boost::optional > token_claims, + const boost::optional& policy, + const boost::optional& roleId, + const boost::optional& role_session, + const boost::optional > token_claims, boost::optional user, rgw::auth::Identity* identity); - const string& getAccessKeyId() const { return accessKeyId; } - const string& getExpiration() const { return expiration; } - const string& getSecretAccessKey() const { return secretAccessKey; } - const string& getSessionToken() const { return sessionToken; } + const std::string& getAccessKeyId() const { return accessKeyId; } + const std::string& getExpiration() const { return expiration; } + const std::string& getSecretAccessKey() const { return secretAccessKey; } + const std::string& getSessionToken() const { return sessionToken; } void dump(Formatter *f) const; }; @@ -214,9 +214,9 @@ struct AssumeRoleResponse { struct AssumeRoleWithWebIdentityResponse { AssumeRoleResponse assumeRoleResp; - string aud; - string providerId; - string sub; + std::string aud; + std::string providerId; + std::string sub; }; using AssumeRoleResponse = struct AssumeRoleResponse ; @@ -229,13 +229,13 @@ class STSService { rgw_user user_id; std::unique_ptr role; rgw::auth::Identity* identity; - int storeARN(const DoutPrefixProvider *dpp, string& arn, optional_yield y); + int storeARN(const DoutPrefixProvider *dpp, std::string& arn, optional_yield y); public: STSService() = default; STSService(CephContext* cct, rgw::sal::Store* store, rgw_user user_id, rgw::auth::Identity* identity) : cct(cct), store(store), user_id(user_id), identity(identity) {} - std::tuple getRoleInfo(const DoutPrefixProvider *dpp, const string& arn, optional_yield y); + std::tuple getRoleInfo(const DoutPrefixProvider *dpp, const std::string& arn, optional_yield y); AssumeRoleResponse assumeRole(const DoutPrefixProvider *dpp, AssumeRoleRequest& req, optional_yield y); GetSessionTokenResponse getSessionToken(GetSessionTokenRequest& req); AssumeRoleWithWebIdentityResponse assumeRoleWithWebIdentity(AssumeRoleWithWebIdentityRequest& req); diff --git a/src/rgw/rgw_swift_auth.cc b/src/rgw/rgw_swift_auth.cc index 640c85fcdb0d9..3791e7d9214b7 100644 --- a/src/rgw/rgw_swift_auth.cc +++ b/src/rgw/rgw_swift_auth.cc @@ -27,6 +27,7 @@ #define DEFAULT_SWIFT_PREFIX "/swift" +using namespace std; using namespace ceph::crypto; diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index ae10118cbe6e5..e921aeb1adf1e 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -36,6 +36,8 @@ #undef dout_prefix #define dout_prefix (*_dout << "meta sync: ") +using namespace std; + static string mdlog_sync_status_oid = "mdlog.sync-status"; static string mdlog_sync_status_shard_prefix = "mdlog.sync-status.shard"; static string mdlog_sync_full_sync_index_prefix = "meta.full-sync.index"; diff --git a/src/rgw/rgw_sync.h b/src/rgw/rgw_sync.h index 346232058b6f0..41b0119d58a31 100644 --- a/src/rgw/rgw_sync.h +++ b/src/rgw/rgw_sync.h @@ -32,9 +32,9 @@ struct rgw_mdlog_info { struct rgw_mdlog_entry { - string id; - string section; - string name; + std::string id; + std::string section; + std::string name; ceph::real_time timestamp; RGWMetadataLogData log_data; @@ -56,9 +56,9 @@ struct rgw_mdlog_entry { }; struct rgw_mdlog_shard_data { - string marker; + std::string marker; bool truncated; - vector entries; + std::vector entries; void decode_json(JSONObj *obj); }; @@ -72,24 +72,24 @@ class RGWSyncTraceManager; class RGWSyncErrorLogger { rgw::sal::RadosStore* store; - vector oids; + std::vector oids; int num_shards; std::atomic counter = { 0 }; public: - RGWSyncErrorLogger(rgw::sal::RadosStore* _store, const string &oid_prefix, int _num_shards); - RGWCoroutine *log_error_cr(const DoutPrefixProvider *dpp, const string& source_zone, const string& section, const string& name, uint32_t error_code, const string& message); + RGWSyncErrorLogger(rgw::sal::RadosStore* _store, const std::string &oid_prefix, int _num_shards); + RGWCoroutine *log_error_cr(const DoutPrefixProvider *dpp, const std::string& source_zone, const std::string& section, const std::string& name, uint32_t error_code, const std::string& message); - static string get_shard_oid(const string& oid_prefix, int shard_id); + static std::string get_shard_oid(const std::string& oid_prefix, int shard_id); }; struct rgw_sync_error_info { - string source_zone; + std::string source_zone; uint32_t error_code; - string message; + std::string message; rgw_sync_error_info() : error_code(0) {} - rgw_sync_error_info(const string& _source_zone, uint32_t _error_code, const string& _message) : source_zone(_source_zone), error_code(_error_code), message(_message) {} + rgw_sync_error_info(const std::string& _source_zone, uint32_t _error_code, const std::string& _message) : source_zone(_source_zone), error_code(_error_code), message(_message) {} void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); @@ -188,8 +188,8 @@ struct RGWMetaSyncEnv { RGWAsyncRadosProcessor *_async_rados, RGWHTTPManager *_http_manager, RGWSyncErrorLogger *_error_logger, RGWSyncTraceManager *_sync_tracer); - string shard_obj_name(int shard_id); - string status_oid(); + std::string shard_obj_name(int shard_id); + std::string status_oid(); }; class RGWRemoteMetaLog : public RGWCoroutinesManager { @@ -231,8 +231,8 @@ public: void finish(); int read_log_info(const DoutPrefixProvider *dpp, rgw_mdlog_info *log_info); - int read_master_log_shards_info(const DoutPrefixProvider *dpp, const string& master_period, map *shards_info); - int read_master_log_shards_next(const DoutPrefixProvider *dpp, const string& period, map shard_markers, map *result); + int read_master_log_shards_info(const DoutPrefixProvider *dpp, const std::string& master_period, std::map *shards_info); + int read_master_log_shards_next(const DoutPrefixProvider *dpp, const std::string& period, std::map shard_markers, std::map *result); int read_sync_status(const DoutPrefixProvider *dpp, rgw_meta_sync_status *sync_status); int init_sync_status(const DoutPrefixProvider *dpp); int run_sync(const DoutPrefixProvider *dpp, optional_yield y); @@ -250,7 +250,7 @@ class RGWMetaSyncStatusManager : public DoutPrefixProvider { RGWRemoteMetaLog master_log; - map shard_objs; + std::map shard_objs; struct utime_shard { real_time ts; @@ -267,8 +267,8 @@ class RGWMetaSyncStatusManager : public DoutPrefixProvider { }; ceph::shared_mutex ts_to_shard_lock = ceph::make_shared_mutex("ts_to_shard_lock"); - map ts_to_shard; - vector clone_markers; + std::map ts_to_shard; + std::vector clone_markers; public: RGWMetaSyncStatusManager(rgw::sal::RadosStore* _store, RGWAsyncRadosProcessor *async_rados) @@ -286,10 +286,10 @@ public: int read_log_info(const DoutPrefixProvider *dpp, rgw_mdlog_info *log_info) { return master_log.read_log_info(dpp, log_info); } - int read_master_log_shards_info(const DoutPrefixProvider *dpp, const string& master_period, map *shards_info) { + int read_master_log_shards_info(const DoutPrefixProvider *dpp, const std::string& master_period, std::map *shards_info) { return master_log.read_master_log_shards_info(dpp, master_period, shards_info); } - int read_master_log_shards_next(const DoutPrefixProvider *dpp, const string& period, map shard_markers, map *result) { + int read_master_log_shards_next(const DoutPrefixProvider *dpp, const std::string& period, std::map shard_markers, std::map *result) { return master_log.read_master_log_shards_next(dpp, period, shard_markers, result); } @@ -348,7 +348,7 @@ class RGWSyncShardMarkerTrack { }; typename std::map pending; - map finish_markers; + std::map finish_markers; int window_size; int updates_since_flush; @@ -483,13 +483,13 @@ class RGWMetaSyncShardMarkerTrack; class RGWMetaSyncSingleEntryCR : public RGWCoroutine { RGWMetaSyncEnv *sync_env; - string raw_key; - string entry_marker; + std::string raw_key; + std::string entry_marker; RGWMDLogStatus op_status; ssize_t pos; - string section; - string key; + std::string section; + std::string key; int sync_status; @@ -505,7 +505,7 @@ class RGWMetaSyncSingleEntryCR : public RGWCoroutine { public: RGWMetaSyncSingleEntryCR(RGWMetaSyncEnv *_sync_env, - const string& _raw_key, const string& _entry_marker, + const std::string& _raw_key, const std::string& _entry_marker, const RGWMDLogStatus& _op_status, RGWMetaSyncShardMarkerTrack *_marker_tracker, const RGWSyncTraceNodeRef& _tn_parent); diff --git a/src/rgw/rgw_sync_module.h b/src/rgw/rgw_sync_module.h index 5a3f62f741308..19292b3d80995 100644 --- a/src/rgw/rgw_sync_module.h +++ b/src/rgw/rgw_sync_module.h @@ -85,19 +85,19 @@ typedef std::shared_ptr RGWSyncModuleRef; class RGWSyncModulesManager { ceph::mutex lock = ceph::make_mutex("RGWSyncModulesManager"); - map modules; + std::map modules; public: RGWSyncModulesManager() = default; - void register_module(const string& name, RGWSyncModuleRef& module, bool is_default = false) { + void register_module(const std::string& name, RGWSyncModuleRef& module, bool is_default = false) { std::lock_guard l{lock}; modules[name] = module; if (is_default) { - modules[string()] = module; + modules[std::string()] = module; } } - bool get_module(const string& name, RGWSyncModuleRef *module) { + bool get_module(const std::string& name, RGWSyncModuleRef *module) { std::lock_guard l{lock}; auto iter = modules.find(name); if (iter == modules.end()) { @@ -110,7 +110,7 @@ public: } - bool supports_data_export(const string& name) { + bool supports_data_export(const std::string& name) { RGWSyncModuleRef module; if (!get_module(name, &module)) { return false; @@ -119,7 +119,7 @@ public: return module->supports_data_export(); } - int create_instance(CephContext *cct, const string& name, const JSONFormattable& config, RGWSyncModuleInstanceRef *instance) { + int create_instance(CephContext *cct, const std::string& name, const JSONFormattable& config, RGWSyncModuleInstanceRef *instance) { RGWSyncModuleRef module; if (!get_module(name, &module)) { return -ENOENT; @@ -128,8 +128,8 @@ public: return module.get()->create_instance(cct, config, instance); } - vector get_registered_module_names() const { - vector names; + std::vector get_registered_module_names() const { + std::vector names; for (auto& i: modules) { if (!i.first.empty()) { names.push_back(i.first); @@ -149,9 +149,9 @@ protected: ceph::real_time mtime; uint64_t size = 0; - string etag; - map attrs; - map headers; + std::string etag; + std::map attrs; + std::map headers; public: RGWStatRemoteObjCBCR(RGWDataSyncCtx *_sc, rgw_bucket& _src_bucket, rgw_obj_key& _key); @@ -159,9 +159,9 @@ public: void set_result(ceph::real_time& _mtime, uint64_t _size, - const string& _etag, - map&& _attrs, - map&& _headers) { + const std::string& _etag, + std::map&& _attrs, + std::map&& _headers) { mtime = _mtime; size = _size; etag = _etag; @@ -173,9 +173,9 @@ public: class RGWCallStatRemoteObjCR : public RGWCoroutine { ceph::real_time mtime; uint64_t size{0}; - string etag; - map attrs; - map headers; + std::string etag; + std::map attrs; + std::map headers; protected: RGWDataSyncCtx *sc; diff --git a/src/rgw/rgw_sync_module_aws.cc b/src/rgw/rgw_sync_module_aws.cc index 065c2cc701212..e74d289458f84 100644 --- a/src/rgw/rgw_sync_module_aws.cc +++ b/src/rgw/rgw_sync_module_aws.cc @@ -23,6 +23,8 @@ #define DEFAULT_MULTIPART_SYNC_PART_SIZE (32 * 1024 * 1024) +using namespace std; + static string default_target_path = "rgw-${zonegroup}-${sid}/${bucket}"; static string get_key_oid(const rgw_obj_key& key) diff --git a/src/rgw/rgw_sync_module_aws.h b/src/rgw/rgw_sync_module_aws.h index def56eecee1be..7799fb8cb8ef6 100644 --- a/src/rgw/rgw_sync_module_aws.h +++ b/src/rgw/rgw_sync_module_aws.h @@ -10,7 +10,7 @@ struct rgw_sync_aws_multipart_part_info { int part_num{0}; uint64_t ofs{0}; uint64_t size{0}; - string etag; + std::string etag; void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); @@ -34,7 +34,7 @@ WRITE_CLASS_ENCODER(rgw_sync_aws_multipart_part_info) struct rgw_sync_aws_src_obj_properties { ceph::real_time mtime; - string etag; + std::string etag; uint32_t zone_short_id{0}; uint64_t pg_ver{0}; uint64_t versioned_epoch{0}; @@ -62,7 +62,7 @@ struct rgw_sync_aws_src_obj_properties { WRITE_CLASS_ENCODER(rgw_sync_aws_src_obj_properties) struct rgw_sync_aws_multipart_upload_info { - string upload_id; + std::string upload_id; uint64_t obj_size; rgw_sync_aws_src_obj_properties src_properties; uint32_t part_size{0}; diff --git a/src/rgw/rgw_sync_module_es.cc b/src/rgw/rgw_sync_module_es.cc index f01ec2c8af702..42c45104e327e 100644 --- a/src/rgw/rgw_sync_module_es.cc +++ b/src/rgw/rgw_sync_module_es.cc @@ -22,6 +22,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; /* * allowlist utility. Config string is a list of entries, where an entry is either an item, diff --git a/src/rgw/rgw_sync_module_es.h b/src/rgw/rgw_sync_module_es.h index b61cfddfcd209..d8c088a9aa245 100644 --- a/src/rgw/rgw_sync_module_es.h +++ b/src/rgw/rgw_sync_module_es.h @@ -53,7 +53,7 @@ public: RGWRESTMgr *get_rest_filter(int dialect, RGWRESTMgr *orig) override; RGWRESTConn *get_rest_conn(); std::string get_index_path(); - map& get_request_headers(); + std::map& get_request_headers(); bool supports_user_writes() override { return true; } diff --git a/src/rgw/rgw_sync_module_es_rest.cc b/src/rgw/rgw_sync_module_es_rest.cc index 5884322dba3b0..7beec151c1276 100644 --- a/src/rgw/rgw_sync_module_es_rest.cc +++ b/src/rgw/rgw_sync_module_es_rest.cc @@ -12,6 +12,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + struct es_index_obj_response { string bucket; rgw_obj_key key; diff --git a/src/rgw/rgw_sync_module_log.cc b/src/rgw/rgw_sync_module_log.cc index c85fd478f1c28..9c02818d329d4 100644 --- a/src/rgw/rgw_sync_module_log.cc +++ b/src/rgw/rgw_sync_module_log.cc @@ -10,6 +10,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + class RGWLogStatRemoteObjCBCR : public RGWStatRemoteObjCBCR { public: RGWLogStatRemoteObjCBCR(RGWDataSyncCtx *_sc, diff --git a/src/rgw/rgw_sync_module_pubsub.cc b/src/rgw/rgw_sync_module_pubsub.cc index c37b5637907ee..c14e795fc57e8 100644 --- a/src/rgw/rgw_sync_module_pubsub.cc +++ b/src/rgw/rgw_sync_module_pubsub.cc @@ -26,6 +26,8 @@ #define PUBSUB_EVENTS_RETENTION_DEFAULT 7 +using namespace std; + /* config: diff --git a/src/rgw/rgw_sync_module_pubsub_rest.cc b/src/rgw/rgw_sync_module_pubsub_rest.cc index b6afdc54aca6c..47e202aeb2f81 100644 --- a/src/rgw/rgw_sync_module_pubsub_rest.cc +++ b/src/rgw/rgw_sync_module_pubsub_rest.cc @@ -19,6 +19,8 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rgw +using namespace std; + // command: PUT /topics/[&push-endpoint=[&=]] class RGWPSCreateTopic_ObjStore : public RGWPSCreateTopicOp { public: diff --git a/src/rgw/rgw_sync_policy.cc b/src/rgw/rgw_sync_policy.cc index 6b5ecf414e0f9..90798fffe3325 100644 --- a/src/rgw/rgw_sync_policy.cc +++ b/src/rgw/rgw_sync_policy.cc @@ -5,6 +5,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; string rgw_sync_bucket_entity::bucket_key() const { diff --git a/src/rgw/rgw_sync_policy.h b/src/rgw/rgw_sync_policy.h index 5231ab3f4dc91..0ee79b4702fc6 100644 --- a/src/rgw/rgw_sync_policy.h +++ b/src/rgw/rgw_sync_policy.h @@ -20,11 +20,11 @@ struct rgw_sync_symmetric_group { - string id; + std::string id; std::set zones; rgw_sync_symmetric_group() {} - rgw_sync_symmetric_group(const string& _id, + rgw_sync_symmetric_group(const std::string& _id, const std::set _zones) : id(_id), zones(_zones) {} @@ -74,7 +74,7 @@ struct rgw_sync_bucket_entity { std::optional zone; /* define specific zones */ std::optional bucket; /* define specific bucket */ - static bool match_str(const string& s1, const string& s2) { /* empty string is wildcard */ + static bool match_str(const std::string& s1, const std::string& s2) { /* empty std::string is wildcard */ return (s1.empty() || s2.empty() || s1 == s2); @@ -114,7 +114,7 @@ struct rgw_sync_bucket_entity { return bucket.value_or(rgw_bucket()); } - string bucket_key() const; + std::string bucket_key() const; bool match_zone(const rgw_zone_id& z) const { if (all_zones) { @@ -132,7 +132,7 @@ struct rgw_sync_bucket_entity { zone = z; } - static bool match_bucket_id(const string& bid1, const string& bid2) { + static bool match_bucket_id(const std::string& bid1, const std::string& bid2) { return (bid1.empty() || bid2.empty() || (bid1 == bid2)); } @@ -178,15 +178,15 @@ struct rgw_sync_bucket_entity { WRITE_CLASS_ENCODER(rgw_sync_bucket_entity) struct rgw_sync_pipe_filter_tag { - string key; - string value; + std::string key; + std::string value; rgw_sync_pipe_filter_tag() {} - rgw_sync_pipe_filter_tag(const string& s) { + rgw_sync_pipe_filter_tag(const std::string& s) { from_str(s); } - rgw_sync_pipe_filter_tag(const string& _key, - const string& _value) : key(_key), + rgw_sync_pipe_filter_tag(const std::string& _key, + const std::string& _value) : key(_key), value(_value) {} void encode(bufferlist& bl) const { @@ -206,7 +206,7 @@ struct rgw_sync_pipe_filter_tag { void dump(ceph::Formatter *f) const; void decode_json(JSONObj *obj); - bool from_str(const string& s); + bool from_str(const std::string& s); bool operator<(const rgw_sync_pipe_filter_tag& t) const { if (key < t.key) { @@ -218,12 +218,12 @@ struct rgw_sync_pipe_filter_tag { return (value < t.value); } - bool operator==(const string& s) const; + bool operator==(const std::string& s) const; }; WRITE_CLASS_ENCODER(rgw_sync_pipe_filter_tag) struct rgw_sync_pipe_filter { - std::optional prefix; + std::optional prefix; std::set tags; void set_prefix(std::optional opt_prefix, @@ -240,9 +240,9 @@ struct rgw_sync_pipe_filter { bool is_subset_of(const rgw_sync_pipe_filter& f) const; bool has_tags() const; - bool check_tag(const string& s) const; - bool check_tag(const string& k, const string& v) const; - bool check_tags(const std::vector& tags) const; + bool check_tag(const std::string& s) const; + bool check_tag(const std::string& k, const std::string& v) const; + bool check_tags(const std::vector& tags) const; bool check_tags(const RGWObjTags::tag_map_t& tags) const; }; WRITE_CLASS_ENCODER(rgw_sync_pipe_filter) @@ -293,7 +293,7 @@ WRITE_CLASS_ENCODER(rgw_sync_pipe_source_params) struct rgw_sync_pipe_dest_params { std::optional acl_translation; - std::optional storage_class; + std::optional storage_class; void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); @@ -309,7 +309,7 @@ struct rgw_sync_pipe_dest_params { DECODE_FINISH(bl); } - void set_storage_class(const string& sc) { + void set_storage_class(const std::string& sc) { storage_class = sc; } @@ -370,7 +370,7 @@ struct rgw_sync_pipe_params { WRITE_CLASS_ENCODER(rgw_sync_pipe_params) struct rgw_sync_bucket_pipe { - string id; + std::string id; rgw_sync_bucket_entity source; rgw_sync_bucket_entity dest; @@ -461,12 +461,12 @@ struct rgw_sync_bucket_entities { void add_zones(const std::vector& new_zones); void remove_zones(const std::vector& rm_zones); - void set_bucket(std::optional tenant, - std::optional bucket_name, - std::optional bucket_id); - void remove_bucket(std::optional tenant, - std::optional bucket_name, - std::optional bucket_id); + void set_bucket(std::optional tenant, + std::optional bucket_name, + std::optional bucket_id); + void remove_bucket(std::optional tenant, + std::optional bucket_name, + std::optional bucket_id); bool match_zone(const rgw_zone_id& zone) const { if (!zones) { @@ -485,7 +485,7 @@ struct rgw_sync_bucket_entities { return bucket.value_or(rgw_bucket()); } - static string bucket_key(std::optional b); + static std::string bucket_key(std::optional b); void set_all_zones(bool state) { all_zones = state; @@ -497,7 +497,7 @@ struct rgw_sync_bucket_entities { WRITE_CLASS_ENCODER(rgw_sync_bucket_entities) struct rgw_sync_bucket_pipes { - string id; + std::string id; rgw_sync_bucket_entities source; rgw_sync_bucket_entities dest; @@ -578,8 +578,8 @@ struct rgw_sync_data_flow_group { return (symmetrical.empty() && directional.empty()); } - bool find_or_create_symmetrical(const string& flow_id, rgw_sync_symmetric_group **flow_group); - void remove_symmetrical(const string& flow_id, std::optional > zones); + bool find_or_create_symmetrical(const std::string& flow_id, rgw_sync_symmetric_group **flow_group); + void remove_symmetrical(const std::string& flow_id, std::optional > zones); bool find_or_create_directional(const rgw_zone_id& source_zone, const rgw_zone_id& dest_zone, rgw_sync_directional_rule **flow_group); void remove_directional(const rgw_zone_id& source_zone, const rgw_zone_id& dest_zone); @@ -589,7 +589,7 @@ WRITE_CLASS_ENCODER(rgw_sync_data_flow_group) struct rgw_sync_policy_group { - string id; + std::string id; rgw_sync_data_flow_group data_flow; /* override data flow, howver, will not be able to add new flows that don't exist at higher level */ @@ -626,7 +626,7 @@ struct rgw_sync_policy_group { void dump(ceph::Formatter *f) const; void decode_json(JSONObj *obj); - bool set_status(const string& s) { + bool set_status(const std::string& s) { if (s == "forbidden") { status = rgw_sync_policy_group::Status::FORBIDDEN; } else if (s == "allowed") { @@ -641,8 +641,8 @@ struct rgw_sync_policy_group { return true; } - bool find_pipe(const string& pipe_id, bool create, rgw_sync_bucket_pipes **pipe); - void remove_pipe(const string& pipe_id); + bool find_pipe(const std::string& pipe_id, bool create, rgw_sync_bucket_pipes **pipe); + void remove_pipe(const std::string& pipe_id); void get_potential_related_buckets(const rgw_bucket& bucket, std::set *sources, @@ -652,7 +652,7 @@ struct rgw_sync_policy_group { WRITE_CLASS_ENCODER(rgw_sync_policy_group) struct rgw_sync_policy_info { - std::map groups; + std::map groups; void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); diff --git a/src/rgw/rgw_sync_trace.cc b/src/rgw/rgw_sync_trace.cc index c0bf602c740d2..dc29cfa857ec0 100644 --- a/src/rgw/rgw_sync_trace.cc +++ b/src/rgw/rgw_sync_trace.cc @@ -16,6 +16,8 @@ #define dout_context g_ceph_context +using namespace std; + RGWSyncTraceNode::RGWSyncTraceNode(CephContext *_cct, uint64_t _handle, const RGWSyncTraceNodeRef& _parent, const string& _type, const string& _id) : cct(_cct), diff --git a/src/rgw/rgw_sync_trace.h b/src/rgw/rgw_sync_trace.h index 8e0a31cdfcb8d..e66dde7cf41aa 100644 --- a/src/rgw/rgw_sync_trace.h +++ b/src/rgw/rgw_sync_trace.h @@ -52,7 +52,7 @@ class RGWSyncTraceNode final { uint64_t handle; - boost::circular_buffer history; + boost::circular_buffer history; // private constructor, create with RGWSyncTraceManager::add_node() RGWSyncTraceNode(CephContext *_cct, uint64_t _handle, @@ -60,11 +60,11 @@ class RGWSyncTraceNode final { const std::string& _type, const std::string& _id); public: - void set_resource_name(const string& s) { + void set_resource_name(const std::string& s) { resource_name = s; } - const string& get_resource_name() { + const std::string& get_resource_name() { return resource_name; } @@ -83,7 +83,7 @@ class RGWSyncTraceNode final { return prefix + " " + status; } - const string& get_prefix() { + const std::string& get_prefix() { return prefix; } @@ -92,11 +92,11 @@ class RGWSyncTraceNode final { return os; } - boost::circular_buffer& get_history() { + boost::circular_buffer& get_history() { return history; } - bool match(const string& search_term, bool search_history); + bool match(const std::string& search_term, bool search_history); }; class RGWSyncTraceManager : public AdminSocketHook { @@ -113,7 +113,7 @@ class RGWSyncTraceManager : public AdminSocketHook { std::atomic count = { 0 }; - std::list > admin_commands; + std::list > admin_commands; uint64_t alloc_handle() { return ++count; @@ -137,7 +137,7 @@ public: Formatter *f, std::ostream& ss, bufferlist& out) override; - string get_active_names(); + std::string get_active_names(); }; diff --git a/src/rgw/rgw_tag.cc b/src/rgw/rgw_tag.cc index f43a182486856..681ce1ed69b3c 100644 --- a/src/rgw/rgw_tag.cc +++ b/src/rgw/rgw_tag.cc @@ -10,6 +10,8 @@ #include "rgw_tag.h" #include "rgw_common.h" +using namespace std; + bool RGWObjTags::add_tag(const string&key, const string& val){ return tag_map.emplace(std::make_pair(key,val)).second; } diff --git a/src/rgw/rgw_tag_s3.cc b/src/rgw/rgw_tag_s3.cc index b03607f73a7e6..c4b847b27e858 100644 --- a/src/rgw/rgw_tag_s3.cc +++ b/src/rgw/rgw_tag_s3.cc @@ -9,6 +9,8 @@ #include "rgw_tag_s3.h" +using namespace std; + void RGWObjTagEntry_S3::decode_xml(XMLObj *obj) { RGWXMLDecoder::decode_xml("Key", key, obj, true); RGWXMLDecoder::decode_xml("Value", val, obj, true); diff --git a/src/rgw/rgw_token.cc b/src/rgw/rgw_token.cc index 00430a6096a36..aaa4f47ca2c84 100644 --- a/src/rgw/rgw_token.cc +++ b/src/rgw/rgw_token.cc @@ -48,6 +48,8 @@ namespace { } +using namespace std; + void usage() { cout << "usage: radosgw-token --encode --ttype= [options...]" << std::endl; diff --git a/src/rgw/rgw_token.h b/src/rgw/rgw_token.h index d95239bcf9f54..9505f970c6037 100644 --- a/src/rgw/rgw_token.h +++ b/src/rgw/rgw_token.h @@ -152,13 +152,13 @@ namespace rgw { return to_base64(std::move(os.str())); } - friend inline ostream& operator<<(ostream& os, const RGWToken& token); + friend inline std::ostream& operator<<(std::ostream& os, const RGWToken& token); virtual ~RGWToken() {}; }; WRITE_CLASS_ENCODER(RGWToken) - inline ostream& operator<<(ostream& os, const RGWToken& token) + inline std::ostream& operator<<(std::ostream& os, const RGWToken& token) { os << "<; diff --git a/src/rgw/rgw_usage.cc b/src/rgw/rgw_usage.cc index e76995eb48649..cf0cac66cd629 100644 --- a/src/rgw/rgw_usage.cc +++ b/src/rgw/rgw_usage.cc @@ -9,7 +9,7 @@ #include "rgw_formats.h" #include "rgw_sal.h" - +using namespace std; static void dump_usage_categories_info(Formatter *formatter, const rgw_usage_log_entry& entry, map *categories) { diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index 9d45170a54c7a..20301e047b2cc 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -32,7 +32,7 @@ #define dout_subsys ceph_subsys_rgw - +using namespace std; extern void op_type_to_str(uint32_t mask, char *buf, int len); diff --git a/src/rgw/rgw_user.h b/src/rgw/rgw_user.h index 542efc2092561..5015e0d02e2f5 100644 --- a/src/rgw/rgw_user.h +++ b/src/rgw/rgw_user.h @@ -43,13 +43,13 @@ struct RGWUID { rgw_user user_id; void encode(bufferlist& bl) const { - string s; + std::string s; user_id.to_str(s); using ceph::encode; encode(s, bl); } void decode(bufferlist::const_iterator& bl) { - string s; + std::string s; using ceph::decode; decode(s, bl); user_id.from_str(s); @@ -60,7 +60,7 @@ WRITE_CLASS_ENCODER(RGWUID) extern int rgw_user_sync_all_stats(const DoutPrefixProvider *dpp, rgw::sal::Store* store, rgw::sal::User* user, optional_yield y); extern int rgw_user_get_all_buckets_stats(const DoutPrefixProvider *dpp, rgw::sal::Store* store, rgw::sal::User* user, - map& buckets_usage_map, optional_yield y); + std::map& buckets_usage_map, optional_yield y); /** * Get the anonymous (ie, unauthenticated) user info. @@ -70,7 +70,7 @@ extern void rgw_get_anon_user(RGWUserInfo& info); extern void rgw_perm_to_str(uint32_t mask, char *buf, int len); extern uint32_t rgw_str_to_perm(const char *str); -extern int rgw_validate_tenant_name(const string& t); +extern int rgw_validate_tenant_name(const std::string& t); enum ObjectKeyType { KEY_TYPE_SWIFT, @@ -111,7 +111,7 @@ struct RGWUserAdminOpState { std::string caps; RGWObjVersionTracker objv; uint32_t op_mask{0}; - map temp_url_keys; + std::map temp_url_keys; // subuser attributes std::string subuser; @@ -122,7 +122,7 @@ struct RGWUserAdminOpState { std::string key; // secret key int32_t key_type{-1}; - std::set mfa_ids; + std::set mfa_ids; // operation attributes bool existing_user{false}; @@ -174,7 +174,7 @@ struct RGWUserAdminOpState { rgw_placement_rule default_placement; // user default placement bool default_placement_specified{false}; - list placement_tags; // user default placement_tags + std::list placement_tags; // user default placement_tags bool placement_tags_specified{false}; void set_access_key(const std::string& access_key) { @@ -244,7 +244,7 @@ struct RGWUserAdminOpState { op_mask_specified = true; } - void set_temp_url_key(const string& key, int index) { + void set_temp_url_key(const std::string& key, int index) { temp_url_keys[index] = key; temp_url_key_specified = true; } @@ -326,7 +326,7 @@ struct RGWUserAdminOpState { user_quota_specified = true; } - void set_mfa_ids(const std::set& ids) { + void set_mfa_ids(const std::set& ids) { mfa_ids = ids; mfa_ids_specified = true; } @@ -336,7 +336,7 @@ struct RGWUserAdminOpState { default_placement_specified = true; } - void set_placement_tags(const list& _tags) { + void set_placement_tags(const std::list& _tags) { placement_tags = _tags; placement_tags_specified = true; } @@ -377,7 +377,7 @@ struct RGWUserAdminOpState { uint32_t get_op_mask() { return op_mask; } RGWQuotaInfo& get_bucket_quota() { return bucket_quota; } RGWQuotaInfo& get_user_quota() { return user_quota; } - set& get_mfa_ids() { return mfa_ids; } + std::set& get_mfa_ids() { return mfa_ids; } rgw::sal::User* get_user() { return user.get(); } const rgw_user& get_user_id(); @@ -389,13 +389,13 @@ struct RGWUserAdminOpState { std::string get_display_name() { return display_name; } rgw_user& get_new_uid() { return new_user_id; } bool get_overwrite_new_user() const { return overwrite_new_user; } - map& get_temp_url_keys() { return temp_url_keys; } + std::map& get_temp_url_keys() { return temp_url_keys; } RGWUserInfo& get_user_info(); - map* get_swift_keys(); - map* get_access_keys(); - map* get_subusers(); + std::map* get_swift_keys(); + std::map* get_access_keys(); + std::map* get_subusers(); RGWUserCaps* get_caps_obj(); @@ -416,8 +416,8 @@ class RGWAccessKeyPool rgw_user user_id; rgw::sal::Store* store{nullptr}; - map *swift_keys{nullptr}; - map *access_keys{nullptr}; + std::map *swift_keys{nullptr}; + std::map *access_keys{nullptr}; // we don't want to allow keys for the anonymous user or a null user bool keys_allowed{false}; @@ -470,7 +470,7 @@ class RGWSubUserPool rgw::sal::Store* store{nullptr}; bool subusers_allowed{false}; - map *subuser_map{nullptr}; + std::map *subuser_map{nullptr}; private: int check_op(RGWUserAdminOpState& op_state, std::string *err_msg = NULL); @@ -670,7 +670,7 @@ public: struct RGWUserCompleteInfo { RGWUserInfo info; - map attrs; + std::map attrs; bool has_attrs{false}; void dump(Formatter * const f) const { @@ -736,7 +736,7 @@ public: RGWObjVersionTracker *objv_tracker{nullptr}; ceph::real_time *mtime{nullptr}; rgw_cache_entry_info *cache_info{nullptr}; - map *attrs{nullptr}; + std::map *attrs{nullptr}; GetParams() {} @@ -755,7 +755,7 @@ public: return *this; } - GetParams& set_attrs(map *_attrs) { + GetParams& set_attrs(std::map *_attrs) { attrs = _attrs; return *this; } @@ -766,7 +766,7 @@ public: RGWObjVersionTracker *objv_tracker{nullptr}; ceph::real_time mtime; bool exclusive{false}; - map *attrs{nullptr}; + std::map *attrs{nullptr}; PutParams() {} @@ -790,7 +790,7 @@ public: return *this; } - PutParams& set_attrs(map *_attrs) { + PutParams& set_attrs(std::map *_attrs) { attrs = _attrs; return *this; } @@ -811,18 +811,18 @@ public: const rgw_user& uid, RGWUserInfo *info, optional_yield y, const GetParams& params = {}); int get_info_by_email(const DoutPrefixProvider *dpp, - const string& email, RGWUserInfo *info, + const std::string& email, RGWUserInfo *info, optional_yield y, const GetParams& params = {}); int get_info_by_swift(const DoutPrefixProvider *dpp, - const string& swift_name, RGWUserInfo *info, + const std::string& swift_name, RGWUserInfo *info, optional_yield y, const GetParams& params = {}); int get_info_by_access_key(const DoutPrefixProvider *dpp, - const string& access_key, RGWUserInfo *info, + const std::string& access_key, RGWUserInfo *info, optional_yield y, const GetParams& params = {}); int get_attrs_by_uid(const DoutPrefixProvider *dpp, const rgw_user& user_id, - map *attrs, + std::map *attrs, optional_yield y, RGWObjVersionTracker *objv_tracker = nullptr); @@ -843,8 +843,8 @@ public: const rgw_bucket& bucket, optional_yield y); int list_buckets(const DoutPrefixProvider *dpp, const rgw_user& user, - const string& marker, - const string& end_marker, + const std::string& marker, + const std::string& end_marker, uint64_t max, bool need_stats, RGWUserBuckets *buckets, diff --git a/src/rgw/rgw_website.cc b/src/rgw/rgw_website.cc index ff58786c77d0f..8710228570645 100644 --- a/src/rgw/rgw_website.cc +++ b/src/rgw/rgw_website.cc @@ -25,7 +25,7 @@ #include "include/types.h" #include "rgw_website.h" - +using namespace std; bool RGWBWRoutingRuleCondition::check_key_condition(const string& key) { return (key.size() >= key_prefix_equals.size() && diff --git a/src/rgw/rgw_worker.h b/src/rgw/rgw_worker.h index f878ff8a6d18d..d01456172a00e 100644 --- a/src/rgw/rgw_worker.h +++ b/src/rgw/rgw_worker.h @@ -67,12 +67,12 @@ protected: std::atomic down_flag = { false }; - string thread_name; + std::string thread_name; virtual uint64_t interval_msec() = 0; virtual void stop_process() {} public: - RGWRadosThread(RGWRados *_store, const string& thread_name = "radosgw") + RGWRadosThread(RGWRados *_store, const std::string& thread_name = "radosgw") : worker(NULL), cct(_store->ctx()), store(_store), thread_name(thread_name) {} virtual ~RGWRadosThread() { stop(); diff --git a/src/rgw/rgw_xml.cc b/src/rgw/rgw_xml.cc index 19f0ac4f98eee..22a62ac480a5a 100644 --- a/src/rgw/rgw_xml.cc +++ b/src/rgw/rgw_xml.cc @@ -13,6 +13,8 @@ #include "rgw_xml.h" +using namespace std; + XMLObjIter:: XMLObjIter() { diff --git a/src/rgw/rgw_xml.h b/src/rgw/rgw_xml.h index b3e1e8ee681fc..c56c8c5247d74 100644 --- a/src/rgw/rgw_xml.h +++ b/src/rgw/rgw_xml.h @@ -16,8 +16,8 @@ class RGWXMLParser; class XMLObjIter { public: - typedef map::iterator map_iter_t; - typedef map::iterator const_map_iter_t; + typedef std::map::iterator map_iter_t; + typedef std::map::iterator const_map_iter_t; XMLObjIter(); ~XMLObjIter(); @@ -76,7 +76,7 @@ public: // return the first sub-tags matching the name XMLObj *find_first(const std::string& name); - friend ostream& operator<<(ostream &out, const XMLObj &obj); + friend std::ostream& operator<<(std::ostream &out, const XMLObj &obj); friend RGWXMLParser; }; @@ -165,7 +165,7 @@ namespace RGWXMLDecoder { void decode_xml(const char *name, T& val, T& default_val, XMLObj* obj); } -static inline ostream& operator<<(ostream &out, RGWXMLDecoder::err& err) +static inline std::ostream& operator<<(std::ostream &out, RGWXMLDecoder::err& err) { return out << err.what(); } @@ -176,7 +176,7 @@ void decode_xml_obj(T& val, XMLObj *obj) val.decode_xml(obj); } -static inline void decode_xml_obj(string& val, XMLObj *obj) +static inline void decode_xml_obj(std::string& val, XMLObj *obj) { val = obj->get_data(); } @@ -200,7 +200,7 @@ void decode_xml_obj(std::optional& val, XMLObj *obj) } template -void do_decode_xml_obj(list& l, const string& name, XMLObj *obj) +void do_decode_xml_obj(std::list& l, const std::string& name, XMLObj *obj) { l.clear(); @@ -221,7 +221,7 @@ bool RGWXMLDecoder::decode_xml(const char *name, T& val, XMLObj *obj, bool manda XMLObj *o = iter.get_next(); if (!o) { if (mandatory) { - string s = "missing mandatory field " + string(name); + std::string s = "missing mandatory field " + std::string(name); throw err(s); } val = T(); @@ -231,7 +231,7 @@ bool RGWXMLDecoder::decode_xml(const char *name, T& val, XMLObj *obj, bool manda try { decode_xml_obj(val, o); } catch (const err& e) { - string s = string(name) + ": "; + std::string s = std::string(name) + ": "; s.append(e.what()); throw err(s); } @@ -249,7 +249,7 @@ bool RGWXMLDecoder::decode_xml(const char *name, std::vector& v, XMLObj *obj, if (!o) { if (mandatory) { - string s = "missing mandatory field " + string(name); + std::string s = "missing mandatory field " + std::string(name); throw err(s); } return false; @@ -260,7 +260,7 @@ bool RGWXMLDecoder::decode_xml(const char *name, std::vector& v, XMLObj *obj, try { decode_xml_obj(val, o); } catch (const err& e) { - string s = string(name) + ": "; + std::string s = std::string(name) + ": "; s.append(e.what()); throw err(s); } @@ -278,7 +278,7 @@ bool RGWXMLDecoder::decode_xml(const char *name, C& container, void (*cb)(C&, XM XMLObj *o = iter.get_next(); if (!o) { if (mandatory) { - string s = "missing mandatory field " + string(name); + std::string s = "missing mandatory field " + std::string(name); throw err(s); } return false; @@ -287,7 +287,7 @@ bool RGWXMLDecoder::decode_xml(const char *name, C& container, void (*cb)(C&, XM try { decode_xml_obj(container, cb, o); } catch (const err& e) { - string s = string(name) + ": "; + std::string s = std::string(name) + ": "; s.append(e.what()); throw err(s); } @@ -309,7 +309,7 @@ void RGWXMLDecoder::decode_xml(const char *name, T& val, T& default_val, XMLObj decode_xml_obj(val, o); } catch (const err& e) { val = default_val; - string s = string(name) + ": "; + std::string s = std::string(name) + ": "; s.append(e.what()); throw err(s); } @@ -331,7 +331,7 @@ static void encode_xml(const char *name, const char *ns, const T& val, ceph::For f->close_section(); } -void encode_xml(const char *name, const string& val, ceph::Formatter *f); +void encode_xml(const char *name, const std::string& val, ceph::Formatter *f); void encode_xml(const char *name, const char *val, ceph::Formatter *f); void encode_xml(const char *name, bool val, ceph::Formatter *f); void encode_xml(const char *name, int val, ceph::Formatter *f); diff --git a/src/rgw/rgw_xml_enc.cc b/src/rgw/rgw_xml_enc.cc index 3c7afcbbdc7b4..c12d15f4bc5a3 100644 --- a/src/rgw/rgw_xml_enc.cc +++ b/src/rgw/rgw_xml_enc.cc @@ -21,6 +21,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + void RGWBWRedirectInfo::dump_xml(Formatter *f) const { if (!redirect.protocol.empty()) { diff --git a/src/rgw/rgw_zone.cc b/src/rgw/rgw_zone.cc index 4c4b47b145dcd..9dd98d43f5dff 100644 --- a/src/rgw/rgw_zone.cc +++ b/src/rgw/rgw_zone.cc @@ -41,6 +41,7 @@ std::string default_storage_pool_suffix = "rgw.buckets.data"; } +using namespace std; using namespace rgw_zone_defaults; RGWMetaSyncStatusManager::~RGWMetaSyncStatusManager(){} diff --git a/src/rgw/rgw_zone.h b/src/rgw/rgw_zone.h index c167dd4d73e57..2823d54fc71bb 100644 --- a/src/rgw/rgw_zone.h +++ b/src/rgw/rgw_zone.h @@ -184,7 +184,7 @@ WRITE_CLASS_ENCODER(RGWZoneStorageClass) class RGWZoneStorageClasses { - map m; + std::map m; /* in memory only */ RGWZoneStorageClass *standard_class; @@ -207,7 +207,7 @@ public: return *standard_class; } - bool find(const string& sc, const RGWZoneStorageClass **pstorage_class) const { + bool find(const std::string& sc, const RGWZoneStorageClass **pstorage_class) const { auto iter = m.find(sc); if (iter == m.end()) { return false; @@ -216,7 +216,7 @@ public: return true; } - bool exists(const string& sc) const { + bool exists(const std::string& sc) const { if (sc.empty()) { return true; } @@ -224,16 +224,16 @@ public: return (iter != m.end()); } - const map& get_all() const { + const std::map& get_all() const { return m; } - map& get_all() { + std::map& get_all() { return m; } - void set_storage_class(const string& sc, const rgw_pool *data_pool, const string *compression_type) { - const string *psc = ≻ + void set_storage_class(const std::string& sc, const rgw_pool *data_pool, const std::string *compression_type) { + const std::string *psc = ≻ if (sc.empty()) { psc = &RGW_STORAGE_CLASS_STANDARD; } @@ -246,7 +246,7 @@ public: } } - void remove_storage_class(const string& sc) { + void remove_storage_class(const std::string& sc) { if (!sc.empty()) { m.erase(sc); } @@ -285,7 +285,7 @@ struct RGWZonePlacementInfo { encode(standard_data_pool.to_str(), bl); encode(data_extra_pool.to_str(), bl); encode((uint32_t)index_type, bl); - string standard_compression_type = get_compression_type(RGW_STORAGE_CLASS_STANDARD); + std::string standard_compression_type = get_compression_type(RGW_STORAGE_CLASS_STANDARD); encode(standard_compression_type, bl); encode(storage_classes, bl); ENCODE_FINISH(bl); @@ -293,14 +293,14 @@ struct RGWZonePlacementInfo { void decode(bufferlist::const_iterator& bl) { DECODE_START(7, bl); - string index_pool_str; - string data_pool_str; + std::string index_pool_str; + std::string data_pool_str; decode(index_pool_str, bl); index_pool = rgw_pool(index_pool_str); decode(data_pool_str, bl); rgw_pool standard_data_pool(data_pool_str); if (struct_v >= 4) { - string data_extra_pool_str; + std::string data_extra_pool_str; decode(data_extra_pool_str, bl); data_extra_pool = rgw_pool(data_extra_pool_str); } @@ -309,7 +309,7 @@ struct RGWZonePlacementInfo { decode(it, bl); index_type = (rgw::BucketIndexType)it; } - string standard_compression_type; + std::string standard_compression_type; if (struct_v >= 6) { decode(standard_compression_type, bl); } @@ -328,7 +328,7 @@ struct RGWZonePlacementInfo { } return data_extra_pool; } - const rgw_pool& get_data_pool(const string& sc) const { + const rgw_pool& get_data_pool(const std::string& sc) const { const RGWZoneStorageClass *storage_class; static rgw_pool no_pool; @@ -342,9 +342,9 @@ struct RGWZonePlacementInfo { return get_data_pool(RGW_STORAGE_CLASS_STANDARD); } - const string& get_compression_type(const string& sc) const { + const std::string& get_compression_type(const std::string& sc) const { const RGWZoneStorageClass *storage_class; - static string no_compression; + static std::string no_compression; if (!storage_classes.find(sc, &storage_class)) { return no_compression; @@ -352,7 +352,7 @@ struct RGWZonePlacementInfo { return storage_class->compression_type.get_value_or(no_compression); } - bool storage_class_exists(const string& sc) const { + bool storage_class_exists(const std::string& sc) const { return storage_classes.exists(sc); } @@ -382,7 +382,7 @@ struct RGWZoneParams : RGWSystemMetaObj { RGWAccessKey system_key; - map placement_pools; + std::map placement_pools; std::string realm_id; @@ -413,7 +413,7 @@ struct RGWZoneParams : RGWSystemMetaObj { int create(const DoutPrefixProvider *dpp, optional_yield y, bool exclusive = true) override; int fix_pool_names(const DoutPrefixProvider *dpp, optional_yield y); - const string& get_compression_type(const rgw_placement_rule& placement_rule) const; + const std::string& get_compression_type(const rgw_placement_rule& placement_rule) const; void encode(bufferlist& bl) const override { ENCODE_START(14, 1, bl); @@ -434,7 +434,7 @@ struct RGWZoneParams : RGWSystemMetaObj { encode(unused_metadata_heap, bl); encode(realm_id, bl); encode(lc_pool, bl); - map old_tier_config; + std::map old_tier_config; encode(old_tier_config, bl); encode(roles_pool, bl); encode(reshard_pool, bl); @@ -479,7 +479,7 @@ struct RGWZoneParams : RGWSystemMetaObj { } else { lc_pool = log_pool.name + ":lc"; } - map old_tier_config; + std::map old_tier_config; if (struct_v >= 8) { decode(old_tier_config, bl); } @@ -519,7 +519,7 @@ struct RGWZoneParams : RGWSystemMetaObj { } void dump(Formatter *f) const; void decode_json(JSONObj *obj); - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); bool get_placement(const std::string& placement_id, RGWZonePlacementInfo *placement) const { auto iter = placement_pools.find(placement_id); @@ -571,7 +571,7 @@ WRITE_CLASS_ENCODER(RGWZoneParams) struct RGWZone { std::string id; std::string name; - list endpoints; + std::list endpoints; bool log_meta; bool log_data; bool read_only; @@ -594,7 +594,7 @@ struct RGWZone { static constexpr uint32_t default_bucket_index_max_shards = 11; bool sync_from_all; - set sync_from; /* list of zones to sync from */ + std::set sync_from; /* list of zones to sync from */ RGWZone() : log_meta(false), log_data(false), read_only(false), @@ -649,7 +649,7 @@ struct RGWZone { } void dump(Formatter *f) const; void decode_json(JSONObj *obj); - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); bool is_read_only() const { return read_only; } @@ -681,10 +681,10 @@ WRITE_CLASS_ENCODER(RGWDefaultZoneGroupInfo) struct RGWZoneGroupPlacementTarget { std::string name; - set tags; - set storage_classes; + std::set tags; + std::set storage_classes; - bool user_permitted(const list& user_tags) const { + bool user_permitted(const std::list& user_tags) const { if (tags.empty()) { return true; } @@ -723,24 +723,24 @@ WRITE_CLASS_ENCODER(RGWZoneGroupPlacementTarget) struct RGWZoneGroup : public RGWSystemMetaObj { std::string api_name; - list endpoints; + std::list endpoints; bool is_master = false; rgw_zone_id master_zone; - map zones; + std::map zones; - map placement_targets; + std::map placement_targets; rgw_placement_rule default_placement; - list hostnames; - list hostnames_s3website; - // TODO: Maybe convert hostnames to a map> for + std::list hostnames; + std::list hostnames_s3website; + // TODO: Maybe convert hostnames to a map> for // endpoint_type->hostnames /* 20:05 < _robbat21irssi> maybe I do someting like: if (hostname_map.empty()) { populate all map keys from hostnames; }; 20:05 < _robbat21irssi> but that's a later compatability migration planning bit 20:06 < yehudasa> more like if (!hostnames.empty()) { -20:06 < yehudasa> for (list::iterator iter = hostnames.begin(); iter != hostnames.end(); ++iter) { +20:06 < yehudasa> for (std::list::iterator iter = hostnames.begin(); iter != hostnames.end(); ++iter) { 20:06 < yehudasa> hostname_map["s3"].append(iter->second); 20:07 < yehudasa> hostname_map["s3website"].append(iter->second); 20:07 < yehudasa> s/append/push_back/g @@ -748,8 +748,8 @@ struct RGWZoneGroup : public RGWSystemMetaObj { 20:08 < yehudasa> yeah, probably 20:08 < _robbat21irssi> s3, s3website, swift, swith_auth, swift_website */ - map > api_hostname_map; - map > api_endpoints_map; + std::map > api_hostname_map; + std::map > api_endpoints_map; std::string realm_id; @@ -759,7 +759,7 @@ struct RGWZoneGroup : public RGWSystemMetaObj { RGWZoneGroup(const std::string &id, const std::string &name):RGWSystemMetaObj(id, name) {} explicit RGWZoneGroup(const std::string &_name):RGWSystemMetaObj(_name) {} RGWZoneGroup(const std::string &_name, bool _is_master, CephContext *cct, RGWSI_SysObj* sysobj_svc, - const std::string& _realm_id, const list& _endpoints) + const std::string& _realm_id, const std::list& _endpoints) : RGWSystemMetaObj(_name, cct , sysobj_svc), endpoints(_endpoints), is_master(_is_master), realm_id(_realm_id) {} @@ -822,9 +822,9 @@ struct RGWZoneGroup : public RGWSystemMetaObj { int equals(const std::string& other_zonegroup) const; int add_zone(const DoutPrefixProvider *dpp, const RGWZoneParams& zone_params, bool *is_master, bool *read_only, - const list& endpoints, const std::string *ptier_type, - bool *psync_from_all, list& sync_from, - list& sync_from_rm, std::string *predirect_zone, + const std::list& endpoints, const std::string *ptier_type, + bool *psync_from_all, std::list& sync_from, + std::list& sync_from_rm, std::string *predirect_zone, std::optional bucket_index_max_shards, RGWSyncModulesManager *sync_mgr, optional_yield y); int remove_zone(const DoutPrefixProvider *dpp, const std::string& zone_id, optional_yield y); @@ -838,16 +838,16 @@ struct RGWZoneGroup : public RGWSystemMetaObj { void dump(Formatter *f) const; void decode_json(JSONObj *obj); - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; WRITE_CLASS_ENCODER(RGWZoneGroup) struct RGWPeriodMap { std::string id; - map zonegroups; - map zonegroups_by_api; - map short_zone_ids; + std::map zonegroups; + std::map zonegroups_by_api; + std::map short_zone_ids; std::string master_zonegroup; @@ -870,7 +870,7 @@ struct RGWPeriodMap bool find_zone_by_id(const rgw_zone_id& zone_id, RGWZoneGroup *zonegroup, RGWZone *zone) const; - bool find_zone_by_name(const string& zone_id, + bool find_zone_by_name(const std::string& zone_id, RGWZoneGroup *zonegroup, RGWZone *zone) const; }; @@ -912,7 +912,7 @@ WRITE_CLASS_ENCODER(RGWPeriodConfig) /* for backward comaptability */ struct RGWRegionMap { - map regions; + std::map regions; std::string master_region; @@ -929,8 +929,8 @@ WRITE_CLASS_ENCODER(RGWRegionMap) struct RGWZoneGroupMap { - map zonegroups; - map zonegroups_by_api; + std::map zonegroups; + std::map zonegroups_by_api; std::string master_zonegroup; @@ -994,7 +994,7 @@ public: void dump(Formatter *f) const; void decode_json(JSONObj *obj); - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); const std::string& get_current_period() const { return current_period; @@ -1038,7 +1038,7 @@ struct RGWPeriodLatestEpochInfo { void dump(Formatter *f) const; void decode_json(JSONObj *obj); - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); }; WRITE_CLASS_ENCODER(RGWPeriodLatestEpochInfo) @@ -1127,7 +1127,7 @@ public: period_config.bucket_quota = bucket_quota; } - void set_id(const string& _id) { + void set_id(const std::string& _id) { this->id = _id; period_map.id = _id; } @@ -1233,7 +1233,7 @@ public: } void dump(Formatter *f) const; void decode_json(JSONObj *obj); - static void generate_test_instances(list& o); + static void generate_test_instances(std::list& o); static std::string get_staging_id(const std::string& realm_id) { return realm_id + ":staging"; diff --git a/src/rgw/services/svc_bi_rados.cc b/src/rgw/services/svc_bi_rados.cc index dd9bcc6add235..950ded02f6345 100644 --- a/src/rgw/services/svc_bi_rados.cc +++ b/src/rgw/services/svc_bi_rados.cc @@ -13,6 +13,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + static string dir_oid_prefix = ".dir."; RGWSI_BucketIndex_RADOS::RGWSI_BucketIndex_RADOS(CephContext *cct) : RGWSI_BucketIndex(cct) diff --git a/src/rgw/services/svc_bi_rados.h b/src/rgw/services/svc_bi_rados.h index 9037f43c8af35..85eb3e5b7fede 100644 --- a/src/rgw/services/svc_bi_rados.h +++ b/src/rgw/services/svc_bi_rados.h @@ -47,22 +47,22 @@ class RGWSI_BucketIndex_RADOS : public RGWSI_BucketIndex int open_bucket_index_base(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWSI_RADOS::Pool *index_pool, - string *bucket_oid_base); + std::string *bucket_oid_base); - void get_bucket_index_object(const string& bucket_oid_base, + void get_bucket_index_object(const std::string& bucket_oid_base, uint32_t num_shards, int shard_id, uint64_t gen_id, - string *bucket_obj); - int get_bucket_index_object(const string& bucket_oid_base, const string& obj_key, + std::string *bucket_obj); + int get_bucket_index_object(const std::string& bucket_oid_base, const std::string& obj_key, uint32_t num_shards, rgw::BucketHashType hash_type, - string *bucket_obj, int *shard_id); + std::string *bucket_obj, int *shard_id); int cls_bucket_head(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, int shard_id, - vector *headers, - map *bucket_instance_ids, + std::vector *headers, + std::map *bucket_instance_ids, optional_yield y); public: @@ -85,7 +85,7 @@ public: return RGW_SHARDS_PRIME_1; } - static int shard_id(const string& key, int max_shards) { + static int shard_id(const std::string& key, int max_shards) { return rgw_shard_id(key, max_shards); } @@ -115,7 +115,7 @@ public: int open_bucket_index_shard(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, - const string& obj_key, + const std::string& obj_key, RGWSI_RADOS::Obj *bucket_obj, int *shard_id); @@ -128,14 +128,14 @@ public: int open_bucket_index(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, RGWSI_RADOS::Pool *index_pool, - string *bucket_oid); + std::string *bucket_oid); int open_bucket_index(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, std::optional shard_id, RGWSI_RADOS::Pool *index_pool, - map *bucket_objs, - map *bucket_instance_ids); + std::map *bucket_objs, + std::map *bucket_instance_ids); }; diff --git a/src/rgw/services/svc_bilog_rados.cc b/src/rgw/services/svc_bilog_rados.cc index 06cf5ce7a67ed..79f096e839ae1 100644 --- a/src/rgw/services/svc_bilog_rados.cc +++ b/src/rgw/services/svc_bilog_rados.cc @@ -6,9 +6,10 @@ #include "cls/rgw/cls_rgw_client.h" - #define dout_subsys ceph_subsys_rgw +using namespace std; + RGWSI_BILog_RADOS::RGWSI_BILog_RADOS(CephContext *cct) : RGWServiceInstance(cct) { } diff --git a/src/rgw/services/svc_bilog_rados.h b/src/rgw/services/svc_bilog_rados.h index 84f5679af1051..8bebf72113bbd 100644 --- a/src/rgw/services/svc_bilog_rados.h +++ b/src/rgw/services/svc_bilog_rados.h @@ -54,7 +54,7 @@ public: int get_log_status(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, int shard_id, - map *markers, + std::map *markers, optional_yield y); }; diff --git a/src/rgw/services/svc_bucket.cc b/src/rgw/services/svc_bucket.cc index dff3677cf2be6..b115990d2bf80 100644 --- a/src/rgw/services/svc_bucket.cc +++ b/src/rgw/services/svc_bucket.cc @@ -6,7 +6,7 @@ #define dout_subsys ceph_subsys_rgw -string RGWSI_Bucket::get_entrypoint_meta_key(const rgw_bucket& bucket) +std::string RGWSI_Bucket::get_entrypoint_meta_key(const rgw_bucket& bucket) { if (bucket.bucket_id.empty()) { return bucket.get_key(); @@ -18,7 +18,7 @@ string RGWSI_Bucket::get_entrypoint_meta_key(const rgw_bucket& bucket) return b.get_key(); } -string RGWSI_Bucket::get_bi_meta_key(const rgw_bucket& bucket) +std::string RGWSI_Bucket::get_bi_meta_key(const rgw_bucket& bucket) { return bucket.get_key(); } diff --git a/src/rgw/services/svc_bucket.h b/src/rgw/services/svc_bucket.h index fcdabca8b6f21..f1212c9d86f0a 100644 --- a/src/rgw/services/svc_bucket.h +++ b/src/rgw/services/svc_bucket.h @@ -27,44 +27,44 @@ public: RGWSI_Bucket(CephContext *cct) : RGWServiceInstance(cct) {} virtual ~RGWSI_Bucket() {} - static string get_entrypoint_meta_key(const rgw_bucket& bucket); - static string get_bi_meta_key(const rgw_bucket& bucket); + static std::string get_entrypoint_meta_key(const rgw_bucket& bucket); + static std::string get_bi_meta_key(const rgw_bucket& bucket); virtual RGWSI_Bucket_BE_Handler& get_ep_be_handler() = 0; virtual RGWSI_BucketInstance_BE_Handler& get_bi_be_handler() = 0; virtual int read_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx, - const string& key, + const std::string& key, RGWBucketEntryPoint *entry_point, RGWObjVersionTracker *objv_tracker, real_time *pmtime, - map *pattrs, + std::map *pattrs, optional_yield y, const DoutPrefixProvider *dpp, rgw_cache_entry_info *cache_info = nullptr, boost::optional refresh_version = boost::none) = 0; virtual int store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx, - const string& key, + const std::string& key, RGWBucketEntryPoint& info, bool exclusive, real_time mtime, - map *pattrs, + std::map *pattrs, RGWObjVersionTracker *objv_tracker, optional_yield y, const DoutPrefixProvider *dpp) = 0; virtual int remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx, - const string& key, + const std::string& key, RGWObjVersionTracker *objv_tracker, optional_yield y, const DoutPrefixProvider *dpp) = 0; virtual int read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx, - const string& key, + const std::string& key, RGWBucketInfo *info, real_time *pmtime, - map *pattrs, + std::map *pattrs, optional_yield y, const DoutPrefixProvider *dpp, rgw_cache_entry_info *cache_info = nullptr, @@ -74,24 +74,24 @@ public: const rgw_bucket& bucket, RGWBucketInfo *info, real_time *pmtime, - map *pattrs, + std::map *pattrs, boost::optional refresh_version, optional_yield y, const DoutPrefixProvider *dpp) = 0; virtual int store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx, - const string& key, + const std::string& key, RGWBucketInfo& info, std::optional orig_info, /* nullopt: orig_info was not fetched, nullptr: orig_info was not found (new bucket instance */ bool exclusive, real_time mtime, - map *pattrs, + std::map *pattrs, optional_yield y, const DoutPrefixProvider *dpp) = 0; virtual int remove_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx, - const string& key, + const std::string& key, const RGWBucketInfo& bucket_info, RGWObjVersionTracker *objv_tracker, optional_yield y, @@ -104,7 +104,7 @@ public: const DoutPrefixProvider *dpp) = 0; virtual int read_buckets_stats(RGWSI_Bucket_X_Ctx& ctx, - map& m, + std::map& m, optional_yield y, const DoutPrefixProvider *dpp) = 0; }; diff --git a/src/rgw/services/svc_bucket_sobj.cc b/src/rgw/services/svc_bucket_sobj.cc index f4086e8bd0dda..c5bdd69b0746e 100644 --- a/src/rgw/services/svc_bucket_sobj.cc +++ b/src/rgw/services/svc_bucket_sobj.cc @@ -19,6 +19,8 @@ #define RGW_BUCKET_INSTANCE_MD_PREFIX ".bucket.meta." +using namespace std; + class RGWSI_Bucket_SObj_Module : public RGWSI_MBSObj_Handler_Module { RGWSI_Bucket_SObj::Svc& svc; diff --git a/src/rgw/services/svc_bucket_sobj.h b/src/rgw/services/svc_bucket_sobj.h index 776367e8aba4f..643291536a513 100644 --- a/src/rgw/services/svc_bucket_sobj.h +++ b/src/rgw/services/svc_bucket_sobj.h @@ -40,11 +40,11 @@ class RGWSI_Bucket_SObj : public RGWSI_Bucket struct bucket_info_cache_entry { RGWBucketInfo info; real_time mtime; - map attrs; + std::map attrs; }; using RGWChainedCacheImpl_bucket_info_cache_entry = RGWChainedCacheImpl; - unique_ptr binfo_cache; + std::unique_ptr binfo_cache; RGWSI_Bucket_BE_Handler ep_be_handler; std::unique_ptr ep_be_module; @@ -54,10 +54,10 @@ class RGWSI_Bucket_SObj : public RGWSI_Bucket int do_start(optional_yield, const DoutPrefixProvider *dpp) override; int do_read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx, - const string& key, + const std::string& key, RGWBucketInfo *info, real_time *pmtime, - map *pattrs, + std::map *pattrs, rgw_cache_entry_info *cache_info, boost::optional refresh_version, optional_yield y, @@ -103,37 +103,37 @@ public: int read_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx, - const string& key, + const std::string& key, RGWBucketEntryPoint *entry_point, RGWObjVersionTracker *objv_tracker, real_time *pmtime, - map *pattrs, + std::map *pattrs, optional_yield y, const DoutPrefixProvider *dpp, rgw_cache_entry_info *cache_info = nullptr, boost::optional refresh_version = boost::none) override; int store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx, - const string& key, + const std::string& key, RGWBucketEntryPoint& info, bool exclusive, real_time mtime, - map *pattrs, + std::map *pattrs, RGWObjVersionTracker *objv_tracker, optional_yield y, const DoutPrefixProvider *dpp) override; int remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx, - const string& key, + const std::string& key, RGWObjVersionTracker *objv_tracker, optional_yield y, const DoutPrefixProvider *dpp) override; int read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx, - const string& key, + const std::string& key, RGWBucketInfo *info, real_time *pmtime, - map *pattrs, + std::map *pattrs, optional_yield y, const DoutPrefixProvider *dpp, rgw_cache_entry_info *cache_info = nullptr, @@ -143,24 +143,24 @@ public: const rgw_bucket& bucket, RGWBucketInfo *info, real_time *pmtime, - map *pattrs, + std::map *pattrs, boost::optional refresh_version, optional_yield y, const DoutPrefixProvider *dpp) override; int store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx, - const string& key, + const std::string& key, RGWBucketInfo& info, std::optional orig_info, /* nullopt: orig_info was not fetched, nullptr: orig_info was not found (new bucket instance */ bool exclusive, real_time mtime, - map *pattrs, + std::map *pattrs, optional_yield y, const DoutPrefixProvider *dpp) override; int remove_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx, - const string& key, + const std::string& key, const RGWBucketInfo& bucket_info, RGWObjVersionTracker *objv_tracker, optional_yield y, @@ -173,7 +173,7 @@ public: const DoutPrefixProvider *dpp) override; int read_buckets_stats(RGWSI_Bucket_X_Ctx& ctx, - map& m, + std::map& m, optional_yield y, const DoutPrefixProvider *dpp) override; }; diff --git a/src/rgw/services/svc_bucket_sync_sobj.cc b/src/rgw/services/svc_bucket_sync_sobj.cc index 52cd64617c9b8..87a2372488cc6 100644 --- a/src/rgw/services/svc_bucket_sync_sobj.cc +++ b/src/rgw/services/svc_bucket_sync_sobj.cc @@ -9,6 +9,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + static string bucket_sync_sources_oid_prefix = "bucket.sync-source-hints"; static string bucket_sync_targets_oid_prefix = "bucket.sync-target-hints"; diff --git a/src/rgw/services/svc_bucket_sync_sobj.h b/src/rgw/services/svc_bucket_sync_sobj.h index 60786665d1d5a..951affb2d4e17 100644 --- a/src/rgw/services/svc_bucket_sync_sobj.h +++ b/src/rgw/services/svc_bucket_sync_sobj.h @@ -39,18 +39,18 @@ class RGWSI_Bucket_Sync_SObj : public RGWSI_Bucket_Sync std::shared_ptr handler; }; - unique_ptr > sync_policy_cache; + std::unique_ptr > sync_policy_cache; std::unique_ptr hint_index_mgr; int do_start(optional_yield, const DoutPrefixProvider *dpp) override; struct optional_zone_bucket { - optional zone; - optional bucket; + std::optional zone; + std::optional bucket; - optional_zone_bucket(const optional& _zone, - const optional& _bucket) : zone(_zone), bucket(_bucket) {} + optional_zone_bucket(const std::optional& _zone, + const std::optional& _bucket) : zone(_zone), bucket(_bucket) {} bool operator<(const optional_zone_bucket& ozb) const { if (zone < ozb.zone) { diff --git a/src/rgw/services/svc_cls.cc b/src/rgw/services/svc_cls.cc index d2aaa6d889d94..73b9328ebc22b 100644 --- a/src/rgw/services/svc_cls.cc +++ b/src/rgw/services/svc_cls.cc @@ -15,6 +15,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + static string log_lock_name = "rgw_log_lock"; int RGWSI_Cls::do_start(optional_yield y, const DoutPrefixProvider *dpp) diff --git a/src/rgw/services/svc_cls.h b/src/rgw/services/svc_cls.h index 61487b2f95487..ca17d0f8f2e6c 100644 --- a/src/rgw/services/svc_cls.h +++ b/src/rgw/services/svc_cls.h @@ -58,96 +58,96 @@ public: public: MFA(CephContext *cct): ClsSubService(cct) {} - string get_mfa_oid(const rgw_user& user) { - return string("user:") + user.to_str(); + std::string get_mfa_oid(const rgw_user& user) { + return std::string("user:") + user.to_str(); } - int check_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, const string& otp_id, const string& pin, optional_yield y); + int check_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, const std::string& otp_id, const std::string& pin, optional_yield y); int create_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, const rados::cls::otp::otp_info_t& config, RGWObjVersionTracker *objv_tracker, const ceph::real_time& mtime, optional_yield y); int remove_mfa(const DoutPrefixProvider *dpp, - const rgw_user& user, const string& id, + const rgw_user& user, const std::string& id, RGWObjVersionTracker *objv_tracker, const ceph::real_time& mtime, optional_yield y); - int get_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, const string& id, rados::cls::otp::otp_info_t *result, optional_yield y); - int list_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, list *result, optional_yield y); + int get_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, const std::string& id, rados::cls::otp::otp_info_t *result, optional_yield y); + int list_mfa(const DoutPrefixProvider *dpp, const rgw_user& user, std::list *result, optional_yield y); int otp_get_current_time(const DoutPrefixProvider *dpp, const rgw_user& user, ceph::real_time *result, optional_yield y); - int set_mfa(const DoutPrefixProvider *dpp, const string& oid, const list& entries, + int set_mfa(const DoutPrefixProvider *dpp, const std::string& oid, const std::list& entries, bool reset_obj, RGWObjVersionTracker *objv_tracker, const real_time& mtime, optional_yield y); - int list_mfa(const DoutPrefixProvider *dpp, const string& oid, list *result, + int list_mfa(const DoutPrefixProvider *dpp, const std::string& oid, std::list *result, RGWObjVersionTracker *objv_tracker, ceph::real_time *pmtime, optional_yield y); } mfa; class TimeLog : public ClsSubService { - int init_obj(const DoutPrefixProvider *dpp, const string& oid, RGWSI_RADOS::Obj& obj); + int init_obj(const DoutPrefixProvider *dpp, const std::string& oid, RGWSI_RADOS::Obj& obj); public: TimeLog(CephContext *cct): ClsSubService(cct) {} void prepare_entry(cls_log_entry& entry, const real_time& ut, - const string& section, - const string& key, + const std::string& section, + const std::string& key, bufferlist& bl); int add(const DoutPrefixProvider *dpp, - const string& oid, + const std::string& oid, const real_time& ut, - const string& section, - const string& key, + const std::string& section, + const std::string& key, bufferlist& bl, optional_yield y); int add(const DoutPrefixProvider *dpp, - const string& oid, + const std::string& oid, std::list& entries, librados::AioCompletion *completion, bool monotonic_inc, optional_yield y); int list(const DoutPrefixProvider *dpp, - const string& oid, + const std::string& oid, const real_time& start_time, const real_time& end_time, - int max_entries, list& entries, - const string& marker, - string *out_marker, + int max_entries, std::list& entries, + const std::string& marker, + std::string *out_marker, bool *truncated, optional_yield y); int info(const DoutPrefixProvider *dpp, - const string& oid, + const std::string& oid, cls_log_header *header, optional_yield y); int info_async(const DoutPrefixProvider *dpp, RGWSI_RADOS::Obj& obj, - const string& oid, + const std::string& oid, cls_log_header *header, librados::AioCompletion *completion); int trim(const DoutPrefixProvider *dpp, - const string& oid, + const std::string& oid, const real_time& start_time, const real_time& end_time, - const string& from_marker, - const string& to_marker, + const std::string& from_marker, + const std::string& to_marker, librados::AioCompletion *completion, optional_yield y); } timelog; class Lock : public ClsSubService { - int init_obj(const string& oid, RGWSI_RADOS::Obj& obj); + int init_obj(const std::string& oid, RGWSI_RADOS::Obj& obj); public: Lock(CephContext *cct): ClsSubService(cct) {} int lock_exclusive(const DoutPrefixProvider *dpp, const rgw_pool& pool, - const string& oid, + const std::string& oid, timespan& duration, - string& zone_id, - string& owner_id, - std::optional lock_name = std::nullopt); + std::string& zone_id, + std::string& owner_id, + std::optional lock_name = std::nullopt); int unlock(const DoutPrefixProvider *dpp, const rgw_pool& pool, - const string& oid, - string& zone_id, - string& owner_id, - std::optional lock_name = std::nullopt); + const std::string& oid, + std::string& zone_id, + std::string& owner_id, + std::optional lock_name = std::nullopt); } lock; RGWSI_Cls(CephContext *cct): RGWServiceInstance(cct), mfa(cct), timelog(cct), lock(cct) {} diff --git a/src/rgw/services/svc_config_key.h b/src/rgw/services/svc_config_key.h index e008aea5ff43c..1740336d19198 100644 --- a/src/rgw/services/svc_config_key.h +++ b/src/rgw/services/svc_config_key.h @@ -26,6 +26,6 @@ public: RGWSI_ConfigKey(CephContext *cct) : RGWServiceInstance(cct) {} virtual ~RGWSI_ConfigKey() {} - virtual int get(const string& key, bool secure, bufferlist *result) = 0; + virtual int get(const std::string& key, bool secure, bufferlist *result) = 0; }; diff --git a/src/rgw/services/svc_config_key_rados.cc b/src/rgw/services/svc_config_key_rados.cc index 7cc84ea80cb11..5edb02ea7f34c 100644 --- a/src/rgw/services/svc_config_key_rados.cc +++ b/src/rgw/services/svc_config_key_rados.cc @@ -2,6 +2,8 @@ #include "svc_rados.h" #include "svc_config_key_rados.h" +using namespace std; + RGWSI_ConfigKey_RADOS::~RGWSI_ConfigKey_RADOS(){} int RGWSI_ConfigKey_RADOS::do_start(optional_yield, const DoutPrefixProvider *dpp) diff --git a/src/rgw/services/svc_config_key_rados.h b/src/rgw/services/svc_config_key_rados.h index 086da63889cf7..e867a01f57aa0 100644 --- a/src/rgw/services/svc_config_key_rados.h +++ b/src/rgw/services/svc_config_key_rados.h @@ -48,7 +48,7 @@ public: virtual ~RGWSI_ConfigKey_RADOS() override; - int get(const string& key, bool secure, bufferlist *result) override; + int get(const std::string& key, bool secure, bufferlist *result) override; }; diff --git a/src/rgw/services/svc_finisher.cc b/src/rgw/services/svc_finisher.cc index 83e1b1514e42f..b3d5d50220719 100644 --- a/src/rgw/services/svc_finisher.cc +++ b/src/rgw/services/svc_finisher.cc @@ -5,6 +5,8 @@ #include "svc_finisher.h" +using namespace std; + int RGWSI_Finisher::do_start(optional_yield, const DoutPrefixProvider *dpp) { finisher = new Finisher(cct); diff --git a/src/rgw/services/svc_mdlog.cc b/src/rgw/services/svc_mdlog.cc index f93c44d680e36..a553072778c8c 100644 --- a/src/rgw/services/svc_mdlog.cc +++ b/src/rgw/services/svc_mdlog.cc @@ -18,6 +18,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + using Svc = RGWSI_MDLog::Svc; using Cursor = RGWPeriodHistory::Cursor; diff --git a/src/rgw/services/svc_mdlog.h b/src/rgw/services/svc_mdlog.h index 57103efb464f4..70c8628a56d40 100644 --- a/src/rgw/services/svc_mdlog.h +++ b/src/rgw/services/svc_mdlog.h @@ -102,9 +102,9 @@ public: RGWObjVersionTracker *objv_tracker, optional_yield y, bool exclusive = false); - int add_entry(const DoutPrefixProvider *dpp, const string& hash_key, const string& section, const string& key, bufferlist& bl); + int add_entry(const DoutPrefixProvider *dpp, const std::string& hash_key, const std::string& section, const std::string& key, bufferlist& bl); - int get_shard_id(const string& hash_key, int *shard_id); + int get_shard_id(const std::string& hash_key, int *shard_id); RGWPeriodHistory *get_period_history() { return period_history.get(); diff --git a/src/rgw/services/svc_meta.cc b/src/rgw/services/svc_meta.cc index a4ca764201616..6efc3764f70bd 100644 --- a/src/rgw/services/svc_meta.cc +++ b/src/rgw/services/svc_meta.cc @@ -8,6 +8,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; RGWSI_Meta::RGWSI_Meta(CephContext *cct) : RGWServiceInstance(cct) { } diff --git a/src/rgw/services/svc_meta.h b/src/rgw/services/svc_meta.h index ef3d6ebbd96ee..8cfc8de0aaaab 100644 --- a/src/rgw/services/svc_meta.h +++ b/src/rgw/services/svc_meta.h @@ -30,9 +30,9 @@ class RGWSI_Meta : public RGWServiceInstance RGWSI_SysObj *sysobj_svc{nullptr}; RGWSI_MDLog *mdlog_svc{nullptr}; - map be_svc; + std::map be_svc; - vector > be_handlers; + std::vector > be_handlers; public: RGWSI_Meta(CephContext *cct); @@ -40,7 +40,7 @@ public: void init(RGWSI_SysObj *_sysobj_svc, RGWSI_MDLog *_mdlog_svc, - vector& _be_svc); + std::vector& _be_svc); int create_be_handler(RGWSI_MetaBackend::Type be_type, RGWSI_MetaBackend_Handler **phandler); diff --git a/src/rgw/services/svc_meta_be.cc b/src/rgw/services/svc_meta_be.cc index 0d4daffe2a41a..5037ae536277d 100644 --- a/src/rgw/services/svc_meta_be.cc +++ b/src/rgw/services/svc_meta_be.cc @@ -8,6 +8,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; RGWSI_MetaBackend::Context::~Context() {} // needed, even though destructor is pure virtual RGWSI_MetaBackend::Module::~Module() {} // ditto diff --git a/src/rgw/services/svc_meta_be.h b/src/rgw/services/svc_meta_be.h index da2bb716df7ac..79f0a4aa1ae8e 100644 --- a/src/rgw/services/svc_meta_be.h +++ b/src/rgw/services/svc_meta_be.h @@ -159,16 +159,16 @@ public: RGWObjVersionTracker *objv_tracker, optional_yield y) = 0; - virtual int list_init(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const string& marker) = 0; + virtual int list_init(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const std::string& marker) = 0; virtual int list_next(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, - int max, list *keys, + int max, std::list *keys, bool *truncated) = 0; virtual int list_get_marker(RGWSI_MetaBackend::Context *ctx, - string *marker) = 0; + std::string *marker) = 0; int call(std::function f) { - return call(nullopt, f); + return call(std::nullopt, f); } virtual int call(std::optional opt, @@ -257,14 +257,14 @@ public: return be->mutate(be_ctx, key, params, objv_tracker, y, f, dpp); } - int list_init(const DoutPrefixProvider *dpp, const string& marker) { + int list_init(const DoutPrefixProvider *dpp, const std::string& marker) { return be->list_init(dpp, be_ctx, marker); } - int list_next(const DoutPrefixProvider *dpp, int max, list *keys, + int list_next(const DoutPrefixProvider *dpp, int max, std::list *keys, bool *truncated) { return be->list_next(dpp, be_ctx, max, keys, truncated); } - int list_get_marker(string *marker) { + int list_get_marker(std::string *marker) { return be->list_get_marker(be_ctx, marker); } @@ -283,7 +283,7 @@ public: virtual ~RGWSI_MetaBackend_Handler() {} int call(std::function f) { - return call(nullopt, f); + return call(std::nullopt, f); } virtual int call(std::optional bectx_params, diff --git a/src/rgw/services/svc_meta_be_otp.cc b/src/rgw/services/svc_meta_be_otp.cc index 1800f8a3cac52..e8c8b7864d143 100644 --- a/src/rgw/services/svc_meta_be_otp.cc +++ b/src/rgw/services/svc_meta_be_otp.cc @@ -9,6 +9,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; RGWSI_MetaBackend_OTP::RGWSI_MetaBackend_OTP(CephContext *cct) : RGWSI_MetaBackend_SObj(cct) { } diff --git a/src/rgw/services/svc_meta_be_otp.h b/src/rgw/services/svc_meta_be_otp.h index 9da97b024bbb7..52ea66b337359 100644 --- a/src/rgw/services/svc_meta_be_otp.h +++ b/src/rgw/services/svc_meta_be_otp.h @@ -29,7 +29,7 @@ using RGWSI_MBOTP_Handler_Module = RGWSI_MBSObj_Handler_Module; using RGWSI_MetaBackend_Handler_OTP = RGWSI_MetaBackend_Handler_SObj; -using otp_devices_list_t = list; +using otp_devices_list_t = std::list; struct RGWSI_MBOTP_GetParams : public RGWSI_MetaBackend::GetParams { otp_devices_list_t *pdevices{nullptr}; @@ -59,7 +59,7 @@ public: return MDBE_OTP; } - static string get_meta_key(const rgw_user& user); + static std::string get_meta_key(const rgw_user& user); void init(RGWSI_SysObj *_sysobj_svc, RGWSI_MDLog *_mdlog_svc, @@ -74,14 +74,14 @@ public: int call_with_get_params(ceph::real_time *pmtime, std::function cb) override; int get_entry(RGWSI_MetaBackend::Context *ctx, - const string& key, + const std::string& key, RGWSI_MetaBackend::GetParams& _params, RGWObjVersionTracker *objv_tracker, optional_yield y, const DoutPrefixProvider *dpp); int put_entry(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, - const string& key, + const std::string& key, RGWSI_MetaBackend::PutParams& _params, RGWObjVersionTracker *objv_tracker, optional_yield y); diff --git a/src/rgw/services/svc_meta_be_sobj.cc b/src/rgw/services/svc_meta_be_sobj.cc index 88f74472cf6f0..6c06182af477f 100644 --- a/src/rgw/services/svc_meta_be_sobj.cc +++ b/src/rgw/services/svc_meta_be_sobj.cc @@ -11,6 +11,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; RGWSI_MetaBackend_SObj::RGWSI_MetaBackend_SObj(CephContext *cct) : RGWSI_MetaBackend(cct) { } diff --git a/src/rgw/services/svc_meta_be_sobj.h b/src/rgw/services/svc_meta_be_sobj.h index f587fe882bb43..8183617d437b0 100644 --- a/src/rgw/services/svc_meta_be_sobj.h +++ b/src/rgw/services/svc_meta_be_sobj.h @@ -26,9 +26,9 @@ class RGWSI_MBSObj_Handler_Module : public RGWSI_MetaBackend::Module { protected: - string section; + std::string section; public: - RGWSI_MBSObj_Handler_Module(const string& _section) : section(_section) {} + RGWSI_MBSObj_Handler_Module(const std::string& _section) : section(_section) {} virtual void get_pool_and_oid(const std::string& key, rgw_pool *pool, std::string *oid) = 0; virtual const std::string& get_oid_prefix() = 0; virtual std::string key_to_oid(const std::string& key) = 0; @@ -47,13 +47,13 @@ public: struct RGWSI_MBSObj_GetParams : public RGWSI_MetaBackend::GetParams { bufferlist *pbl{nullptr}; - map *pattrs{nullptr}; + std::map *pattrs{nullptr}; rgw_cache_entry_info *cache_info{nullptr}; boost::optional refresh_version; RGWSI_MBSObj_GetParams() {} RGWSI_MBSObj_GetParams(bufferlist *_pbl, - std::map *_pattrs, + std::map *_pattrs, ceph::real_time *_pmtime) : RGWSI_MetaBackend::GetParams(_pmtime), pbl(_pbl), pattrs(_pattrs) {} @@ -70,15 +70,15 @@ struct RGWSI_MBSObj_GetParams : public RGWSI_MetaBackend::GetParams { struct RGWSI_MBSObj_PutParams : public RGWSI_MetaBackend::PutParams { bufferlist bl; - map *pattrs{nullptr}; + std::map *pattrs{nullptr}; bool exclusive{false}; RGWSI_MBSObj_PutParams() {} - RGWSI_MBSObj_PutParams(std::map *_pattrs, + RGWSI_MBSObj_PutParams(std::map *_pattrs, const ceph::real_time& _mtime) : RGWSI_MetaBackend::PutParams(_mtime), pattrs(_pattrs) {} RGWSI_MBSObj_PutParams(bufferlist& _bl, - std::map *_pattrs, + std::map *_pattrs, const ceph::real_time& _mtime, bool _exclusive) : RGWSI_MetaBackend::PutParams(_mtime), bl(_bl), @@ -134,44 +134,44 @@ public: int pre_modify(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, - const string& key, + const std::string& key, RGWMetadataLogData& log_data, RGWObjVersionTracker *objv_tracker, RGWMDLogStatus op_type, optional_yield y); int post_modify(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, - const string& key, + const std::string& key, RGWMetadataLogData& log_data, RGWObjVersionTracker *objv_tracker, int ret, optional_yield y); int get_entry(RGWSI_MetaBackend::Context *ctx, - const string& key, + const std::string& key, RGWSI_MetaBackend::GetParams& params, RGWObjVersionTracker *objv_tracker, optional_yield y, const DoutPrefixProvider *dpp) override; int put_entry(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, - const string& key, + const std::string& key, RGWSI_MetaBackend::PutParams& params, RGWObjVersionTracker *objv_tracker, optional_yield y) override; int remove_entry(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, - const string& key, + const std::string& key, RGWSI_MetaBackend::RemoveParams& params, RGWObjVersionTracker *objv_tracker, optional_yield y) override; - int list_init(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *_ctx, const string& marker) override; + int list_init(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *_ctx, const std::string& marker) override; int list_next(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *_ctx, - int max, list *keys, + int max, std::list *keys, bool *truncated) override; int list_get_marker(RGWSI_MetaBackend::Context *ctx, - string *marker) override; + std::string *marker) override; int get_shard_id(RGWSI_MetaBackend::Context *ctx, const std::string& key, diff --git a/src/rgw/services/svc_notify.cc b/src/rgw/services/svc_notify.cc index dafd89ad06e72..093e7d76534b3 100644 --- a/src/rgw/services/svc_notify.cc +++ b/src/rgw/services/svc_notify.cc @@ -15,6 +15,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + static string notify_oid_prefix = "notify"; RGWSI_Notify::~RGWSI_Notify() diff --git a/src/rgw/services/svc_notify.h b/src/rgw/services/svc_notify.h index b630bf21f25f4..8531b2e23be93 100644 --- a/src/rgw/services/svc_notify.h +++ b/src/rgw/services/svc_notify.h @@ -37,15 +37,15 @@ private: int num_watchers{0}; RGWWatcher **watchers{nullptr}; std::set watchers_set; - vector notify_objs; + std::vector notify_objs; bool enabled{false}; double inject_notify_timeout_probability{0}; static constexpr unsigned max_notify_retries = 10; - string get_control_oid(int i); - RGWSI_RADOS::Obj pick_control_obj(const string& key); + std::string get_control_oid(int i); + RGWSI_RADOS::Obj pick_control_obj(const std::string& key); CB *cb{nullptr}; @@ -99,7 +99,7 @@ public: virtual void set_enabled(bool status) = 0; }; - int distribute(const DoutPrefixProvider *dpp, const string& key, const RGWCacheNotifyInfo& bl, + int distribute(const DoutPrefixProvider *dpp, const std::string& key, const RGWCacheNotifyInfo& bl, optional_yield y); void register_watch_cb(CB *cb); diff --git a/src/rgw/services/svc_otp.cc b/src/rgw/services/svc_otp.cc index fc386ae72359f..bd08fb94c269e 100644 --- a/src/rgw/services/svc_otp.cc +++ b/src/rgw/services/svc_otp.cc @@ -10,6 +10,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + class RGW_MB_Handler_Module_OTP : public RGWSI_MBSObj_Handler_Module { RGWSI_Zone *zone_svc; string prefix; diff --git a/src/rgw/services/svc_otp.h b/src/rgw/services/svc_otp.h index f4b2e4ed2cc89..f95df40731944 100644 --- a/src/rgw/services/svc_otp.h +++ b/src/rgw/services/svc_otp.h @@ -53,7 +53,7 @@ public: RGWSI_MetaBackend *_meta_be_svc); int read_all(RGWSI_OTP_BE_Ctx& ctx, - const string& key, + const std::string& key, otp_devices_list_t *devices, real_time *pmtime, RGWObjVersionTracker *objv_tracker, @@ -68,7 +68,7 @@ public: const DoutPrefixProvider *dpp); int store_all(const DoutPrefixProvider *dpp, RGWSI_OTP_BE_Ctx& ctx, - const string& key, + const std::string& key, const otp_devices_list_t& devices, real_time mtime, RGWObjVersionTracker *objv_tracker, @@ -82,7 +82,7 @@ public: optional_yield y); int remove_all(const DoutPrefixProvider *dpp, RGWSI_OTP_BE_Ctx& ctx, - const string& key, + const std::string& key, RGWObjVersionTracker *objv_tracker, optional_yield y); int remove_all(const DoutPrefixProvider *dpp, diff --git a/src/rgw/services/svc_rados.cc b/src/rgw/services/svc_rados.cc index 8bfe5324f5ee7..217882f1919e2 100644 --- a/src/rgw/services/svc_rados.cc +++ b/src/rgw/services/svc_rados.cc @@ -13,6 +13,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + RGWSI_RADOS::RGWSI_RADOS(CephContext *cct) : RGWServiceInstance(cct) { } diff --git a/src/rgw/services/svc_rados.h b/src/rgw/services/svc_rados.h index a334d26509d96..7e6e8fedc1dcd 100644 --- a/src/rgw/services/svc_rados.h +++ b/src/rgw/services/svc_rados.h @@ -13,14 +13,14 @@ class RGWAsyncRadosProcessor; class RGWAccessListFilter { public: virtual ~RGWAccessListFilter() {} - virtual bool filter(const string& name, string& key) = 0; + virtual bool filter(const std::string& name, std::string& key) = 0; }; struct RGWAccessListFilterPrefix : public RGWAccessListFilter { - string prefix; + std::string prefix; - explicit RGWAccessListFilterPrefix(const string& _prefix) : prefix(_prefix) {} - bool filter(const string& name, string& key) override { + explicit RGWAccessListFilterPrefix(const std::string& _prefix) : prefix(_prefix) {} + bool filter(const std::string& name, std::string& key) override { return (prefix.compare(key.substr(0, prefix.size())) == 0); } }; @@ -55,7 +55,7 @@ private: int pool_iterate(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, librados::NObjectIterator& iter, - uint32_t num, vector& objs, + uint32_t num, std::vector& objs, RGWAccessListFilter *filter, bool *is_truncated); @@ -74,7 +74,7 @@ public: return async_processor.get(); } - int clog_warn(const string& msg); + int clog_warn(const std::string& msg); class Handle; @@ -124,12 +124,12 @@ public: List() {} List(Pool *_pool) : pool(_pool) {} - int init(const DoutPrefixProvider *dpp, const string& marker, RGWAccessListFilter *filter = nullptr); + int init(const DoutPrefixProvider *dpp, const std::string& marker, RGWAccessListFilter *filter = nullptr); int get_next(const DoutPrefixProvider *dpp, int max, - std::vector *oids, + std::vector *oids, bool *is_truncated); - int get_marker(string *marker); + int get_marker(std::string *marker); }; List op() { @@ -159,7 +159,7 @@ public: init(_obj); } - Obj(Pool& pool, const string& oid); + Obj(Pool& pool, const std::string& oid); public: Obj() {} @@ -222,7 +222,7 @@ public: return Obj(this, o); } - Obj obj(Pool& pool, const string& oid) { + Obj obj(Pool& pool, const std::string& oid) { return Obj(pool, oid); } @@ -241,6 +241,6 @@ public: using rgw_rados_ref = RGWSI_RADOS::rados_ref; -inline ostream& operator<<(ostream& out, const RGWSI_RADOS::Obj& obj) { +inline std::ostream& operator<<(std::ostream& out, const RGWSI_RADOS::Obj& obj) { return out << obj.get_raw_obj(); } diff --git a/src/rgw/services/svc_sys_obj.cc b/src/rgw/services/svc_sys_obj.cc index f0a18c9ec6902..771a0169ac289 100644 --- a/src/rgw/services/svc_sys_obj.cc +++ b/src/rgw/services/svc_sys_obj.cc @@ -10,6 +10,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + RGWSysObjectCtx RGWSI_SysObj::init_obj_ctx() { return RGWSysObjectCtx(this); diff --git a/src/rgw/services/svc_sys_obj.h b/src/rgw/services/svc_sys_obj.h index db2c1fa40c9f4..cc618bf7b75cd 100644 --- a/src/rgw/services/svc_sys_obj.h +++ b/src/rgw/services/svc_sys_obj.h @@ -53,7 +53,7 @@ public: ceph::static_ptr state; RGWObjVersionTracker *objv_tracker{nullptr}; - map *attrs{nullptr}; + std::map *attrs{nullptr}; bool raw_attrs{false}; boost::optional refresh_version{boost::none}; ceph::real_time *lastmod{nullptr}; @@ -75,7 +75,7 @@ public: return *this; } - ROp& set_attrs(map *_attrs) { + ROp& set_attrs(std::map *_attrs) { attrs = _attrs; return *this; } @@ -109,7 +109,7 @@ public: Obj& source; RGWObjVersionTracker *objv_tracker{nullptr}; - map attrs; + std::map attrs; ceph::real_time mtime; ceph::real_time *pmtime{nullptr}; bool exclusive{false}; @@ -119,12 +119,12 @@ public: return *this; } - WOp& set_attrs(map& _attrs) { + WOp& set_attrs(std::map& _attrs) { attrs = _attrs; return *this; } - WOp& set_attrs(map&& _attrs) { + WOp& set_attrs(std::map&& _attrs) { attrs = _attrs; return *this; } @@ -167,12 +167,12 @@ public: OmapOp(Obj& _source) : source(_source) {} - int get_all(const DoutPrefixProvider *dpp, std::map *m, optional_yield y); - int get_vals(const DoutPrefixProvider *dpp, const string& marker, uint64_t count, - std::map *m, + int get_all(const DoutPrefixProvider *dpp, std::map *m, optional_yield y); + int get_vals(const DoutPrefixProvider *dpp, const std::string& marker, uint64_t count, + std::map *m, bool *pmore, optional_yield y); int set(const DoutPrefixProvider *dpp, const std::string& key, bufferlist& bl, optional_yield y); - int set(const DoutPrefixProvider *dpp, const map& m, optional_yield y); + int set(const DoutPrefixProvider *dpp, const std::map& m, optional_yield y); int del(const DoutPrefixProvider *dpp, const std::string& key, optional_yield y); }; @@ -231,16 +231,16 @@ public: Op(Pool& _source) : source(_source) {} int init(const DoutPrefixProvider *dpp, const std::string& marker, const std::string& prefix); - int get_next(const DoutPrefixProvider *dpp, int max, std::vector *oids, bool *is_truncated); - int get_marker(string *marker); + int get_next(const DoutPrefixProvider *dpp, int max, std::vector *oids, bool *is_truncated); + int get_marker(std::string *marker); }; - int list_prefixed_objs(const DoutPrefixProvider *dpp, const std::string& prefix, std::function cb); + int list_prefixed_objs(const DoutPrefixProvider *dpp, const std::string& prefix, std::function cb); template - int list_prefixed_objs(const DoutPrefixProvider *dpp, const string& prefix, + int list_prefixed_objs(const DoutPrefixProvider *dpp, const std::string& prefix, Container *result) { - return list_prefixed_objs(dpp, prefix, [&](const string& val) { + return list_prefixed_objs(dpp, prefix, [&](const std::string& val) { result->push_back(val); }); } diff --git a/src/rgw/services/svc_sys_obj_cache.cc b/src/rgw/services/svc_sys_obj_cache.cc index 5690f8d14c5be..3453f43e16ad1 100644 --- a/src/rgw/services/svc_sys_obj_cache.cc +++ b/src/rgw/services/svc_sys_obj_cache.cc @@ -13,6 +13,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + class RGWSI_SysObj_Cache_CB : public RGWSI_Notify::CB { RGWSI_SysObj_Cache *svc; diff --git a/src/rgw/services/svc_sys_obj_cache.h b/src/rgw/services/svc_sys_obj_cache.h index 9b99d6dbda3ce..3999d514da003 100644 --- a/src/rgw/services/svc_sys_obj_cache.h +++ b/src/rgw/services/svc_sys_obj_cache.h @@ -25,7 +25,7 @@ class RGWSI_SysObj_Cache : public RGWSI_SysObj_Core std::shared_ptr cb; - void normalize_pool_and_obj(const rgw_pool& src_pool, const string& src_obj, rgw_pool& dst_pool, string& dst_obj); + void normalize_pool_and_obj(const rgw_pool& src_pool, const std::string& src_obj, rgw_pool& dst_pool, std::string& dst_obj); protected: void init(RGWSI_RADOS *_rados_svc, RGWSI_Zone *_zone_svc, @@ -38,7 +38,7 @@ protected: void shutdown() override; int raw_stat(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, uint64_t *psize, real_time *pmtime, uint64_t *epoch, - map *attrs, bufferlist *first_chunk, + std::map *attrs, bufferlist *first_chunk, RGWObjVersionTracker *objv_tracker, optional_yield y) override; @@ -48,7 +48,7 @@ protected: RGWObjVersionTracker *objv_tracker, const rgw_raw_obj& obj, bufferlist *bl, off_t ofs, off_t end, - map *attrs, + std::map *attrs, bool raw_attrs, rgw_cache_entry_info *cache_info, boost::optional, @@ -59,8 +59,8 @@ protected: int set_attrs(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, - map& attrs, - map *rmattrs, + std::map& attrs, + std::map *rmattrs, RGWObjVersionTracker *objv_tracker, optional_yield y); @@ -73,7 +73,7 @@ protected: int write(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, real_time *pmtime, - map& attrs, + std::map& attrs, bool exclusive, const bufferlist& data, RGWObjVersionTracker *objv_tracker, @@ -87,7 +87,7 @@ protected: RGWObjVersionTracker *objv_tracker, optional_yield y); - int distribute_cache(const DoutPrefixProvider *dpp, const string& normal_name, const rgw_raw_obj& obj, + int distribute_cache(const DoutPrefixProvider *dpp, const std::string& normal_name, const rgw_raw_obj& obj, ObjectCacheInfo& obj_info, int op, optional_yield y); @@ -125,7 +125,7 @@ public: // `call_list` must iterate over all cache entries and call // `cache_list_dump_helper` with the supplied Formatter on any that - // include `filter` as a substring. + // include `filter` as a substd::string. // void call_list(const std::optional& filter, Formatter* f); @@ -175,7 +175,7 @@ public: "rgw_cache_expiry_interval")); } - boost::optional find(const string& key) { + boost::optional find(const std::string& key) { std::shared_lock rl{lock}; auto iter = entries.find(key); if (iter == entries.end()) { @@ -189,7 +189,7 @@ public: return iter->second.first; } - bool put(const DoutPrefixProvider *dpp, RGWSI_SysObj_Cache *svc, const string& key, T *entry, + bool put(const DoutPrefixProvider *dpp, RGWSI_SysObj_Cache *svc, const std::string& key, T *entry, std::initializer_list cache_info_entries) { if (!svc) { return false; @@ -201,7 +201,7 @@ public: return svc->chain_cache_entry(dpp, cache_info_entries, &chain_entry); } - void chain_cb(const string& key, void *data) override { + void chain_cb(const std::string& key, void *data) override { T *entry = static_cast(data); std::unique_lock wl{lock}; entries[key].first = *entry; @@ -210,7 +210,7 @@ public: } } - void invalidate(const string& key) override { + void invalidate(const std::string& key) override { std::unique_lock wl{lock}; entries.erase(key); } diff --git a/src/rgw/services/svc_sys_obj_core.cc b/src/rgw/services/svc_sys_obj_core.cc index 94467c22ebe68..e673fdb86f9aa 100644 --- a/src/rgw/services/svc_sys_obj_core.cc +++ b/src/rgw/services/svc_sys_obj_core.cc @@ -9,6 +9,8 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; + int RGWSI_SysObj_Core_GetObjState::get_rados_obj(const DoutPrefixProvider *dpp, RGWSI_RADOS *rados_svc, RGWSI_Zone *zone_svc, diff --git a/src/rgw/services/svc_sys_obj_core.h b/src/rgw/services/svc_sys_obj_core.h index b8ee00794fc55..7a6ffce0e028a 100644 --- a/src/rgw/services/svc_sys_obj_core.h +++ b/src/rgw/services/svc_sys_obj_core.h @@ -35,7 +35,7 @@ protected: virtual int raw_stat(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, uint64_t *psize, real_time *pmtime, uint64_t *epoch, - map *attrs, bufferlist *first_chunk, + std::map *attrs, bufferlist *first_chunk, RGWObjVersionTracker *objv_tracker, optional_yield y); @@ -45,7 +45,7 @@ protected: RGWObjVersionTracker *objv_tracker, const rgw_raw_obj& obj, bufferlist *bl, off_t ofs, off_t end, - map *attrs, + std::map *attrs, bool raw_attrs, rgw_cache_entry_info *cache_info, boost::optional, @@ -60,7 +60,7 @@ protected: virtual int write(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, real_time *pmtime, - map& attrs, + std::map& attrs, bool exclusive, const bufferlist& data, RGWObjVersionTracker *objv_tracker, @@ -79,18 +79,18 @@ protected: optional_yield y); virtual int set_attrs(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, - map& attrs, - map *rmattrs, + std::map& attrs, + std::map *rmattrs, RGWObjVersionTracker *objv_tracker, optional_yield y); - virtual int omap_get_all(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, std::map *m, + virtual int omap_get_all(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, std::map *m, optional_yield y); virtual int omap_get_vals(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, - const string& marker, + const std::string& marker, uint64_t count, - std::map *m, + std::map *m, bool *pmore, optional_yield y); virtual int omap_set(const DoutPrefixProvider *dpp, @@ -98,7 +98,7 @@ protected: bufferlist& bl, bool must_exist, optional_yield y); virtual int omap_set(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, - const map& m, bool must_exist, + const std::map& m, bool must_exist, optional_yield y); virtual int omap_del(const DoutPrefixProvider *dpp, const rgw_raw_obj& obj, const std::string& key, optional_yield y); @@ -110,8 +110,8 @@ protected: virtual int pool_list_prefixed_objs(const DoutPrefixProvider *dpp, const rgw_pool& pool, - const string& prefix, - std::function cb); + const std::string& prefix, + std::function cb); virtual int pool_list_objects_init(const DoutPrefixProvider *dpp, const rgw_pool& pool, @@ -121,11 +121,11 @@ protected: virtual int pool_list_objects_next(const DoutPrefixProvider *dpp, RGWSI_SysObj::Pool::ListCtx& ctx, int max, - vector *oids, + std::vector *oids, bool *is_truncated); virtual int pool_list_objects_get_marker(RGWSI_SysObj::Pool::ListCtx& _ctx, - string *marker); + std::string *marker); /* wrappers */ int get_system_obj_state_impl(RGWSysObjectCtxBase *rctx, @@ -142,7 +142,7 @@ protected: int stat(RGWSysObjectCtxBase& obj_ctx, RGWSI_SysObj_Obj_GetObjState& state, const rgw_raw_obj& obj, - map *attrs, + std::map *attrs, bool raw_attrs, real_time *lastmod, uint64_t *obj_size, diff --git a/src/rgw/services/svc_sys_obj_core_types.h b/src/rgw/services/svc_sys_obj_core_types.h index f45fe77f5b4a3..159c55115813f 100644 --- a/src/rgw/services/svc_sys_obj_core_types.h +++ b/src/rgw/services/svc_sys_obj_core_types.h @@ -30,7 +30,7 @@ struct RGWSI_SysObj_Core_PoolListImplInfo : public RGWSI_SysObj_Pool_ListInfo { RGWSI_RADOS::Pool::List op; RGWAccessListFilterPrefix filter; - RGWSI_SysObj_Core_PoolListImplInfo(const string& prefix) : op(pool.op()), filter(prefix) {} + RGWSI_SysObj_Core_PoolListImplInfo(const std::string& prefix) : op(pool.op()), filter(prefix) {} }; struct RGWSysObjState { @@ -50,7 +50,7 @@ struct RGWSysObjState { RGWObjVersionTracker objv_tracker; - map attrset; + std::map attrset; RGWSysObjState() {} RGWSysObjState(const RGWSysObjState& rhs) : obj (rhs.obj) { has_attrs = rhs.has_attrs; diff --git a/src/rgw/services/svc_tier_rados.cc b/src/rgw/services/svc_tier_rados.cc index f9b57d5593db8..ca87e8aceb908 100644 --- a/src/rgw/services/svc_tier_rados.cc +++ b/src/rgw/services/svc_tier_rados.cc @@ -3,6 +3,8 @@ #include "svc_tier_rados.h" +using namespace std; + const std::string MP_META_SUFFIX = ".meta"; MultipartMetaFilter::~MultipartMetaFilter() {} diff --git a/src/rgw/services/svc_tier_rados.h b/src/rgw/services/svc_tier_rados.h index fd48e40e8a76d..1796b7b356509 100644 --- a/src/rgw/services/svc_tier_rados.h +++ b/src/rgw/services/svc_tier_rados.h @@ -25,26 +25,26 @@ extern const std::string MP_META_SUFFIX; class RGWMPObj { - string oid; - string prefix; - string meta; - string upload_id; + std::string oid; + std::string prefix; + std::string meta; + std::string upload_id; public: RGWMPObj() {} - RGWMPObj(const string& _oid, const string& _upload_id) { + RGWMPObj(const std::string& _oid, const std::string& _upload_id) { init(_oid, _upload_id, _upload_id); } - RGWMPObj(const string& _oid, std::optional _upload_id) { + RGWMPObj(const std::string& _oid, std::optional _upload_id) { if (_upload_id) { init(_oid, *_upload_id, *_upload_id); } else { from_meta(_oid); } } - void init(const string& _oid, const string& _upload_id) { + void init(const std::string& _oid, const std::string& _upload_id) { init(_oid, _upload_id, _upload_id); } - void init(const string& _oid, const string& _upload_id, const string& part_unique_str) { + void init(const std::string& _oid, const std::string& _upload_id, const std::string& part_unique_str) { if (_oid.empty()) { clear(); return; @@ -55,27 +55,27 @@ public: meta = prefix + upload_id + MP_META_SUFFIX; prefix.append(part_unique_str); } - const string& get_meta() const { return meta; } - string get_part(int num) const { + const std::string& get_meta() const { return meta; } + std::string get_part(int num) const { char buf[16]; snprintf(buf, 16, ".%d", num); - string s = prefix; + std::string s = prefix; s.append(buf); return s; } - string get_part(const string& part) const { - string s = prefix; + std::string get_part(const std::string& part) const { + std::string s = prefix; s.append("."); s.append(part); return s; } - const string& get_upload_id() const { + const std::string& get_upload_id() const { return upload_id; } - const string& get_key() const { + const std::string& get_key() const { return oid; } - bool from_meta(const string& meta) { + bool from_meta(const std::string& meta) { int end_pos = meta.rfind('.'); // search for ".meta" if (end_pos < 0) return false; @@ -123,7 +123,7 @@ public: * @return true if the name provided is in the form of a multipart meta * object, false otherwise */ - bool filter(const string& name, string& key) override; + bool filter(const std::string& name, std::string& key) override; }; class RGWSI_Tier_RADOS : public RGWServiceInstance diff --git a/src/rgw/services/svc_user.h b/src/rgw/services/svc_user.h index 37e533d6dfc4f..a998f857e8b92 100644 --- a/src/rgw/services/svc_user.h +++ b/src/rgw/services/svc_user.h @@ -30,11 +30,11 @@ public: RGWSI_User(CephContext *cct); virtual ~RGWSI_User(); - static string get_meta_key(const rgw_user& user) { + static std::string get_meta_key(const rgw_user& user) { return user.to_str(); } - static rgw_user user_from_meta_key(const string& key) { + static rgw_user user_from_meta_key(const std::string& key) { return rgw_user(key); } @@ -48,7 +48,7 @@ public: RGWObjVersionTracker * const objv_tracker, real_time * const pmtime, rgw_cache_entry_info * const cache_info, - map * const pattrs, + std::map * const pattrs, optional_yield y, const DoutPrefixProvider *dpp) = 0; @@ -58,7 +58,7 @@ public: RGWObjVersionTracker *objv_tracker, const real_time& mtime, bool exclusive, - map *attrs, + std::map *attrs, optional_yield y, const DoutPrefixProvider *dpp) = 0; @@ -69,13 +69,13 @@ public: const DoutPrefixProvider *dpp) = 0; virtual int get_user_info_by_email(RGWSI_MetaBackend::Context *ctx, - const string& email, RGWUserInfo *info, + const std::string& email, RGWUserInfo *info, RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, const DoutPrefixProvider *dpp) = 0; virtual int get_user_info_by_swift(RGWSI_MetaBackend::Context *ctx, - const string& swift_name, + const std::string& swift_name, RGWUserInfo *info, /* out */ RGWObjVersionTracker * const objv_tracker, real_time * const pmtime, @@ -102,8 +102,8 @@ public: virtual int list_buckets(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const rgw_user& user, - const string& marker, - const string& end_marker, + const std::string& marker, + const std::string& end_marker, uint64_t max, RGWUserBuckets *buckets, bool *is_truncated, diff --git a/src/rgw/services/svc_user_rados.cc b/src/rgw/services/svc_user_rados.cc index eb30f3e663ee2..bb8e8aaf88608 100644 --- a/src/rgw/services/svc_user_rados.cc +++ b/src/rgw/services/svc_user_rados.cc @@ -24,6 +24,8 @@ #define RGW_BUCKETS_OBJ_SUFFIX ".buckets" +using namespace std; + class RGWSI_User_Module : public RGWSI_MBSObj_Handler_Module { RGWSI_User_RADOS::Svc& svc; diff --git a/src/rgw/services/svc_user_rados.h b/src/rgw/services/svc_user_rados.h index f0b025e9db04c..3ab69b0355d1d 100644 --- a/src/rgw/services/svc_user_rados.h +++ b/src/rgw/services/svc_user_rados.h @@ -53,12 +53,12 @@ class RGWSI_User_RADOS : public RGWSI_User }; using RGWChainedCacheImpl_user_info_cache_entry = RGWChainedCacheImpl; - unique_ptr uinfo_cache; + std::unique_ptr uinfo_cache; rgw_raw_obj get_buckets_obj(const rgw_user& user_id) const; int get_user_info_from_index(RGWSI_MetaBackend::Context *ctx, - const string& key, + const std::string& key, const rgw_pool& pool, RGWUserInfo *info, RGWObjVersionTracker * const objv_tracker, @@ -70,11 +70,11 @@ class RGWSI_User_RADOS : public RGWSI_User optional_yield y, const DoutPrefixProvider *dpp); int remove_key_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const RGWAccessKey& access_key, optional_yield y); - int remove_email_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const string& email, optional_yield y); - int remove_swift_name_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const string& swift_name, optional_yield y); + int remove_email_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const std::string& email, optional_yield y); + int remove_swift_name_index(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const std::string& swift_name, optional_yield y); /* admin management */ - int cls_user_update_buckets(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, list& entries, bool add, optional_yield y); + int cls_user_update_buckets(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, std::list& entries, bool add, optional_yield y); int cls_user_add_bucket(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, const cls_user_bucket_entry& entry, optional_yield y); int cls_user_remove_bucket(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, const cls_user_bucket& bucket, optional_yield y); @@ -83,17 +83,17 @@ class RGWSI_User_RADOS : public RGWSI_User const RGWBucketEnt& ent, optional_yield y); int cls_user_list_buckets(const DoutPrefixProvider *dpp, rgw_raw_obj& obj, - const string& in_marker, - const string& end_marker, + const std::string& in_marker, + const std::string& end_marker, const int max_entries, - list& entries, - string * const out_marker, + std::list& entries, + std::string * const out_marker, bool * const truncated, optional_yield y); int cls_user_reset_stats(const DoutPrefixProvider *dpp, const rgw_user& user, optional_yield y); int cls_user_get_header(const DoutPrefixProvider *dpp, const rgw_user& user, cls_user_header *header, optional_yield y); - int cls_user_get_header_async(const DoutPrefixProvider *dpp, const string& user, RGWGetUserHeader_CB *cb); + int cls_user_get_header_async(const DoutPrefixProvider *dpp, const std::string& user, RGWGetUserHeader_CB *cb); int do_start(optional_yield, const DoutPrefixProvider *dpp) override; public: @@ -127,7 +127,7 @@ public: RGWObjVersionTracker * const objv_tracker, real_time * const pmtime, rgw_cache_entry_info * const cache_info, - map * const pattrs, + std::map * const pattrs, optional_yield y, const DoutPrefixProvider *dpp) override; @@ -137,7 +137,7 @@ public: RGWObjVersionTracker *objv_tracker, const real_time& mtime, bool exclusive, - map *attrs, + std::map *attrs, optional_yield y, const DoutPrefixProvider *dpp) override; @@ -148,13 +148,13 @@ public: const DoutPrefixProvider *dpp) override; int get_user_info_by_email(RGWSI_MetaBackend::Context *ctx, - const string& email, RGWUserInfo *info, + const std::string& email, RGWUserInfo *info, RGWObjVersionTracker *objv_tracker, real_time *pmtime, optional_yield y, const DoutPrefixProvider *dpp) override; int get_user_info_by_swift(RGWSI_MetaBackend::Context *ctx, - const string& swift_name, + const std::string& swift_name, RGWUserInfo *info, /* out */ RGWObjVersionTracker * const objv_tracker, real_time * const pmtime, @@ -184,8 +184,8 @@ public: int list_buckets(const DoutPrefixProvider *dpp, RGWSI_MetaBackend::Context *ctx, const rgw_user& user, - const string& marker, - const string& end_marker, + const std::string& marker, + const std::string& end_marker, uint64_t max, RGWUserBuckets *buckets, bool *is_truncated, diff --git a/src/rgw/services/svc_zone.cc b/src/rgw/services/svc_zone.cc index fdaeb6cbeb43b..a3502b3b5abe2 100644 --- a/src/rgw/services/svc_zone.cc +++ b/src/rgw/services/svc_zone.cc @@ -15,6 +15,7 @@ #define dout_subsys ceph_subsys_rgw +using namespace std; using namespace rgw_zone_defaults; RGWSI_Zone::RGWSI_Zone(CephContext *cct) : RGWServiceInstance(cct) diff --git a/src/rgw/services/svc_zone.h b/src/rgw/services/svc_zone.h index a9e70932bb035..175fbc2c4a0e4 100644 --- a/src/rgw/services/svc_zone.h +++ b/src/rgw/services/svc_zone.h @@ -47,13 +47,13 @@ class RGWSI_Zone : public RGWServiceInstance std::map > sync_policy_handlers; RGWRESTConn *rest_master_conn{nullptr}; - map zone_conn_map; + std::map zone_conn_map; std::vector data_sync_source_zones; - map zone_data_notify_to_map; - map zonegroup_conn_map; + std::map zone_data_notify_to_map; + std::map zonegroup_conn_map; - map zone_id_by_name; - map zone_by_id; + std::map zone_id_by_name; + std::map zone_by_id; std::unique_ptr sync_policy; @@ -89,23 +89,23 @@ public: const RGWPeriod& get_current_period() const; const RGWRealm& get_realm() const; const RGWZoneGroup& get_zonegroup() const; - int get_zonegroup(const string& id, RGWZoneGroup& zonegroup) const; + int get_zonegroup(const std::string& id, RGWZoneGroup& zonegroup) const; const RGWZone& get_zone() const; - std::shared_ptr get_sync_policy_handler(std::optional zone = nullopt) const; + std::shared_ptr get_sync_policy_handler(std::optional zone = std::nullopt) const; - const string& zone_name() const; + const std::string& zone_name() const; const rgw_zone_id& zone_id() const { return cur_zone_id; } uint32_t get_zone_short_id() const; - const string& get_current_period_id() const; + const std::string& get_current_period_id() const; bool has_zonegroup_api(const std::string& api) const; bool zone_is_writeable(); bool zone_syncs_from(const RGWZone& target_zone, const RGWZone& source_zone) const; - bool get_redirect_zone_endpoint(string *endpoint); + bool get_redirect_zone_endpoint(std::string *endpoint); bool sync_module_supports_writes() const { return writeable_zone; } bool sync_module_exports_data() const { return exports_data; } @@ -113,11 +113,11 @@ public: return rest_master_conn; } - map& get_zonegroup_conn_map() { + std::map& get_zonegroup_conn_map() { return zonegroup_conn_map; } - map& get_zone_conn_map() { + std::map& get_zone_conn_map() { return zone_conn_map; } @@ -125,21 +125,21 @@ public: return data_sync_source_zones; } - map& get_zone_data_notify_to_map() { + std::map& get_zone_data_notify_to_map() { return zone_data_notify_to_map; } bool find_zone(const rgw_zone_id& id, RGWZone **zone); RGWRESTConn *get_zone_conn(const rgw_zone_id& zone_id); - RGWRESTConn *get_zone_conn_by_name(const string& name); - bool find_zone_id_by_name(const string& name, rgw_zone_id *id); + RGWRESTConn *get_zone_conn_by_name(const std::string& name); + bool find_zone_id_by_name(const std::string& name, rgw_zone_id *id); - int select_bucket_placement(const DoutPrefixProvider *dpp, const RGWUserInfo& user_info, const string& zonegroup_id, + int select_bucket_placement(const DoutPrefixProvider *dpp, const RGWUserInfo& user_info, const std::string& zonegroup_id, const rgw_placement_rule& rule, rgw_placement_rule *pselected_rule, RGWZonePlacementInfo *rule_info, optional_yield y); int select_legacy_bucket_placement(const DoutPrefixProvider *dpp, RGWZonePlacementInfo *rule_info, optional_yield y); - int select_new_bucket_location(const DoutPrefixProvider *dpp, const RGWUserInfo& user_info, const string& zonegroup_id, + int select_new_bucket_location(const DoutPrefixProvider *dpp, const RGWUserInfo& user_info, const std::string& zonegroup_id, const rgw_placement_rule& rule, rgw_placement_rule *pselected_rule_name, RGWZonePlacementInfo *rule_info, optional_yield y); @@ -147,7 +147,7 @@ public: int add_bucket_placement(const DoutPrefixProvider *dpp, const rgw_pool& new_pool, optional_yield y); int remove_bucket_placement(const DoutPrefixProvider *dpp, const rgw_pool& old_pool, optional_yield y); - int list_placement_set(const DoutPrefixProvider *dpp, set& names, optional_yield y); + int list_placement_set(const DoutPrefixProvider *dpp, std::set& names, optional_yield y); bool is_meta_master() const; @@ -157,10 +157,10 @@ public: bool can_reshard() const; bool is_syncing_bucket_meta(const rgw_bucket& bucket); - int list_zonegroups(const DoutPrefixProvider *dpp, list& zonegroups); - int list_regions(const DoutPrefixProvider *dpp, list& regions); - int list_zones(const DoutPrefixProvider *dpp, list& zones); - int list_realms(const DoutPrefixProvider *dpp, list& realms); - int list_periods(const DoutPrefixProvider *dpp, list& periods); - int list_periods(const DoutPrefixProvider *dpp, const string& current_period, list& periods, optional_yield y); + int list_zonegroups(const DoutPrefixProvider *dpp, std::list& zonegroups); + int list_regions(const DoutPrefixProvider *dpp, std::list& regions); + int list_zones(const DoutPrefixProvider *dpp, std::list& zones); + int list_realms(const DoutPrefixProvider *dpp, std::list& realms); + int list_periods(const DoutPrefixProvider *dpp, std::list& periods); + int list_periods(const DoutPrefixProvider *dpp, const std::string& current_period, std::list& periods, optional_yield y); }; diff --git a/src/rgw/services/svc_zone_utils.cc b/src/rgw/services/svc_zone_utils.cc index b292d7b992f07..0641f83350462 100644 --- a/src/rgw/services/svc_zone_utils.cc +++ b/src/rgw/services/svc_zone_utils.cc @@ -7,6 +7,8 @@ #include "rgw/rgw_zone.h" +using namespace std; + int RGWSI_ZoneUtils::do_start(optional_yield, const DoutPrefixProvider *dpp) { init_unique_trans_id_deps(); diff --git a/src/rgw/services/svc_zone_utils.h b/src/rgw/services/svc_zone_utils.h index 24abe528e53b3..c534e7ea346ea 100644 --- a/src/rgw/services/svc_zone_utils.h +++ b/src/rgw/services/svc_zone_utils.h @@ -16,7 +16,7 @@ class RGWSI_ZoneUtils : public RGWServiceInstance RGWSI_RADOS *rados_svc{nullptr}; RGWSI_Zone *zone_svc{nullptr}; - string trans_id_suffix; + std::string trans_id_suffix; void init(RGWSI_RADOS *_rados_svc, RGWSI_Zone *_zone_svc) { @@ -31,8 +31,8 @@ class RGWSI_ZoneUtils : public RGWServiceInstance public: RGWSI_ZoneUtils(CephContext *cct): RGWServiceInstance(cct) {} - string gen_host_id(); - string unique_id(uint64_t unique_num); + std::string gen_host_id(); + std::string unique_id(uint64_t unique_num); - string unique_trans_id(const uint64_t unique_num); + std::string unique_trans_id(const uint64_t unique_num); }; -- 2.39.5