]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Use unqualified encode/decode
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 26 Dec 2017 22:47:58 +0000 (17:47 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 10 Jan 2018 19:03:35 +0000 (14:03 -0500)
This is a portion of Part 1 of the namespace project: using ADL
properly in encode and decode so we can use namespaces easily in Ceph.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
38 files changed:
src/test/cls_hello/test_cls_hello.cc
src/test/cls_log/test_cls_log.cc
src/test/cls_lua/test_cls_lua.cc
src/test/cls_statelog/test_cls_statelog.cc
src/test/common/ObjectContents.h
src/test/common/test_bloom_filter.cc
src/test/encoding.cc
src/test/encoding/ceph_dencoder.cc
src/test/encoding/test_ceph_time.h
src/test/journal/test_Entry.cc
src/test/journal/test_ObjectPlayer.cc
src/test/librados/aio.cc
src/test/librados/io.cc
src/test/librados/list.cc
src/test/librados/misc.cc
src/test/librados/tier.cc
src/test/librados/watch_notify.cc
src/test/librados_test_stub/TestIoCtxImpl.cc
src/test/librados_test_stub/TestWatchNotify.cc
src/test/librbd/image/test_mock_CloneRequest.cc
src/test/librbd/trash/test_mock_MoveRequest.cc
src/test/messenger/message_helper.h
src/test/msgr/test_msgr.cc
src/test/objectstore/DeterministicOpSequence.cc
src/test/objectstore/FileStoreTracker.cc
src/test/objectstore/TestObjectStoreState.cc
src/test/objectstore/store_test.cc
src/test/objectstore/test_idempotent_sequence.cc
src/test/osd/Object.cc
src/test/osd/RadosModel.h
src/test/osd/TestPGLog.cc
src/test/perf_local.cc
src/test/rbd_mirror/image_deleter/test_mock_TrashWatcher.cc
src/test/rgw/test_rgw_common.h
src/test/rgw/test_rgw_manifest.cc
src/test/rgw/test_rgw_obj.cc
src/test/test_denc.cc
src/test/test_snap_mapper.cc

index efd9fc749f5c004f33c2d0ca48d3a7289e261bc3..55386a86fb227d7ee676b78a1433e0eb97e46cc0 100644 (file)
@@ -162,9 +162,9 @@ TEST(ClsHello, Filter) {
 
   bufferlist filter_bl;
   std::string filter_name = "hello.hello";
-  ::encode(filter_name, filter_bl);
-  ::encode("_theattr", filter_bl);
-  ::encode(target_str, filter_bl);
+  encode(filter_name, filter_bl);
+  encode("_theattr", filter_bl);
+  encode(target_str, filter_bl);
 
   NObjectIterator iter(ioctx.nobjects_begin(filter_bl));
   bool foundit = false;
index ca5ebafaf9bc26b699e4dcfff1be37db0ec010ec..7209382b27ac9244a6447c07f0b8e4e0eeba607e 100644 (file)
@@ -34,7 +34,7 @@ static int read_bl(bufferlist& bl, int *i)
   bufferlist::iterator iter = bl.begin();
 
   try {
-    ::decode(*i, iter);
+    decode(*i, iter);
   } catch (buffer::error& err) {
     std::cout << "failed to decode buffer" << std::endl;
     return -EIO;
@@ -46,7 +46,7 @@ static int read_bl(bufferlist& bl, int *i)
 void add_log(librados::ObjectWriteOperation *op, utime_t& timestamp, string& section, string&name, int i)
 {
   bufferlist bl;
-  ::encode(i, bl);
+  encode(i, bl);
 
   cls_log_add(*op, timestamp, section, name, bl);
 }
index e97dcef5c7df06744dd2917730fe1fb7767f3ce3..1cd3a00d2faa9133f6d5b4c6b8585334e3c81686 100644 (file)
@@ -595,7 +595,7 @@ TEST_F(ClsLua, Write) {
   /* write some data into object */
   string written = "Hello World";
   bufferlist inbl;
-  ::encode(written, inbl);
+  encode(written, inbl);
   ASSERT_EQ(0, clslua_exec(test_script, &inbl, "write"));
 
   /* have Lua read out of the object */
@@ -606,7 +606,7 @@ TEST_F(ClsLua, Write) {
 
   /* compare what Lua read to what we wrote */
   string read;
-  ::decode(read, outbl);
+  decode(read, outbl);
   ASSERT_EQ(read, written);
 }
 
@@ -735,7 +735,7 @@ TEST_F(ClsLua, MapClear) {
 TEST_F(ClsLua, MapSetVal) {
   /* build some input value */
   bufferlist orig_val;
-  ::encode("this is the original value yay", orig_val);
+  encode("this is the original value yay", orig_val);
 
   /* have the lua script stuff the data into a map value */
   ASSERT_EQ(0, clslua_exec(test_script, &orig_val, "map_set_val"));
@@ -747,7 +747,7 @@ TEST_F(ClsLua, MapSetVal) {
   ASSERT_EQ(0, ioctx.omap_get_vals_by_keys(oid, out_keys, &out_map));
   bufferlist out_bl = out_map["foo"];
   string out_val;
-  ::decode(out_val, out_bl);
+  decode(out_val, out_bl);
   ASSERT_EQ(out_val, "this is the original value yay");
 }
 
index 9cc6175ad785c0d9aae964e9012906210db977ea..18b9b95c969651b96e3177794abfbad9cdb7c059 100644 (file)
@@ -36,7 +36,7 @@ static void reset_rop(librados::ObjectReadOperation **pop) {
 void add_log(librados::ObjectWriteOperation *op, const string& client_id, const string& op_id, string& obj, uint32_t state)
 {
   bufferlist bl;
-  ::encode(state, bl);
+  encode(state, bl);
 
   utime_t ts = ceph_clock_now();
 
index 3892c75bb59da0d8a4ca62e546e6cce7f7acf96f..3b802fc36d85aea803d2f9455ff343e186f4d6b3 100644 (file)
@@ -78,10 +78,10 @@ public:
   }
 
   explicit ObjectContents(bufferlist::iterator &bp) {
-    ::decode(_size, bp);
-    ::decode(seeds, bp);
-    ::decode(written, bp);
-    ::decode(_exists, bp);
+    decode(_size, bp);
+    decode(seeds, bp);
+    decode(written, bp);
+    decode(_exists, bp);
   }
 
   void clone_range(ObjectContents &other,
@@ -111,10 +111,11 @@ public:
   }
 
   void encode(bufferlist &bl) const {
-    ::encode(_size, bl);
-    ::encode(seeds, bl);
-    ::encode(written, bl);
-    ::encode(_exists, bl);
+    using ceph::encode;
+    encode(_size, bl);
+    encode(seeds, bl);
+    encode(written, bl);
+    encode(_exists, bl);
   }
 };
 
index dc388c3639f9eaffaed01ef344422a8c9e1903d0..f556b2776e06238b677ef08da0e9f964408a6eba 100644 (file)
@@ -62,7 +62,7 @@ TEST(BloomFilter, Sweep) {
       double actual = (double)hit / (double)test;
 
       bufferlist bl;
-      ::encode(bf, bl);
+      encode(bf, bl);
 
       double byte_per_insert = (double)bl.length() / (double)max;
 
@@ -102,7 +102,7 @@ TEST(BloomFilter, SweepInt) {
       double actual = (double)hit / (double)test;
 
       bufferlist bl;
-      ::encode(bf, bl);
+      encode(bf, bl);
 
       double byte_per_insert = (double)bl.length() / (double)max;
 
@@ -145,7 +145,7 @@ TEST(BloomFilter, CompressibleSweep) {
     double actual = (double)hit / (double)test;
 
     bufferlist bl;
-    ::encode(bf, bl);
+    encode(bf, bl);
 
     double byte_per_insert = (double)bl.length() / (double)max;
     unsigned est_after = bf.approx_unique_element_count();
@@ -184,7 +184,7 @@ TEST(BloomFilter, BinSweep) {
       for (int j=0; j<max; j++) {
        ls.back()->insert(10000 * (i+1) + j);
       }
-      ::encode(*ls.front(), bl);
+      encode(*ls.front(), bl);
     }
 
     int hit = 0;
index f05789af43f358527b6643c209a656e207941e25..8c0025ce8f27b8580a0c69eb086d581945b0293d 100644 (file)
@@ -165,12 +165,12 @@ public:
 
   friend void decode(ConstructorCounter &s, bufferlist::iterator& p)
   {
-    ::decode(s.data, p);
+    decode(s.data, p);
   }
 
   friend void encode(const ConstructorCounter &s, bufferlist& p)
   {
-    ::encode(s.data, p);
+    encode(s.data, p);
   }
 
   friend ostream& operator<<(ostream &oss, const ConstructorCounter &cc)
index 3f0581cab8fe2b9e61444272904038e710f2c556..dd5a79202978fd1c32bb29feeb7a7fbeac9e69f0 100644 (file)
@@ -112,7 +112,6 @@ public:
     bufferlist::iterator p = bl.begin();
     p.seek(seek);
     try {
-      using ::decode;
       using ceph::decode;
       decode(*m_object, p);
     }
@@ -160,7 +159,6 @@ public:
     : DencoderBase<T>(stray_ok, nondeterministic) {}
   void encode(bufferlist& out, uint64_t features) override {
     out.clear();
-    using ::encode;
     using ceph::encode;
     encode(*this->m_object, out);
   }
@@ -190,10 +188,7 @@ public:
   DencoderImplFeaturefulNoCopy(bool stray_ok, bool nondeterministic)
     : DencoderBase<T>(stray_ok, nondeterministic) {}
   void encode(bufferlist& out, uint64_t features) override {
-    using ceph::encode;
-    using ::encode;
     out.clear();
-    using ::encode;
     using ceph::encode;
     encode(*(this->m_object), out, features);
   }
index 722d29bf1ea1486f6215eb44eaae794606ded480..18f89314b7ab86fa8844fc03a6b920046771cdd7 100644 (file)
@@ -2,7 +2,10 @@
 #define TEST_CEPH_TIME_H
 
 #include <list>
+
+#include "include/encoding.h"
 #include "common/ceph_time.h"
+#include "common/Formatter.h"
 
 // wrapper for ceph::real_time that implements the dencoder interface
 class real_time_wrapper {
@@ -12,10 +15,12 @@ class real_time_wrapper {
   real_time_wrapper(const ceph::real_time& t) : t(t) {}
 
   void encode(bufferlist& bl) const {
-    ::encode(t, bl);
+    using ceph::encode;
+    encode(t, bl);
   }
   void decode(bufferlist::iterator &p) {
-    ::decode(t, p);
+    using ceph::decode;
+    decode(t, p);
   }
   void dump(Formatter* f) {
     auto epoch_time = ceph::real_clock::to_time_t(t);
index 49b060ecbde87894e57f3fe508c475289bfb0634..ff0e82c01f0cff7cb211c6ae3e13075a6048c63c 100644 (file)
@@ -62,7 +62,7 @@ TEST_F(TestEntry, IsReadableBadPreamble) {
 
   uint64_t stray_bytes = 0x1122334455667788;
   bufferlist full_bl;
-  ::encode(stray_bytes, full_bl);
+  encode(stray_bytes, full_bl);
   encode(entry, full_bl);
 
   uint32_t bytes_needed;
@@ -85,7 +85,7 @@ TEST_F(TestEntry, IsReadableBadCRC) {
 
   bufferlist bad_bl;
   bad_bl.substr_of(full_bl, 0, full_bl.length() - 4);
-  ::encode(full_bl.crc32c(1), bad_bl);
+  encode(full_bl.crc32c(1), bad_bl);
 
   uint32_t bytes_needed;
   ASSERT_FALSE(journal::Entry::is_readable(bad_bl.begin(), &bytes_needed));
index 661a9eb36064d97ee749e69ab9a7ae02bc8e4d16..3c255c9ed6ccf5b423bdbb589bae9c2b39a1ea2c 100644 (file)
@@ -158,7 +158,7 @@ TYPED_TEST(TestObjectPlayer, FetchCorrupt) {
 
   bufferlist bl;
   encode(entry1, bl);
-  ::encode(this->create_payload("corruption"), bl);
+  encode(this->create_payload("corruption"), bl);
   encode(entry2, bl);
   ASSERT_EQ(0, this->append(this->get_object_name(oid), bl));
 
index 23b9bba109beeb71413eb1fa1f43f3401b2a2d4d..d30438074b0b7bd654e85601a433dd5d7453858a 100644 (file)
@@ -591,7 +591,7 @@ TEST(LibRadosAio, RoundTripPP3)
   op1.read(0, sizeof(buf), &bl, NULL);
   op1.set_op_flags2(LIBRADOS_OP_FLAG_FADVISE_DONTNEED|LIBRADOS_OP_FLAG_FADVISE_RANDOM);
   bufferlist init_value_bl;
-  ::encode(static_cast<int32_t>(-1), init_value_bl);
+  encode(static_cast<int32_t>(-1), init_value_bl);
   bufferlist csum_bl;
   op1.checksum(LIBRADOS_CHECKSUM_TYPE_CRC32C, init_value_bl,
               0, 0, 0, &csum_bl, nullptr);
@@ -607,9 +607,9 @@ TEST(LibRadosAio, RoundTripPP3)
   auto csum_bl_it = csum_bl.begin();
   uint32_t csum_count;
   uint32_t csum;
-  ::decode(csum_count, csum_bl_it);
+  decode(csum_count, csum_bl_it);
   ASSERT_EQ(1U, csum_count);
-  ::decode(csum, csum_bl_it);
+  decode(csum, csum_bl_it);
   ASSERT_EQ(bl.crc32c(-1), csum);
   ioctx.remove("test_obj");
   destroy_one_pool_pp(pool_name, cluster);
index 5094f756987af0c29a89650802b14e3881eb57a8..0f879fa45e180d8a1d486f1867be400d3754a9c8 100644 (file)
@@ -326,16 +326,16 @@ TEST_F(LibRadosIoPP, Checksum) {
   bl.append(buf, sizeof(buf));
   ASSERT_EQ(0, ioctx.write("foo", bl, sizeof(buf), 0));
   bufferlist init_value_bl;
-  ::encode(static_cast<uint32_t>(-1), init_value_bl);
+  encode(static_cast<uint32_t>(-1), init_value_bl);
   bufferlist csum_bl;
   ASSERT_EQ(0, ioctx.checksum("foo", LIBRADOS_CHECKSUM_TYPE_CRC32C,
                              init_value_bl, sizeof(buf), 0, 0, &csum_bl));
   auto csum_bl_it = csum_bl.begin();
   uint32_t csum_count;
-  ::decode(csum_count, csum_bl_it);
+  decode(csum_count, csum_bl_it);
   ASSERT_EQ(1U, csum_count);
   uint32_t csum;
-  ::decode(csum, csum_bl_it);
+  decode(csum, csum_bl_it);
   ASSERT_EQ(bl.crc32c(-1), csum);
 }
 
index db90ac80c3aa6b498e4768fb3b44b9744bfbe2cb..ab027ad0ed432ff0a10deffc8038e559061c2818 100644 (file)
@@ -935,9 +935,9 @@ TEST_F(LibRadosListPP, ListObjectsFilterPP) {
 
   bufferlist filter_bl;
   std::string filter_name = "plain";
-  ::encode(filter_name, filter_bl);
-  ::encode("_theattr", filter_bl);
-  ::encode(target_str, filter_bl);
+  encode(filter_name, filter_bl);
+  encode("_theattr", filter_bl);
+  encode(target_str, filter_bl);
 
   NObjectIterator iter(ioctx.nobjects_begin(filter_bl));
   bool foundit = false;
@@ -1230,9 +1230,9 @@ TEST_F(LibRadosListPP, EnumerateObjectsFilterPP) {
 
   bufferlist filter_bl;
   std::string filter_name = "plain";
-  ::encode(filter_name, filter_bl);
-  ::encode("_theattr", filter_bl);
-  ::encode(target_str, filter_bl);
+  encode(filter_name, filter_bl);
+  encode("_theattr", filter_bl);
+  encode(target_str, filter_bl);
 
   ObjectCursor c = ioctx.object_list_begin();
   ObjectCursor end = ioctx.object_list_end();
index 2c957fe1b32056bb76916bb4d9e78c4b75393838..a931c7d718ac48ebe40f38fbf91233325ae3fc44 100644 (file)
@@ -284,13 +284,13 @@ static std::string read_key_from_tmap(IoCtx& ioctx, const std::string &obj,
   bufferlist::iterator p = bl.begin();
   bufferlist header;
   map<string, bufferlist> m;
-  ::decode(header, p);
-  ::decode(m, p);
+  decode(header, p);
+  decode(m, p);
   map<string, bufferlist>::iterator i = m.find(key);
   if (i == m.end())
     return "";
   std::string retstring;
-  ::decode(retstring, i->second);
+  decode(retstring, i->second);
   return retstring;
 }
 
@@ -300,11 +300,11 @@ static std::string add_key_to_tmap(IoCtx &ioctx, const std::string &obj,
   __u8 c = CEPH_OSD_TMAP_SET;
 
   bufferlist tmbl;
-  ::encode(c, tmbl);
-  ::encode(key, tmbl);
+  encode(c, tmbl);
+  encode(key, tmbl);
   bufferlist blbl;
-  ::encode(val, blbl);
-  ::encode(blbl, tmbl);
+  encode(val, blbl);
+  encode(blbl, tmbl);
   int ret = ioctx.tmap_update(obj, tmbl);
   if (ret) {
     ostringstream oss;
@@ -321,8 +321,8 @@ static int remove_key_from_tmap(IoCtx &ioctx, const std::string &obj,
   __u8 c = CEPH_OSD_TMAP_RM;
 
   bufferlist tmbl;
-  ::encode(c, tmbl);
-  ::encode(key, tmbl);
+  encode(c, tmbl);
+  encode(key, tmbl);
   int ret = ioctx.tmap_update(obj, tmbl);
   if (ret) {
     ostringstream oss;
@@ -340,9 +340,9 @@ TEST_F(LibRadosMiscPP, TmapUpdatePP) {
     bufferlist emptybl;
 
     bufferlist tmbl;
-    ::encode(c, tmbl);
-    ::encode(my_tmap, tmbl);
-    ::encode(emptybl, tmbl);
+    encode(c, tmbl);
+    encode(my_tmap, tmbl);
+    encode(emptybl, tmbl);
     ASSERT_EQ(0, ioctx.tmap_update("foo", tmbl));
   }
 
@@ -369,9 +369,9 @@ TEST_F(LibRadosMiscPP, TmapUpdateMisorderedPP) {
     bufferlist emptybl;
 
     bufferlist tmbl;
-    ::encode(c, tmbl);
-    ::encode(my_tmap, tmbl);
-    ::encode(emptybl, tmbl);
+    encode(c, tmbl);
+    encode(my_tmap, tmbl);
+    encode(emptybl, tmbl);
     ASSERT_EQ(0, ioctx.tmap_update("foo", tmbl));
   }
 
@@ -379,19 +379,19 @@ TEST_F(LibRadosMiscPP, TmapUpdateMisorderedPP) {
   {
     __u8 c = CEPH_OSD_TMAP_SET;
     bufferlist tmbl;
-    ::encode(c, tmbl);
-    ::encode("a", tmbl);
+    encode(c, tmbl);
+    encode("a", tmbl);
     bufferlist blbl;
-    ::encode("old", blbl);
-    ::encode(blbl, tmbl);
+    encode("old", blbl);
+    encode(blbl, tmbl);
 
-    ::encode(c, tmbl);
-    ::encode("b", tmbl);
-    ::encode(blbl, tmbl);
+    encode(c, tmbl);
+    encode("b", tmbl);
+    encode(blbl, tmbl);
 
-    ::encode(c, tmbl);
-    ::encode("c", tmbl);
-    ::encode(blbl, tmbl);
+    encode(c, tmbl);
+    encode("c", tmbl);
+    encode(blbl, tmbl);
 
     ASSERT_EQ(0, ioctx.tmap_update("foo", tmbl));
   }
@@ -400,19 +400,19 @@ TEST_F(LibRadosMiscPP, TmapUpdateMisorderedPP) {
   {
     __u8 c = CEPH_OSD_TMAP_SET;
     bufferlist tmbl;
-    ::encode(c, tmbl);
-    ::encode("b", tmbl);
+    encode(c, tmbl);
+    encode("b", tmbl);
     bufferlist blbl;
-    ::encode("new", blbl);
-    ::encode(blbl, tmbl);
+    encode("new", blbl);
+    encode(blbl, tmbl);
 
-    ::encode(c, tmbl);
-    ::encode("a", tmbl);
-    ::encode(blbl, tmbl);
+    encode(c, tmbl);
+    encode("a", tmbl);
+    encode(blbl, tmbl);
 
-    ::encode(c, tmbl);
-    ::encode("c", tmbl);
-    ::encode(blbl, tmbl);
+    encode(c, tmbl);
+    encode("c", tmbl);
+    encode(blbl, tmbl);
 
     ASSERT_EQ(0, ioctx.tmap_update("foo", tmbl));
   }
@@ -433,15 +433,15 @@ TEST_F(LibRadosMiscPP, TmapUpdateMisorderedPutPP) {
   // create unsorted tmap
   string h("header");
   bufferlist bl;
-  ::encode(h, bl);
+  encode(h, bl);
   uint32_t n = 3;
-  ::encode(n, bl);
-  ::encode(string("b"), bl);
-  ::encode(string("bval"), bl);
-  ::encode(string("a"), bl);
-  ::encode(string("aval"), bl);
-  ::encode(string("c"), bl);
-  ::encode(string("cval"), bl);
+  encode(n, bl);
+  encode(string("b"), bl);
+  encode(string("bval"), bl);
+  encode(string("a"), bl);
+  encode(string("aval"), bl);
+  encode(string("c"), bl);
+  encode(string("cval"), bl);
   bufferlist orig = bl;  // tmap_put steals bl content
   ASSERT_EQ(0, ioctx.tmap_put("foo", bl));
 
@@ -461,8 +461,8 @@ TEST_F(LibRadosMiscPP, Tmap2OmapPP) {
   omap["3"].append("c");
   {
     bufferlist bl;
-    ::encode(hdr, bl);
-    ::encode(omap, bl);
+    encode(hdr, bl);
+    encode(omap, bl);
     ASSERT_EQ(0, ioctx.tmap_put("foo", bl));
   }
 
@@ -519,7 +519,7 @@ TEST_F(LibRadosMisc, Exec) {
   bl.append(buf2, res);
   bufferlist::iterator iter = bl.begin();
   uint64_t all_features;
-  ::decode(all_features, iter);
+  decode(all_features, iter);
   // make sure *some* features are specified; don't care which ones
   ASSERT_NE(all_features, (unsigned)0);
 }
@@ -532,7 +532,7 @@ TEST_F(LibRadosMiscPP, ExecPP) {
   ASSERT_EQ(0, r);
   bufferlist::iterator iter = out.begin();
   uint64_t all_features;
-  ::decode(all_features, iter);
+  decode(all_features, iter);
   // make sure *some* features are specified; don't care which ones
   ASSERT_NE(all_features, (unsigned)0);
 }
@@ -1134,7 +1134,7 @@ TYPED_TEST(LibRadosChecksum, Subset) {
 
   typename TestFixture::init_value_t init_value = -1;
   bufferlist init_value_bl;
-  ::encode(init_value, init_value_bl);
+  encode(init_value, init_value_bl);
 
   std::vector<bufferlist> checksum_bls(csum_count);
   std::vector<int> checksum_rvals(csum_count);
@@ -1152,11 +1152,11 @@ TYPED_TEST(LibRadosChecksum, Subset) {
 
     auto bl_it = checksum_bls[i].begin();
     uint32_t count;
-    ::decode(count, bl_it);
+    decode(count, bl_it);
     ASSERT_EQ(1U, count);
 
     typename TestFixture::value_t value;
-    ::decode(value, bl_it);
+    decode(value, bl_it);
 
     bufferlist content_sub_bl;
     content_sub_bl.substr_of(this->content_bl, i * chunk_size, chunk_size);
@@ -1177,7 +1177,7 @@ TYPED_TEST(LibRadosChecksum, Chunked) {
 
   typename TestFixture::init_value_t init_value = -1;
   bufferlist init_value_bl;
-  ::encode(init_value, init_value_bl);
+  encode(init_value, init_value_bl);
 
   bufferlist checksum_bl;
   int checksum_rval;
@@ -1191,7 +1191,7 @@ TYPED_TEST(LibRadosChecksum, Chunked) {
 
   auto bl_it = checksum_bl.begin();
   uint32_t count;
-  ::decode(count, bl_it);
+  decode(count, bl_it);
   ASSERT_EQ(csum_count, count);
 
   std::vector<typename TestFixture::value_t> expected_values(csum_count);
@@ -1205,7 +1205,7 @@ TYPED_TEST(LibRadosChecksum, Chunked) {
 
   for (uint32_t i = 0; i < csum_count; ++i) {
     typename TestFixture::value_t value;
-    ::decode(value, bl_it);
+    decode(value, bl_it);
     ASSERT_EQ(expected_values[i], value);
   }
 }
index cfdf6de8f8fba32801a7ef62d9ab4cdffbcacdf5..f4324b2d51d4efd87046ebcd8c9a35b1204336b9 100644 (file)
@@ -2368,7 +2368,7 @@ TEST_F(LibRadosTwoPoolsPP, HitSetRead) {
     if (hbl.length()) {
       bufferlist::iterator p = hbl.begin();
       HitSet hs;
-      ::decode(hs, p);
+      decode(hs, p);
       if (hs.contains(oid)) {
        cout << "ok, hit_set contains " << oid << std::endl;
        break;
@@ -2466,7 +2466,7 @@ TEST_F(LibRadosTwoPoolsPP, HitSetWrite) {
 
     try {
       bufferlist::iterator p = bl.begin();
-      ::decode(hitsets[i], p);
+      decode(hitsets[i], p);
     }
     catch (buffer::error& e) {
       std::cout << "failed to decode hit set; bl len is " << bl.length() << "\n";
@@ -5185,7 +5185,7 @@ TEST_F(LibRadosTwoPoolsECPP, HitSetRead) {
     if (hbl.length()) {
       bufferlist::iterator p = hbl.begin();
       HitSet hs;
-      ::decode(hs, p);
+      decode(hs, p);
       if (hs.contains(oid)) {
        cout << "ok, hit_set contains " << oid << std::endl;
        break;
@@ -5250,7 +5250,7 @@ TEST_F(LibRadosTierECPP, HitSetWrite) {
     //std::cout << std::endl;
 
     bufferlist::iterator p = bl.begin();
-    ::decode(hitsets[i], p);
+    decode(hitsets[i], p);
 
     // cope with racing splits by refreshing pg_num
     if (i == num_pg - 1)
index a525d518ffada699ab86397515a926cab5937d8b..4da695768059400ddb721d1079e4cc0ac4a8097f 100644 (file)
@@ -345,8 +345,8 @@ TEST_F(LibRadosWatchNotify, WatchNotify2) {
   std::map<std::pair<uint64_t,uint64_t>, bufferlist> reply_map;
   std::set<std::pair<uint64_t,uint64_t> > missed_map;
   bufferlist::iterator reply_p = reply.begin();
-  ::decode(reply_map, reply_p);
-  ::decode(missed_map, reply_p);
+  decode(reply_map, reply_p);
+  decode(missed_map, reply_p);
   ASSERT_EQ(1u, reply_map.size());
   ASSERT_EQ(0u, missed_map.size());
   ASSERT_EQ(1u, notify_cookies.size());
@@ -396,8 +396,8 @@ TEST_F(LibRadosWatchNotify, AioWatchNotify2) {
   std::map<std::pair<uint64_t,uint64_t>, bufferlist> reply_map;
   std::set<std::pair<uint64_t,uint64_t> > missed_map;
   bufferlist::iterator reply_p = reply.begin();
-  ::decode(reply_map, reply_p);
-  ::decode(missed_map, reply_p);
+  decode(reply_map, reply_p);
+  decode(missed_map, reply_p);
   ASSERT_EQ(1u, reply_map.size());
   ASSERT_EQ(0u, missed_map.size());
   ASSERT_EQ(1u, notify_cookies.size());
@@ -450,8 +450,8 @@ TEST_F(LibRadosWatchNotify, AioNotify) {
   std::map<std::pair<uint64_t,uint64_t>, bufferlist> reply_map;
   std::set<std::pair<uint64_t,uint64_t> > missed_map;
   bufferlist::iterator reply_p = reply.begin();
-  ::decode(reply_map, reply_p);
-  ::decode(missed_map, reply_p);
+  decode(reply_map, reply_p);
+  decode(missed_map, reply_p);
   ASSERT_EQ(1u, reply_map.size());
   ASSERT_EQ(0u, missed_map.size());
   ASSERT_EQ(1u, notify_cookies.size());
@@ -497,8 +497,8 @@ TEST_P(LibRadosWatchNotifyPP, WatchNotify2) {
   bufferlist::iterator p = bl_reply.begin();
   std::map<std::pair<uint64_t,uint64_t>,bufferlist> reply_map;
   std::set<std::pair<uint64_t,uint64_t> > missed_map;
-  ::decode(reply_map, p);
-  ::decode(missed_map, p);
+  decode(reply_map, p);
+  decode(missed_map, p);
   ASSERT_EQ(1u, notify_cookies.size());
   ASSERT_EQ(1u, notify_cookies.count(handle));
   ASSERT_EQ(1u, reply_map.size());
@@ -536,8 +536,8 @@ TEST_P(LibRadosWatchNotifyPP, AioWatchNotify2) {
   bufferlist::iterator p = bl_reply.begin();
   std::map<std::pair<uint64_t,uint64_t>,bufferlist> reply_map;
   std::set<std::pair<uint64_t,uint64_t> > missed_map;
-  ::decode(reply_map, p);
-  ::decode(missed_map, p);
+  decode(reply_map, p);
+  decode(missed_map, p);
   ASSERT_EQ(1u, notify_cookies.size());
   ASSERT_EQ(1u, notify_cookies.count(handle));
   ASSERT_EQ(1u, reply_map.size());
@@ -578,8 +578,8 @@ TEST_P(LibRadosWatchNotifyPP, AioNotify) {
   bufferlist::iterator p = bl_reply.begin();
   std::map<std::pair<uint64_t,uint64_t>,bufferlist> reply_map;
   std::set<std::pair<uint64_t,uint64_t> > missed_map;
-  ::decode(reply_map, p);
-  ::decode(missed_map, p);
+  decode(reply_map, p);
+  decode(missed_map, p);
   ASSERT_EQ(1u, notify_cookies.size());
   ASSERT_EQ(1u, notify_cookies.count(handle));
   ASSERT_EQ(1u, reply_map.size());
@@ -622,8 +622,8 @@ TEST_F(LibRadosWatchNotify, WatchNotify2Multi) {
   std::map<std::pair<uint64_t,uint64_t>, bufferlist> reply_map;
   std::set<std::pair<uint64_t,uint64_t> > missed_map;
   bufferlist::iterator reply_p = reply.begin();
-  ::decode(reply_map, reply_p);
-  ::decode(missed_map, reply_p);
+  decode(reply_map, reply_p);
+  decode(missed_map, reply_p);
   ASSERT_EQ(2u, reply_map.size());
   ASSERT_EQ(5u, reply_map.begin()->second.length());
   ASSERT_EQ(0u, missed_map.size());
@@ -667,8 +667,8 @@ TEST_F(LibRadosWatchNotify, WatchNotify2Timeout) {
     std::map<std::pair<uint64_t,uint64_t>, bufferlist> reply_map;
     std::set<std::pair<uint64_t,uint64_t> > missed_map;
     bufferlist::iterator reply_p = reply.begin();
-    ::decode(reply_map, reply_p);
-    ::decode(missed_map, reply_p);
+    decode(reply_map, reply_p);
+    decode(missed_map, reply_p);
     ASSERT_EQ(0u, reply_map.size());
     ASSERT_EQ(1u, missed_map.size());
   }
@@ -759,8 +759,8 @@ TEST_P(LibRadosWatchNotifyPP, WatchNotify3) {
   bufferlist::iterator p = bl_reply.begin();
   std::map<std::pair<uint64_t,uint64_t>,bufferlist> reply_map;
   std::set<std::pair<uint64_t,uint64_t> > missed_map;
-  ::decode(reply_map, p);
-  ::decode(missed_map, p);
+  decode(reply_map, p);
+  decode(missed_map, p);
   ASSERT_EQ(1u, notify_cookies.size());
   ASSERT_EQ(1u, notify_cookies.count(handle));
   ASSERT_EQ(1u, reply_map.size());
@@ -833,8 +833,8 @@ TEST_F(LibRadosWatchNotify, Watch3Timeout) {
     std::map<std::pair<uint64_t,uint64_t>, bufferlist> reply_map;
     std::set<std::pair<uint64_t,uint64_t> > missed_map;
     bufferlist::iterator reply_p = reply.begin();
-    ::decode(reply_map, reply_p);
-    ::decode(missed_map, reply_p);
+    decode(reply_map, reply_p);
+    decode(missed_map, reply_p);
     ASSERT_EQ(0u, reply_map.size());
     ASSERT_EQ(0u, missed_map.size());
   }
@@ -863,8 +863,8 @@ TEST_F(LibRadosWatchNotify, Watch3Timeout) {
     std::map<std::pair<uint64_t,uint64_t>, bufferlist> reply_map;
     std::set<std::pair<uint64_t,uint64_t> > missed_map;
     bufferlist::iterator reply_p = reply.begin();
-    ::decode(reply_map, reply_p);
-    ::decode(missed_map, reply_p);
+    decode(reply_map, reply_p);
+    decode(missed_map, reply_p);
     ASSERT_EQ(1u, reply_map.size());
     ASSERT_EQ(0u, missed_map.size());
     ASSERT_EQ(1u, notify_cookies.count(handle));
index 56ce88690b4c46da9dabd6f25c8f4bc474013490..6cfde3cdcac330d08c1ffca7041b39bd6e3c3f93 100644 (file)
@@ -284,20 +284,20 @@ int TestIoCtxImpl::tmap_update(const std::string& oid, bufferlist& cmdbl) {
       return r;
     }
     bufferlist::iterator iter = inbl.begin();
-    ::decode(tmap_header, iter);
-    ::decode(tmap, iter);
+    decode(tmap_header, iter);
+    decode(tmap, iter);
   }
 
   __u8 c;
   std::string key;
   bufferlist value;
   bufferlist::iterator iter = cmdbl.begin();
-  ::decode(c, iter);
-  ::decode(key, iter);
+  decode(c, iter);
+  decode(key, iter);
 
   switch (c) {
     case CEPH_OSD_TMAP_SET:
-      ::decode(value, iter);
+      decode(value, iter);
       tmap[key] = value;
       break;
     case CEPH_OSD_TMAP_RM:
@@ -311,8 +311,8 @@ int TestIoCtxImpl::tmap_update(const std::string& oid, bufferlist& cmdbl) {
   }
 
   bufferlist out;
-  ::encode(tmap_header, out);
-  ::encode(tmap, out);
+  encode(tmap_header, out);
+  encode(tmap, out);
   r = write_full(oid, out, m_snapc);
   return r;
 }
index 6f69092fe4e3ffb6a89edda7c5330d2bd2059150..492c5a8dbc86a7e589a711ae1ba8ec8cafe81ad7 100644 (file)
@@ -302,8 +302,8 @@ void TestWatchNotify::finish_notify(TestRadosClient *rados_client,
                 << ": completing" << dendl;
 
   if (notify_handle->pbl != NULL) {
-    ::encode(notify_handle->notify_responses, *notify_handle->pbl);
-    ::encode(notify_handle->pending_watcher_ids, *notify_handle->pbl);
+    encode(notify_handle->notify_responses, *notify_handle->pbl);
+    encode(notify_handle->pending_watcher_ids, *notify_handle->pbl);
   }
 
   notify_handle->rados_client->get_aio_finisher()->queue(
index 0515db7b062dff8767bc7a6cab9fcd99e7e4b1fe..71b53e4aeda01ed54cf77c57d979729dfd45b951 100644 (file)
@@ -237,7 +237,7 @@ public:
                             const std::map<std::string, bufferlist>& metadata,
                             int r) {
     bufferlist out_bl;
-    ::encode(metadata, out_bl);
+    encode(metadata, out_bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
                 exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("metadata_list"), _, _, _))
@@ -252,7 +252,7 @@ public:
                            const std::map<std::string, bufferlist>& metadata,
                            int r) {
     bufferlist in_bl;
-    ::encode(metadata, in_bl);
+    encode(metadata, in_bl);
 
     EXPECT_CALL(get_mock_io_ctx(io_ctx),
                 exec(mock_image_ctx.header_oid, _, StrEq("rbd"), StrEq("metadata_set"),
@@ -269,7 +269,7 @@ public:
   void expect_mirror_mode_get(MockTestImageCtx &mock_image_ctx,
                               cls::rbd::MirrorMode mirror_mode, int r) {
     bufferlist out_bl;
-    ::encode(static_cast<uint32_t>(mirror_mode), out_bl);
+    encode(static_cast<uint32_t>(mirror_mode), out_bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
                 exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_mode_get"),
index 43a31f89092fe13784ff0a47887bc6fab90e5849..e315efac386432585119b9fb17fe774255c26007 100644 (file)
@@ -68,7 +68,7 @@ struct TestMockTrashMoveRequest : public TestMockFixture {
                              cls::rbd::TrashImageSpec trash_image_spec;
 
                              bufferlist::iterator bl_it = in_bl.begin();
-                             ::decode(id, bl_it);
+                             decode(id, bl_it);
                              decode(trash_image_spec, bl_it);
 
                              EXPECT_EQ(id, image_id);
@@ -91,8 +91,8 @@ struct TestMockTrashMoveRequest : public TestMockFixture {
                          const std::string& name, const std::string& id,
                          int r) {
     bufferlist in_bl;
-    ::encode(name, in_bl);
-    ::encode(id, in_bl);
+    encode(name, in_bl);
+    encode(id, in_bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
                 exec(StrEq("rbd_directory"), _, StrEq("rbd"), StrEq("dir_remove_image"),
index bec2c685cf206db3c8ebcdd520c93f02750b5b39..c65f42ee05a80c663ec29dcd7d77caeffc501bd8 100644 (file)
@@ -38,7 +38,7 @@ static inline Message* new_ping_monstyle(const char *tag, int mult)
   stringstream ss;
 
   f->flush(ss);
-  ::encode(ss.str(), bl);
+  encode(ss.str(), bl);
   m->set_payload(bl);
 
   return m;
index ad9ca091fc69480c99b95dfab0bfd23b2968429d..32608de84db798e8304b218b921649e3c89a322d 100644 (file)
@@ -868,7 +868,7 @@ class SyntheticDispatcher : public Dispatcher {
 
     Payload pl;
     auto p = m->get_data().begin();
-    ::decode(pl, p);
+    decode(pl, p);
     if (pl.who == Payload::PING) {
       lderr(g_ceph_context) << __func__ << " conn=" << m->get_connection() << pl << dendl;
       reply_message(m, pl);
@@ -901,7 +901,7 @@ class SyntheticDispatcher : public Dispatcher {
   void reply_message(const Message *m, Payload& pl) {
     pl.who = Payload::PONG;
     bufferlist bl;
-    ::encode(pl, bl);
+    encode(pl, bl);
     MPing *rm = new MPing();
     rm->set_data(bl);
     m->get_connection()->send_message(rm);
@@ -912,7 +912,7 @@ class SyntheticDispatcher : public Dispatcher {
     Message *m = new MPing();
     Payload pl{Payload::PING, index++, data};
     bufferlist bl;
-    ::encode(pl, bl);
+    encode(pl, bl);
     m->set_data(bl);
     if (!con->get_messenger()->get_default_policy().lossy) {
       Mutex::Locker l(lock);
index 772715eb4ccbe2eab4a4ca68aa68906889df72b1..f92a4cf8f39ccebddb92a5b489e388c15890d6b4 100644 (file)
@@ -133,7 +133,7 @@ int DeterministicOpSequence::_gen_obj_id(rngen_t& gen)
 void DeterministicOpSequence::note_txn(ObjectStore::Transaction *t)
 {
   bufferlist bl;
-  ::encode(txn, bl);
+  encode(txn, bl);
   t->truncate(txn_coll, ghobject_t(txn_object), 0);
   t->write(txn_coll, ghobject_t(txn_object), 0, bl.length(), bl);
   dout(10) << __func__ << " " << txn << dendl;
@@ -448,8 +448,8 @@ void DeterministicOpSequence::_do_coll_create(coll_t cid, uint32_t pg_num, uint6
   note_txn(&t);
   t.create_collection(cid, 32);
   bufferlist hint;
-  ::encode(pg_num, hint);
-  ::encode(num_objs, hint);
+  encode(pg_num, hint);
+  encode(num_objs, hint);
   t.collection_hint(cid, ObjectStore::Transaction::COLL_HINT_EXPECTED_NUM_OBJECTS, hint);
   dout(0) << "Give collection: " << cid << " a hint, pg_num is: " << pg_num << ", num_objs is: "
     << num_objs << dendl;
index de0e3a7d020cf135482dac3378e9e5ea8770a48e..16490ba44ad8cee1550a70c9a2b0e39f26f5730e 100644 (file)
@@ -51,12 +51,12 @@ int FileStoreTracker::init()
   restart_seq = 0;
   if (!got.empty()) {
     bufferlist::iterator bp = got.begin()->second.begin();
-    ::decode(restart_seq, bp);
+    decode(restart_seq, bp);
   }
   ++restart_seq;
   KeyValueDB::Transaction t = db->get_transaction();
   got.clear();
-  ::encode(restart_seq, got["STATUS"]);
+  encode(restart_seq, got["STATUS"]);
   t->set("STATUS", got);
   db->submit_transaction(t);
   return 0;
@@ -219,14 +219,14 @@ struct ObjStatus {
   }
 };
 void encode(const ObjStatus &obj, bufferlist &bl) {
-  ::encode(obj.last_applied, bl);
-  ::encode(obj.last_committed, bl);
-  ::encode(obj.restart_seq, bl);
+  encode(obj.last_applied, bl);
+  encode(obj.last_committed, bl);
+  encode(obj.restart_seq, bl);
 }
 void decode(ObjStatus &obj, bufferlist::iterator &bl) {
-  ::decode(obj.last_applied, bl);
-  ::decode(obj.last_committed, bl);
-  ::decode(obj.restart_seq, bl);
+  decode(obj.last_applied, bl);
+  decode(obj.last_committed, bl);
+  decode(obj.restart_seq, bl);
 }
 
 
@@ -240,7 +240,7 @@ ObjStatus get_obj_status(const pair<coll_t, string> &obj,
   ObjStatus retval;
   if (!got.empty()) {
     bufferlist::iterator bp = got.begin()->second.begin();
-    ::decode(retval, bp);
+    decode(retval, bp);
   }
   return retval;
 }
@@ -250,7 +250,7 @@ void set_obj_status(const pair<coll_t, string> &obj,
                    KeyValueDB::Transaction t)
 {
   map<string, bufferlist> to_set;
-  ::encode(status, to_set["META"]);
+  encode(status, to_set["META"]);
   t->set(obj_to_meta_prefix(obj), to_set);
 }
 
@@ -340,7 +340,7 @@ ObjectContents FileStoreTracker::get_current_content(
     bufferlist bl = iter->value();
     bufferlist::iterator bp = bl.begin();
     pair<uint64_t, bufferlist> val;
-    ::decode(val, bp);
+    decode(val, bp);
     assert(seq_to_key(val.first) == iter->key());
     bp = val.second.begin();
     return ObjectContents(bp);
@@ -359,7 +359,7 @@ ObjectContents FileStoreTracker::get_content(
     return ObjectContents();
   pair<uint64_t, bufferlist> val;
   bufferlist::iterator bp = got.begin()->second.begin();
-  ::decode(val, bp);
+  decode(val, bp);
   bp = val.second.begin();
   assert(val.first == version);
   return ObjectContents(bp);
@@ -376,7 +376,7 @@ pair<uint64_t, uint64_t> FileStoreTracker::get_valid_reads(
     pair<uint64_t, bufferlist> val;
     bufferlist bl = iter->value();
     bufferlist::iterator bp = bl.begin();
-    ::decode(val, bp);
+    decode(val, bp);
     bounds.second = val.first + 1;
   }
 
@@ -436,13 +436,13 @@ uint64_t FileStoreTracker::set_content(const pair<coll_t, string> &obj,
     pair<uint64_t, bufferlist> val;
     bufferlist bl = iter->value();
     bufferlist::iterator bp = bl.begin();
-    ::decode(val, bp);
+    decode(val, bp);
     most_recent = val.first;
   }
   bufferlist buf_content;
   content.encode(buf_content);
   map<string, bufferlist> to_set;
-  ::encode(make_pair(most_recent + 1, buf_content),
+  encode(make_pair(most_recent + 1, buf_content),
           to_set[seq_to_key(most_recent + 1)]);
   t->set(obj_to_prefix(obj), to_set);
   db->submit_transaction(t);
index 7eab8b3842ffa7718e25f6902f226cbd4a035638..54f4639323ab3816315c3ec73e4cfe1c4eb48d5a 100644 (file)
@@ -54,8 +54,8 @@ void TestObjectStoreState::init(int colls, int objs)
     bufferlist hint;
     uint32_t pg_num = colls;
     uint64_t num_objs = uint64_t(objs / colls);
-    ::encode(pg_num, hint);
-    ::encode(num_objs, hint);
+    encode(pg_num, hint);
+    encode(num_objs, hint);
     t->collection_hint(entry->m_coll, ObjectStore::Transaction::COLL_HINT_EXPECTED_NUM_OBJECTS, hint);
     dout(5) << "give collection hint, number of objects per collection: " << num_objs << dendl;
     t->touch(coll_t::meta(), entry->m_meta_obj);
index 619298dba22df9aa722531fe413ef308a3021883..5eb81afe020e0c5157316a556c9646e80d528fa2 100644 (file)
@@ -428,7 +428,7 @@ TEST_P(StoreTest, FiemapEmpty) {
     store->fiemap(cid, oid, 0, 100000, bl);
     map<uint64_t,uint64_t> m, e;
     bufferlist::iterator p = bl.begin();
-    ::decode(m, p);
+    decode(m, p);
     cout << " got " << m << std::endl;
     e[0] = 100000;
     EXPECT_TRUE(m == e || m.empty());
@@ -467,7 +467,7 @@ TEST_P(StoreTest, FiemapHoles) {
     store->fiemap(cid, oid, 0, SKIP_STEP * (MAX_EXTENTS - 1) + 3, bl);
     map<uint64_t,uint64_t> m, e;
     bufferlist::iterator p = bl.begin();
-    ::decode(m, p);
+    decode(m, p);
     cout << " got " << m << std::endl;
     ASSERT_TRUE(!m.empty());
     ASSERT_GE(m[0], 3u);
@@ -487,7 +487,7 @@ TEST_P(StoreTest, FiemapHoles) {
     store->fiemap(cid, oid, SKIP_STEP, SKIP_STEP * (MAX_EXTENTS - 2) + 3, bl);
     map<uint64_t,uint64_t> m, e;
     auto p = bl.begin();
-    ::decode(m, p);
+    decode(m, p);
     cout << " got " << m << std::endl;
     ASSERT_TRUE(!m.empty());
     // kstore always returns [0, object_size] regardless of offset and length
@@ -612,8 +612,8 @@ TEST_P(StoreTest, SimpleColPreHashTest) {
     t.create_collection(cid, 5);
     cerr << "create collection" << std::endl;
     bufferlist hint;
-    ::encode(pg_num, hint);
-    ::encode(expected_num_objs, hint);
+    encode(pg_num, hint);
+    encode(expected_num_objs, hint);
     t.collection_hint(cid, ObjectStore::Transaction::COLL_HINT_EXPECTED_NUM_OBJECTS, hint);
     cerr << "collection hint" << std::endl;
     r = apply_transaction(store, &osr, std::move(t));
index c4049beb80bf43ee4ae3868c6acf32ca39b1d572..08df9a5771cf5a6b4172df81e9c238183cc2c65a 100644 (file)
@@ -118,7 +118,7 @@ int run_get_last_op(std::string& filestore_path, std::string& journal_path)
   int32_t txn = 0;
   if (bl.length()) {
     bufferlist::iterator p = bl.begin();
-    ::decode(txn, p);
+    decode(txn, p);
   }
 
   store->umount();
index 077146573971f216f60de5d7559fccee0bba3970..a8390f7041747eec4f53c970482847c932c7b9c9 100644 (file)
 void ContDesc::encode(bufferlist &bl) const
 {
   ENCODE_START(1, 1, bl);
-  ::encode(objnum, bl);
-  ::encode(cursnap, bl);
-  ::encode(seqnum, bl);
-  ::encode(prefix, bl);
-  ::encode(oid, bl);
+  encode(objnum, bl);
+  encode(cursnap, bl);
+  encode(seqnum, bl);
+  encode(prefix, bl);
+  encode(oid, bl);
   ENCODE_FINISH(bl);
 }
 
 void ContDesc::decode(bufferlist::iterator &bl)
 {
   DECODE_START(1, bl);
-  ::decode(objnum, bl);
-  ::decode(cursnap, bl);
-  ::decode(seqnum, bl);
-  ::decode(prefix, bl);
-  ::decode(oid, bl);
+  decode(objnum, bl);
+  decode(cursnap, bl);
+  decode(seqnum, bl);
+  decode(prefix, bl);
+  decode(oid, bl);
   DECODE_FINISH(bl);
 }
 
index d0ea5b82c52346ad70e2d2f3afc4ef75f2af688d..be496b622d668041053cd8079247c171ad9a09a3 100644 (file)
@@ -848,7 +848,7 @@ public:
     }
 
     bufferlist contbl;
-    ::encode(cont, contbl);
+    encode(cont, contbl);
     pair<TestOp*, TestOp::CallbackInfo*> *cb_arg =
       new pair<TestOp*, TestOp::CallbackInfo*>(
        this,
@@ -1027,7 +1027,7 @@ public:
     }
 
     bufferlist contbl;
-    ::encode(cont, contbl);
+    encode(cont, contbl);
     pair<TestOp*, TestOp::CallbackInfo*> *cb_arg =
       new pair<TestOp*, TestOp::CallbackInfo*>(
        this,
@@ -1249,7 +1249,7 @@ public:
                   &results[index],
                   &retvals[index]);
       bufferlist init_value_bl;
-      ::encode(static_cast<uint32_t>(-1), init_value_bl);
+      encode(static_cast<uint32_t>(-1), init_value_bl);
       read_op.checksum(LIBRADOS_CHECKSUM_TYPE_CRC32C, init_value_bl, 0, len,
                       0, &checksums[index], &checksum_retvals[index]);
     } else {
@@ -1408,7 +1408,7 @@ public:
       if (old_value.has_contents()) {
        ContDesc to_check;
        bufferlist::iterator p = headerbl.begin();
-       ::decode(to_check, p);
+       decode(to_check, p);
        if (to_check != old_value.most_recent()) {
          cerr << num << ": oid " << oid << " found incorrect object contents " << to_check
               << ", expected " << old_value.most_recent() << std::endl;
@@ -1431,8 +1431,8 @@ public:
              try {
                auto bl_it = checksums[i].begin();
                uint32_t csum_count;
-               ::decode(csum_count, bl_it);
-               ::decode(checksum, bl_it);
+               decode(csum_count, bl_it);
+               decode(checksum, bl_it);
              } catch (const buffer::error &err) {
                checksum_retvals[i] = -EBADMSG;
              }
@@ -2024,7 +2024,7 @@ public:
                 &retvals[index]);
     if (index != 0) {
       bufferlist init_value_bl;
-      ::encode(static_cast<uint32_t>(-1), init_value_bl);
+      encode(static_cast<uint32_t>(-1), init_value_bl);
       read_op.checksum(LIBRADOS_CHECKSUM_TYPE_CRC32C, init_value_bl, offset, length,
                       0, &checksums[index], &checksum_retvals[index]);
     }
@@ -2161,8 +2161,8 @@ public:
          try {
            auto bl_it = checksums[1].begin();
            uint32_t csum_count;
-           ::decode(csum_count, bl_it);
-           ::decode(checksum[1], bl_it);
+           decode(csum_count, bl_it);
+           decode(checksum[1], bl_it);
          } catch (const buffer::error &err) {
            checksum_retvals[1] = -EBADMSG;
          }
@@ -2585,7 +2585,7 @@ public:
       if (r == 0) {
        HitSet hitset;
        bufferlist::iterator p = bl.begin();
-       ::decode(hitset, p);
+       decode(hitset, p);
        cout << num << ": got hitset of type " << hitset.get_type_name()
             << " size " << bl.length()
             << std::endl;
index a72b07a23dd143b039ac40c6161772dc912403bb..c0242dd77cf4a8b3c2e65cb6559f050843658554 100644 (file)
@@ -2328,7 +2328,7 @@ public:
     object_info_t existing_info;
     existing_info.version = eversion_t(6, 2);
     bufferlist enc_oi;
-    ::encode(existing_info, enc_oi, 0);
+    encode(existing_info, enc_oi, 0);
     ObjectStore::Transaction t2;
     t2.touch(test_coll, ghobject_t(existing_oid));
     t2.setattr(test_coll, ghobject_t(existing_oid), OI_ATTR, enc_oi);
index fd21ee4f60ded3a3fd5a3ba40d30ec96e865aeaa..6cafff111ceb1d754d388ad50788789f1b794740 100644 (file)
@@ -188,18 +188,18 @@ struct DummyBlock {
   int a = 1, b = 2, c = 3, d = 4;
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(a, bl);
-    ::encode(b, bl);
-    ::encode(c, bl);
-    ::encode(d, bl);
+    encode(a, bl);
+    encode(b, bl);
+    encode(c, bl);
+    encode(d, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(a, bl);
-    ::decode(b, bl);
-    ::decode(c, bl);
-    ::decode(d, bl);
+    decode(a, bl);
+    decode(b, bl);
+    decode(c, bl);
+    decode(d, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -214,9 +214,9 @@ double buffer_encode_decode()
   for (int i = 0; i < count; i++) {
     bufferlist b;
     DummyBlock dummy_block;
-    ::encode(dummy_block, b);
+    encode(dummy_block, b);
     bufferlist::iterator iter = b.begin();
-    ::decode(dummy_block, iter);
+    decode(dummy_block, iter);
   }
   uint64_t stop = Cycles::rdtsc();
   return Cycles::to_seconds(stop - start)/count;
@@ -261,18 +261,18 @@ double buffer_encode()
   for (int i = 0; i < count; i++) {
     bufferlist b;
     DummyBlock dummy_block;
-    ::encode(dummy_block, b);
+    encode(dummy_block, b);
     uint64_t start = Cycles::rdtsc();
-    ::encode(dummy_block, b);
-    ::encode(dummy_block, b);
-    ::encode(dummy_block, b);
-    ::encode(dummy_block, b);
-    ::encode(dummy_block, b);
-    ::encode(dummy_block, b);
-    ::encode(dummy_block, b);
-    ::encode(dummy_block, b);
-    ::encode(dummy_block, b);
-    ::encode(dummy_block, b);
+    encode(dummy_block, b);
+    encode(dummy_block, b);
+    encode(dummy_block, b);
+    encode(dummy_block, b);
+    encode(dummy_block, b);
+    encode(dummy_block, b);
+    encode(dummy_block, b);
+    encode(dummy_block, b);
+    encode(dummy_block, b);
+    encode(dummy_block, b);
     total += Cycles::rdtsc() - start;
   }
   return Cycles::to_seconds(total)/(count*10);
index c401e37cb3db46bd5ce8bf945632b9e3f7ae4a2d..d23bc4c6f65592547c501179f2bfab0a266c172c 100644 (file)
@@ -160,11 +160,11 @@ public:
                          std::map<std::string, cls::rbd::TrashImageSpec>&& images,
                          int r) {
     bufferlist bl;
-    ::encode(last_image_id, bl);
-    ::encode(static_cast<size_t>(1024), bl);
+    encode(last_image_id, bl);
+    encode(static_cast<size_t>(1024), bl);
 
     bufferlist out_bl;
-    ::encode(images, out_bl);
+    encode(images, out_bl);
 
     EXPECT_CALL(get_mock_io_ctx(io_ctx),
                 exec(RBD_TRASH, _, StrEq("rbd"), StrEq("trash_list"),
index 5530f8b9b368eec12aaff9719ab707aa5d8c8441..e434ceb2273c5bce11044ec0b8615aa45a799e9d 100644 (file)
@@ -48,41 +48,41 @@ struct old_rgw_bucket {
 
   void encode(bufferlist& bl) const {
      ENCODE_START(8, 3, bl);
-    ::encode(name, bl);
-    ::encode(data_pool, bl);
-    ::encode(marker, bl);
-    ::encode(bucket_id, bl);
-    ::encode(index_pool, bl);
-    ::encode(data_extra_pool, bl);
-    ::encode(tenant, bl);
+    encode(name, bl);
+    encode(data_pool, bl);
+    encode(marker, bl);
+    encode(bucket_id, bl);
+    encode(index_pool, bl);
+    encode(data_extra_pool, bl);
+    encode(tenant, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(8, 3, 3, bl);
-    ::decode(name, bl);
-    ::decode(data_pool, bl);
+    decode(name, bl);
+    decode(data_pool, bl);
     if (struct_v >= 2) {
-      ::decode(marker, bl);
+      decode(marker, bl);
       if (struct_v <= 3) {
         uint64_t id;
-        ::decode(id, bl);
+        decode(id, bl);
         char buf[16];
         snprintf(buf, sizeof(buf), "%llu", (long long)id);
         bucket_id = buf;
       } else {
-        ::decode(bucket_id, bl);
+        decode(bucket_id, bl);
       }
     }
     if (struct_v >= 5) {
-      ::decode(index_pool, bl);
+      decode(index_pool, bl);
     } else {
       index_pool = data_pool;
     }
     if (struct_v >= 7) {
-      ::decode(data_extra_pool, bl);
+      decode(data_extra_pool, bl);
     }
     if (struct_v >= 8) {
-      ::decode(tenant, bl);
+      decode(tenant, bl);
     }
     DECODE_FINISH(bl);
   }
@@ -380,27 +380,27 @@ public:
 
   void encode(bufferlist& bl) const {
     ENCODE_START(5, 3, bl);
-    ::encode(bucket.name, bl);
-    ::encode(loc, bl);
-    ::encode(ns, bl);
-    ::encode(object, bl);
-    ::encode(bucket, bl);
-    ::encode(instance, bl);
+    encode(bucket.name, bl);
+    encode(loc, bl);
+    encode(ns, bl);
+    encode(object, bl);
+    encode(bucket, bl);
+    encode(instance, bl);
     if (!ns.empty() || !instance.empty()) {
-      ::encode(orig_obj, bl);
+      encode(orig_obj, bl);
     }
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
-    ::decode(bucket.name, bl);
-    ::decode(loc, bl);
-    ::decode(ns, bl);
-    ::decode(object, bl);
+    decode(bucket.name, bl);
+    decode(loc, bl);
+    decode(ns, bl);
+    decode(object, bl);
     if (struct_v >= 2)
-      ::decode(bucket, bl);
+      decode(bucket, bl);
     if (struct_v >= 4)
-      ::decode(instance, bl);
+      decode(instance, bl);
     if (ns.empty() && instance.empty()) {
       if (object[0] != '_') {
         orig_obj = object;
@@ -409,7 +409,7 @@ public:
       }
     } else {
       if (struct_v >= 5) {
-        ::decode(orig_obj, bl);
+        decode(orig_obj, bl);
       } else {
         ssize_t pos = object.find('_', 1);
         if (pos < 0) {
index 8a64efe62ad1b28b189129acda0c023757a44387..e72ecc50c770583388b11dd731e59426720bd1f8 100644 (file)
@@ -40,17 +40,17 @@ struct OldObjManifestPart {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 2, bl);
-    ::encode(loc, bl);
-    ::encode(loc_ofs, bl);
-    ::encode(size, bl);
+    encode(loc, bl);
+    encode(loc_ofs, bl);
+    encode(size, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
      DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl);
-     ::decode(loc, bl);
-     ::decode(loc_ofs, bl);
-     ::decode(size, bl);
+     decode(loc, bl);
+     decode(loc_ofs, bl);
+     decode(size, bl);
      DECODE_FINISH(bl);
   }
 
@@ -87,15 +87,15 @@ public:
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 2, bl);
-    ::encode(obj_size, bl);
-    ::encode(objs, bl);
+    encode(obj_size, bl);
+    encode(objs, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN_32(6, 2, 2, bl);
-    ::decode(obj_size, bl);
-    ::decode(objs, bl);
+    decode(obj_size, bl);
+    decode(objs, bl);
     DECODE_FINISH(bl);
   }
 
@@ -357,13 +357,13 @@ TEST(TestRGWManifest, old_obj_manifest) {
 
 
   bufferlist bl;
-  ::encode(old_manifest , bl);
+  encode(old_manifest , bl);
 
   RGWObjManifest manifest;
 
   try {
     auto iter = bl.begin();
-    ::decode(manifest, iter);
+    decode(manifest, iter);
   } catch (buffer::error& err) {
     ASSERT_TRUE(false);
   }
index 0a83536a5f1acd76fd273486e864baf540efa94c..91dfc8dc66b361d2679009f359005eff772c730c 100644 (file)
@@ -93,18 +93,18 @@ void test_obj(const string& name, const string& ns, const string& instance)
   encode_json("obj1", obj1, formatter);
 
   bufferlist bl;
-  ::encode(obj1, bl);
+  encode(obj1, bl);
 
   rgw_obj obj2;
-  ::decode(obj2, bl);
+  decode(obj2, bl);
   check_parsed_correctly(obj2, name, ns, instance);
 
   encode_json("obj2", obj2, formatter);
 
   rgw_obj obj3(o);
   bufferlist bl3;
-  ::encode(obj3, bl3);
-  ::decode(obj3, bl3);
+  encode(obj3, bl3);
+  decode(obj3, bl3);
   encode_json("obj3", obj3, formatter);
 
   if (!instance.empty()) {
@@ -227,17 +227,17 @@ TEST(TestRGWObj, old_to_raw) {
 
         bufferlist bl;
 
-        ::encode(old, bl);
+        encode(old, bl);
 
         rgw_obj new_obj;
         rgw_raw_obj raw_obj;
 
         try {
           bufferlist::iterator iter = bl.begin();
-          ::decode(new_obj, iter);
+          decode(new_obj, iter);
 
           iter = bl.begin();
-          ::decode(raw_obj, iter);
+          decode(raw_obj, iter);
         } catch (buffer::error& err) {
           ASSERT_TRUE(false);
         }
@@ -247,7 +247,7 @@ TEST(TestRGWObj, old_to_raw) {
         rgw_obj new_obj2;
         rgw_raw_obj raw_obj2;
 
-        ::encode(new_obj, bl);
+        encode(new_obj, bl);
 
         dump(f, "raw_obj", raw_obj);
         dump(f, "new_obj", new_obj);
@@ -255,7 +255,7 @@ TEST(TestRGWObj, old_to_raw) {
 
         try {
           bufferlist::iterator iter = bl.begin();
-          ::decode(new_obj2, iter);
+          decode(new_obj2, iter);
 
           /*
             can't decode raw obj here, because we didn't encode an old versioned
@@ -263,9 +263,9 @@ TEST(TestRGWObj, old_to_raw) {
            */
 
           bl.clear();
-          ::encode(raw_obj, bl);
+          encode(raw_obj, bl);
           iter = bl.begin();
-          ::decode(raw_obj2, iter);
+          decode(raw_obj2, iter);
         } catch (buffer::error& err) {
           ASSERT_TRUE(false);
         }
index 6a7c4a2defee07a91c50e05b844616353acf84a7..178f56030f117fc9ed8a70347d666958c651e946 100644 (file)
 template<typename T>
 void test_encode_decode(T v) {
   bufferlist bl;
-  ::encode(v, bl);
+  encode(v, bl);
   bufferlist::iterator p = bl.begin();
   T out;
-  ::decode(out, p);
+  decode(out, p);
   ASSERT_EQ(v, out);
 }
 
@@ -66,10 +66,10 @@ void test_denc(T v) {
 template<typename T>
 void test_encode_decode_featured(T v) {
   bufferlist bl;
-  ::encode(v, bl, 123);
+  encode(v, bl, 123);
   bufferlist::iterator p = bl.begin();
   T out;
-  ::decode(out, p);
+  decode(out, p);
   ASSERT_EQ(v, out);
 }
 
@@ -151,8 +151,8 @@ TEST(denc, denc_counter)
   denc_counter_t single, single2;
   {
     bufferlist bl;
-    ::encode(single, bl);
-    ::decode(single2, bl);
+    encode(single, bl);
+    decode(single2, bl);
   }
   ASSERT_EQ(counts.num_bound_encode, 1);
   ASSERT_EQ(counts.num_encode, 1);
@@ -183,10 +183,12 @@ TEST(denc, string)
 struct legacy_t {
   int32_t a = 1;
   void encode(bufferlist& bl) const {
-    ::encode(a, bl);
+    using ceph::encode;
+    encode(a, bl);
   }
   void decode(bufferlist::iterator& p) {
-    ::decode(a, p);
+    using ceph::decode;
+    decode(a, p);
   }
   legacy_t() {}
   legacy_t(int32_t i) : a(i) {}
@@ -243,8 +245,8 @@ TEST(denc, vector)
     v.resize(100);
     {
       bufferlist bl;
-      ::encode(v, bl);
-      ::decode(v2, bl);
+      encode(v, bl);
+      decode(v2, bl);
     }
     ASSERT_EQ(counts.num_bound_encode, 100);
     ASSERT_EQ(counts.num_encode, 100);
@@ -256,8 +258,8 @@ TEST(denc, vector)
     v.resize(100);
     {
       bufferlist bl;
-      ::encode(v, bl);
-      ::decode(v2, bl);
+      encode(v, bl);
+      decode(v2, bl);
     }
     ASSERT_EQ(counts.num_bound_encode, 1);
     ASSERT_EQ(counts.num_encode, 100);
@@ -279,8 +281,8 @@ TEST(denc, list)
     }
     {
       bufferlist bl;
-      ::encode(l, bl);
-      ::decode(l2, bl);
+      encode(l, bl);
+      decode(l2, bl);
     }
     ASSERT_EQ(counts.num_bound_encode, 1);
     ASSERT_EQ(counts.num_encode, 100);
@@ -386,7 +388,7 @@ TEST(denc, foo)
   foo_t a;
   test_denc(a);
   bufferlist bl;
-  ::encode(a, bl);
+  encode(a, bl);
   bl.hexdump(cout);
 }
 
@@ -405,11 +407,11 @@ TEST(denc, pair)
   {
     auto a = bl.get_contiguous_appender(1000);
     denc(p, a);
-    ::encode(p, bl);
+    encode(p, bl);
   }
 
   pair<int32_t,legacy_t> lp;
-  ::encode(lp, bl);
+  encode(lp, bl);
 }
 
 template<template<class, class> class C>
@@ -591,7 +593,8 @@ struct Legacy {
   }
   void decode(buffer::list::iterator& p) {
     n_decode++;
-    ::decode(value, p);
+    using ceph::decode;
+    decode(value, p);
   }
   static void reset() {
     n_denc = n_decode = 0;
@@ -608,7 +611,8 @@ bufferlist Legacy::encode_n(unsigned n, const vector<unsigned>& segments) {
     v.push_back(Legacy());
   }
   bufferlist bl(n * sizeof(uint8_t));
-  ::encode(v, bl);
+  using ceph::encode;
+  encode(v, bl);
   bufferlist segmented;
   auto p = bl.begin();
 
@@ -639,7 +643,7 @@ TEST(denc, no_copy_if_segmented_and_lengthy)
     // denc() is shared by encode() and decode(), so reset() right before
     // decode()
     Legacy::reset();
-    ::decode(v, p);
+    decode(v, p);
     ASSERT_EQ(N_COPIES, v.size());
     ASSERT_EQ(N_COPIES, Legacy::n_denc);
     ASSERT_EQ(0u, Legacy::n_decode);
@@ -654,7 +658,7 @@ TEST(denc, no_copy_if_segmented_and_lengthy)
     auto p = segmented.begin();
     vector<Legacy> v;
     Legacy::reset();
-    ::decode(v, p);
+    decode(v, p);
     ASSERT_EQ(N_COPIES, v.size());
     ASSERT_EQ(N_COPIES, Legacy::n_denc);
     ASSERT_EQ(0u, Legacy::n_decode);
@@ -674,7 +678,7 @@ TEST(denc, no_copy_if_segmented_and_lengthy)
     ASSERT_LT(segmented.length() - p.get_off(), CEPH_PAGE_SIZE);
     vector<Legacy> v;
     Legacy::reset();
-    ::decode(v, p);
+    decode(v, p);
     ASSERT_EQ(Legacy::n_denc, 100u);
     ASSERT_EQ(0u, Legacy::n_decode);
   }
@@ -692,7 +696,7 @@ TEST(denc, no_copy_if_segmented_and_lengthy)
     ASSERT_GT(segmented.length() - p.get_off(), CEPH_PAGE_SIZE);
     vector<Legacy> v;
     Legacy::reset();
-    ::decode(v, p);
+    decode(v, p);
     ASSERT_EQ(0u, Legacy::n_denc);
     ASSERT_EQ(CEPH_PAGE_SIZE * 2, Legacy::n_decode);
   }
index 20d2a629b9640eae826541a08094542881f416cb..10d96aa523d35befe81047906a2ab9fd04f114e0 100644 (file)
@@ -389,7 +389,7 @@ TEST_F(MapCacherTest, Simple)
   set<string> truth_keys;
   string blah("asdf");
   bufferlist bl;
-  ::encode(blah, bl);
+  encode(blah, bl);
   truth[string("asdf")] = bl;
   truth_keys.insert(truth.begin()->first);
   {