]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove potentially conficting definition of dout_subsys 46265/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Fri, 13 May 2022 23:03:25 +0000 (19:03 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Sat, 14 May 2022 04:33:26 +0000 (00:33 -0400)
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 <ivancich@redhat.com>
src/rgw/rgw_log.cc
src/rgw/rgw_log.h
src/rgw/rgw_s3select.cc

index 01789bd4e04f373e3a7ea1b5699ac0ca7d3b68e9..ae05df62610730c173802538b1b895761d2fe323 100644 (file)
@@ -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);
 }
-
index 874f97079c79308507a78772d340864b620460ca..a689ee6a637cb9659c293a96958f5fd063320b8d 100644 (file)
@@ -10,8 +10,6 @@
 #include <vector>
 #include <fstream>
 
-#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();
index 19c787303be911fb1d5ada03a9f7a56a062cb626..14cadb32c6b8841175de9478829bc36e2434d76e 100644 (file)
@@ -3,6 +3,8 @@
 
 #include "rgw_s3select_private.h"
 
+#define dout_subsys ceph_subsys_rgw
+
 namespace rgw::s3select {
 RGWOp* create_s3select_op()
 {