]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove potentially conficting definition of dout_subsys 53462/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Fri, 13 May 2022 23:03:25 +0000 (19:03 -0400)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Thu, 14 Sep 2023 13:43:37 +0000 (20:43 +0700)
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>
(cherry picked from commit 8efea3e894e7db82a6f65cd997bb832e1e91a54a)

src/rgw/rgw_log.cc
src/rgw/rgw_log.h
src/rgw/rgw_s3select.cc

index 5f7598a41f6a8e6e5d4e66ea1ae03e287b567427..eaf4f100c210fbec7ce9f588b7221cb6da9e7a65 100644 (file)
@@ -467,6 +467,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;
 }
@@ -720,4 +724,3 @@ void rgw_log_entry::dump(Formatter *f) const
   f->dump_string("trans_id", trans_id);
   f->dump_unsigned("identity_type", identity_type);
 }
-
index 14159f2384716b68a31224472c1c4ce446b3ae7d..fb961e5e0fcc47dd5ad559f0c597eb0331942778 100644 (file)
@@ -10,8 +10,6 @@
 #include <vector>
 #include <fstream>
 
-#define dout_subsys ceph_subsys_rgw
-
 namespace rgw { namespace sal {
   class Store;
 } }
@@ -260,7 +258,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()
 {