From c396bf1bd08baad6174eaf38bb54a0553f5d76ff Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Tue, 21 Jun 2022 18:12:32 -0400 Subject: [PATCH] rgw: remove unnecessary "struct" from req_state declarations The "struct" is superfluous and makes it harder for those looking for the definition. Signed-off-by: J. Eric Ivancich --- src/rgw/librgw.cc | 8 +- src/rgw/rgw_auth.h | 1 + src/rgw/rgw_client_io.h | 4 +- src/rgw/rgw_common.cc | 26 +++--- src/rgw/rgw_common.h | 34 ++++---- src/rgw/rgw_crypt.cc | 10 +-- src/rgw/rgw_crypt.h | 4 +- src/rgw/rgw_file.cc | 6 +- src/rgw/rgw_file.h | 46 +++++----- src/rgw/rgw_lib.h | 8 +- src/rgw/rgw_log.cc | 16 ++-- src/rgw/rgw_log.h | 16 ++-- src/rgw/rgw_lua_request.h | 2 +- src/rgw/rgw_op.cc | 36 ++++---- src/rgw/rgw_op.h | 56 ++++++------- src/rgw/rgw_os_lib.cc | 2 +- src/rgw/rgw_process.cc | 4 +- src/rgw/rgw_rados.cc | 2 +- src/rgw/rgw_request.h | 2 +- src/rgw/rgw_rest.cc | 86 +++++++++---------- src/rgw/rgw_rest.h | 112 ++++++++++++------------- src/rgw/rgw_rest_bucket.h | 2 +- src/rgw/rgw_rest_config.h | 2 +- src/rgw/rgw_rest_iam.cc | 6 +- src/rgw/rgw_rest_iam.h | 8 +- src/rgw/rgw_rest_info.h | 2 +- src/rgw/rgw_rest_log.h | 2 +- src/rgw/rgw_rest_metadata.h | 2 +- src/rgw/rgw_rest_ratelimit.h | 2 +- src/rgw/rgw_rest_realm.cc | 4 +- src/rgw/rgw_rest_realm.h | 2 +- src/rgw/rgw_rest_s3.cc | 28 +++---- src/rgw/rgw_rest_s3.h | 12 +-- src/rgw/rgw_rest_sts.cc | 8 +- src/rgw/rgw_rest_sts.h | 10 +-- src/rgw/rgw_rest_swift.cc | 16 ++-- src/rgw/rgw_rest_swift.h | 28 +++---- src/rgw/rgw_rest_usage.h | 2 +- src/rgw/rgw_rest_user.h | 2 +- src/rgw/rgw_s3select_private.h | 6 +- src/rgw/rgw_sal.h | 2 +- src/rgw/rgw_sal_dbstore.cc | 2 +- src/rgw/rgw_sal_dbstore.h | 2 +- src/rgw/rgw_sal_motr.cc | 2 +- src/rgw/rgw_sal_motr.h | 2 +- src/rgw/rgw_sal_rados.cc | 2 +- src/rgw/rgw_sal_rados.h | 2 +- src/rgw/rgw_swift_auth.cc | 2 +- src/rgw/rgw_swift_auth.h | 6 +- src/rgw/rgw_sync_module_es_rest.cc | 2 +- src/rgw/rgw_sync_module_es_rest.h | 2 +- src/rgw/rgw_sync_module_pubsub_rest.cc | 2 +- src/rgw/rgw_sync_module_pubsub_rest.h | 2 +- src/rgw/rgw_torrent.cc | 2 +- src/rgw/rgw_torrent.h | 4 +- 55 files changed, 330 insertions(+), 331 deletions(-) diff --git a/src/rgw/librgw.cc b/src/rgw/librgw.cc index 7e3068c382ea2..87fbb97ad6dd1 100644 --- a/src/rgw/librgw.cc +++ b/src/rgw/librgw.cc @@ -183,7 +183,7 @@ namespace rgw { return ret; } /* process_request */ - static inline void abort_req(struct req_state *s, RGWOp *op, int err_no) + static inline void abort_req(req_state *s, RGWOp *op, int err_no) { if (!s) return; @@ -234,8 +234,8 @@ namespace rgw { rgw_env.set("HTTP_HOST", ""); /* XXX and -then- bloat up req_state with string copies from it */ - struct req_state rstate(req->cct, &rgw_env, req->id); - struct req_state *s = &rstate; + req_state rstate(req->cct, &rgw_env, req->id); + req_state *s = &rstate; // XXX fix this s->cio = io; @@ -371,7 +371,7 @@ namespace rgw { return -EINVAL; } - struct req_state* s = req->get_state(); + req_state* s = req->get_state(); RGWLibIO& io_ctx = req->get_io(); RGWEnv& rgw_env = io_ctx.get_env(); diff --git a/src/rgw/rgw_auth.h b/src/rgw/rgw_auth.h index 50f2d12e42422..f14066592afee 100644 --- a/src/rgw/rgw_auth.h +++ b/src/rgw/rgw_auth.h @@ -19,6 +19,7 @@ class RGWCtl; struct rgw_log_entry; +struct req_state; namespace rgw { namespace auth { diff --git a/src/rgw/rgw_client_io.h b/src/rgw/rgw_client_io.h index 9626d289fc9da..5e47aee0627a4 100644 --- a/src/rgw/rgw_client_io.h +++ b/src/rgw/rgw_client_io.h @@ -352,13 +352,13 @@ public: /* Type conversions to work around lack of req_state type hierarchy matching * (e.g.) REST backends (may be replaced w/dynamic typed req_state). */ -static inline rgw::io::RestfulClient* RESTFUL_IO(struct req_state* s) { +static inline rgw::io::RestfulClient* RESTFUL_IO(req_state* s) { ceph_assert(dynamic_cast(s->cio) != nullptr); return static_cast(s->cio); } -static inline rgw::io::Accounter* ACCOUNTING_IO(struct req_state* s) { +static inline rgw::io::Accounter* ACCOUNTING_IO(req_state* s) { auto ptr = dynamic_cast(s->cio); ceph_assert(ptr != nullptr); diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 750157edd5671..96eded1f56a93 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -333,7 +333,7 @@ void set_req_state_err(struct rgw_err& err, /* out */ err.err_code = "UnknownError"; } -void set_req_state_err(struct req_state* s, int err_no, const string& err_msg) +void set_req_state_err(req_state* s, int err_no, const string& err_msg) { if (s) { set_req_state_err(s, err_no); @@ -351,14 +351,14 @@ void set_req_state_err(struct req_state* s, int err_no, const string& err_msg) } } -void set_req_state_err(struct req_state* s, int err_no) +void set_req_state_err(req_state* s, int err_no) { if (s) { set_req_state_err(s->err, err_no, s->prot_flags); } } -void dump(struct req_state* s) +void dump(req_state* s) { if (s->format != RGW_FORMAT_HTML) s->formatter->open_object_section("Error"); @@ -1189,7 +1189,7 @@ bool verify_user_permission_no_policy(const DoutPrefixProvider* dpp, } bool verify_user_permission(const DoutPrefixProvider* dpp, - struct req_state * const s, + req_state * const s, const rgw::ARN& res, const uint64_t op) { @@ -1198,7 +1198,7 @@ bool verify_user_permission(const DoutPrefixProvider* dpp, } bool verify_user_permission_no_policy(const DoutPrefixProvider* dpp, - struct req_state * const s, + req_state * const s, const int perm) { perm_state_from_req_state ps(s); @@ -1281,7 +1281,7 @@ bool verify_bucket_permission(const DoutPrefixProvider* dpp, } bool verify_bucket_permission(const DoutPrefixProvider* dpp, - struct req_state * const s, + req_state * const s, const rgw_bucket& bucket, RGWAccessControlPolicy * const user_acl, RGWAccessControlPolicy * const bucket_acl, @@ -1320,7 +1320,7 @@ bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, struct pe return user_acl->verify_permission(dpp, *s->identity, perm, perm); } -bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, struct req_state * const s, +bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, req_state * const s, RGWAccessControlPolicy * const user_acl, RGWAccessControlPolicy * const bucket_acl, const int perm) @@ -1333,7 +1333,7 @@ bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, struct re perm); } -bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, struct req_state * const s, const int perm) +bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, req_state * const s, const int perm) { perm_state_from_req_state ps(s); @@ -1347,7 +1347,7 @@ bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, struct re perm); } -bool verify_bucket_permission(const DoutPrefixProvider* dpp, struct req_state * const s, const uint64_t op) +bool verify_bucket_permission(const DoutPrefixProvider* dpp, req_state * const s, const uint64_t op) { perm_state_from_req_state ps(s); @@ -1365,7 +1365,7 @@ bool verify_bucket_permission(const DoutPrefixProvider* dpp, struct req_state * // Authorize anyone permitted by the bucket policy, identity policies, session policies and the bucket owner // unless explicitly denied by the policy. -int verify_bucket_owner_or_policy(struct req_state* const s, +int verify_bucket_owner_or_policy(req_state* const s, const uint64_t op) { auto identity_policy_res = eval_identity_or_session_policies(s->iam_user_policies, s->env, op, ARN(s->bucket->get_key())); @@ -1536,7 +1536,7 @@ bool verify_object_permission(const DoutPrefixProvider* dpp, struct perm_state_b return user_acl->verify_permission(dpp, *s->identity, swift_perm, swift_perm); } -bool verify_object_permission(const DoutPrefixProvider* dpp, struct req_state * const s, +bool verify_object_permission(const DoutPrefixProvider* dpp, req_state * const s, const rgw_obj& obj, RGWAccessControlPolicy * const user_acl, RGWAccessControlPolicy * const bucket_acl, @@ -1604,7 +1604,7 @@ bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, return user_acl->verify_permission(dpp, *s->identity, swift_perm, swift_perm); } -bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, struct req_state *s, int perm) +bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, req_state *s, int perm) { perm_state_from_req_state ps(s); @@ -1619,7 +1619,7 @@ bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, struct re perm); } -bool verify_object_permission(const DoutPrefixProvider* dpp, struct req_state *s, uint64_t op) +bool verify_object_permission(const DoutPrefixProvider* dpp, req_state *s, uint64_t op) { perm_state_from_req_state ps(s); diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 9e3096a2795a3..eafa25806e988 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -279,8 +279,6 @@ using ceph::crypto::MD5; #define UINT32_MAX (0xffffffffu) #endif -struct req_state; - typedef void *RGWAccessHandle; enum RGWIntentEvent { @@ -1714,10 +1712,10 @@ struct req_state : DoutPrefixProvider { unsigned get_subsys() const override { return ceph_subsys_rgw; } }; -void set_req_state_err(struct req_state*, int); -void set_req_state_err(struct req_state*, int, const std::string&); +void set_req_state_err(req_state*, int); +void set_req_state_err(req_state*, int, const std::string&); void set_req_state_err(struct rgw_err&, int, const int); -void dump(struct req_state*); +void dump(req_state*); /** Store basic data on bucket */ struct RGWBucketEnt { @@ -2190,26 +2188,26 @@ rgw::IAM::Effect eval_identity_or_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, - struct req_state * const s, + req_state * const s, RGWAccessControlPolicy * const user_acl, const int perm); bool verify_user_permission(const DoutPrefixProvider* dpp, - struct req_state * const s, + req_state * const s, const rgw::ARN& res, const uint64_t op); bool verify_user_permission_no_policy(const DoutPrefixProvider* dpp, - struct req_state * const s, + req_state * const s, int perm); bool verify_bucket_permission( const DoutPrefixProvider* dpp, - struct req_state * const s, + req_state * const s, const rgw_bucket& bucket, RGWAccessControlPolicy * const user_acl, RGWAccessControlPolicy * const bucket_acl, @@ -2217,21 +2215,21 @@ bool verify_bucket_permission( 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(const DoutPrefixProvider* dpp, req_state * const s, const uint64_t op); bool verify_bucket_permission_no_policy( const DoutPrefixProvider* dpp, - struct req_state * const s, + req_state * const s, RGWAccessControlPolicy * const user_acl, RGWAccessControlPolicy * const bucket_acl, const int perm); bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, - struct req_state * const s, + req_state * const s, const int perm); -int verify_bucket_owner_or_policy(struct req_state* const s, +int verify_bucket_owner_or_policy(req_state* const s, const uint64_t op); extern bool verify_object_permission( const DoutPrefixProvider* dpp, - struct req_state * const s, + req_state * const s, const rgw_obj& obj, RGWAccessControlPolicy * const user_acl, RGWAccessControlPolicy * const bucket_acl, @@ -2240,15 +2238,15 @@ extern bool verify_object_permission( 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(const DoutPrefixProvider* dpp, req_state *s, uint64_t op); extern bool verify_object_permission_no_policy( const DoutPrefixProvider* dpp, - struct req_state * const s, + req_state * const s, RGWAccessControlPolicy * const user_acl, RGWAccessControlPolicy * const bucket_acl, RGWAccessControlPolicy * const object_acl, int perm); -extern bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, struct req_state *s, +extern bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, req_state *s, int perm); extern int verify_object_lock( const DoutPrefixProvider* dpp, diff --git a/src/rgw/rgw_crypt.cc b/src/rgw/rgw_crypt.cc index 515a5ba78c0e0..0c6d36de257db 100644 --- a/src/rgw/rgw_crypt.cc +++ b/src/rgw/rgw_crypt.cc @@ -217,7 +217,7 @@ get_tenant_or_id(req_state *s) } int -make_canonical_context(struct req_state *s, +make_canonical_context(req_state *s, std::string_view &context, std::string &cooked_context) { @@ -892,7 +892,7 @@ struct CryptAttributes { } }; -std::string fetch_bucket_key_id(struct req_state *s) +std::string fetch_bucket_key_id(req_state *s) { auto kek_iter = s->bucket_attrs.find(RGW_ATTR_BUCKET_ENCRYPTION_KEY_ID); if (kek_iter == s->bucket_attrs.end()) @@ -907,7 +907,7 @@ std::string fetch_bucket_key_id(struct req_state *s) } const std::string cant_expand_key{ "\uFFFD" }; -std::string expand_key_name(struct req_state *s, const std::string_view&t) +std::string expand_key_name(req_state *s, const std::string_view&t) { std::string r; size_t i, j; @@ -989,7 +989,7 @@ static int get_sse_s3_bucket_key(req_state *s, return 0; } -int rgw_s3_prepare_encrypt(struct req_state* s, +int rgw_s3_prepare_encrypt(req_state* s, std::map& attrs, std::unique_ptr* block_crypt, std::map& crypt_http_responses) @@ -1270,7 +1270,7 @@ int rgw_s3_prepare_encrypt(struct req_state* s, } -int rgw_s3_prepare_decrypt(struct req_state* s, +int rgw_s3_prepare_decrypt(req_state* s, map& attrs, std::unique_ptr* block_crypt, std::map& crypt_http_responses) diff --git a/src/rgw/rgw_crypt.h b/src/rgw/rgw_crypt.h index 921d9ff21f589..33d6bc3bbc38c 100644 --- a/src/rgw/rgw_crypt.h +++ b/src/rgw/rgw_crypt.h @@ -139,13 +139,13 @@ public: }; /* RGWPutObj_BlockEncrypt */ -int rgw_s3_prepare_encrypt(struct req_state* s, +int rgw_s3_prepare_encrypt(req_state* s, std::map& attrs, std::unique_ptr* block_crypt, std::map& crypt_http_responses); -int rgw_s3_prepare_decrypt(struct req_state* s, +int rgw_s3_prepare_decrypt(req_state* s, std::map& attrs, std::unique_ptr* block_crypt, std::mapobject->set_bucket(state->bucket.get()); @@ -1892,7 +1892,7 @@ namespace rgw { int RGWWriteRequest::exec_continue() { - struct req_state* state = get_state(); + req_state* state = get_state(); op_ret = 0; /* check guards (e.g., contig write) */ @@ -1930,7 +1930,7 @@ namespace rgw { map::iterator iter; char calc_md5[CEPH_CRYPTO_MD5_DIGESTSIZE * 2 + 1]; unsigned char m[CEPH_CRYPTO_MD5_DIGESTSIZE]; - struct req_state* state = get_state(); + req_state* state = get_state(); size_t osize = rgw_fh->get_size(); struct timespec octime = rgw_fh->get_ctime(); diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index d1c19ab0a5005..81e7ac0a3465f 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -1383,7 +1383,7 @@ public: } int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "GET"; state->op = OP_GET; @@ -1518,7 +1518,7 @@ public: } int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "GET"; state->op = OP_GET; @@ -1578,7 +1578,7 @@ public: } void send_response() override { - struct req_state* state = get_state(); + req_state* state = get_state(); auto cnow = real_clock::now(); /* enumerate objs and common_prefixes in parallel, @@ -1819,7 +1819,7 @@ public: } int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "GET"; state->op = OP_GET; @@ -1899,7 +1899,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "PUT"; state->op = OP_PUT; @@ -1915,7 +1915,7 @@ public: } int get_params(optional_yield) override { - struct req_state* state = get_state(); + req_state* state = get_state(); RGWAccessControlPolicy_S3 s3policy(state->cct); /* we don't have (any) headers, so just create canned ACLs */ int ret = s3policy.create_canned(state->owner, state->bucket_owner, state->canned_acl); @@ -1956,7 +1956,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "DELETE"; state->op = OP_DELETE; @@ -2012,7 +2012,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "PUT"; state->op = OP_PUT; @@ -2031,7 +2031,7 @@ public: } int get_params(optional_yield) override { - struct req_state* state = get_state(); + req_state* state = get_state(); RGWAccessControlPolicy_S3 s3policy(state->cct); /* we don't have (any) headers, so just create canned ACLs */ int ret = s3policy.create_canned(state->owner, state->bucket_owner, state->canned_acl); @@ -2103,7 +2103,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "GET"; state->op = OP_GET; @@ -2184,7 +2184,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "DELETE"; state->op = OP_DELETE; @@ -2259,7 +2259,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "GET"; state->op = OP_GET; @@ -2333,7 +2333,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "GET"; state->op = OP_GET; @@ -2396,7 +2396,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "GET"; state->op = OP_GET; @@ -2423,7 +2423,7 @@ public: } void send_response() override { - struct req_state* state = get_state(); + req_state* state = get_state(); // try objects for (const auto& iter : objs) { auto& name = iter.key.name; @@ -2518,7 +2518,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "PUT"; state->op = OP_PUT; @@ -2534,7 +2534,7 @@ public: } int get_params(optional_yield) override { - struct req_state* state = get_state(); + req_state* state = get_state(); RGWAccessControlPolicy_S3 s3policy(state->cct); /* we don't have (any) headers, so just create canned ACLs */ int ret = s3policy.create_canned(state->owner, state->bucket_owner, state->canned_acl); @@ -2607,7 +2607,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "PUT"; // XXX check state->op = OP_PUT; @@ -2640,7 +2640,7 @@ public: } int get_params(optional_yield) override { - struct req_state* s = get_state(); + req_state* s = get_state(); RGWAccessControlPolicy_S3 s3policy(s->cct); /* we don't have (any) headers, so just create canned ACLs */ int ret = s3policy.create_canned(s->owner, s->bucket_owner, s->canned_acl); @@ -2688,7 +2688,7 @@ public: virtual int header_init() { - struct req_state* s = get_state(); + req_state* s = get_state(); s->info.method = "GET"; s->op = OP_GET; @@ -2739,7 +2739,7 @@ public: int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "PUT"; state->op = OP_PUT; @@ -2793,7 +2793,7 @@ public: virtual int header_init() { - struct req_state* s = get_state(); + req_state* s = get_state(); s->info.method = "DELETE"; s->op = OP_PUT; @@ -2837,7 +2837,7 @@ public: } int header_init() override { - struct req_state* state = get_state(); + req_state* state = get_state(); state->info.method = "GET"; state->op = OP_GET; return 0; diff --git a/src/rgw/rgw_lib.h b/src/rgw/rgw_lib.h index 4f3bd0205cce0..7713f19935fe8 100644 --- a/src/rgw/rgw_lib.h +++ b/src/rgw/rgw_lib.h @@ -128,7 +128,7 @@ namespace rgw { RGWHandler_Lib() {} ~RGWHandler_Lib() override {} static int init_from_header(rgw::sal::Store* store, - struct req_state *s); + req_state *s); }; /* RGWHandler_Lib */ class RGWLibRequest : public RGWRequest, @@ -139,7 +139,7 @@ namespace rgw { CephContext* cct; /* unambiguiously return req_state */ - inline struct req_state* get_state() { return this->RGWRequest::s; } + inline req_state* get_state() { return this->RGWRequest::s; } RGWLibRequest(CephContext* _cct, std::unique_ptr _user) : RGWRequest(rgwlib.get_store()->get_new_req_id()), @@ -161,7 +161,7 @@ namespace rgw { using RGWHandler::init; int init(const RGWEnv& rgw_env, rgw::sal::Store* _store, - RGWLibIO* io, struct req_state* _s) { + RGWLibIO* io, req_state* _s) { RGWRequest::init_state(_s); RGWHandler::init(_store, _s, io); @@ -189,7 +189,7 @@ namespace rgw { class RGWLibContinuedReq : public RGWLibRequest { RGWLibIO io_ctx; - struct req_state rstate; + req_state rstate; public: RGWLibContinuedReq(CephContext* _cct, diff --git a/src/rgw/rgw_log.cc b/src/rgw/rgw_log.cc index 6617ac3e5a84b..75b1d9d8f30a3 100644 --- a/src/rgw/rgw_log.cc +++ b/src/rgw/rgw_log.cc @@ -24,7 +24,7 @@ using namespace std; -static void set_param_str(struct req_state *s, const char *name, string& str) +static void set_param_str(req_state *s, const char *name, string& str) { const char *p = s->info.env->get(name); if (p) @@ -192,7 +192,7 @@ void rgw_log_usage_finalize() usage_logger = NULL; } -static void log_usage(struct req_state *s, const string& op_name) +static void log_usage(req_state *s, const string& op_name) { if (s->system_request) /* don't log system user operations */ return; @@ -338,7 +338,7 @@ void OpsLogManifold::add_sink(OpsLogSink* sink) sinks.push_back(sink); } -int OpsLogManifold::log(struct req_state* s, struct rgw_log_entry& entry) +int OpsLogManifold::log(req_state* s, struct rgw_log_entry& entry) { int ret = 0; for (const auto &sink : sinks) { @@ -431,7 +431,7 @@ OpsLogFile::~OpsLogFile() file.close(); } -int OpsLogFile::log_json(struct req_state* s, bufferlist& bl) +int OpsLogFile::log_json(req_state* s, bufferlist& bl) { std::unique_lock lock(mutex); if (data_size + bl.length() >= max_data_size) { @@ -464,7 +464,7 @@ void JsonOpsLogSink::formatter_to_bl(bufferlist& bl) bl.append(s); } -int JsonOpsLogSink::log(struct req_state* s, struct rgw_log_entry& entry) +int JsonOpsLogSink::log(req_state* s, struct rgw_log_entry& entry) { bufferlist bl; @@ -486,7 +486,7 @@ OpsLogSocket::OpsLogSocket(CephContext *cct, uint64_t _backlog) : OutputDataSock delim.append(",\n"); } -int OpsLogSocket::log_json(struct req_state* s, bufferlist& bl) +int OpsLogSocket::log_json(req_state* s, bufferlist& bl) { append_output(bl); return 0; @@ -496,7 +496,7 @@ OpsLogRados::OpsLogRados(rgw::sal::Store* const& store): store(store) { } -int OpsLogRados::log(struct req_state* s, struct rgw_log_entry& entry) +int OpsLogRados::log(req_state* s, struct rgw_log_entry& entry) { if (!s->cct->_conf->rgw_ops_log_rados) { return 0; @@ -519,7 +519,7 @@ int OpsLogRados::log(struct req_state* s, struct rgw_log_entry& entry) return 0; } -int rgw_log_op(RGWREST* const rest, struct req_state *s, const string& op_name, OpsLogSink *olog) +int rgw_log_op(RGWREST* const rest, req_state *s, const string& op_name, OpsLogSink *olog) { struct rgw_log_entry entry; string bucket_id; diff --git a/src/rgw/rgw_log.h b/src/rgw/rgw_log.h index db1ff2e710c85..f798941a13ce4 100644 --- a/src/rgw/rgw_log.h +++ b/src/rgw/rgw_log.h @@ -147,7 +147,7 @@ WRITE_CLASS_ENCODER(rgw_log_entry) class OpsLogSink { public: - virtual int log(struct req_state* s, struct rgw_log_entry& entry) = 0; + virtual int log(req_state* s, struct rgw_log_entry& entry) = 0; virtual ~OpsLogSink() = default; }; @@ -156,7 +156,7 @@ class OpsLogManifold: public OpsLogSink { public: ~OpsLogManifold() override; void add_sink(OpsLogSink* sink); - int log(struct req_state* s, struct rgw_log_entry& entry) override; + int log(req_state* s, struct rgw_log_entry& entry) override; }; class JsonOpsLogSink : public OpsLogSink { @@ -165,11 +165,11 @@ class JsonOpsLogSink : public OpsLogSink { void formatter_to_bl(bufferlist& bl); protected: - virtual int log_json(struct req_state* s, bufferlist& bl) = 0; + virtual int log_json(req_state* s, bufferlist& bl) = 0; public: JsonOpsLogSink(); ~JsonOpsLogSink() override; - int log(struct req_state* s, struct rgw_log_entry& entry) override; + int log(req_state* s, struct rgw_log_entry& entry) override; }; class OpsLogFile : public JsonOpsLogSink, public Thread, public DoutPrefixProvider { @@ -187,7 +187,7 @@ class OpsLogFile : public JsonOpsLogSink, public Thread, public DoutPrefixProvid void flush(); protected: - int log_json(struct req_state* s, bufferlist& bl) override; + int log_json(req_state* s, bufferlist& bl) override; void *entry() override; public: OpsLogFile(CephContext* cct, std::string& path, uint64_t max_data_size); @@ -202,7 +202,7 @@ public: class OpsLogSocket : public OutputDataSocket, public JsonOpsLogSink { protected: - int log_json(struct req_state* s, bufferlist& bl) override; + int log_json(req_state* s, bufferlist& bl) override; void init_connection(bufferlist& bl) override; public: @@ -215,12 +215,12 @@ class OpsLogRados : public OpsLogSink { public: OpsLogRados(rgw::sal::Store* const& store); - int log(struct req_state* s, struct rgw_log_entry& entry) override; + int log(req_state* s, struct rgw_log_entry& entry) override; }; class RGWREST; -int rgw_log_op(RGWREST* const rest, struct req_state* s, +int rgw_log_op(RGWREST* const rest, req_state* s, const std::string& op_name, OpsLogSink* olog); void rgw_log_usage_init(CephContext* cct, rgw::sal::Store* store); void rgw_log_usage_finalize(); diff --git a/src/rgw/rgw_lua_request.h b/src/rgw/rgw_lua_request.h index d1410b584ff0a..e49989e32e3a3 100644 --- a/src/rgw/rgw_lua_request.h +++ b/src/rgw/rgw_lua_request.h @@ -3,7 +3,7 @@ #include #include "include/common_fwd.h" -class req_state; +struct req_state; class RGWREST; class OpsLogSink; namespace rgw::sal { diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 44efe7e3a007e..717725fc0ed0a 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -334,7 +334,7 @@ vector get_iam_user_policy_from_attr(CephContext* cct, static int read_bucket_policy(const DoutPrefixProvider *dpp, rgw::sal::Store* store, - struct req_state *s, + req_state *s, RGWBucketInfo& bucket_info, map& bucket_attrs, RGWAccessControlPolicy *policy, @@ -361,7 +361,7 @@ static int read_bucket_policy(const DoutPrefixProvider *dpp, static int read_obj_policy(const DoutPrefixProvider *dpp, rgw::sal::Store* store, - struct req_state *s, + req_state *s, RGWBucketInfo& bucket_info, map& bucket_attrs, RGWAccessControlPolicy* acl, @@ -449,7 +449,7 @@ static int read_obj_policy(const DoutPrefixProvider *dpp, * only_bucket: If true, reads the user and bucket ACLs rather than the object ACL. * Returns: 0 on success, -ERR# otherwise. */ -int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store, struct req_state* s, optional_yield y) +int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store, req_state* s, optional_yield y) { int ret = 0; @@ -644,7 +644,7 @@ int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* st * Returns: 0 on success, -ERR# otherwise. */ int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store, - struct req_state *s, bool prefetch_data, optional_yield y) + req_state *s, bool prefetch_data, optional_yield y) { int ret = 0; @@ -666,7 +666,7 @@ int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* st return ret; } -static int rgw_iam_remove_objtags(const DoutPrefixProvider *dpp, struct req_state* s, rgw::sal::Object* object, bool has_existing_obj_tag, bool has_resource_tag) { +static int rgw_iam_remove_objtags(const DoutPrefixProvider *dpp, req_state* s, rgw::sal::Object* object, bool has_existing_obj_tag, bool has_resource_tag) { object->set_atomic(); int op_ret = object->get_obj_attrs(s->yield, dpp); if (op_ret < 0) @@ -723,7 +723,7 @@ void rgw_add_to_iam_environment(rgw::IAM::Environment& e, std::string_view key, e.emplace(key,val); } -static int rgw_iam_add_tags_from_bl(struct req_state* s, bufferlist& bl, bool has_existing_obj_tag=false, bool has_resource_tag=false){ +static int rgw_iam_add_tags_from_bl(req_state* s, bufferlist& bl, bool has_existing_obj_tag=false, bool has_resource_tag=false){ RGWObjTags& tagset = s->tagset; try { auto bliter = bl.cbegin(); @@ -742,7 +742,7 @@ static int rgw_iam_add_tags_from_bl(struct req_state* s, bufferlist& bl, bool ha return 0; } -static int rgw_iam_add_objtags(const DoutPrefixProvider *dpp, struct req_state* s, rgw::sal::Object* object, bool has_existing_obj_tag, bool has_resource_tag) { +static int rgw_iam_add_objtags(const DoutPrefixProvider *dpp, req_state* s, rgw::sal::Object* object, bool has_existing_obj_tag, bool has_resource_tag) { object->set_atomic(); int op_ret = object->get_obj_attrs(s->yield, dpp); if (op_ret < 0) @@ -755,14 +755,14 @@ static int rgw_iam_add_objtags(const DoutPrefixProvider *dpp, struct req_state* return 0; } -static int rgw_iam_add_objtags(const DoutPrefixProvider *dpp, struct req_state* s, bool has_existing_obj_tag, bool has_resource_tag) { +static int rgw_iam_add_objtags(const DoutPrefixProvider *dpp, req_state* s, bool has_existing_obj_tag, bool has_resource_tag) { if (!rgw::sal::Object::empty(s->object.get())) { return rgw_iam_add_objtags(dpp, s, s->object.get(), has_existing_obj_tag, has_resource_tag); } return 0; } -static int rgw_iam_add_buckettags(const DoutPrefixProvider *dpp, struct req_state* s, rgw::sal::Bucket* bucket) { +static int rgw_iam_add_buckettags(const DoutPrefixProvider *dpp, req_state* s, rgw::sal::Bucket* bucket) { rgw::sal::Attrs attrs = bucket->get_attrs(); auto tags = attrs.find(RGW_ATTR_TAGS); if (tags != attrs.end()) { @@ -771,7 +771,7 @@ static int rgw_iam_add_buckettags(const DoutPrefixProvider *dpp, struct req_stat return 0; } -static int rgw_iam_add_buckettags(const DoutPrefixProvider *dpp, struct req_state* s) { +static int rgw_iam_add_buckettags(const DoutPrefixProvider *dpp, req_state* s) { return rgw_iam_add_buckettags(dpp, s, s->bucket.get()); } @@ -822,11 +822,11 @@ static std::tuple rgw_check_policy_condition(const DoutPrefixProvide return make_tuple(has_existing_obj_tag, has_resource_tag); } -static std::tuple rgw_check_policy_condition(const DoutPrefixProvider *dpp, struct req_state* s, bool check_obj_exist_tag=true) { +static std::tuple rgw_check_policy_condition(const DoutPrefixProvider *dpp, req_state* s, bool check_obj_exist_tag=true) { return rgw_check_policy_condition(dpp, s->iam_policy, s->iam_user_policies, s->session_policies, check_obj_exist_tag); } -static void rgw_add_grant_to_iam_environment(rgw::IAM::Environment& e, struct req_state *s){ +static void rgw_add_grant_to_iam_environment(rgw::IAM::Environment& e, req_state *s){ using header_pair_t = std::pair ; static const std::initializer_list acl_header_conditionals { @@ -848,7 +848,7 @@ static void rgw_add_grant_to_iam_environment(rgw::IAM::Environment& e, struct re } void rgw_build_iam_environment(rgw::sal::Store* store, - struct req_state* s) + req_state* s) { const auto& m = s->info.env->get_map(); auto t = ceph::real_clock::now(); @@ -907,7 +907,7 @@ void rgw_build_iam_environment(rgw::sal::Store* store, } } -void rgw_bucket_object_pre_exec(struct req_state *s) +void rgw_bucket_object_pre_exec(req_state *s) { if (s->expect_cont) dump_continue(s); @@ -2110,7 +2110,7 @@ void RGWGetObj::pre_exec() } static inline void rgw_cond_decode_objtags( - struct req_state *s, + req_state *s, const std::map &attrs) { const auto& tags = attrs.find(RGW_ATTR_TAGS); @@ -7204,7 +7204,7 @@ RGWBulkUploadOp::parse_path(const std::string_view& path) } std::pair -RGWBulkUploadOp::handle_upload_path(struct req_state *s) +RGWBulkUploadOp::handle_upload_path(req_state *s) { std::string bucket_path, file_prefix; if (! s->init_state.url_bucket.empty()) { @@ -7258,7 +7258,7 @@ static void forward_req_info(const DoutPrefixProvider *dpp, CephContext *cct, re } void RGWBulkUploadOp::init(rgw::sal::Store* const store, - struct req_state* const s, + req_state* const s, RGWHandler* const h) { RGWOp::init(store, s, h); @@ -7893,7 +7893,7 @@ RGWHandler::~RGWHandler() } int RGWHandler::init(rgw::sal::Store* _store, - struct req_state *_s, + req_state *_s, rgw::io::BasicClient *cio) { store = _store; diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index a7885922f9ea0..9176d2389350a 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -88,7 +88,7 @@ int rgw_op_get_bucket_policy_from_attr(const DoutPrefixProvider *dpp, class RGWHandler { protected: rgw::sal::Store* store{nullptr}; - struct req_state *s{nullptr}; + req_state *s{nullptr}; int do_init_permissions(const DoutPrefixProvider *dpp, optional_yield y); int do_read_permissions(RGWOp* op, bool only_bucket, optional_yield y); @@ -98,7 +98,7 @@ public: virtual ~RGWHandler(); virtual int init(rgw::sal::Store* store, - struct req_state* _s, + req_state* _s, rgw::io::BasicClient* cio); virtual int init_permissions(RGWOp*, optional_yield y) { @@ -123,11 +123,11 @@ public: -void rgw_bucket_object_pre_exec(struct req_state *s); +void rgw_bucket_object_pre_exec(req_state *s); namespace dmc = rgw::dmclock; -std::tuple rgw_rest_read_all_input(struct req_state *s, +std::tuple rgw_rest_read_all_input(req_state *s, const uint64_t max_len, const bool allow_chunked=true); @@ -173,7 +173,7 @@ int rgw_rest_get_json_input(CephContext *cct, req_state *s, T& out, */ class RGWOp : public DoutPrefixProvider { protected: - struct req_state *s; + req_state *s; RGWHandler *dialect_handler; rgw::sal::Store* store; RGWCORSConfiguration bucket_cors; @@ -184,7 +184,7 @@ protected: virtual int init_quota(); - std::tuple read_all_input(struct req_state *s, + std::tuple read_all_input(req_state *s, const uint64_t max_len, const bool allow_chunked=true) { @@ -231,7 +231,7 @@ public: return 0; } - virtual void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *dialect_handler) { + virtual void init(rgw::sal::Store* store, req_state *s, RGWHandler *dialect_handler) { this->store = store; this->s = s; this->dialect_handler = dialect_handler; @@ -690,7 +690,7 @@ protected: parse_path(const std::string_view& path); std::pair - handle_upload_path(struct req_state *s); + handle_upload_path(req_state *s); bool handle_file_verify_permission(RGWBucketInfo& binfo, const rgw_obj& obj, @@ -711,7 +711,7 @@ public: } void init(rgw::sal::Store* const store, - struct req_state* const s, + req_state* const s, RGWHandler* const h) override; int verify_permission(optional_yield y) override; @@ -921,7 +921,7 @@ public: void pre_exec() override; void execute(optional_yield y) override; - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); } virtual int get_params(optional_yield y) = 0; @@ -1094,7 +1094,7 @@ public: int verify_permission(optional_yield y) override; void pre_exec() override; void execute(optional_yield y) override; - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); relaxed_region_enforcement = @@ -1248,7 +1248,7 @@ public: delete obj_legal_hold; } - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } @@ -1320,7 +1320,7 @@ public: attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */ } - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } @@ -1359,7 +1359,7 @@ public: has_policy(false) { } - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } @@ -1398,7 +1398,7 @@ public: attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */ } - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } @@ -1425,7 +1425,7 @@ public: : dlo_manifest(NULL) {} - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } @@ -1550,13 +1550,13 @@ public: static bool parse_copy_location(const std::string_view& src, std::string& bucket_name, rgw_obj_key& object, - struct req_state *s); + req_state *s); void emplace_attr(std::string&& key, buffer::list&& bl) { attrs.emplace(std::move(key), std::move(bl)); } - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); dest_policy.set_ctx(s->cct); } @@ -1609,7 +1609,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, std::stringstream& ss) { return 0; } + virtual int get_policy_from_state(rgw::sal::Store* store, 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"; } @@ -1646,7 +1646,7 @@ public: } ~RGWPutLC() override {} - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *dialect_handler) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *dialect_handler) override { #define COOKIE_LEN 16 char buf[COOKIE_LEN + 1]; @@ -1659,7 +1659,7 @@ public: void pre_exec() override; void execute(optional_yield y) override; -// virtual int get_policy_from_state(RGWRados* store, struct req_state *s, std::stringstream& ss) { return 0; } +// virtual int get_policy_from_state(RGWRados* store, 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"; } @@ -1839,7 +1839,7 @@ protected: public: RGWInitMultipart() {} - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } @@ -1914,7 +1914,7 @@ public: truncated = false; } - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy = RGWAccessControlPolicy(s->cct); } @@ -1952,7 +1952,7 @@ public: default_max = 0; } - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); max_uploads = default_max; } @@ -2062,11 +2062,11 @@ public: }; extern int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store, - struct req_state* s, optional_yield y); + req_state* s, optional_yield y); extern int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store, - struct req_state *s, bool prefetch_data, optional_yield y); + req_state *s, bool prefetch_data, optional_yield y); extern void rgw_build_iam_environment(rgw::sal::Store* store, - struct req_state* s); + req_state* s); extern std::vector get_iam_user_policy_from_attr(CephContext* cct, std::map& attrs, const std::string& tenant); @@ -2531,7 +2531,7 @@ protected: public: RGWGetClusterStat() {} - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); } int verify_permission(optional_yield) override {return 0;} diff --git a/src/rgw/rgw_os_lib.cc b/src/rgw/rgw_os_lib.cc index 379f4a911a457..64ae8e102b1a0 100644 --- a/src/rgw/rgw_os_lib.cc +++ b/src/rgw/rgw_os_lib.cc @@ -12,7 +12,7 @@ namespace rgw { /* static */ int RGWHandler_Lib::init_from_header(rgw::sal::Store* store, - struct req_state *s) + req_state *s) { string req; string first; diff --git a/src/rgw/rgw_process.cc b/src/rgw/rgw_process.cc index c5dcb28f3c534..1d4c8014c1fdd 100644 --- a/src/rgw/rgw_process.cc +++ b/src/rgw/rgw_process.cc @@ -283,8 +283,8 @@ int process_request(rgw::sal::Store* const store, RGWEnv& rgw_env = client_io->get_env(); - struct req_state rstate(g_ceph_context, &rgw_env, req->id); - struct req_state *s = &rstate; + req_state rstate(g_ceph_context, &rgw_env, req->id); + req_state *s = &rstate; s->ratelimit_data = ratelimit; std::unique_ptr u = store->get_user(rgw_user()); diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index ad5c71fddbc6a..927a01c7970ea 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3064,7 +3064,7 @@ int RGWRados::Object::Write::_do_write_meta(const DoutPrefixProvider *dpp, ObjectWriteOperation op; #ifdef WITH_LTTNG - const struct req_state* s = get_req_state(); + const req_state* s = get_req_state(); string req_id; if (!s) { // fake req_id diff --git a/src/rgw/rgw_request.h b/src/rgw/rgw_request.h index 8a9005047e8ac..ed54dca595ec4 100644 --- a/src/rgw/rgw_request.h +++ b/src/rgw/rgw_request.h @@ -16,7 +16,7 @@ struct RGWRequest { uint64_t id; - struct req_state *s; + req_state *s; RGWOp *op; explicit RGWRequest(uint64_t id) : id(id), s(NULL), op(NULL) {} diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 0e898dee9d1d9..7279bbcc5ef0d 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -280,7 +280,7 @@ static bool rgw_find_host_in_domains(const string& host, string *domain, string return false; } -static void dump_status(struct req_state *s, int status, +static void dump_status(req_state *s, int status, const char *status_name) { s->formatter->set_status(status, status_name); @@ -292,7 +292,7 @@ static void dump_status(struct req_state *s, int status, } } -void rgw_flush_formatter_and_reset(struct req_state *s, Formatter *formatter) +void rgw_flush_formatter_and_reset(req_state *s, Formatter *formatter) { std::ostringstream oss; formatter->output_footer(); @@ -305,7 +305,7 @@ void rgw_flush_formatter_and_reset(struct req_state *s, Formatter *formatter) s->formatter->reset(); } -void rgw_flush_formatter(struct req_state *s, Formatter *formatter) +void rgw_flush_formatter(req_state *s, Formatter *formatter) { std::ostringstream oss; formatter->flush(oss); @@ -326,17 +326,17 @@ void dump_errno(const struct rgw_err &err, string& out) { dump_errno(err.http_ret, out); } -void dump_errno(struct req_state *s) +void dump_errno(req_state *s) { dump_status(s, s->err.http_ret, http_status_names[s->err.http_ret]); } -void dump_errno(struct req_state *s, int http_ret) +void dump_errno(req_state *s, int http_ret) { dump_status(s, http_ret, http_status_names[http_ret]); } -void dump_header(struct req_state* const s, +void dump_header(req_state* const s, const std::string_view& name, const std::string_view& val) { @@ -348,14 +348,14 @@ void dump_header(struct req_state* const s, } } -void dump_header(struct req_state* const s, +void dump_header(req_state* const s, const std::string_view& name, ceph::buffer::list& bl) { return dump_header(s, name, rgw_sanitized_hdrval(bl)); } -void dump_header(struct req_state* const s, +void dump_header(req_state* const s, const std::string_view& name, const long long val) { @@ -365,7 +365,7 @@ void dump_header(struct req_state* const s, return dump_header(s, name, std::string_view(buf, len)); } -void dump_header(struct req_state* const s, +void dump_header(req_state* const s, const std::string_view& name, const utime_t& ut) { @@ -377,7 +377,7 @@ void dump_header(struct req_state* const s, return dump_header(s, name, std::string_view(buf, len)); } -void dump_content_length(struct req_state* const s, const uint64_t len) +void dump_content_length(req_state* const s, const uint64_t len) { try { RESTFUL_IO(s)->send_content_length(len); @@ -388,7 +388,7 @@ void dump_content_length(struct req_state* const s, const uint64_t len) dump_header(s, "Accept-Ranges", "bytes"); } -static void dump_chunked_encoding(struct req_state* const s) +static void dump_chunked_encoding(req_state* const s) { try { RESTFUL_IO(s)->send_chunked_transfer_encoding(); @@ -398,7 +398,7 @@ static void dump_chunked_encoding(struct req_state* const s) } } -void dump_etag(struct req_state* const s, +void dump_etag(req_state* const s, const std::string_view& etag, const bool quoted) { @@ -413,7 +413,7 @@ void dump_etag(struct req_state* const s, } } -void dump_bucket_from_state(struct req_state *s) +void dump_bucket_from_state(req_state *s) { if (g_conf()->rgw_expose_bucket && ! s->bucket_name.empty()) { if (! s->bucket_tenant.empty()) { @@ -425,7 +425,7 @@ void dump_bucket_from_state(struct req_state *s) } } -void dump_redirect(struct req_state * const s, const std::string& redirect) +void dump_redirect(req_state * const s, const std::string& redirect) { return dump_header_if_nonempty(s, "Location", redirect); } @@ -446,7 +446,7 @@ static size_t dump_time_header_impl(char (×tr)[TIME_BUF_SIZE], "%a, %d %b %Y %H:%M:%S %Z", tmp); } -void dump_time_header(struct req_state *s, const char *name, real_time t) +void dump_time_header(req_state *s, const char *name, real_time t) { char timestr[TIME_BUF_SIZE]; @@ -467,12 +467,12 @@ std::string dump_time_to_str(const real_time& t) } -void dump_last_modified(struct req_state *s, real_time t) +void dump_last_modified(req_state *s, real_time t) { dump_time_header(s, "Last-Modified", t); } -void dump_epoch_header(struct req_state *s, const char *name, real_time t) +void dump_epoch_header(req_state *s, const char *name, real_time t) { utime_t ut(t); char buf[65]; @@ -483,7 +483,7 @@ void dump_epoch_header(struct req_state *s, const char *name, real_time t) return dump_header(s, name, std::string_view(buf, len)); } -void dump_time(struct req_state *s, const char *name, real_time t) +void dump_time(req_state *s, const char *name, real_time t) { char buf[TIME_BUF_SIZE]; rgw_to_iso8601(t, buf, sizeof(buf)); @@ -491,7 +491,7 @@ void dump_time(struct req_state *s, const char *name, real_time t) s->formatter->dump_string(name, buf); } -void dump_owner(struct req_state *s, const rgw_user& id, const string& name, +void dump_owner(req_state *s, const rgw_user& id, const string& name, const char *section) { if (!section) @@ -502,7 +502,7 @@ void dump_owner(struct req_state *s, const rgw_user& id, const string& name, s->formatter->close_section(); } -void dump_access_control(struct req_state *s, const char *origin, +void dump_access_control(req_state *s, const char *origin, const char *meth, const char *hdr, const char *exp_hdr, uint32_t max_age) { @@ -547,7 +547,7 @@ void dump_access_control(req_state *s, RGWOp *op) exp_header.c_str(), max_age); } -void dump_start(struct req_state *s) +void dump_start(req_state *s) { if (!s->content_started) { s->formatter->output_header(); @@ -565,7 +565,7 @@ void dump_trans_id(req_state *s) } } -void end_header(struct req_state* s, RGWOp* op, const char *content_type, +void end_header(req_state* s, RGWOp* op, const char *content_type, const int64_t proposed_content_length, bool force_content_type, bool force_no_error) { @@ -654,7 +654,7 @@ static void build_redirect_url(req_state *s, const string& redirect_base, string dest_uri += s->info.request_params; } -void abort_early(struct req_state *s, RGWOp* op, int err_no, +void abort_early(req_state *s, RGWOp* op, int err_no, RGWHandler* handler, optional_yield y) { string error_content(""); @@ -725,7 +725,7 @@ void abort_early(struct req_state *s, RGWOp* op, int err_no, perfcounter->inc(l_rgw_failed_req); } -void dump_continue(struct req_state * const s) +void dump_continue(req_state * const s) { try { RESTFUL_IO(s)->send_100_continue(); @@ -735,7 +735,7 @@ void dump_continue(struct req_state * const s) } } -void dump_range(struct req_state* const s, +void dump_range(req_state* const s, const uint64_t ofs, const uint64_t end, const uint64_t total) @@ -759,7 +759,7 @@ void dump_range(struct req_state* const s, } -int dump_body(struct req_state* const s, +int dump_body(req_state* const s, const char* const buf, const size_t len) { @@ -780,17 +780,17 @@ int dump_body(struct req_state* const s, } } -int dump_body(struct req_state* const s, /* const */ ceph::buffer::list& bl) +int dump_body(req_state* const s, /* const */ ceph::buffer::list& bl) { return dump_body(s, bl.c_str(), bl.length()); } -int dump_body(struct req_state* const s, const std::string& str) +int dump_body(req_state* const s, const std::string& str) { return dump_body(s, str.c_str(), str.length()); } -int recv_body(struct req_state* const s, +int recv_body(req_state* const s, char* const buf, const size_t max) { @@ -835,7 +835,7 @@ int RGWGetObj_ObjStore::get_params(optional_yield y) return 0; } -int RESTArgs::get_string(struct req_state *s, const string& name, +int RESTArgs::get_string(req_state *s, const string& name, const string& def_val, string *val, bool *existed) { bool exists; @@ -852,7 +852,7 @@ int RESTArgs::get_string(struct req_state *s, const string& name, return 0; } -int RESTArgs::get_uint64(struct req_state *s, const string& name, +int RESTArgs::get_uint64(req_state *s, const string& name, uint64_t def_val, uint64_t *val, bool *existed) { bool exists; @@ -873,7 +873,7 @@ int RESTArgs::get_uint64(struct req_state *s, const string& name, return 0; } -int RESTArgs::get_int64(struct req_state *s, const string& name, +int RESTArgs::get_int64(req_state *s, const string& name, int64_t def_val, int64_t *val, bool *existed) { bool exists; @@ -894,7 +894,7 @@ int RESTArgs::get_int64(struct req_state *s, const string& name, return 0; } -int RESTArgs::get_uint32(struct req_state *s, const string& name, +int RESTArgs::get_uint32(req_state *s, const string& name, uint32_t def_val, uint32_t *val, bool *existed) { bool exists; @@ -915,7 +915,7 @@ int RESTArgs::get_uint32(struct req_state *s, const string& name, return 0; } -int RESTArgs::get_int32(struct req_state *s, const string& name, +int RESTArgs::get_int32(req_state *s, const string& name, int32_t def_val, int32_t *val, bool *existed) { bool exists; @@ -936,7 +936,7 @@ int RESTArgs::get_int32(struct req_state *s, const string& name, return 0; } -int RESTArgs::get_time(struct req_state *s, const string& name, +int RESTArgs::get_time(req_state *s, const string& name, const utime_t& def_val, utime_t *val, bool *existed) { bool exists; @@ -961,7 +961,7 @@ int RESTArgs::get_time(struct req_state *s, const string& name, return 0; } -int RESTArgs::get_epoch(struct req_state *s, const string& name, uint64_t def_val, uint64_t *epoch, bool *existed) +int RESTArgs::get_epoch(req_state *s, const string& name, uint64_t def_val, uint64_t *epoch, bool *existed) { bool exists; string date = s->info.args.get(name, &exists); @@ -981,7 +981,7 @@ int RESTArgs::get_epoch(struct req_state *s, const string& name, uint64_t def_va return 0; } -int RESTArgs::get_bool(struct req_state *s, const string& name, bool def_val, bool *val, bool *existed) +int RESTArgs::get_bool(req_state *s, const string& name, bool def_val, bool *val, bool *existed) { bool exists; string sval = s->info.args.get(name, &exists); @@ -1529,7 +1529,7 @@ static std::tuple read_all_chunked_input(req_state *s, const ui return std::make_tuple(0, std::move(bl)); } -std::tuple rgw_rest_read_all_input(struct req_state *s, +std::tuple rgw_rest_read_all_input(req_state *s, const uint64_t max_len, const bool allow_chunked) { @@ -1724,7 +1724,7 @@ void RGWHandler_REST::put_op(RGWOp* op) delete op; } /* put_op */ -int RGWHandler_REST::allocate_formatter(struct req_state *s, +int RGWHandler_REST::allocate_formatter(req_state *s, int default_type, bool configurable) { @@ -1760,7 +1760,7 @@ int RGWHandler_REST::allocate_formatter(struct req_state *s, return RGWHandler_REST::reallocate_formatter(s, type); } -int RGWHandler_REST::reallocate_formatter(struct req_state *s, int type) +int RGWHandler_REST::reallocate_formatter(req_state *s, int type) { if (s->format == type) { // do nothing, just reset @@ -1982,7 +1982,7 @@ void RGWRESTMgr::register_default_mgr(RGWRESTMgr *mgr) default_mgr = mgr; } -RGWRESTMgr* RGWRESTMgr::get_resource_mgr(struct req_state* const s, +RGWRESTMgr* RGWRESTMgr::get_resource_mgr(req_state* const s, const std::string& uri, std::string* const out_uri) { @@ -2042,7 +2042,7 @@ int64_t parse_content_length(const char *content_length) return len; } -int RGWREST::preprocess(struct req_state *s, rgw::io::BasicClient* cio) +int RGWREST::preprocess(req_state *s, rgw::io::BasicClient* cio) { req_info& info = s->info; @@ -2305,7 +2305,7 @@ int RGWREST::preprocess(struct req_state *s, rgw::io::BasicClient* cio) RGWHandler_REST* RGWREST::get_handler( rgw::sal::Store* const store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix, RGWRestfulIO* const rio, diff --git a/src/rgw/rgw_rest.h b/src/rgw/rgw_rest.h index 4a0142fbaa0eb..833be21ecbb76 100644 --- a/src/rgw/rgw_rest.h +++ b/src/rgw/rgw_rest.h @@ -18,10 +18,10 @@ extern std::map rgw_to_http_attrs; extern void rgw_rest_init(CephContext *cct, const rgw::sal::ZoneGroup& zone_group); -extern void rgw_flush_formatter_and_reset(struct req_state *s, +extern void rgw_flush_formatter_and_reset(req_state *s, ceph::Formatter *formatter); -extern void rgw_flush_formatter(struct req_state *s, +extern void rgw_flush_formatter(req_state *s, ceph::Formatter *formatter); inline std::string_view rgw_sanitized_hdrval(ceph::buffer::list& raw) @@ -75,39 +75,39 @@ std::tuple rgw_rest_get_json_input_keep_data(CephContext *cct, class RESTArgs { public: - static int get_string(struct req_state *s, const std::string& name, + static int get_string(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 std::string& name, + static int get_uint64(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 std::string& name, + static int get_int64(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 std::string& name, + static int get_uint32(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 std::string& name, + static int get_int32(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 std::string& name, + static int get_time(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 std::string& name, + static int get_epoch(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 std::string& name, bool def_val, + static int get_bool(req_state *s, const std::string& name, bool def_val, bool *val, bool *existed = NULL); }; class RGWRESTFlusher : public RGWFormatterFlusher { - struct req_state *s; + req_state *s; RGWOp *op; protected: void do_flush() override; void do_start(int ret) override; public: - RGWRESTFlusher(struct req_state *_s, RGWOp *_op) : + RGWRESTFlusher(req_state *_s, RGWOp *_op) : RGWFormatterFlusher(_s->formatter), s(_s), op(_op) {} RGWRESTFlusher() : RGWFormatterFlusher(NULL), s(NULL), op(NULL) {} - void init(struct req_state *_s, RGWOp *_op) { + void init(req_state *_s, RGWOp *_op) { s = _s; op = _op; set_formatter(s->formatter); @@ -121,7 +121,7 @@ protected: public: RGWGetObj_ObjStore() : sent_header(false) {} - void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override { + void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override { RGWGetObj::init(store, s, h); sent_header = false; } @@ -522,7 +522,7 @@ protected: RGWRESTFlusher flusher; public: - void init(rgw::sal::Store* store, struct req_state *s, + void init(rgw::sal::Store* store, req_state *s, RGWHandler *dialect_handler) override { RGWOp::init(store, s, dialect_handler); flusher.init(s, this); @@ -547,7 +547,7 @@ protected: virtual RGWOp *op_options() { return NULL; } public: - static int allocate_formatter(struct req_state *s, int default_formatter, + static int allocate_formatter(req_state *s, int default_formatter, bool configurable); static constexpr int MAX_BUCKET_NAME_LEN = 255; @@ -558,7 +558,7 @@ public: 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); + static int reallocate_formatter(req_state *s, int type); int init_permissions(RGWOp* op, optional_yield y) override; int read_permissions(RGWOp* op, optional_yield y) override; @@ -585,11 +585,11 @@ protected: std::multimap resources_by_size; RGWRESTMgr* default_mgr; - virtual RGWRESTMgr* get_resource_mgr(struct req_state* s, + virtual RGWRESTMgr* get_resource_mgr(req_state* s, const std::string& uri, std::string* out_uri); - virtual RGWRESTMgr* get_resource_mgr_as_default(struct req_state* const s, + virtual RGWRESTMgr* get_resource_mgr_as_default(req_state* const s, const std::string& uri, std::string* our_uri) { return this; @@ -605,7 +605,7 @@ public: void register_resource(std::string resource, RGWRESTMgr* mgr); void register_default_mgr(RGWRESTMgr* mgr); - virtual RGWRESTMgr* get_manager(struct req_state* const s, + virtual RGWRESTMgr* get_manager(req_state* const s, /* Prefix to be concatenated with @uri * during the lookup. */ const std::string& frontend_prefix, @@ -616,7 +616,7 @@ public: virtual RGWHandler_REST* get_handler( rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix ) { @@ -644,18 +644,18 @@ class RGWREST { boost::container::flat_set x_headers; RGWRESTMgr mgr; - static int preprocess(struct req_state *s, rgw::io::BasicClient* rio); + static int preprocess(req_state *s, rgw::io::BasicClient* rio); public: RGWREST() {} RGWHandler_REST *get_handler(rgw::sal::Store* store, - struct req_state *s, + req_state *s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix, RGWRestfulIO *rio, RGWRESTMgr **pmgr, int *init_error); #if 0 - RGWHandler *get_handler(RGWRados *store, struct req_state *s, + RGWHandler *get_handler(RGWRados *store, req_state *s, RGWLibIO *io, RGWRESTMgr **pmgr, int *init_error); #endif @@ -692,34 +692,34 @@ static constexpr int64_t CHUNKED_TRANSFER_ENCODING = -2; 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, +extern void dump_errno(req_state *s); +extern void dump_errno(req_state *s, int http_ret); +extern void end_header(req_state *s, RGWOp* op = nullptr, const char *content_type = nullptr, const int64_t proposed_content_length = NO_CONTENT_LENGTH, bool force_content_type = false, 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, +extern void dump_start(req_state *s); +extern void list_all_buckets_start(req_state *s); +extern void dump_owner(req_state *s, const rgw_user& id, const std::string& name, const char *section = NULL); -extern void dump_header(struct req_state* s, +extern void dump_header(req_state* s, const std::string_view& name, const std::string_view& val); -extern void dump_header(struct req_state* s, +extern void dump_header(req_state* s, const std::string_view& name, ceph::buffer::list& bl); -extern void dump_header(struct req_state* s, +extern void dump_header(req_state* s, const std::string_view& name, long long val); -extern void dump_header(struct req_state* s, +extern void dump_header(req_state* s, const std::string_view& name, const utime_t& val); template -inline void dump_header_prefixed(struct req_state* s, +inline void dump_header_prefixed(req_state* s, const std::string_view& name_prefix, const std::string_view& name, Args&&... args) { @@ -734,7 +734,7 @@ inline void dump_header_prefixed(struct req_state* s, } template -inline void dump_header_infixed(struct req_state* s, +inline void dump_header_infixed(req_state* s, const std::string_view& prefix, const std::string_view& infix, const std::string_view& sufix, @@ -752,7 +752,7 @@ inline void dump_header_infixed(struct req_state* s, } template -inline void dump_header_quoted(struct req_state* s, +inline void dump_header_quoted(req_state* s, const std::string_view& name, const std::string_view& val) { /* We need two extra bytes for quotes. */ @@ -763,7 +763,7 @@ inline void dump_header_quoted(struct req_state* s, } template -inline void dump_header_if_nonempty(struct req_state* s, +inline void dump_header_if_nonempty(req_state* s, const std::string_view& name, const ValueT& value) { if (name.length() > 0 && value.length() > 0) { @@ -771,7 +771,7 @@ inline void dump_header_if_nonempty(struct req_state* s, } } -inline std::string compute_domain_uri(const struct req_state *s) { +inline std::string compute_domain_uri(const req_state *s) { std::string uri = (!s->info.domain.empty()) ? s->info.domain : [&s]() -> std::string { RGWEnv const &env(*(s->info.env)); @@ -787,32 +787,32 @@ inline std::string compute_domain_uri(const struct req_state *s) { return uri; } -extern void dump_content_length(struct req_state *s, uint64_t len); +extern void dump_content_length(req_state *s, uint64_t len); extern int64_t parse_content_length(const char *content_length); -extern void dump_etag(struct req_state *s, +extern void dump_etag(req_state *s, const std::string_view& etag, bool quoted = false); -extern void dump_epoch_header(struct req_state *s, const char *name, real_time t); -extern void dump_time_header(struct req_state *s, const char *name, real_time t); -extern void dump_last_modified(struct req_state *s, real_time t); -extern void abort_early(struct req_state* s, RGWOp* op, int err, +extern void dump_epoch_header(req_state *s, const char *name, real_time t); +extern void dump_time_header(req_state *s, const char *name, real_time t); +extern void dump_last_modified(req_state *s, real_time t); +extern void abort_early(req_state* s, RGWOp* op, int err, RGWHandler* handler, optional_yield y); -extern void dump_range(struct req_state* s, uint64_t ofs, uint64_t end, +extern void dump_range(req_state* s, uint64_t ofs, uint64_t end, uint64_t total_size); -extern void dump_continue(struct req_state *s); -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 void dump_continue(req_state *s); +extern void list_all_buckets_end(req_state *s); +extern void dump_time(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 std::string& redirect); +extern void dump_bucket_from_state(req_state *s); +extern void dump_redirect(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, +extern void dump_access_control(req_state *s, const char *origin, const char *meth, const char *hdr, const char *exp_hdr, uint32_t max_age); extern void dump_access_control(req_state *s, RGWOp *op); -extern int dump_body(struct req_state* s, const char* buf, size_t len); -extern int dump_body(struct req_state* s, /* const */ ceph::buffer::list& bl); -extern int dump_body(struct req_state* s, const std::string& str); -extern int recv_body(struct req_state* s, char* buf, size_t max); +extern int dump_body(req_state* s, const char* buf, size_t len); +extern int dump_body(req_state* s, /* const */ ceph::buffer::list& bl); +extern int dump_body(req_state* s, const std::string& str); +extern int recv_body(req_state* s, char* buf, size_t max); diff --git a/src/rgw/rgw_rest_bucket.h b/src/rgw/rgw_rest_bucket.h index e22fc0576ae21..3f3d5a6ba9b63 100644 --- a/src/rgw/rgw_rest_bucket.h +++ b/src/rgw/rgw_rest_bucket.h @@ -28,7 +28,7 @@ public: ~RGWRESTMgr_Bucket() override = default; RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry& auth_registry, const std::string&) override { return new RGWHandler_Bucket(auth_registry); diff --git a/src/rgw/rgw_rest_config.h b/src/rgw/rgw_rest_config.h index f79f811dd534e..ac1cde433d17d 100644 --- a/src/rgw/rgw_rest_config.h +++ b/src/rgw/rgw_rest_config.h @@ -80,7 +80,7 @@ public: ~RGWRESTMgr_Config() override = default; RGWHandler_REST* get_handler(rgw::sal::Store* , - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry& auth_registry, const std::string&) override { return new RGWHandler_Config(auth_registry); diff --git a/src/rgw/rgw_rest_iam.cc b/src/rgw/rgw_rest_iam.cc index f63018d189b3b..7389cc6f011a5 100644 --- a/src/rgw/rgw_rest_iam.cc +++ b/src/rgw/rgw_rest_iam.cc @@ -92,7 +92,7 @@ RGWOp *RGWHandler_REST_IAM::op_post() } int RGWHandler_REST_IAM::init(rgw::sal::Store* store, - struct req_state *s, + req_state *s, rgw::io::BasicClient *cio) { s->dialect = "iam"; @@ -110,7 +110,7 @@ int RGWHandler_REST_IAM::authorize(const DoutPrefixProvider* dpp, optional_yield return RGW_Auth_S3::authorize(dpp, store, auth_registry, s, y); } -int RGWHandler_REST_IAM::init_from_header(struct req_state* s, +int RGWHandler_REST_IAM::init_from_header(req_state* s, int default_formatter, bool configurable_format) { @@ -154,7 +154,7 @@ int RGWHandler_REST_IAM::init_from_header(struct req_state* s, RGWHandler_REST* RGWRESTMgr_IAM::get_handler(rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) { diff --git a/src/rgw/rgw_rest_iam.h b/src/rgw/rgw_rest_iam.h index d2421b603210a..93bcc58d82f19 100644 --- a/src/rgw/rgw_rest_iam.h +++ b/src/rgw/rgw_rest_iam.h @@ -14,7 +14,7 @@ class RGWHandler_REST_IAM : public RGWHandler_REST { void rgw_iam_parse_input(); public: - static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format); + static int init_from_header(req_state *s, int default_formatter, bool configurable_format); RGWHandler_REST_IAM(const rgw::auth::StrategyRegistry& auth_registry, bufferlist& bl_post_body) @@ -24,7 +24,7 @@ public: ~RGWHandler_REST_IAM() override = default; int init(rgw::sal::Store* store, - struct req_state *s, + req_state *s, rgw::io::BasicClient *cio) override; int authorize(const DoutPrefixProvider* dpp, optional_yield y) override; int postauth_init(optional_yield y) override { return 0; } @@ -35,14 +35,14 @@ public: RGWRESTMgr_IAM() = default; ~RGWRESTMgr_IAM() override = default; - RGWRESTMgr *get_resource_mgr(struct req_state* const s, + RGWRESTMgr *get_resource_mgr(req_state* const s, const std::string& uri, std::string* const out_uri) override { return this; } RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry&, const std::string&) override; }; diff --git a/src/rgw/rgw_rest_info.h b/src/rgw/rgw_rest_info.h index 4beb65d8076de..f109af01f65d4 100644 --- a/src/rgw/rgw_rest_info.h +++ b/src/rgw/rgw_rest_info.h @@ -25,7 +25,7 @@ public: ~RGWRESTMgr_Info() override = default; RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry& auth_registry, const std::string&) override { return new RGWHandler_Info(auth_registry); diff --git a/src/rgw/rgw_rest_log.h b/src/rgw/rgw_rest_log.h index 0838a0e510b87..3232f03ca6854 100644 --- a/src/rgw/rgw_rest_log.h +++ b/src/rgw/rgw_rest_log.h @@ -327,7 +327,7 @@ public: ~RGWRESTMgr_Log() override = default; RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state* const, + req_state* const, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefixs) override { return new RGWHandler_Log(auth_registry); diff --git a/src/rgw/rgw_rest_metadata.h b/src/rgw/rgw_rest_metadata.h index dd512c8ea768f..9dc29953a05ee 100644 --- a/src/rgw/rgw_rest_metadata.h +++ b/src/rgw/rgw_rest_metadata.h @@ -99,7 +99,7 @@ public: ~RGWRESTMgr_Metadata() override = default; RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) override { return new RGWHandler_Metadata(auth_registry); diff --git a/src/rgw/rgw_rest_ratelimit.h b/src/rgw/rgw_rest_ratelimit.h index e1f14a594f177..0f2f594203b48 100644 --- a/src/rgw/rgw_rest_ratelimit.h +++ b/src/rgw/rgw_rest_ratelimit.h @@ -26,7 +26,7 @@ public: ~RGWRESTMgr_Ratelimit() override = default; RGWHandler_REST *get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry& auth_registry, const std::string&) override { return new RGWHandler_Ratelimit(auth_registry); diff --git a/src/rgw/rgw_rest_realm.cc b/src/rgw/rgw_rest_realm.cc index 9e318ef400ae0..771355dee1152 100644 --- a/src/rgw/rgw_rest_realm.cc +++ b/src/rgw/rgw_rest_realm.cc @@ -251,7 +251,7 @@ class RGWHandler_Period : public RGWHandler_Auth_S3 { class RGWRESTMgr_Period : public RGWRESTMgr { public: RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry& auth_registry, const std::string&) override { return new RGWHandler_Period(auth_registry); @@ -368,7 +368,7 @@ RGWRESTMgr_Realm::RGWRESTMgr_Realm() RGWHandler_REST* RGWRESTMgr_Realm::get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry& auth_registry, const std::string&) { diff --git a/src/rgw/rgw_rest_realm.h b/src/rgw/rgw_rest_realm.h index 7800f91f896b4..aa9aa423fd10d 100644 --- a/src/rgw/rgw_rest_realm.h +++ b/src/rgw/rgw_rest_realm.h @@ -10,7 +10,7 @@ public: RGWRESTMgr_Realm(); RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry& auth_registry, const std::string&) override; }; diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 7020e3f18cbc8..4f90abb914a4d 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -79,17 +79,17 @@ using namespace std; using namespace rgw; using namespace ceph::crypto; -void list_all_buckets_start(struct req_state *s) +void list_all_buckets_start(req_state *s) { s->formatter->open_array_section_in_ns("ListAllMyBucketsResult", XMLNS_AWS_S3); } -void list_all_buckets_end(struct req_state *s) +void list_all_buckets_end(req_state *s) { s->formatter->close_section(); } -void dump_bucket(struct req_state *s, rgw::sal::Bucket& obj) +void dump_bucket(req_state *s, rgw::sal::Bucket& obj) { s->formatter->open_object_section("Bucket"); s->formatter->dump_string("Name", obj.get_name()); @@ -111,7 +111,7 @@ void rgw_get_errno_s3(rgw_http_error *e , int err_no) } static inline std::string get_s3_expiration_header( - struct req_state* s, + req_state* s, const ceph::real_time& mtime) { return rgw::lc::s3_expiration_header( @@ -119,7 +119,7 @@ static inline std::string get_s3_expiration_header( } static inline bool get_s3_multipart_abort_header( - struct req_state* s, const ceph::real_time& mtime, + req_state* s, const ceph::real_time& mtime, ceph::real_time& date, std::string& rule_id) { return rgw::lc::s3_multipart_abort_header( @@ -2266,7 +2266,7 @@ void RGWGetBucketWebsite_ObjStore_S3::send_response() rgw_flush_formatter_and_reset(s, s->formatter); } -static void dump_bucket_metadata(struct req_state *s, rgw::sal::Bucket* bucket) +static void dump_bucket_metadata(req_state *s, rgw::sal::Bucket* bucket) { dump_header(s, "X-RGW-Object-Count", static_cast(bucket->get_count())); dump_header(s, "X-RGW-Bytes-Used", static_cast(bucket->get_size())); @@ -2294,7 +2294,7 @@ void RGWStatBucket_ObjStore_S3::send_response() dump_start(s); } -static int create_s3_policy(struct req_state *s, rgw::sal::Store* store, +static int create_s3_policy(req_state *s, rgw::sal::Store* store, RGWAccessControlPolicy_S3& s3policy, ACLOwner& owner) { @@ -2463,7 +2463,7 @@ void RGWDeleteBucket_ObjStore_S3::send_response() end_header(s, this); } -static inline void map_qs_metadata(struct req_state* s, bool crypto_too) +static inline void map_qs_metadata(req_state* s, bool crypto_too) { /* merge S3 valid user metadata from the query-string into * x_meta_map, which maps them to attributes */ @@ -3508,7 +3508,7 @@ int RGWPutACLs_ObjStore_S3::get_params(optional_yield y) } int RGWPutACLs_ObjStore_S3::get_policy_from_state(rgw::sal::Store* store, - struct req_state *s, + req_state *s, stringstream& ss) { RGWAccessControlPolicy_S3 s3policy(s->cct); @@ -4743,7 +4743,7 @@ RGWOp *RGWHandler_REST_Obj_S3::op_options() } int RGWHandler_REST_S3::init_from_header(rgw::sal::Store* store, - struct req_state* s, + req_state* s, int default_formatter, bool configurable_format) { @@ -4897,7 +4897,7 @@ int RGWHandler_REST_S3::postauth_init(optional_yield y) return 0; } -int RGWHandler_REST_S3::init(rgw::sal::Store* store, struct req_state *s, +int RGWHandler_REST_S3::init(rgw::sal::Store* store, req_state *s, rgw::io::BasicClient *cio) { int ret; @@ -5009,7 +5009,7 @@ discover_aws_flavour(const req_info& info) int RGW_Auth_S3::authorize(const DoutPrefixProvider *dpp, rgw::sal::Store* const store, const rgw::auth::StrategyRegistry& auth_registry, - struct req_state* const s, optional_yield y) + req_state* const s, optional_yield y) { /* neither keystone and rados enabled; warn and exit! */ @@ -5029,7 +5029,7 @@ int RGW_Auth_S3::authorize(const DoutPrefixProvider *dpp, return ret; } -int RGWHandler_Auth_S3::init(rgw::sal::Store* store, struct req_state *state, +int RGWHandler_Auth_S3::init(rgw::sal::Store* store, req_state *state, rgw::io::BasicClient *cio) { int ret = RGWHandler_REST_S3::init_from_header(store, state, RGW_FORMAT_JSON, true); @@ -5040,7 +5040,7 @@ int RGWHandler_Auth_S3::init(rgw::sal::Store* store, struct req_state *state, } RGWHandler_REST* RGWRESTMgr_S3::get_handler(rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) { diff --git a/src/rgw/rgw_rest_s3.h b/src/rgw/rgw_rest_s3.h index d9d60376d0728..a4c9c893c1b1d 100644 --- a/src/rgw/rgw_rest_s3.h +++ b/src/rgw/rgw_rest_s3.h @@ -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, std::stringstream& ss) override; + int get_policy_from_state(rgw::sal::Store* store, req_state *s, std::stringstream& ss) override; void send_response() override; int get_params(optional_yield y) override; }; @@ -617,7 +617,7 @@ public: static int authorize(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const rgw::auth::StrategyRegistry& auth_registry, - struct req_state *s, optional_yield y); + req_state *s, optional_yield y); }; class RGWHandler_Auth_S3 : public RGWHandler_REST { @@ -636,7 +636,7 @@ public: static int validate_object_name(const std::string& bucket); int init(rgw::sal::Store* store, - struct req_state *s, + req_state *s, rgw::io::BasicClient *cio) override; int authorize(const DoutPrefixProvider *dpp, optional_yield y) override { return RGW_Auth_S3::authorize(dpp, store, auth_registry, s, y); @@ -649,7 +649,7 @@ class RGWHandler_REST_S3 : public RGWHandler_REST { protected: const rgw::auth::StrategyRegistry& auth_registry; public: - static int init_from_header(rgw::sal::Store* store, struct req_state *s, int default_formatter, bool configurable_format); + static int init_from_header(rgw::sal::Store* store, req_state *s, int default_formatter, bool configurable_format); explicit RGWHandler_REST_S3(const rgw::auth::StrategyRegistry& auth_registry) : RGWHandler_REST(), @@ -658,7 +658,7 @@ public: ~RGWHandler_REST_S3() override = default; int init(rgw::sal::Store* store, - struct req_state *s, + req_state *s, rgw::io::BasicClient *cio) override; int authorize(const DoutPrefixProvider *dpp, optional_yield y) override; int postauth_init(optional_yield y) override; @@ -793,7 +793,7 @@ public: ~RGWRESTMgr_S3() override = default; RGWHandler_REST *get_handler(rgw::sal::Store* store, - struct req_state* s, + req_state* s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) override; }; diff --git a/src/rgw/rgw_rest_sts.cc b/src/rgw/rgw_rest_sts.cc index 093c92d3633ea..bd1b842f8cf99 100644 --- a/src/rgw/rgw_rest_sts.cc +++ b/src/rgw/rgw_rest_sts.cc @@ -743,7 +743,7 @@ void RGWSTSAssumeRole::execute(optional_yield y) int RGW_Auth_STS::authorize(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const rgw::auth::StrategyRegistry& auth_registry, - struct req_state *s, optional_yield y) + req_state *s, optional_yield y) { return rgw::auth::Strategy::apply(dpp, auth_registry.get_sts(), s, y); } @@ -788,7 +788,7 @@ RGWOp *RGWHandler_REST_STS::op_post() } int RGWHandler_REST_STS::init(rgw::sal::Store* store, - struct req_state *s, + req_state *s, rgw::io::BasicClient *cio) { s->dialect = "sts"; @@ -809,7 +809,7 @@ int RGWHandler_REST_STS::authorize(const DoutPrefixProvider* dpp, optional_yield return RGW_Auth_S3::authorize(dpp, store, auth_registry, s, y); } -int RGWHandler_REST_STS::init_from_header(struct req_state* s, +int RGWHandler_REST_STS::init_from_header(req_state* s, int default_formatter, bool configurable_format) { @@ -853,7 +853,7 @@ int RGWHandler_REST_STS::init_from_header(struct req_state* s, RGWHandler_REST* RGWRESTMgr_STS::get_handler(rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) { diff --git a/src/rgw/rgw_rest_sts.h b/src/rgw/rgw_rest_sts.h index 54f0cfff9f895..3a3abdf26e8b0 100644 --- a/src/rgw/rgw_rest_sts.h +++ b/src/rgw/rgw_rest_sts.h @@ -194,7 +194,7 @@ public: static int authorize(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const rgw::auth::StrategyRegistry& auth_registry, - struct req_state *s, optional_yield y); + req_state *s, optional_yield y); }; class RGWHandler_REST_STS : public RGWHandler_REST { @@ -204,7 +204,7 @@ class RGWHandler_REST_STS : public RGWHandler_REST { void rgw_sts_parse_input(); public: - static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format); + static int init_from_header(req_state *s, int default_formatter, bool configurable_format); RGWHandler_REST_STS(const rgw::auth::StrategyRegistry& auth_registry, const std::string& post_body="") : RGWHandler_REST(), @@ -213,7 +213,7 @@ public: ~RGWHandler_REST_STS() override = default; int init(rgw::sal::Store* store, - struct req_state *s, + req_state *s, rgw::io::BasicClient *cio) override; int authorize(const DoutPrefixProvider* dpp, optional_yield y) override; int postauth_init(optional_yield y) override { return 0; } @@ -224,14 +224,14 @@ public: RGWRESTMgr_STS() = default; ~RGWRESTMgr_STS() override = default; - RGWRESTMgr *get_resource_mgr(struct req_state* const s, + RGWRESTMgr *get_resource_mgr(req_state* const s, const std::string& uri, std::string* const out_uri) override { return this; } RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry&, const std::string&) override; }; diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index 858397079b1bb..15647ec0f80d5 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -85,7 +85,7 @@ int RGWListBuckets_ObjStore_SWIFT::get_params(optional_yield y) return 0; } -static void dump_account_metadata(struct req_state * const s, +static void dump_account_metadata(req_state * const s, const RGWUsageStats& global_stats, const std::map &policies_stats, /* const */map& attrs, @@ -341,7 +341,7 @@ int RGWListBucket_ObjStore_SWIFT::get_params(optional_yield y) return 0; } -static void dump_container_metadata(struct req_state *, +static void dump_container_metadata(req_state *, const rgw::sal::Bucket*, const RGWQuotaInfo&, const RGWBucketWebsiteConf&); @@ -451,7 +451,7 @@ next: rgw_flush_formatter_and_reset(s, s->formatter); } // RGWListBucket_ObjStore_SWIFT::send_response -static void dump_container_metadata(struct req_state *s, +static void dump_container_metadata(req_state *s, const rgw::sal::Bucket* bucket, const RGWQuotaInfo& quota, const RGWBucketWebsiteConf& ws_conf) @@ -1311,7 +1311,7 @@ static void get_contype_from_attrs(map& attrs, } } -static void dump_object_metadata(const DoutPrefixProvider* dpp, struct req_state * const s, +static void dump_object_metadata(const DoutPrefixProvider* dpp, req_state * const s, const map& attrs) { map response_attrs; @@ -2904,7 +2904,7 @@ static void next_tok(string& str, string& tok, char delim) } int RGWHandler_REST_SWIFT::init_from_header(rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const std::string& frontend_prefix) { string req; @@ -3029,7 +3029,7 @@ int RGWHandler_REST_SWIFT::init_from_header(rgw::sal::Store* store, return 0; } -int RGWHandler_REST_SWIFT::init(rgw::sal::Store* store, struct req_state* s, +int RGWHandler_REST_SWIFT::init(rgw::sal::Store* store, req_state* s, rgw::io::BasicClient *cio) { struct req_init_state *t = &s->init_state; @@ -3077,7 +3077,7 @@ int RGWHandler_REST_SWIFT::init(rgw::sal::Store* store, struct req_state* s, RGWHandler_REST* RGWRESTMgr_SWIFT::get_handler(rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) { @@ -3102,7 +3102,7 @@ RGWRESTMgr_SWIFT::get_handler(rgw::sal::Store* store, RGWHandler_REST* RGWRESTMgr_SWIFT_Info::get_handler( rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) { diff --git a/src/rgw/rgw_rest_swift.h b/src/rgw/rgw_rest_swift.h index e799a44c65ba6..a6e0bd90d9ff2 100644 --- a/src/rgw/rgw_rest_swift.h +++ b/src/rgw/rgw_rest_swift.h @@ -385,7 +385,7 @@ protected: return false; } - static int init_from_header(rgw::sal::Store* store, struct req_state* s, + static int init_from_header(rgw::sal::Store* store, req_state* s, const std::string& frontend_prefix); public: explicit RGWHandler_REST_SWIFT(const rgw::auth::Strategy& auth_strategy) @@ -395,7 +395,7 @@ public: int validate_bucket_name(const std::string& bucket); - int init(rgw::sal::Store* store, struct req_state *s, rgw::io::BasicClient *cio) override; + int init(rgw::sal::Store* store, req_state *s, rgw::io::BasicClient *cio) override; int authorize(const DoutPrefixProvider *dpp, optional_yield y) override; int postauth_init(optional_yield y) override; @@ -444,7 +444,7 @@ public: } int init(rgw::sal::Store* const store, - struct req_state* const s, + req_state* const s, rgw::io::BasicClient* const cio) override { website_handler = boost::in_place(store, s, this); return RGWHandler_REST_SWIFT::init(store, s, cio); @@ -483,7 +483,7 @@ public: } int init(rgw::sal::Store* const store, - struct req_state* const s, + req_state* const s, rgw::io::BasicClient* const cio) override { website_handler = boost::in_place(store, s, this); return RGWHandler_REST_SWIFT::init(store, s, cio); @@ -492,7 +492,7 @@ public: class RGWRESTMgr_SWIFT : public RGWRESTMgr { protected: - RGWRESTMgr* get_resource_mgr_as_default(struct req_state* const s, + RGWRESTMgr* get_resource_mgr_as_default(req_state* const s, const std::string& uri, std::string* const out_uri) override { return this->get_resource_mgr(s, uri, out_uri); @@ -503,7 +503,7 @@ public: ~RGWRESTMgr_SWIFT() override = default; RGWHandler_REST *get_handler(rgw::sal::Store* store, - struct req_state *s, + req_state *s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) override; }; @@ -537,7 +537,7 @@ public: } int init(rgw::sal::Store* const store, - struct req_state* const state, + req_state* const state, rgw::io::BasicClient* const cio) override { state->dialect = "swift"; state->formatter = new JSONFormatter; @@ -564,7 +564,7 @@ public: class RGWRESTMgr_SWIFT_CrossDomain : public RGWRESTMgr { protected: - RGWRESTMgr *get_resource_mgr(struct req_state* const s, + RGWRESTMgr *get_resource_mgr(req_state* const s, const std::string& uri, std::string* const out_uri) override { return this; @@ -575,7 +575,7 @@ public: ~RGWRESTMgr_SWIFT_CrossDomain() override = default; RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry&, const std::string&) override { s->prot_flags |= RGW_REST_SWIFT; @@ -594,7 +594,7 @@ public: } int init(rgw::sal::Store* const store, - struct req_state* const state, + req_state* const state, rgw::io::BasicClient* const cio) override { state->dialect = "swift"; state->formatter = new JSONFormatter; @@ -621,7 +621,7 @@ public: class RGWRESTMgr_SWIFT_HealthCheck : public RGWRESTMgr { protected: - RGWRESTMgr *get_resource_mgr(struct req_state* const s, + RGWRESTMgr *get_resource_mgr(req_state* const s, const std::string& uri, std::string* const out_uri) override { return this; @@ -632,7 +632,7 @@ public: ~RGWRESTMgr_SWIFT_HealthCheck() override = default; RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry&, const std::string&) override { s->prot_flags |= RGW_REST_SWIFT; @@ -651,7 +651,7 @@ public: } int init(rgw::sal::Store* const store, - struct req_state* const state, + req_state* const state, rgw::io::BasicClient* const cio) override { state->dialect = "swift"; state->formatter = new JSONFormatter; @@ -679,7 +679,7 @@ public: ~RGWRESTMgr_SWIFT_Info() override = default; RGWHandler_REST *get_handler(rgw::sal::Store* store, - struct req_state* s, + req_state* s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) override; }; diff --git a/src/rgw/rgw_rest_usage.h b/src/rgw/rgw_rest_usage.h index e7195cd31e835..a6c1a8493cb93 100644 --- a/src/rgw/rgw_rest_usage.h +++ b/src/rgw/rgw_rest_usage.h @@ -26,7 +26,7 @@ public: ~RGWRESTMgr_Usage() override = default; RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry& auth_registry, const std::string&) override { return new RGWHandler_Usage(auth_registry); diff --git a/src/rgw/rgw_rest_user.h b/src/rgw/rgw_rest_user.h index d3e3e1627bb2f..d094df745dcfb 100644 --- a/src/rgw/rgw_rest_user.h +++ b/src/rgw/rgw_rest_user.h @@ -28,7 +28,7 @@ public: ~RGWRESTMgr_User() override = default; RGWHandler_REST *get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry& auth_registry, const std::string&) override { return new RGWHandler_User(auth_registry); diff --git a/src/rgw/rgw_s3select_private.h b/src/rgw/rgw_s3select_private.h index 9174c04908fe3..8fffbfbade5e6 100644 --- a/src/rgw/rgw_s3select_private.h +++ b/src/rgw/rgw_s3select_private.h @@ -41,7 +41,7 @@ class aws_response_handler private: std::string sql_result; - struct req_state* s; + req_state* s; uint32_t header_size; // the parameters are according to CRC-32 algorithm and its aligned with AWS-cli checksum boost::crc_optimal<32, 0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, true, true> crc32; @@ -82,7 +82,7 @@ private: int create_message(u_int32_t header_len); public: - aws_response_handler(struct req_state* ps, RGWOp* rgwop) : s(ps), m_rgwop(rgwop), total_bytes_returned{0}, processed_size{0} + aws_response_handler(req_state* ps, RGWOp* rgwop) : s(ps), m_rgwop(rgwop), total_bytes_returned{0}, processed_size{0} {} aws_response_handler() : s(nullptr), m_rgwop(nullptr), total_bytes_returned{0}, processed_size{0} @@ -96,7 +96,7 @@ public: return true; } - void set(struct req_state* ps, RGWOp* rgwop) + void set(req_state* ps, RGWOp* rgwop) { s = ps; m_rgwop = rgwop; diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 7da18bbe7be2a..0fcb6b005d096 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -341,7 +341,7 @@ class Store { /** Get a @a Notification object. Used to communicate with non-RGW daemons, such as * management/tracking software */ /** RGWOp variant */ - virtual std::unique_ptr get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s, + virtual std::unique_ptr get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) = 0; /** No-req_state variant (e.g., rgwlc) */ virtual std::unique_ptr get_notification( diff --git a/src/rgw/rgw_sal_dbstore.cc b/src/rgw/rgw_sal_dbstore.cc index 9cebbc81e0df9..76adbaee3a627 100644 --- a/src/rgw/rgw_sal_dbstore.cc +++ b/src/rgw/rgw_sal_dbstore.cc @@ -1809,7 +1809,7 @@ namespace rgw::sal { } std::unique_ptr DBStore::get_notification( - rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s, + rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, const std::string* object_name) { return std::make_unique(obj, src_obj, event_type); diff --git a/src/rgw/rgw_sal_dbstore.h b/src/rgw/rgw_sal_dbstore.h index b3b92db63e9da..c3d956cbdc357 100644 --- a/src/rgw/rgw_sal_dbstore.h +++ b/src/rgw/rgw_sal_dbstore.h @@ -778,7 +778,7 @@ public: virtual std::unique_ptr get_completions(void) override; virtual std::unique_ptr get_notification( - rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s, + rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, const std::string* object_name) override; virtual std::unique_ptr get_notification( diff --git a/src/rgw/rgw_sal_motr.cc b/src/rgw/rgw_sal_motr.cc index 5623b2efa2813..deb129624fcde 100644 --- a/src/rgw/rgw_sal_motr.cc +++ b/src/rgw/rgw_sal_motr.cc @@ -2969,7 +2969,7 @@ std::unique_ptr MotrStore::get_completions(void) return 0; } -std::unique_ptr MotrStore::get_notification(Object* obj, Object* src_obj, struct req_state* s, +std::unique_ptr MotrStore::get_notification(Object* obj, Object* src_obj, req_state* s, rgw::notify::EventType event_type, const string* object_name) { return std::make_unique(obj, src_obj, event_type); diff --git a/src/rgw/rgw_sal_motr.h b/src/rgw/rgw_sal_motr.h index 872393b6cafe6..c87053903339d 100644 --- a/src/rgw/rgw_sal_motr.h +++ b/src/rgw/rgw_sal_motr.h @@ -925,7 +925,7 @@ class MotrStore : public Store { virtual std::unique_ptr get_lifecycle(void) override; virtual std::unique_ptr get_completions(void) override; virtual std::unique_ptr get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, - struct req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override; + req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override; virtual std::unique_ptr get_notification(const DoutPrefixProvider* dpp, rgw::sal::Object* obj, rgw::sal::Object* src_obj, rgw::notify::EventType event_type, rgw::sal::Bucket* _bucket, std::string& _user_id, std::string& _user_tenant, std::string& _req_id, optional_yield y) override; diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 158d54752bacd..8da5df5d8cd5f 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -1209,7 +1209,7 @@ std::unique_ptr RadosStore::get_completions(void) } std::unique_ptr RadosStore::get_notification( - rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s, rgw::notify::EventType event_type, const std::string* object_name) + rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, const std::string* object_name) { return std::make_unique(s, this, obj, src_obj, s, event_type, object_name); } diff --git a/src/rgw/rgw_sal_rados.h b/src/rgw/rgw_sal_rados.h index 663a11d4a30ed..119e09e5dd7d8 100644 --- a/src/rgw/rgw_sal_rados.h +++ b/src/rgw/rgw_sal_rados.h @@ -151,7 +151,7 @@ class RadosStore : public Store { virtual int cluster_stat(RGWClusterStat& stats) override; virtual std::unique_ptr get_lifecycle(void) override; virtual std::unique_ptr get_completions(void) override; - virtual std::unique_ptr get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override; + virtual std::unique_ptr get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override; virtual std::unique_ptr get_notification( const DoutPrefixProvider* dpp, rgw::sal::Object* obj, rgw::sal::Object* src_obj, rgw::notify::EventType event_type, rgw::sal::Bucket* _bucket, std::string& _user_id, std::string& _user_tenant, diff --git a/src/rgw/rgw_swift_auth.cc b/src/rgw/rgw_swift_auth.cc index 8f41807368c99..0069d02e6551e 100644 --- a/src/rgw/rgw_swift_auth.cc +++ b/src/rgw/rgw_swift_auth.cc @@ -751,7 +751,7 @@ done: end_header(s); } -int RGWHandler_SWIFT_Auth::init(rgw::sal::Store* store, struct req_state *state, +int RGWHandler_SWIFT_Auth::init(rgw::sal::Store* store, req_state *state, rgw::io::BasicClient *cio) { state->dialect = "swift-auth"; diff --git a/src/rgw/rgw_swift_auth.h b/src/rgw/rgw_swift_auth.h index 430739a447c8a..25bc3e3dd823f 100644 --- a/src/rgw/rgw_swift_auth.h +++ b/src/rgw/rgw_swift_auth.h @@ -317,7 +317,7 @@ public: ~RGWHandler_SWIFT_Auth() override {} RGWOp *op_get() override; - int init(rgw::sal::Store* store, struct req_state *state, rgw::io::BasicClient *cio) override; + int init(rgw::sal::Store* store, req_state *state, rgw::io::BasicClient *cio) override; int authorize(const DoutPrefixProvider *dpp, optional_yield y) override; int postauth_init(optional_yield) override { return 0; } int read_permissions(RGWOp *op, optional_yield) override { return 0; } @@ -331,14 +331,14 @@ public: RGWRESTMgr_SWIFT_Auth() = default; ~RGWRESTMgr_SWIFT_Auth() override = default; - RGWRESTMgr *get_resource_mgr(struct req_state* const s, + RGWRESTMgr *get_resource_mgr(req_state* const s, const std::string& uri, std::string* const out_uri) override { return this; } RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state*, + req_state*, const rgw::auth::StrategyRegistry&, const std::string&) override { return new RGWHandler_SWIFT_Auth; diff --git a/src/rgw/rgw_sync_module_es_rest.cc b/src/rgw/rgw_sync_module_es_rest.cc index f21c307ffd0d1..d5c202e9a01e7 100644 --- a/src/rgw/rgw_sync_module_es_rest.cc +++ b/src/rgw/rgw_sync_module_es_rest.cc @@ -404,7 +404,7 @@ public: RGWHandler_REST* RGWRESTMgr_MDSearch_S3::get_handler(rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) { diff --git a/src/rgw/rgw_sync_module_es_rest.h b/src/rgw/rgw_sync_module_es_rest.h index 9224ffe4022cf..f9fba879f0a36 100644 --- a/src/rgw/rgw_sync_module_es_rest.h +++ b/src/rgw/rgw_sync_module_es_rest.h @@ -12,7 +12,7 @@ public: explicit RGWRESTMgr_MDSearch_S3() {} RGWHandler_REST *get_handler(rgw::sal::Store* store, - struct req_state* s, + req_state* s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) override; }; diff --git a/src/rgw/rgw_sync_module_pubsub_rest.cc b/src/rgw/rgw_sync_module_pubsub_rest.cc index b663cb15e2cb4..8ae6f1dfe6ee2 100644 --- a/src/rgw/rgw_sync_module_pubsub_rest.cc +++ b/src/rgw/rgw_sync_module_pubsub_rest.cc @@ -500,7 +500,7 @@ public: // factory for ceph specific PubSub REST handlers RGWHandler_REST* RGWRESTMgr_PubSub::get_handler(rgw::sal::Store* store, - struct req_state* const s, + req_state* const s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) { diff --git a/src/rgw/rgw_sync_module_pubsub_rest.h b/src/rgw/rgw_sync_module_pubsub_rest.h index 32335f69486af..e782942cb51bf 100644 --- a/src/rgw/rgw_sync_module_pubsub_rest.h +++ b/src/rgw/rgw_sync_module_pubsub_rest.h @@ -8,7 +8,7 @@ class RGWRESTMgr_PubSub : public RGWRESTMgr { public: virtual RGWHandler_REST* get_handler(rgw::sal::Store* store, - struct req_state* s, + req_state* s, const rgw::auth::StrategyRegistry& auth_registry, const std::string& frontend_prefix) override; }; diff --git a/src/rgw/rgw_torrent.cc b/src/rgw/rgw_torrent.cc index 41a4a4d91a510..5670bc1a0d90b 100644 --- a/src/rgw/rgw_torrent.cc +++ b/src/rgw/rgw_torrent.cc @@ -37,7 +37,7 @@ seed::~seed() store = NULL; } -void seed::init(struct req_state *p_req, rgw::sal::Store* p_store) +void seed::init(req_state *p_req, rgw::sal::Store* p_store) { s = p_req; store = p_store; diff --git a/src/rgw/rgw_torrent.h b/src/rgw/rgw_torrent.h index cc84a1778ceb6..7e225b771400d 100644 --- a/src/rgw/rgw_torrent.h +++ b/src/rgw/rgw_torrent.h @@ -106,7 +106,7 @@ private: bool is_torrent; // flag bufferlist bl; // bufflist ready to send - struct req_state *s{nullptr}; + req_state *s{nullptr}; rgw::sal::Store* store{nullptr}; SHA1 h; @@ -116,7 +116,7 @@ public: ~seed(); int get_params(); - void init(struct req_state *p_req, rgw::sal::Store* p_store); + void init(req_state *p_req, rgw::sal::Store* p_store); int get_torrent_file(rgw::sal::Object* object, uint64_t &total_len, ceph::bufferlist &bl_data, -- 2.39.5