From: J. Eric Ivancich Date: Fri, 13 May 2022 23:03:25 +0000 (-0400) Subject: rgw: remove potentially conficting definition of dout_subsys X-Git-Tag: v18.0.0~883^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8efea3e894e7db82a6f65cd997bb832e1e91a54a;p=ceph.git rgw: remove potentially conficting definition of dout_subsys dout_subsys should strictly be defined in .cc files. There was a definition of dout_subsys in rgw_log.h, which is included in a variety of .cc files due to transitive includes. When a subsystem wants a conflicting definition, a compiler warning is then generated due to the redefinition of dout_subsys. The definition is removed from rgw_log.h and follow-on fixes are made. Signed-off-by: J. Eric Ivancich --- diff --git a/src/rgw/rgw_log.cc b/src/rgw/rgw_log.cc index 01789bd4e04f..ae05df626107 100644 --- a/src/rgw/rgw_log.cc +++ b/src/rgw/rgw_log.cc @@ -438,6 +438,10 @@ int OpsLogFile::log_json(struct req_state* s, bufferlist& bl) return 0; } +unsigned OpsLogFile::get_subsys() const { + return dout_subsys; +} + JsonOpsLogSink::JsonOpsLogSink() { formatter = new JSONFormatter; } @@ -686,4 +690,3 @@ void rgw_log_entry::dump(Formatter *f) const f->dump_string("trans_id", trans_id); f->dump_unsigned("identity_type", identity_type); } - diff --git a/src/rgw/rgw_log.h b/src/rgw/rgw_log.h index 874f97079c79..a689ee6a637c 100644 --- a/src/rgw/rgw_log.h +++ b/src/rgw/rgw_log.h @@ -10,8 +10,6 @@ #include #include -#define dout_subsys ceph_subsys_rgw - namespace rgw { namespace sal { class Store; } } @@ -184,7 +182,7 @@ public: OpsLogFile(CephContext* cct, std::string& path, uint64_t max_data_size); ~OpsLogFile() override; CephContext *get_cct() const override { return cct; } - unsigned get_subsys() const override { return dout_subsys; } + unsigned get_subsys() const override; std::ostream& gen_prefix(std::ostream& out) const override { return out << "rgw OpsLogFile: "; } void reopen(); void start(); diff --git a/src/rgw/rgw_s3select.cc b/src/rgw/rgw_s3select.cc index 19c787303be9..14cadb32c6b8 100644 --- a/src/rgw/rgw_s3select.cc +++ b/src/rgw/rgw_s3select.cc @@ -3,6 +3,8 @@ #include "rgw_s3select_private.h" +#define dout_subsys ceph_subsys_rgw + namespace rgw::s3select { RGWOp* create_s3select_op() {