]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: Build target 'common' without using namespace in headers
authorAdam C. Emerson <aemerson@redhat.com>
Sat, 7 Mar 2020 09:32:31 +0000 (04:32 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Sat, 7 Mar 2020 09:32:31 +0000 (04:32 -0500)
Part of a changeset to allow building all of 'common' without relying
on 'using namespace std' or 'using namespace ceph' at toplevel in
headers.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/mon/MonClient.cc
src/mon/MonCommand.h
src/mon/PGMap.cc
src/mon/PGMap.h
src/mon/Session.h
src/mon/health_check.h

index dbb4287a2a2ebda4f398daabc5e96b9f6b303031..efaae98247d104ecb0f8cd510659745a25460614 100644 (file)
@@ -542,7 +542,7 @@ int MonClient::authenticate(double timeout)
   while (!active_con && authenticate_err >= 0) {
     if (timeout > 0.0) {
       auto r = auth_cond.wait_until(lock, until);
-      if (r == cv_status::timeout && !active_con) {
+      if (r == std::cv_status::timeout && !active_con) {
        ldout(cct, 0) << "authenticate timed out after " << timeout << dendl;
        authenticate_err = -ETIMEDOUT;
       }
index 2d363302bfa58dfab08847051e8c6a3669aaa6e2..cb60d3d17065ac12c025d2e3058bfa2078d18776 100644 (file)
@@ -39,14 +39,14 @@ struct MonCommand {
   void set_flag(uint64_t flag) { flags |= flag; }
   void unset_flag(uint64_t flag) { flags &= ~flag; }
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode_bare(bl);
     encode(flags, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode_bare(bl);
     decode(flags, bl);
@@ -56,7 +56,7 @@ struct MonCommand {
   /**
    * Unversioned encoding for use within encode_array.
    */
-  void encode_bare(bufferlist &bl) const {
+  void encode_bare(ceph::buffer::list &bl) const {
     using ceph::encode;
     encode(cmdstring, bl);
     encode(helpstring, bl);
@@ -65,7 +65,7 @@ struct MonCommand {
     std::string availability = "cli,rest";  // Removed field, for backward compat
     encode(availability, bl);
   }
-  void decode_bare(bufferlist::const_iterator &bl) {
+  void decode_bare(ceph::buffer::list::const_iterator &bl) {
     using ceph::decode;
     decode(cmdstring, bl);
     decode(helpstring, bl);
@@ -103,7 +103,7 @@ struct MonCommand {
     return has_flag(MonCommand::FLAG_HIDDEN);
   }
 
-  static void encode_array(const MonCommand *cmds, int size, bufferlist &bl) {
+  static void encode_array(const MonCommand *cmds, int size, ceph::buffer::list &bl) {
     ENCODE_START(2, 1, bl);
     uint16_t s = size;
     encode(s, bl);
@@ -116,7 +116,7 @@ struct MonCommand {
     ENCODE_FINISH(bl);
   }
   static void decode_array(MonCommand **cmds, int *size,
-                           bufferlist::const_iterator &bl) {
+                           ceph::buffer::list::const_iterator &bl) {
     DECODE_START(2, bl);
     uint16_t s = 0;
     decode(s, bl);
@@ -137,7 +137,7 @@ struct MonCommand {
 
   // this uses a u16 for the count, so we need a special encoder/decoder.
   static void encode_vector(const std::vector<MonCommand>& cmds,
-                           bufferlist &bl) {
+                           ceph::buffer::list &bl) {
     ENCODE_START(2, 1, bl);
     uint16_t s = cmds.size();
     encode(s, bl);
@@ -150,7 +150,7 @@ struct MonCommand {
     ENCODE_FINISH(bl);
   }
   static void decode_vector(std::vector<MonCommand> &cmds,
-                           bufferlist::const_iterator &bl) {
+                           ceph::buffer::list::const_iterator &bl) {
     DECODE_START(2, bl);
     uint16_t s = 0;
     decode(s, bl);
index 636ab0c7156327814c384b2e1050a9a361226d66..1cfb85d11e142f876869670d7cc3124cc553c265 100644 (file)
@@ -31,6 +31,8 @@ using std::stringstream;
 using std::vector;
 
 using ceph::bufferlist;
+using ceph::fixed_u_to_string;
+
 using TOPNSPC::common::cmd_getval;
 
 MEMPOOL_DEFINE_OBJECT_FACTORY(PGMapDigest, pgmap_digest, pgmap);
index d9b2c874c208d609233a34b9933815ae4f37f125..6488cc895c76f1791a41023d960723c273d40238 100644 (file)
@@ -492,12 +492,12 @@ public:
   void get_filtered_pg_stats(uint64_t state, int64_t poolid, int64_t osdid,
                              bool primary, std::set<pg_t>& pgs) const;
 
-  set<std::string> osd_parentage(const OSDMap& osdmap, int id) const;
+  std::set<std::string> osd_parentage(const OSDMap& osdmap, int id) const;
   void get_health_checks(
     CephContext *cct,
     const OSDMap& osdmap,
     health_check_map_t *checks) const;
-  void print_summary(ceph::Formatter *f, ostream *out) const;
+  void print_summary(ceph::Formatter *f, std::ostream *out) const;
 
   static void generate_test_instances(std::list<PGMap*>& o);
 };
index 3d190ae2602339ac0f458ab6f6b034c883cace2b..4ca4814d70050e83039904d3eba97653d5c761dd 100644 (file)
@@ -110,7 +110,7 @@ struct MonSession : public RefCountedObject {
     return socket_addr;
   }
 
-  void dump(Formatter *f) const {
+  void dump(ceph::Formatter *f) const {
     f->dump_stream("name") << name;
     f->dump_stream("entity_name") << entity_name;
     f->dump_object("addrs", addrs);
index bff9166b12da24e1523bf5187ca3949468385007..1473c496eec553f0a3ab738472a362f23a5f608f 100644 (file)
@@ -74,7 +74,7 @@ struct health_mute_t {
   std::string code;
   utime_t ttl;
   bool sticky = false;
-  string summary;
+  std::string summary;
   int64_t count;
 
   DENC(health_mute_t, v, p) {