From: Adam C. Emerson Date: Sat, 7 Mar 2020 09:32:31 +0000 (-0500) Subject: auth: Build target 'common' without using namespace in headers X-Git-Tag: v16.0.0~18^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b9a0b5f59786f782a4029183cfa4deb10506150f;p=ceph.git auth: Build target 'common' without using namespace in headers 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 --- diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index dbb4287a2a2eb..efaae98247d10 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -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; } diff --git a/src/mon/MonCommand.h b/src/mon/MonCommand.h index 2d363302bfa58..cb60d3d17065a 100644 --- a/src/mon/MonCommand.h +++ b/src/mon/MonCommand.h @@ -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& 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 &cmds, - bufferlist::const_iterator &bl) { + ceph::buffer::list::const_iterator &bl) { DECODE_START(2, bl); uint16_t s = 0; decode(s, bl); diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 636ab0c715632..1cfb85d11e142 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -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); diff --git a/src/mon/PGMap.h b/src/mon/PGMap.h index d9b2c874c208d..6488cc895c76f 100644 --- a/src/mon/PGMap.h +++ b/src/mon/PGMap.h @@ -492,12 +492,12 @@ public: void get_filtered_pg_stats(uint64_t state, int64_t poolid, int64_t osdid, bool primary, std::set& pgs) const; - set osd_parentage(const OSDMap& osdmap, int id) const; + std::set 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& o); }; diff --git a/src/mon/Session.h b/src/mon/Session.h index 3d190ae260233..4ca4814d70050 100644 --- a/src/mon/Session.h +++ b/src/mon/Session.h @@ -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); diff --git a/src/mon/health_check.h b/src/mon/health_check.h index bff9166b12da2..1473c496eec55 100644 --- a/src/mon/health_check.h +++ b/src/mon/health_check.h @@ -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) {