From: Adam C. Emerson Date: Fri, 29 Mar 2019 01:01:48 +0000 (-0400) Subject: include: Update util.h to work without using namespace X-Git-Tag: v15.0.0~19^2~58 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a617ffc5af944791721afa126720ab42f63ca018;p=ceph.git include: Update util.h to work without using namespace Signed-off-by: Adam C. Emerson --- diff --git a/src/include/util.h b/src/include/util.h index 9c377aa1413d..1268288e2770 100644 --- a/src/include/util.h +++ b/src/include/util.h @@ -33,7 +33,7 @@ struct ceph_data_stats avail_percent(0) { } - void dump(Formatter *f) const { + void dump(ceph::Formatter *f) const { ceph_assert(f != NULL); f->dump_int("total", byte_total); f->dump_int("used", byte_used); @@ -41,7 +41,7 @@ struct ceph_data_stats f->dump_int("avail_percent", avail_percent); } - void encode(bufferlist &bl) const { + void encode(ceph::buffer::list &bl) const { ENCODE_START(1, 1, bl); encode(byte_total, bl); encode(byte_used, bl); @@ -50,7 +50,7 @@ struct ceph_data_stats ENCODE_FINISH(bl); } - void decode(bufferlist::const_iterator &p) { + void decode(ceph::buffer::list::const_iterator &p) { DECODE_START(1, p); decode(byte_total, p); decode(byte_used, p); @@ -59,7 +59,7 @@ struct ceph_data_stats DECODE_FINISH(p); } - static void generate_test_instances(list& ls) { + static void generate_test_instances(std::list& ls) { ls.push_back(new ceph_data_stats); ls.push_back(new ceph_data_stats); ls.back()->byte_total = 1024*1024; @@ -77,21 +77,24 @@ int get_fs_stats(ceph_data_stats_t &stats, const char *path); int get_cgroup_memory_limit(uint64_t *limit); /// collect info from @p uname(2), @p /proc/meminfo and @p /proc/cpuinfo -void collect_sys_info(map *m, CephContext *cct); +void collect_sys_info(std::map *m, CephContext *cct); /// dump service ids grouped by their host to the specified formatter /// @param f formatter for the output /// @param services a map from hostname to a list of service id hosted by this host /// @param type the service type of given @p services, for example @p osd or @p mon. -void dump_services(Formatter* f, const map >& services, const char* type); +void dump_services(ceph::Formatter* f, + const std::map >& services, + const char* type); /// dump service names grouped by their host to the specified formatter /// @param f formatter for the output /// @param services a map from hostname to a list of service name hosted by this host /// @param type the service type of given @p services, for example @p osd or @p mon. -void dump_services(Formatter* f, const map >& services, const char* type); +void dump_services(ceph::Formatter* f, const std::map >& services, const char* type); -string cleanbin(bufferlist &bl, bool &b64); -string cleanbin(string &str); +std::string cleanbin(ceph::buffer::list &bl, bool &b64); +std::string cleanbin(std::string &str); namespace ceph::util {