From: Sage Weil Date: Wed, 20 Jan 2016 02:12:41 +0000 (-0500) Subject: ceph_test_rados: clean up std usage X-Git-Tag: v10.0.4~156^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2439bb61c71889310dfa1757cc35b658b1769b54;p=ceph.git ceph_test_rados: clean up std usage Signed-off-by: Sage Weil --- diff --git a/src/test/common/ObjectContents.h b/src/test/common/ObjectContents.h index 0f467b17e7c2..768915957401 100644 --- a/src/test/common/ObjectContents.h +++ b/src/test/common/ObjectContents.h @@ -16,13 +16,13 @@ bool test_object_contents(); class ObjectContents { uint64_t _size; - map seeds; + std::map seeds; interval_set written; bool _exists; public: class Iterator { ObjectContents *parent; - map::iterator iter; + std::map::iterator iter; unsigned int current_state; int current_val; uint64_t pos; @@ -100,7 +100,7 @@ public: void debug(std::ostream &out) { out << "_size is " << _size << std::endl; out << "seeds is: ("; - for (map::iterator i = seeds.begin(); + for (std::map::iterator i = seeds.begin(); i != seeds.end(); ++i) { out << "[" << i->first << "," << i->second << "], "; diff --git a/src/test/osd/Object.cc b/src/test/osd/Object.cc index 699005381d80..db4f699623f0 100644 --- a/src/test/osd/Object.cc +++ b/src/test/osd/Object.cc @@ -30,7 +30,7 @@ void ContDesc::decode(bufferlist::iterator &bl) DECODE_FINISH(bl); } -ostream &operator<<(ostream &out, const ContDesc &rhs) +std::ostream &operator<<(std::ostream &out, const ContDesc &rhs) { return out << "(ObjNum " << rhs.objnum << " snap " << rhs.cursnap @@ -40,7 +40,7 @@ ostream &operator<<(ostream &out, const ContDesc &rhs) } void AppendGenerator::get_ranges_map( - const ContDesc &cont, map &out) { + const ContDesc &cont, std::map &out) { RandWrap rand(cont.seqnum); uint64_t pos = off; uint64_t limit = off + get_append_size(cont); @@ -54,13 +54,13 @@ void AppendGenerator::get_ranges_map( } if (alignment) assert(segment_length % alignment == 0); - out.insert(pair(pos, segment_length)); + out.insert(std::pair(pos, segment_length)); pos += segment_length; } } void VarLenGenerator::get_ranges_map( - const ContDesc &cont, map &out) { + const ContDesc &cont, std::map &out) { RandWrap rand(cont.seqnum); uint64_t pos = 0; uint64_t limit = get_length(cont); @@ -73,7 +73,7 @@ void VarLenGenerator::get_ranges_map( segment_length = limit - pos; } if (include) { - out.insert(pair(pos, segment_length)); + out.insert(std::pair(pos, segment_length)); include = false; } else { include = true; @@ -104,7 +104,7 @@ ObjectDesc::iterator &ObjectDesc::iterator::advance(bool init) { interval_set ranges; cur_cont->first->get_ranges(cur_cont->second, ranges); while (!ranges.contains(pos)) { - stack.push_front(pair, + stack.push_front(std::pair, ContDesc> >::iterator, uint64_t>(cur_cont, limit)); uint64_t length = cur_cont->first->get_length(cur_cont->second); @@ -135,11 +135,11 @@ ObjectDesc::iterator &ObjectDesc::iterator::advance(bool init) { } if (!cont_iters.count(cur_cont->second)) { - cont_iters.insert(pair( + cont_iters.insert(std::pair( cur_cont->second, cur_cont->first->get_iterator(cur_cont->second))); } - map::iterator j = cont_iters.find( + std::map::iterator j = cont_iters.find( cur_cont->second); assert(j != cont_iters.end()); j->second.seek(pos); @@ -151,7 +151,7 @@ const ContDesc &ObjectDesc::most_recent() { } void ObjectDesc::update(ContentsGenerator *gen, const ContDesc &next) { - layers.push_front(pair, ContDesc>(ceph::shared_ptr(gen), next)); + layers.push_front(std::pair, ContDesc>(ceph::shared_ptr(gen), next)); return; } diff --git a/src/test/osd/Object.h b/src/test/osd/Object.h index feeefebe8dd9..561685a44b03 100644 --- a/src/test/osd/Object.h +++ b/src/test/osd/Object.h @@ -14,8 +14,8 @@ public: int objnum; int cursnap; unsigned seqnum; - string prefix; - string oid; + std::string prefix; + std::string oid; ContDesc() : objnum(0), cursnap(0), @@ -24,7 +24,7 @@ public: ContDesc(int objnum, int cursnap, unsigned seqnum, - const string &prefix) : + const std::string &prefix) : objnum(objnum), cursnap(cursnap), seqnum(seqnum), prefix(prefix) {} @@ -48,7 +48,7 @@ public: }; WRITE_CLASS_ENCODER(ContDesc) -ostream &operator<<(ostream &out, const ContDesc &rhs); +std::ostream &operator<<(std::ostream &out, const ContDesc &rhs); class ContentsGenerator { public: @@ -97,11 +97,11 @@ public: virtual uint64_t get_length(const ContDesc &in) = 0; virtual void get_ranges_map( - const ContDesc &cont, map &out) = 0; + const ContDesc &cont, std::map &out) = 0; void get_ranges(const ContDesc &cont, interval_set &out) { - map ranges; + std::map ranges; get_ranges_map(cont, ranges); - for (map::iterator i = ranges.begin(); + for (std::map::iterator i = ranges.begin(); i != ranges.end(); ++i) { out.insert(i->first, i->second); @@ -207,7 +207,7 @@ public: min_stride_size(min_stride_size), max_stride_size(max_stride_size) {} void get_ranges_map( - const ContDesc &cont, map &out); + const ContDesc &cont, std::map &out); uint64_t get_length(const ContDesc &in) { RandWrap rand(in.seqnum); if (max_length == 0) @@ -223,8 +223,8 @@ public: AttrGenerator(uint64_t max_len, uint64_t big_max_len) : max_len(max_len), big_max_len(big_max_len) {} void get_ranges_map( - const ContDesc &cont, map &out) { - out.insert(pair(0, get_length(cont))); + const ContDesc &cont, std::map &out) { + out.insert(std::pair(0, get_length(cont))); } uint64_t get_length(const ContDesc &in) { RandWrap rand(in.seqnum); @@ -279,7 +279,7 @@ public: return off + get_append_size(in); } void get_ranges_map( - const ContDesc &cont, map &out); + const ContDesc &cont, std::map &out); }; class ObjectDesc { @@ -290,19 +290,19 @@ public: ObjectDesc(const ContDesc &init, ContentsGenerator *cont_gen) : exists(false), dirty(false), version(0) { - layers.push_front(pair, ContDesc>(ceph::shared_ptr(cont_gen), init)); + layers.push_front(std::pair, ContDesc>(ceph::shared_ptr(cont_gen), init)); } class iterator { public: uint64_t pos; ObjectDesc &obj; - list, + std::list, ContDesc> >::iterator, uint64_t> > stack; - map cont_iters; + std::map cont_iters; uint64_t limit; - list, + std::list, ContDesc> >::iterator cur_cont; iterator(ObjectDesc &obj) : @@ -321,7 +321,7 @@ public: if (cur_cont == obj.layers.end()) { return '\0'; } else { - map::iterator j = cont_iters.find( + std::map::iterator j = cont_iters.find( cur_cont->second); assert(j != cont_iters.end()); return *(j->second); @@ -364,14 +364,14 @@ public: ContentsGenerator *most_recent_gen() { return layers.begin()->first.get(); } - map attrs; // Both omap and xattrs + std::map attrs; // Both omap and xattrs bufferlist header; bool exists; bool dirty; uint64_t version; private: - list, ContDesc> > layers; + std::list, ContDesc> > layers; }; #endif