]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cls: Use unqualified encode/decode
authorAdam C. Emerson <aemerson@redhat.com>
Sat, 23 Dec 2017 02:52:50 +0000 (21:52 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 10 Jan 2018 19:02:09 +0000 (14:02 -0500)
This is a portion of the namespace project.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
61 files changed:
src/cls/cephfs/cls_cephfs.cc
src/cls/cephfs/cls_cephfs.h
src/cls/cephfs/cls_cephfs_client.cc
src/cls/hello/cls_hello.cc
src/cls/journal/cls_journal.cc
src/cls/journal/cls_journal_client.cc
src/cls/journal/cls_journal_types.cc
src/cls/journal/cls_journal_types.h
src/cls/lock/cls_lock.cc
src/cls/lock/cls_lock_client.cc
src/cls/lock/cls_lock_ops.h
src/cls/lock/cls_lock_types.h
src/cls/log/cls_log.cc
src/cls/log/cls_log_client.cc
src/cls/log/cls_log_ops.h
src/cls/log/cls_log_types.h
src/cls/lua/cls_lua.cc
src/cls/lua/cls_lua_client.cc
src/cls/lua/cls_lua_ops.h
src/cls/numops/cls_numops.cc
src/cls/numops/cls_numops_client.cc
src/cls/rbd/cls_rbd.cc
src/cls/rbd/cls_rbd.h
src/cls/rbd/cls_rbd_client.cc
src/cls/rbd/cls_rbd_types.cc
src/cls/rbd/cls_rbd_types.h
src/cls/refcount/cls_refcount.cc
src/cls/refcount/cls_refcount_client.cc
src/cls/refcount/cls_refcount_ops.h
src/cls/replica_log/cls_replica_log.cc
src/cls/replica_log/cls_replica_log_client.cc
src/cls/replica_log/cls_replica_log_ops.h
src/cls/replica_log/cls_replica_log_types.h
src/cls/rgw/cls_rgw.cc
src/cls/rgw/cls_rgw_client.cc
src/cls/rgw/cls_rgw_types.cc
src/cls/statelog/cls_statelog.cc
src/cls/statelog/cls_statelog_client.cc
src/cls/statelog/cls_statelog_ops.h
src/cls/statelog/cls_statelog_types.h
src/cls/timeindex/cls_timeindex.cc
src/cls/timeindex/cls_timeindex_client.cc
src/cls/timeindex/cls_timeindex_client.h
src/cls/timeindex/cls_timeindex_ops.h
src/cls/timeindex/cls_timeindex_types.h
src/cls/user/cls_user.cc
src/cls/user/cls_user_client.cc
src/cls/version/cls_version.cc
src/cls/version/cls_version_client.cc
src/cls/version/cls_version_ops.h
src/cls/version/cls_version_types.h
src/librbd/WatchNotifyTypes.cc
src/librbd/journal/Types.cc
src/librbd/trash_watcher/Types.cc
src/test/cls_rbd/test_cls_rbd.cc
src/test/encoding/ceph_dencoder.cc
src/test/librbd/mirror/test_mock_DisableRequest.cc
src/test/librbd/trash/test_mock_MoveRequest.cc
src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc
src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc
src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc

index 1d656c137892e9e197994e8fbd3c77d5969e120b..047fbd6d801e1a36dd30dc49b8657ac44ec83ff0 100644 (file)
@@ -38,7 +38,7 @@ std::ostream &operator<<(std::ostream &out, const ObjCeiling &in)
  * If the xattr is missing, then it is set to the input integer.
  *
  * @param xattr_name: name of xattr to compare against and set
- * @param input_val: candidate new value, of ::encode()'able type
+ * @param input_val: candidate new value, of encode()'able type
  * @returns 0 on success (irrespective of whether our new value
  *          was used) else an error code
  */
@@ -56,7 +56,7 @@ static int set_if_greater(cls_method_context_t hctx,
     bufferlist::iterator existing_p = existing_val_bl.begin();
     try {
       A existing_val;
-      ::decode(existing_val, existing_p);
+      decode(existing_val, existing_p);
       if (!existing_p.end()) {
         // Trailing junk?  Consider it invalid and overwrite
         set_val = true;
@@ -75,7 +75,7 @@ static int set_if_greater(cls_method_context_t hctx,
   // Conditionally set the new xattr
   if (set_val) {
     bufferlist set_bl;
-    ::encode(input_val, set_bl);
+    encode(input_val, set_bl);
     return cls_cxx_setxattr(hctx, xattr_name.c_str(), &set_bl);
   } else {
     return 0;
@@ -169,7 +169,7 @@ bool PGLSCephFSFilter::filter(const hobject_t &obj,
     std::string tag_ondisk;
     bufferlist::iterator q = xattr_data.begin();
     try {
-      ::decode(tag_ondisk, q);
+      decode(tag_ondisk, q);
       if (tag_ondisk == scrub_tag)
        return false;
     } catch (const buffer::error &err) {
index ca631c66d90264a210960c0a1879ee28b9aca52f..dc426c1c93475276612fc95cac25554234f2b6f5 100644 (file)
@@ -39,16 +39,16 @@ class ObjCeiling {
     void encode(bufferlist &bl) const
     {
       ENCODE_START(1, 1, bl);
-      ::encode(id, bl);
-      ::encode(size, bl);
+      encode(id, bl);
+      encode(size, bl);
       ENCODE_FINISH(bl);
     }
 
     void decode(bufferlist::iterator &p)
     {
       DECODE_START(1, p);
-      ::decode(id, p);
-      ::decode(size, p);
+      decode(id, p);
+      decode(size, p);
       DECODE_FINISH(p);
     }
 };
@@ -86,24 +86,24 @@ public:
   void encode(bufferlist &bl) const
   {
     ENCODE_START(1, 1, bl);
-    ::encode(obj_xattr_name, bl);
-    ::encode(mtime_xattr_name, bl);
-    ::encode(obj_size_xattr_name, bl);
-    ::encode(obj_index, bl);
-    ::encode(obj_size, bl);
-    ::encode(mtime, bl);
+    encode(obj_xattr_name, bl);
+    encode(mtime_xattr_name, bl);
+    encode(obj_size_xattr_name, bl);
+    encode(obj_index, bl);
+    encode(obj_size, bl);
+    encode(mtime, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator &bl)
   {
     DECODE_START(1, bl);
-    ::decode(obj_xattr_name, bl);
-    ::decode(mtime_xattr_name, bl);
-    ::decode(obj_size_xattr_name, bl);
-    ::decode(obj_index, bl);
-    ::decode(obj_size, bl);
-    ::decode(mtime, bl);
+    decode(obj_xattr_name, bl);
+    decode(mtime_xattr_name, bl);
+    decode(obj_size_xattr_name, bl);
+    decode(obj_index, bl);
+    decode(obj_size, bl);
+    decode(mtime, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -116,14 +116,14 @@ class InodeTagFilterArgs
   void encode(bufferlist &bl) const
   {
     ENCODE_START(1, 1, bl);
-    ::encode(scrub_tag, bl);
+    encode(scrub_tag, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator &bl)
   {
     DECODE_START(1, bl);
-    ::decode(scrub_tag, bl);
+    decode(scrub_tag, bl);
     DECODE_FINISH(bl);
   }
 };
index b039242731f067de1d382f7e3bb58f8fa0af79e5..73e72f75e0d0d583ab1f219173d39d86fb9b2c5b 100644 (file)
@@ -120,7 +120,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result(
   // Load scan_max_size
   try {
     bufferlist::iterator scan_max_size_bl_iter = scan_max_size_bl.begin();
-    ::decode(result->max_obj_size, scan_max_size_bl_iter);
+    decode(result->max_obj_size, scan_max_size_bl_iter);
   } catch (const buffer::error &err) {
     //dout(4) << "Invalid size attr on '" << oid << "'" << dendl;
     return -EINVAL;
@@ -129,7 +129,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result(
   // Load scan_max_mtime
   try {
     bufferlist::iterator scan_max_mtime_bl_iter = scan_max_mtime_bl.begin();
-    ::decode(result->max_mtime, scan_max_mtime_bl_iter);
+    decode(result->max_mtime, scan_max_mtime_bl_iter);
   } catch (const buffer::error &err) {
     //dout(4) << "Invalid size attr on '" << oid << "'" << dendl;
     return -EINVAL;
@@ -150,7 +150,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result(
   if (layout_bl.length()) {
     try {
       bufferlist::iterator q = layout_bl.begin();
-      ::decode(*layout, q);
+      decode(*layout, q);
     } catch (buffer::error &e) {
       return -EINVAL;
     }
@@ -166,11 +166,10 @@ void ClsCephFSClient::build_tag_filter(
   assert(out_bl != NULL);
 
   // Leading part of bl is un-versioned string naming the filter
-  ::encode(std::string("cephfs.inode_tag"), *out_bl);
+  encode(std::string("cephfs.inode_tag"), *out_bl);
 
   // Filter-specific part of the bl: in our case this is a versioned structure
   InodeTagFilterArgs args;
   args.scrub_tag = scrub_tag;
   args.encode(*out_bl);
 }
-
index 030c775bfe0fc91e2fa759802db39acd2ef06d7f..a373148d48cbccbc3426c2390be88275038d9573 100644 (file)
@@ -254,8 +254,8 @@ class PGLSHelloFilter : public PGLSFilter {
 public:
   int init(bufferlist::iterator& params) override {
     try {
-      ::decode(xattr, params);
-      ::decode(val, params);
+      decode(xattr, params);
+      decode(val, params);
     } catch (buffer::error &e) {
       return -EINVAL;
     }
index bae5b2108c0a53d19f49ba24e16d59ad18320234..8befbf74fc5b66ae6cddf190079924e4ded26f30 100644 (file)
@@ -64,7 +64,7 @@ int read_key(cls_method_context_t hctx, const string &key, T *t,
 
   try {
     bufferlist::iterator iter = bl.begin();
-    ::decode(*t, iter);
+    decode(*t, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -75,7 +75,7 @@ int read_key(cls_method_context_t hctx, const string &key, T *t,
 template <typename T>
 int write_key(cls_method_context_t hctx, const string &key, const T &t) {
   bufferlist bl;
-  ::encode(t, bl);
+  encode(t, bl);
 
   int r = cls_cxx_map_set_val(hctx, key, &bl);
   if (r < 0) {
@@ -123,7 +123,7 @@ int expire_tags(cls_method_context_t hctx, const std::string *skip_client_id) {
       cls::journal::Client client;
       bufferlist::iterator iter = val.second.begin();
       try {
-        ::decode(client, iter);
+        decode(client, iter);
       } catch (const buffer::error &err) {
         CLS_ERR("error decoding registered client: %s",
                 val.first.c_str());
@@ -172,7 +172,7 @@ int expire_tags(cls_method_context_t hctx, const std::string *skip_client_id) {
       cls::journal::Tag tag;
       bufferlist::iterator iter = val.second.begin();
       try {
-        ::decode(tag, iter);
+        decode(tag, iter);
       } catch (const buffer::error &err) {
         CLS_ERR("error decoding tag: %s", val.first.c_str());
         return -EIO;
@@ -234,7 +234,7 @@ int get_client_list_range(cls_method_context_t hctx,
       bufferlist::iterator iter = it->second.begin();
 
       cls::journal::Client client;
-      ::decode(client, iter);
+      decode(client, iter);
       clients->insert(client);
     } catch (const buffer::error &err) {
       CLS_ERR("could not decode client '%s': %s", it->first.c_str(),
@@ -307,9 +307,9 @@ int journal_create(cls_method_context_t hctx, bufferlist *in, bufferlist *out) {
   int64_t pool_id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(order, iter);
-    ::decode(splay_width, iter);
-    ::decode(pool_id, iter);
+    decode(order, iter);
+    decode(splay_width, iter);
+    decode(pool_id, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -379,7 +379,7 @@ int journal_get_order(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(order, *out);
+  encode(order, *out);
   return 0;
 }
 
@@ -399,7 +399,7 @@ int journal_get_splay_width(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(splay_width, *out);
+  encode(splay_width, *out);
   return 0;
 }
 
@@ -419,7 +419,7 @@ int journal_get_pool_id(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(pool_id, *out);
+  encode(pool_id, *out);
   return 0;
 }
 
@@ -439,7 +439,7 @@ int journal_get_minimum_set(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(minimum_set, *out);
+  encode(minimum_set, *out);
   return 0;
 }
 
@@ -455,7 +455,7 @@ int journal_set_minimum_set(cls_method_context_t hctx, bufferlist *in,
   uint64_t object_set;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(object_set, iter);
+    decode(object_set, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -510,7 +510,7 @@ int journal_get_active_set(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(active_set, *out);
+  encode(active_set, *out);
   return 0;
 }
 
@@ -526,7 +526,7 @@ int journal_set_active_set(cls_method_context_t hctx, bufferlist *in,
   uint64_t object_set;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(object_set, iter);
+    decode(object_set, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -578,7 +578,7 @@ int journal_get_client(cls_method_context_t hctx, bufferlist *in,
   std::string id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -591,7 +591,7 @@ int journal_get_client(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(client, *out);
+  encode(client, *out);
   return 0;
 }
 
@@ -609,8 +609,8 @@ int journal_client_register(cls_method_context_t hctx, bufferlist *in,
   bufferlist data;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
-    ::decode(data, iter);
+    decode(id, iter);
+    decode(data, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -659,8 +659,8 @@ int journal_client_update_data(cls_method_context_t hctx, bufferlist *in,
   bufferlist data;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
-    ::decode(data, iter);
+    decode(id, iter);
+    decode(data, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -696,9 +696,9 @@ int journal_client_update_state(cls_method_context_t hctx, bufferlist *in,
   bufferlist data;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
+    decode(id, iter);
     uint8_t state_raw;
-    ::decode(state_raw, iter);
+    decode(state_raw, iter);
     state = static_cast<cls::journal::ClientState>(state_raw);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
@@ -732,7 +732,7 @@ int journal_client_unregister(cls_method_context_t hctx, bufferlist *in,
   std::string id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -774,8 +774,8 @@ int journal_client_commit(cls_method_context_t hctx, bufferlist *in,
   cls::journal::ObjectSetPosition commit_position;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
-    ::decode(commit_position, iter);
+    decode(id, iter);
+    decode(commit_position, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -825,8 +825,8 @@ int journal_client_list(cls_method_context_t hctx, bufferlist *in,
   uint64_t max_return;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(start_after, iter);
-    ::decode(max_return, iter);
+    decode(start_after, iter);
+    decode(max_return, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -837,7 +837,7 @@ int journal_client_list(cls_method_context_t hctx, bufferlist *in,
   if (r < 0)
     return r;
 
-  ::encode(clients, *out);
+  encode(clients, *out);
   return 0;
 }
 
@@ -856,7 +856,7 @@ int journal_get_next_tag_tid(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(tag_tid, *out);
+  encode(tag_tid, *out);
   return 0;
 }
 
@@ -873,7 +873,7 @@ int journal_get_tag(cls_method_context_t hctx, bufferlist *in,
   uint64_t tag_tid;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(tag_tid, iter);
+    decode(tag_tid, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -886,7 +886,7 @@ int journal_get_tag(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(tag, *out);
+  encode(tag, *out);
   return 0;
 }
 
@@ -906,9 +906,9 @@ int journal_tag_create(cls_method_context_t hctx, bufferlist *in,
   bufferlist data;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(tag_tid, iter);
-    ::decode(tag_class, iter);
-    ::decode(data, iter);
+    decode(tag_tid, iter);
+    decode(tag_class, iter);
+    decode(data, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -1000,10 +1000,10 @@ int journal_tag_list(cls_method_context_t hctx, bufferlist *in,
   tag_class = boost::none;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(start_after_tag_tid, iter);
-    ::decode(max_return, iter);
-    ::decode(client_id, iter);
-    ::decode(tag_class, iter);
+    decode(start_after_tag_tid, iter);
+    decode(max_return, iter);
+    decode(client_id, iter);
+    decode(tag_class, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
@@ -1044,7 +1044,7 @@ int journal_tag_list(cls_method_context_t hctx, bufferlist *in,
       cls::journal::Tag tag;
       bufferlist::iterator iter = val.second.begin();
       try {
-        ::decode(tag, iter);
+        decode(tag, iter);
       } catch (const buffer::error &err) {
         CLS_ERR("error decoding tag: %s", val.first.c_str());
         return -EIO;
@@ -1082,7 +1082,7 @@ int journal_tag_list(cls_method_context_t hctx, bufferlist *in,
     }
   } while (tag_pass != TAG_PASS_DONE);
 
-  ::encode(tags, *out);
+  encode(tags, *out);
   return 0;
 }
 
@@ -1098,7 +1098,7 @@ int journal_object_guard_append(cls_method_context_t hctx, bufferlist *in,
   uint64_t soft_max_size;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(soft_max_size, iter);
+    decode(soft_max_size, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
index c4744ebeee8d9d688f988540c580b368c492a6a9..a003468616ecf568fb48e5c14eb680fd0b0bb7d8 100644 (file)
@@ -11,6 +11,8 @@
 namespace cls {
 namespace journal {
 namespace client {
+using ceph::encode;
+using ceph::decode;
 
 namespace {
 
@@ -40,8 +42,8 @@ struct C_ClientList : public C_AioExec {
 
   void send(const std::string &start_after) {
     bufferlist inbl;
-    ::encode(start_after, inbl);
-    ::encode(JOURNAL_MAX_RETURN, inbl);
+    encode(start_after, inbl);
+    encode(JOURNAL_MAX_RETURN, inbl);
 
     librados::ObjectReadOperation op;
     op.exec("journal", "client_list", inbl);
@@ -63,7 +65,7 @@ struct C_ClientList : public C_AioExec {
     try {
       bufferlist::iterator iter = outbl.begin();
       std::set<cls::journal::Client> partial_clients;
-      ::decode(partial_clients, iter);
+      decode(partial_clients, iter);
 
       std::string start_after;
       if (!partial_clients.empty()) {
@@ -119,9 +121,9 @@ struct C_ImmutableMetadata : public C_AioExec {
     if (r == 0) {
       try {
         bufferlist::iterator iter = outbl.begin();
-        ::decode(*order, iter);
-        ::decode(*splay_width, iter);
-        ::decode(*pool_id, iter);
+        decode(*order, iter);
+        decode(*splay_width, iter);
+        decode(*pool_id, iter);
       } catch (const buffer::error &err) {
         r = -EBADMSG;
       }
@@ -159,8 +161,8 @@ struct C_MutableMetadata : public C_AioExec {
     if (r == 0) {
       try {
         bufferlist::iterator iter = outbl.begin();
-        ::decode(*minimum_set, iter);
-        ::decode(*active_set, iter);
+        decode(*minimum_set, iter);
+        decode(*active_set, iter);
         client_list->send("");
       } catch (const buffer::error &err) {
         r = -EBADMSG;
@@ -178,9 +180,9 @@ struct C_MutableMetadata : public C_AioExec {
 void create(librados::ObjectWriteOperation *op,
             uint8_t order, uint8_t splay, int64_t pool_id) {
   bufferlist bl;
-  ::encode(order, bl);
-  ::encode(splay, bl);
-  ::encode(pool_id, bl);
+  encode(order, bl);
+  encode(splay, bl);
+  encode(pool_id, bl);
 
   op->exec("journal", "create", bl);
 }
@@ -218,13 +220,13 @@ void get_mutable_metadata(librados::IoCtx &ioctx, const std::string &oid,
 
 void set_minimum_set(librados::ObjectWriteOperation *op, uint64_t object_set) {
   bufferlist bl;
-  ::encode(object_set, bl);
+  encode(object_set, bl);
   op->exec("journal", "set_minimum_set", bl);
 }
 
 void set_active_set(librados::ObjectWriteOperation *op, uint64_t object_set) {
   bufferlist bl;
-  ::encode(object_set, bl);
+  encode(object_set, bl);
   op->exec("journal", "set_active_set", bl);
 }
 
@@ -250,14 +252,14 @@ int get_client(librados::IoCtx &ioctx, const std::string &oid,
 void get_client_start(librados::ObjectReadOperation *op,
                       const std::string &id) {
   bufferlist bl;
-  ::encode(id, bl);
+  encode(id, bl);
   op->exec("journal", "get_client", bl);
 }
 
 int get_client_finish(bufferlist::iterator *iter,
                       cls::journal::Client *client) {
   try {
-    ::decode(*client, *iter);
+    decode(*client, *iter);
   } catch (const buffer::error &err) {
     return -EBADMSG;
   }
@@ -274,8 +276,8 @@ int client_register(librados::IoCtx &ioctx, const std::string &oid,
 void client_register(librados::ObjectWriteOperation *op,
                      const std::string &id, const bufferlist &data) {
   bufferlist bl;
-  ::encode(id, bl);
-  ::encode(data, bl);
+  encode(id, bl);
+  encode(data, bl);
   op->exec("journal", "client_register", bl);
 }
 
@@ -289,8 +291,8 @@ int client_update_data(librados::IoCtx &ioctx, const std::string &oid,
 void client_update_data(librados::ObjectWriteOperation *op,
                         const std::string &id, const bufferlist &data) {
   bufferlist bl;
-  ::encode(id, bl);
-  ::encode(data, bl);
+  encode(id, bl);
+  encode(data, bl);
   op->exec("journal", "client_update_data", bl);
 }
 
@@ -305,8 +307,8 @@ void client_update_state(librados::ObjectWriteOperation *op,
                          const std::string &id,
                          cls::journal::ClientState state) {
   bufferlist bl;
-  ::encode(id, bl);
-  ::encode(static_cast<uint8_t>(state), bl);
+  encode(id, bl);
+  encode(static_cast<uint8_t>(state), bl);
   op->exec("journal", "client_update_state", bl);
 }
 
@@ -321,15 +323,15 @@ void client_unregister(librados::ObjectWriteOperation *op,
                       const std::string &id) {
 
   bufferlist bl;
-  ::encode(id, bl);
+  encode(id, bl);
   op->exec("journal", "client_unregister", bl);
 }
 
 void client_commit(librados::ObjectWriteOperation *op, const std::string &id,
                    const cls::journal::ObjectSetPosition &commit_position) {
   bufferlist bl;
-  ::encode(id, bl);
-  ::encode(commit_position, bl);
+  encode(id, bl);
+  encode(commit_position, bl);
   op->exec("journal", "client_commit", bl);
 }
 
@@ -373,7 +375,7 @@ void get_next_tag_tid_start(librados::ObjectReadOperation *op) {
 int get_next_tag_tid_finish(bufferlist::iterator *iter,
                             uint64_t *tag_tid) {
   try {
-    ::decode(*tag_tid, *iter);
+    decode(*tag_tid, *iter);
   } catch (const buffer::error &err) {
     return -EBADMSG;
   }
@@ -402,13 +404,13 @@ int get_tag(librados::IoCtx &ioctx, const std::string &oid,
 void get_tag_start(librados::ObjectReadOperation *op,
                    uint64_t tag_tid) {
   bufferlist bl;
-  ::encode(tag_tid, bl);
+  encode(tag_tid, bl);
   op->exec("journal", "get_tag", bl);
 }
 
 int get_tag_finish(bufferlist::iterator *iter, cls::journal::Tag *tag) {
   try {
-    ::decode(*tag, *iter);
+    decode(*tag, *iter);
   } catch (const buffer::error &err) {
     return -EBADMSG;
   }
@@ -426,9 +428,9 @@ int tag_create(librados::IoCtx &ioctx, const std::string &oid,
 void tag_create(librados::ObjectWriteOperation *op, uint64_t tag_tid,
                 uint64_t tag_class, const bufferlist &data) {
   bufferlist bl;
-  ::encode(tag_tid, bl);
-  ::encode(tag_class, bl);
-  ::encode(data, bl);
+  encode(tag_tid, bl);
+  encode(tag_class, bl);
+  encode(data, bl);
   op->exec("journal", "tag_create", bl);
 }
 
@@ -468,17 +470,17 @@ void tag_list_start(librados::ObjectReadOperation *op,
                     const std::string &client_id,
                     boost::optional<uint64_t> tag_class) {
   bufferlist bl;
-  ::encode(start_after_tag_tid, bl);
-  ::encode(max_return, bl);
-  ::encode(client_id, bl);
-  ::encode(tag_class, bl);
+  encode(start_after_tag_tid, bl);
+  encode(max_return, bl);
+  encode(client_id, bl);
+  encode(tag_class, bl);
   op->exec("journal", "tag_list", bl);
 }
 
 int tag_list_finish(bufferlist::iterator *iter,
                     std::set<cls::journal::Tag> *tags) {
   try {
-    ::decode(*tags, *iter);
+    decode(*tags, *iter);
   } catch (const buffer::error &err) {
     return -EBADMSG;
   }
@@ -487,7 +489,7 @@ int tag_list_finish(bufferlist::iterator *iter,
 
 void guard_append(librados::ObjectWriteOperation *op, uint64_t soft_max_size) {
   bufferlist bl;
-  ::encode(soft_max_size, bl);
+  encode(soft_max_size, bl);
   op->exec("journal", "guard_append", bl);
 }
 
index c8757e20a90a42a357c46857e76319a81d03dbcd..0714c4160df5ff1ef2a734e86ff19f46aa35c7c8 100644 (file)
@@ -10,17 +10,17 @@ namespace journal {
 
 void ObjectPosition::encode(bufferlist& bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(object_number, bl);
-  ::encode(tag_tid, bl);
-  ::encode(entry_tid, bl);
+  encode(object_number, bl);
+  encode(tag_tid, bl);
+  encode(entry_tid, bl);
   ENCODE_FINISH(bl);
 }
 
 void ObjectPosition::decode(bufferlist::iterator& iter) {
   DECODE_START(1, iter);
-  ::decode(object_number, iter);
-  ::decode(tag_tid, iter);
-  ::decode(entry_tid, iter);
+  decode(object_number, iter);
+  decode(tag_tid, iter);
+  decode(entry_tid, iter);
   DECODE_FINISH(iter);
 }
 
@@ -37,13 +37,13 @@ void ObjectPosition::generate_test_instances(std::list<ObjectPosition *> &o) {
 
 void ObjectSetPosition::encode(bufferlist& bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(object_positions, bl);
+  encode(object_positions, bl);
   ENCODE_FINISH(bl);
 }
 
 void ObjectSetPosition::decode(bufferlist::iterator& iter) {
   DECODE_START(1, iter);
-  ::decode(object_positions, iter);
+  decode(object_positions, iter);
   DECODE_FINISH(iter);
 }
 
@@ -65,21 +65,21 @@ void ObjectSetPosition::generate_test_instances(
 
 void Client::encode(bufferlist& bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(id, bl);
-  ::encode(data, bl);
-  ::encode(commit_position, bl);
-  ::encode(static_cast<uint8_t>(state), bl);
+  encode(id, bl);
+  encode(data, bl);
+  encode(commit_position, bl);
+  encode(static_cast<uint8_t>(state), bl);
   ENCODE_FINISH(bl);
 }
 
 void Client::decode(bufferlist::iterator& iter) {
   DECODE_START(1, iter);
-  ::decode(id, iter);
-  ::decode(data, iter);
-  ::decode(commit_position, iter);
+  decode(id, iter);
+  decode(data, iter);
+  decode(commit_position, iter);
 
   uint8_t state_raw;
-  ::decode(state_raw, iter);
+  decode(state_raw, iter);
   state = static_cast<ClientState>(state_raw);
   DECODE_FINISH(iter);
 }
@@ -109,17 +109,17 @@ void Client::generate_test_instances(std::list<Client *> &o) {
 
 void Tag::encode(bufferlist& bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(tid, bl);
-  ::encode(tag_class, bl);
-  ::encode(data, bl);
+  encode(tid, bl);
+  encode(tag_class, bl);
+  encode(data, bl);
   ENCODE_FINISH(bl);
 }
 
 void Tag::decode(bufferlist::iterator& iter) {
   DECODE_START(1, iter);
-  ::decode(tid, iter);
-  ::decode(tag_class, iter);
-  ::decode(data, iter);
+  decode(tid, iter);
+  decode(tag_class, iter);
+  decode(data, iter);
   DECODE_FINISH(iter);
 }
 
index f2cb841973f4327a7ed95a6208ea94d7b10bc688..289abd4b379cfc09f9331ee5e6bc387b822cb038 100644 (file)
@@ -151,7 +151,4 @@ std::ostream &operator<<(std::ostream &os, const Tag &tag);
 } // namespace journal
 } // namespace cls
 
-using cls::journal::encode;
-using cls::journal::decode;
-
 #endif // CEPH_CLS_JOURNAL_TYPES_H
index 32c70143f5730130e718f4d2d97ff5d8c830da88..99ab3a6837fa67f1bcf75311f3f952af5fb0502c 100644 (file)
@@ -84,6 +84,7 @@ static int read_lock(cls_method_context_t hctx, const string& name, lock_info_t
 
 static int write_lock(cls_method_context_t hctx, const string& name, const lock_info_t& lock)
 {
+  using ceph::encode;
   string key = LOCK_PREFIX;
   key.append(name);
 
@@ -214,7 +215,7 @@ static int lock_op(cls_method_context_t hctx,
   cls_lock_lock_op op;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -279,7 +280,7 @@ static int unlock_op(cls_method_context_t hctx,
   cls_lock_unlock_op op;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error& err) {
     return -EINVAL;
   }
@@ -307,7 +308,7 @@ static int break_lock(cls_method_context_t hctx,
   cls_lock_break_op op;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error& err) {
     return -EINVAL;
   }
@@ -333,7 +334,7 @@ static int get_info(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   cls_lock_get_info_op op;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error& err) {
     return -EINVAL;
   }
@@ -355,7 +356,7 @@ static int get_info(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   ret.lock_type = linfo.lock_type;
   ret.tag = linfo.tag;
 
-  ::encode(ret, *out, cls_get_client_features(hctx));
+  encode(ret, *out, cls_get_client_features(hctx));
 
   return 0;
 }
@@ -393,7 +394,7 @@ static int list_locks(cls_method_context_t hctx, bufferlist *in, bufferlist *out
     }
   }
 
-  ::encode(ret, *out);
+  encode(ret, *out);
 
   return 0;
 }
@@ -416,7 +417,7 @@ int assert_locked(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   cls_lock_assert_op op;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error& err) {
     return -EINVAL;
   }
@@ -488,7 +489,7 @@ int set_cookie(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   cls_lock_set_cookie_op op;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error& err) {
     return -EINVAL;
   }
index 3a3cef367947875b2b5b7db29d52a9412a6d0e99..0e64ff914a464b57574c0c3c19c4c3f26dbc70bd 100644 (file)
@@ -41,7 +41,7 @@ namespace rados {
         op.duration = duration;
         op.flags = flags;
         bufferlist in;
-        ::encode(op, in);
+        encode(op, in);
         rados_op->exec("lock", "lock", in);
       }
 
@@ -64,7 +64,7 @@ namespace rados {
         op.name = name;
         op.cookie = cookie;
         bufferlist in;
-        ::encode(op, in);
+        encode(op, in);
 
         rados_op->exec("lock", "unlock", in);
       }
@@ -95,7 +95,7 @@ namespace rados {
         op.cookie = cookie;
         op.locker = locker;
         bufferlist in;
-        ::encode(op, in);
+        encode(op, in);
         rados_op->exec("lock", "break_lock", in);
       }
 
@@ -118,7 +118,7 @@ namespace rados {
         cls_lock_list_locks_reply ret;
         bufferlist::iterator iter = out.begin();
         try {
-          ::decode(ret, iter);
+          decode(ret, iter);
         } catch (buffer::error& err) {
          return -EBADMSG;
         }
@@ -134,7 +134,7 @@ namespace rados {
         bufferlist in;
         cls_lock_get_info_op op;
         op.name = name;
-        ::encode(op, in);
+        encode(op, in);
         rados_op->exec("lock", "get_info", in);
       }
 
@@ -144,7 +144,7 @@ namespace rados {
       {
         cls_lock_get_info_reply ret;
         try {
-          ::decode(ret, *iter);
+          decode(ret, *iter);
         } catch (buffer::error& err) {
          return -EBADMSG;
         }
@@ -188,7 +188,7 @@ namespace rados {
         op.cookie = cookie;
         op.tag = tag;
         bufferlist in;
-        ::encode(op, in);
+        encode(op, in);
         rados_op->exec("lock", "assert_locked", in);
       }
 
@@ -204,7 +204,7 @@ namespace rados {
         op.tag = tag;
         op.new_cookie = new_cookie;
         bufferlist in;
-        ::encode(op, in);
+        encode(op, in);
         rados_op->exec("lock", "set_cookie", in);
       }
 
index dbdddfe21407d5182673e4599c689f630fc76dec..68805b7ba163ffb5d43f894383a7a7bbc1e58a09 100644 (file)
@@ -19,27 +19,27 @@ struct cls_lock_lock_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(name, bl);
+    encode(name, bl);
     uint8_t t = (uint8_t)type;
-    ::encode(t, bl);
-    ::encode(cookie, bl);
-    ::encode(tag, bl);
-    ::encode(description, bl);
-    ::encode(duration, bl);
-    ::encode(flags, bl);
+    encode(t, bl);
+    encode(cookie, bl);
+    encode(tag, bl);
+    encode(description, bl);
+    encode(duration, bl);
+    encode(flags, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(name, bl);
+    decode(name, bl);
     uint8_t t;
-    ::decode(t, bl);
+    decode(t, bl);
     type = (ClsLockType)t;
-    ::decode(cookie, bl);
-    ::decode(tag, bl);
-    ::decode(description, bl);
-    ::decode(duration, bl);
-    ::decode(flags, bl);
+    decode(cookie, bl);
+    decode(tag, bl);
+    decode(description, bl);
+    decode(duration, bl);
+    decode(flags, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -56,14 +56,14 @@ struct cls_lock_unlock_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(name, bl);
-    ::encode(cookie, bl);
+    encode(name, bl);
+    encode(cookie, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(name, bl);
-    ::decode(cookie, bl);
+    decode(name, bl);
+    decode(cookie, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -81,16 +81,16 @@ struct cls_lock_break_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(name, bl);
-    ::encode(locker, bl);
-    ::encode(cookie, bl);
+    encode(name, bl);
+    encode(locker, bl);
+    encode(cookie, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(name, bl);
-    ::decode(locker, bl);
-    ::decode(cookie, bl);
+    decode(name, bl);
+    decode(locker, bl);
+    decode(cookie, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -106,12 +106,12 @@ struct cls_lock_get_info_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(name, bl);
+    encode(name, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(name, bl);
+    decode(name, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -129,19 +129,19 @@ struct cls_lock_get_info_reply
 
   void encode(bufferlist &bl, uint64_t features) const {
     ENCODE_START(1, 1, bl);
-    ::encode(lockers, bl, features);
+    encode(lockers, bl, features);
     uint8_t t = (uint8_t)lock_type;
-    ::encode(t, bl);
-    ::encode(tag, bl);
+    encode(t, bl);
+    encode(tag, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(lockers, bl);
+    decode(lockers, bl);
     uint8_t t;
-    ::decode(t, bl);
+    decode(t, bl);
     lock_type = (ClsLockType)t; 
-    ::decode(tag, bl);
+    decode(tag, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -157,12 +157,12 @@ struct cls_lock_list_locks_reply
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(locks, bl);
+    encode(locks, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(locks, bl);
+    decode(locks, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -181,21 +181,21 @@ struct cls_lock_assert_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(name, bl);
+    encode(name, bl);
     uint8_t t = (uint8_t)type;
-    ::encode(t, bl);
-    ::encode(cookie, bl);
-    ::encode(tag, bl);
+    encode(t, bl);
+    encode(cookie, bl);
+    encode(tag, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(name, bl);
+    decode(name, bl);
     uint8_t t;
-    ::decode(t, bl);
+    decode(t, bl);
     type = (ClsLockType)t;
-    ::decode(cookie, bl);
-    ::decode(tag, bl);
+    decode(cookie, bl);
+    decode(tag, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -215,23 +215,23 @@ struct cls_lock_set_cookie_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(name, bl);
+    encode(name, bl);
     uint8_t t = (uint8_t)type;
-    ::encode(t, bl);
-    ::encode(cookie, bl);
-    ::encode(tag, bl);
-    ::encode(new_cookie, bl);
+    encode(t, bl);
+    encode(cookie, bl);
+    encode(tag, bl);
+    encode(new_cookie, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(name, bl);
+    decode(name, bl);
     uint8_t t;
-    ::decode(t, bl);
+    decode(t, bl);
     type = (ClsLockType)t;
-    ::decode(cookie, bl);
-    ::decode(tag, bl);
-    ::decode(new_cookie, bl);
+    decode(cookie, bl);
+    decode(tag, bl);
+    decode(new_cookie, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
index e28a312d1066745a7e38815a4966f32af25ddbf8..064a64d8964dc0b38168551efe429d9767fc0d71 100644 (file)
@@ -15,7 +15,7 @@ enum ClsLockType {
   LOCK_SHARED    = 2,
 };
 
-static inline const char *cls_lock_type_str(ClsLockType type)
+inline const char *cls_lock_type_str(ClsLockType type)
 {
     switch (type) {
       case LOCK_NONE:
@@ -45,14 +45,14 @@ namespace rados {
 
         void encode(bufferlist &bl) const {
           ENCODE_START(1, 1, bl);
-          ::encode(locker, bl);
-          ::encode(cookie, bl);
+          encode(locker, bl);
+          encode(cookie, bl);
           ENCODE_FINISH(bl);
         }
         void decode(bufferlist::iterator &bl) {
           DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-          ::decode(locker, bl);
-          ::decode(cookie, bl);
+          decode(locker, bl);
+          decode(cookie, bl);
           DECODE_FINISH(bl);
         }
 
@@ -66,7 +66,7 @@ namespace rados {
         void dump(Formatter *f) const;
         static void generate_test_instances(list<locker_id_t*>& o);
       };
-      WRITE_CLASS_ENCODER(rados::cls::lock::locker_id_t)
+      WRITE_CLASS_ENCODER(locker_id_t)
 
       struct locker_info_t
       {
@@ -80,22 +80,22 @@ namespace rados {
 
         void encode(bufferlist &bl, uint64_t features) const {
           ENCODE_START(1, 1, bl);
-          ::encode(expiration, bl);
-          ::encode(addr, bl, features);
-          ::encode(description, bl);
+          encode(expiration, bl);
+          encode(addr, bl, features);
+          encode(description, bl);
           ENCODE_FINISH(bl);
         }
         void decode(bufferlist::iterator &bl) {
           DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-          ::decode(expiration, bl);
-          ::decode(addr, bl);
-          ::decode(description, bl);
+          decode(expiration, bl);
+          decode(addr, bl);
+          decode(description, bl);
           DECODE_FINISH(bl);
         }
         void dump(Formatter *f) const;
         static void generate_test_instances(list<locker_info_t *>& o);
       };
-      WRITE_CLASS_ENCODER_FEATURES(rados::cls::lock::locker_info_t)
+      WRITE_CLASS_ENCODER_FEATURES(locker_info_t)
 
       struct lock_info_t {
         map<locker_id_t, locker_info_t> lockers; // map of lockers
@@ -106,26 +106,26 @@ namespace rados {
 
         void encode(bufferlist &bl, uint64_t features) const {
           ENCODE_START(1, 1, bl);
-          ::encode(lockers, bl, features);
+          encode(lockers, bl, features);
           uint8_t t = (uint8_t)lock_type;
-          ::encode(t, bl);
-          ::encode(tag, bl);
+          encode(t, bl);
+          encode(tag, bl);
           ENCODE_FINISH(bl);
         }
         void decode(bufferlist::iterator &bl) {
           DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-          ::decode(lockers, bl);
+          decode(lockers, bl);
           uint8_t t;
-          ::decode(t, bl);
+          decode(t, bl);
           lock_type = (ClsLockType)t;
-          ::decode(tag, bl);
+          decode(tag, bl);
           DECODE_FINISH(bl);
         }
         lock_info_t() : lock_type(LOCK_NONE) {}
         void dump(Formatter *f) const;
         static void generate_test_instances(list<lock_info_t *>& o);
       };
-      WRITE_CLASS_ENCODER_FEATURES(rados::cls::lock::lock_info_t)
+      WRITE_CLASS_ENCODER_FEATURES(lock_info_t);
     }
   }
 }
index c7ed1f5bfa0b0e563a50d44449e73450d28daf26..fd94a2fd16f2127698f3d9b1b9eb287f7fbd8544 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include "include/types.h"
@@ -20,7 +20,7 @@ static string log_index_prefix = "1_";
 static int write_log_entry(cls_method_context_t hctx, string& index, cls_log_entry& entry)
 {
   bufferlist bl;
-  ::encode(entry, bl);
+  encode(entry, bl);
 
   int ret = cls_cxx_map_set_val(hctx, index, &bl);
   if (ret < 0)
@@ -52,7 +52,7 @@ static int read_header(cls_method_context_t hctx, cls_log_header& header)
 
   bufferlist::iterator iter = header_bl.begin();
   try {
-    ::decode(header, iter);
+    decode(header, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: read_header(): failed to decode header");
   }
@@ -63,7 +63,7 @@ static int read_header(cls_method_context_t hctx, cls_log_header& header)
 static int write_header(cls_method_context_t hctx, cls_log_header& header)
 {
   bufferlist header_bl;
-  ::encode(header, header_bl);
+  encode(header, header_bl);
 
   int ret = cls_cxx_map_write_header(hctx, &header_bl);
   if (ret < 0)
@@ -89,7 +89,7 @@ static int cls_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist *ou
 
   cls_log_add_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_log_add_op(): failed to decode op");
     return -EINVAL;
@@ -144,7 +144,7 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o
 
   cls_log_list_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_log_list_op(): failed to decode op");
     return -EINVAL;
@@ -193,7 +193,7 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o
     bufferlist::iterator biter = bl.begin();
     try {
       cls_log_entry e;
-      ::decode(e, biter);
+      decode(e, biter);
       entries.push_back(e);
     } catch (buffer::error& err) {
       CLS_LOG(0, "ERROR: cls_log_list: could not decode entry, index=%s", index.c_str());
@@ -202,7 +202,7 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o
 
   ret.marker = marker;
 
-  ::encode(ret, *out);
+  encode(ret, *out);
 
   return 0;
 }
@@ -214,7 +214,7 @@ static int cls_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlist *o
 
   cls_log_trim_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: cls_log_list_op(): failed to decode entry");
     return -EINVAL;
@@ -277,7 +277,7 @@ static int cls_log_info(cls_method_context_t hctx, bufferlist *in, bufferlist *o
 
   cls_log_info_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_log_add_op(): failed to decode op");
     return -EINVAL;
@@ -289,7 +289,7 @@ static int cls_log_info(cls_method_context_t hctx, bufferlist *in, bufferlist *o
   if (rc < 0)
     return rc;
 
-  ::encode(ret, *out);
+  encode(ret, *out);
 
   return 0;
 }
index 0aa6e16d4a03508e621bdb91a9994c105e4d02ad..ac9ad2844dc31d07ff6e02311e911176cb60d4c0 100644 (file)
@@ -14,7 +14,7 @@ void cls_log_add(librados::ObjectWriteOperation& op, list<cls_log_entry>& entrie
   bufferlist in;
   cls_log_add_op call;
   call.entries = entries;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("log", "add", in);
 }
 
@@ -23,7 +23,7 @@ void cls_log_add(librados::ObjectWriteOperation& op, cls_log_entry& entry)
   bufferlist in;
   cls_log_add_op call;
   call.entries.push_back(entry);
-  ::encode(call, in);
+  encode(call, in);
   op.exec("log", "add", in);
 }
 
@@ -54,7 +54,7 @@ void cls_log_trim(librados::ObjectWriteOperation& op, const utime_t& from_time,
   call.to_time = to_time;
   call.from_marker = from_marker;
   call.to_marker = to_marker;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("log", "trim", in);
 }
 
@@ -92,7 +92,7 @@ public:
       cls_log_list_ret ret;
       try {
         bufferlist::iterator iter = outbl.begin();
-        ::decode(ret, iter);
+        decode(ret, iter);
         if (entries)
           *entries = std::move(ret.entries);
         if (truncated)
@@ -118,7 +118,7 @@ void cls_log_list(librados::ObjectReadOperation& op, utime_t& from, utime_t& to,
   call.marker = in_marker;
   call.max_entries = max_entries;
 
-  ::encode(call, inbl);
+  encode(call, inbl);
 
   op.exec("log", "list", inbl, new LogListCtx(&entries, out_marker, truncated));
 }
@@ -132,7 +132,7 @@ public:
       cls_log_info_ret ret;
       try {
         bufferlist::iterator iter = outbl.begin();
-        ::decode(ret, iter);
+        decode(ret, iter);
         if (header)
          *header = ret.header;
       } catch (buffer::error& err) {
@@ -147,7 +147,7 @@ void cls_log_info(librados::ObjectReadOperation& op, cls_log_header *header)
   bufferlist inbl;
   cls_log_info_op call;
 
-  ::encode(call, inbl);
+  encode(call, inbl);
 
   op.exec("log", "info", inbl, new LogInfoCtx(header));
 }
index 67dfcd5c5ece798158776bb3dbf59d126ad4a589..514b2b82039dd0636bca23220fad111708784fb7 100644 (file)
@@ -14,16 +14,16 @@ struct cls_log_add_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 1, bl);
-    ::encode(entries, bl);
-    ::encode(monotonic_inc, bl);
+    encode(entries, bl);
+    encode(monotonic_inc, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(2, bl);
-    ::decode(entries, bl);
+    decode(entries, bl);
     if (struct_v >= 2) {
-      ::decode(monotonic_inc, bl);
+      decode(monotonic_inc, bl);
     }
     DECODE_FINISH(bl);
   }
@@ -41,19 +41,19 @@ struct cls_log_list_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(from_time, bl);
-    ::encode(marker, bl);
-    ::encode(to_time, bl);
-    ::encode(max_entries, bl);
+    encode(from_time, bl);
+    encode(marker, bl);
+    encode(to_time, bl);
+    encode(max_entries, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(from_time, bl);
-    ::decode(marker, bl);
-    ::decode(to_time, bl);
-    ::decode(max_entries, bl);
+    decode(from_time, bl);
+    decode(marker, bl);
+    decode(to_time, bl);
+    decode(max_entries, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -68,17 +68,17 @@ struct cls_log_list_ret {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(entries, bl);
-    ::encode(marker, bl);
-    ::encode(truncated, bl);
+    encode(entries, bl);
+    encode(marker, bl);
+    encode(truncated, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(entries, bl);
-    ::decode(marker, bl);
-    ::decode(truncated, bl);
+    decode(entries, bl);
+    decode(marker, bl);
+    decode(truncated, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -99,20 +99,20 @@ struct cls_log_trim_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 1, bl);
-    ::encode(from_time, bl);
-    ::encode(to_time, bl);
-    ::encode(from_marker, bl);
-    ::encode(to_marker, bl);
+    encode(from_time, bl);
+    encode(to_time, bl);
+    encode(from_marker, bl);
+    encode(to_marker, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(2, bl);
-    ::decode(from_time, bl);
-    ::decode(to_time, bl);
+    decode(from_time, bl);
+    decode(to_time, bl);
     if (struct_v >= 2) {
-    ::decode(from_marker, bl);
-    ::decode(to_marker, bl);
+    decode(from_marker, bl);
+    decode(to_marker, bl);
     }
     DECODE_FINISH(bl);
   }
@@ -141,13 +141,13 @@ struct cls_log_info_ret {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(header, bl);
+    encode(header, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(header, bl);
+    decode(header, bl);
     DECODE_FINISH(bl);
   }
 };
index 7d9679488ddcd398a453e6e934583679de72912a..482048bcdb32d5c8e2335f823b1d4b51c7facddc 100644 (file)
@@ -20,22 +20,22 @@ struct cls_log_entry {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 1, bl);
-    ::encode(section, bl);
-    ::encode(name, bl);
-    ::encode(timestamp, bl);
-    ::encode(data, bl);
-    ::encode(id, bl);
+    encode(section, bl);
+    encode(name, bl);
+    encode(timestamp, bl);
+    encode(data, bl);
+    encode(id, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(2, bl);
-    ::decode(section, bl);
-    ::decode(name, bl);
-    ::decode(timestamp, bl);
-    ::decode(data, bl);
+    decode(section, bl);
+    decode(name, bl);
+    decode(timestamp, bl);
+    decode(data, bl);
     if (struct_v >= 2)
-      ::decode(id, bl);
+      decode(id, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -47,15 +47,15 @@ struct cls_log_header {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(max_marker, bl);
-    ::encode(max_time, bl);
+    encode(max_marker, bl);
+    encode(max_time, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(max_marker, bl);
-    ::decode(max_time, bl);
+    decode(max_marker, bl);
+    decode(max_time, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -63,5 +63,3 @@ WRITE_CLASS_ENCODER(cls_log_header)
 
 
 #endif
-
-
index 3c84570c5dfbf4b3108161d898473aed8bffadca..f4d24c2761870b6a254f14b997cde529c871c6df 100644 (file)
@@ -866,7 +866,7 @@ static int clslua_eval(lua_State *L)
 
         try {
           bufferlist::iterator it = ctx->inbl->begin();
-          ::decode(op, it);
+          decode(op, it);
         } catch (const buffer::error &err) {
           CLS_ERR("error: could not decode ceph encoded input");
           ctx->ret = -EINVAL;
index 44348270c80c4001095b3c7b29f74d3c220b4125..0e6544a269370f621f68ec05e077adddf9c77209 100644 (file)
@@ -27,7 +27,7 @@ namespace cls_lua_client {
     op.input = input;
 
     bufferlist inbl;
-    ::encode(op, inbl);
+    encode(op, inbl);
 
     return ioctx.exec(oid, "lua", "eval_bufferlist", inbl, output);
   }
index 2bf95051d34c3b25da3011d9b8a288cfe17e8fbf..d516ee1b27e0e5c62693608c453ca409e017ab67 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef CEPH_CLS_LUA_OPS_H
 #define CEPH_CLS_LUA_OPS_H
 
+#include <string>
+
+#include "include/encoding.h"
+
 struct cls_lua_eval_op {
   std::string script;
   std::string handler;
@@ -8,17 +12,17 @@ struct cls_lua_eval_op {
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(script, bl);
-    ::encode(handler, bl);
-    ::encode(input, bl);
+    encode(script, bl);
+    encode(handler, bl);
+    encode(input, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(script, bl);
-    ::decode(handler, bl);
-    ::decode(input, bl);
+    decode(script, bl);
+    decode(handler, bl);
+    decode(input, bl);
     DECODE_FINISH(bl);
   }
 };
index 968966c27854e29ef524a01f560b907183c3f200..4ade9cf7d51afada03442af84096ca15f2079ce0 100644 (file)
@@ -37,8 +37,8 @@ static int add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(key, iter);
-    ::decode(diff_str, iter);
+    decode(key, iter);
+    decode(diff_str, iter);
   } catch (const buffer::error &err) {
     CLS_LOG(20, "add: invalid decode of input");
     return -EINVAL;
@@ -92,8 +92,8 @@ static int mul(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(key, iter);
-    ::decode(diff_str, iter);
+    decode(key, iter);
+    decode(diff_str, iter);
   } catch (const buffer::error &err) {
     CLS_LOG(20, "add: invalid decode of input");
     return -EINVAL;
index c91d5692b2c21b29852afdeec2ba7bd169544912..fa1a69f2e22420c3cd0a3c0fa243befd744a1d4a 100644 (file)
@@ -29,12 +29,12 @@ namespace rados {
               double value_to_add)
       {
         bufferlist in, out;
-        ::encode(key, in);
+        encode(key, in);
 
         std::stringstream stream;
         stream << value_to_add;
 
-        ::encode(stream.str(), in);
+        encode(stream.str(), in);
 
         return ioctx->exec(oid, "numops", "add", in, out);
       }
@@ -53,12 +53,12 @@ namespace rados {
               double value_to_multiply)
       {
         bufferlist in, out;
-        ::encode(key, in);
+        encode(key, in);
 
         std::stringstream stream;
         stream << value_to_multiply;
 
-        ::encode(stream.str(), in);
+        encode(stream.str(), in);
 
         return ioctx->exec(oid, "numops", "mul", in, out);
       }
index 3932180a841a1bab5e53fa27e1c5576d07ade6f8..2177d868228035872a143019c6db8eb499103938 100644 (file)
@@ -132,7 +132,7 @@ static int read_key(cls_method_context_t hctx, const string &key, T *out)
 
   try {
     bufferlist::iterator it = bl.begin();
-    ::decode(*out, it);
+    decode(*out, it);
   } catch (const buffer::error &err) {
     CLS_ERR("error decoding %s", key.c_str());
     return -EIO;
@@ -188,12 +188,12 @@ int create(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(size, iter);
-    ::decode(order, iter);
-    ::decode(features, iter);
-    ::decode(object_prefix, iter);
+    decode(size, iter);
+    decode(order, iter);
+    decode(features, iter);
+    decode(object_prefix, iter);
     if (!iter.end()) {
-      ::decode(data_pool_id, iter);
+      decode(data_pool_id, iter);
     }
   } catch (const buffer::error &err) {
     return -EINVAL;
@@ -226,12 +226,12 @@ int create(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   bufferlist create_timestampbl;
   uint64_t snap_seq = 0;
   utime_t create_timestamp = ceph_clock_now();
-  ::encode(size, sizebl);
-  ::encode(order, orderbl);
-  ::encode(features, featuresbl);
-  ::encode(object_prefix, object_prefixbl);
-  ::encode(snap_seq, snap_seqbl);
-  ::encode(create_timestamp, create_timestampbl);
+  encode(size, sizebl);
+  encode(order, orderbl);
+  encode(features, featuresbl);
+  encode(object_prefix, object_prefixbl);
+  encode(snap_seq, snap_seqbl);
+  encode(create_timestamp, create_timestampbl);
 
   map<string, bufferlist> omap_vals;
   omap_vals["size"] = sizebl;
@@ -248,7 +248,7 @@ int create(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     }
 
     bufferlist data_pool_id_bl;
-    ::encode(data_pool_id, data_pool_id_bl);
+    encode(data_pool_id, data_pool_id_bl);
     omap_vals["data_pool_id"] = data_pool_id_bl;
   } else if (data_pool_id != -1) {
     CLS_ERR("data pool provided with feature disabled");
@@ -279,9 +279,9 @@ int get_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(snap_id, iter);
+    decode(snap_id, iter);
     if (!iter.end()) {
-      ::decode(read_only, iter);
+      decode(read_only, iter);
     }
   } catch (const buffer::error &err) {
     return -EINVAL;
@@ -312,8 +312,8 @@ int get_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   uint64_t incompatible = (read_only ? features & RBD_FEATURES_INCOMPATIBLE :
                                       features & RBD_FEATURES_RW_INCOMPATIBLE);
-  ::encode(features, *out);
-  ::encode(incompatible, *out);
+  encode(features, *out);
+  encode(incompatible, *out);
   return 0;
 }
 
@@ -335,8 +335,8 @@ int set_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   uint64_t mask;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(features, iter);
-    ::decode(mask, iter);
+    decode(features, iter);
+    decode(mask, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -374,7 +374,7 @@ int set_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
           features, orig_features);
 
   bufferlist bl;
-  ::encode(features, bl);
+  encode(features, bl);
   r = cls_cxx_map_set_val(hctx, "features", &bl);
   if (r < 0) {
     CLS_ERR("error updating features: %s", cpp_strerror(r).c_str());
@@ -422,7 +422,7 @@ int get_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(snap_id, iter);
+    decode(snap_id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -452,8 +452,8 @@ int get_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     size = snap.image_size;
   }
 
-  ::encode(order, *out);
-  ::encode(size, *out);
+  encode(order, *out);
+  encode(size, *out);
 
   return 0;
 }
@@ -471,7 +471,7 @@ int set_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(size, iter);
+    decode(size, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -489,7 +489,7 @@ int set_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
           (unsigned long long)orig_size);
 
   bufferlist sizebl;
-  ::encode(size, sizebl);
+  encode(size, sizebl);
   r = cls_cxx_map_set_val(hctx, "size", &sizebl);
   if (r < 0) {
     CLS_ERR("error writing snapshot metadata: %s", cpp_strerror(r).c_str());
@@ -508,7 +508,7 @@ int set_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     if (parent.exists() && parent.overlap > size) {
       bufferlist parentbl;
       parent.overlap = size;
-      ::encode(parent, parentbl);
+      encode(parent, parentbl);
       r = cls_cxx_map_set_val(hctx, "parent", &parentbl);
       if (r < 0) {
        CLS_ERR("error writing parent: %s", cpp_strerror(r).c_str());
@@ -552,7 +552,7 @@ int get_protection_status(cls_method_context_t hctx, bufferlist *in,
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(snap_id, iter);
+    decode(snap_id, iter);
   } catch (const buffer::error &err) {
     CLS_LOG(20, "get_protection_status: invalid decode");
     return -EINVAL;
@@ -583,7 +583,7 @@ int get_protection_status(cls_method_context_t hctx, bufferlist *in,
     return -EIO;
   }
 
-  ::encode(snap.protection_status, *out);
+  encode(snap.protection_status, *out);
   return 0;
 }
 
@@ -606,8 +606,8 @@ int set_protection_status(cls_method_context_t hctx, bufferlist *in,
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(snap_id, iter);
-    ::decode(status, iter);
+    decode(snap_id, iter);
+    decode(status, iter);
   } catch (const buffer::error &err) {
     CLS_LOG(20, "set_protection_status: invalid decode");
     return -EINVAL;
@@ -646,7 +646,7 @@ int set_protection_status(cls_method_context_t hctx, bufferlist *in,
 
   snap.protection_status = status;
   bufferlist snapshot_bl;
-  ::encode(snap, snapshot_bl);
+  encode(snap, snapshot_bl);
   r = cls_cxx_map_set_val(hctx, snapshot_key, &snapshot_bl);
   if (r < 0) {
     CLS_ERR("error writing snapshot metadata: %s", cpp_strerror(r).c_str());
@@ -703,8 +703,8 @@ int get_stripe_unit_count(cls_method_context_t hctx, bufferlist *in, bufferlist
   if (r < 0)
     return r;
 
-  ::encode(stripe_unit, *out);
-  ::encode(stripe_count, *out);
+  encode(stripe_unit, *out);
+  encode(stripe_count, *out);
   return 0;
 }
 
@@ -723,8 +723,8 @@ int set_stripe_unit_count(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(stripe_unit, iter);
-    ::decode(stripe_count, iter);
+    decode(stripe_unit, iter);
+    decode(stripe_count, iter);
   } catch (const buffer::error &err) {
     CLS_LOG(20, "set_stripe_unit_count: invalid decode");
     return -EINVAL;
@@ -756,14 +756,14 @@ int set_stripe_unit_count(cls_method_context_t hctx, bufferlist *in, bufferlist
   }
 
   bufferlist bl, bl2;
-  ::encode(stripe_unit, bl);
+  encode(stripe_unit, bl);
   r = cls_cxx_map_set_val(hctx, "stripe_unit", &bl);
   if (r < 0) {
     CLS_ERR("error writing stripe_unit metadata: %s", cpp_strerror(r).c_str());
     return r;
   }
 
-  ::encode(stripe_count, bl2);
+  encode(stripe_count, bl2);
   r = cls_cxx_map_set_val(hctx, "stripe_count", &bl2);
   if (r < 0) {
     CLS_ERR("error writing stripe_count metadata: %s", cpp_strerror(r).c_str());
@@ -788,14 +788,14 @@ int get_create_timestamp(cls_method_context_t hctx, bufferlist *in, bufferlist *
   } else {
     try {
       bufferlist::iterator it = bl.begin();
-      ::decode(timestamp, it);
+      decode(timestamp, it);
     } catch (const buffer::error &err) {
       CLS_ERR("could not decode create_timestamp");
       return -EIO;
     }
   }
 
-  ::encode(timestamp, *out);
+  encode(timestamp, *out);
   return 0;
 }
 
@@ -815,7 +815,7 @@ int get_flags(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   uint64_t snap_id;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(snap_id, iter);
+    decode(snap_id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -840,7 +840,7 @@ int get_flags(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     flags = snap.flags;
   }
 
-  ::encode(flags, *out);
+  encode(flags, *out);
   return 0;
 }
 
@@ -864,10 +864,10 @@ int set_flags(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   uint64_t snap_id = CEPH_NOSNAP;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(flags, iter);
-    ::decode(mask, iter);
+    decode(flags, iter);
+    decode(mask, iter);
     if (!iter.end()) {
-      ::decode(snap_id, iter);
+      decode(snap_id, iter);
     }
   } catch (const buffer::error &err) {
     return -EINVAL;
@@ -904,13 +904,13 @@ int set_flags(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   if (snap_id == CEPH_NOSNAP) {
     bufferlist bl;
-    ::encode(flags, bl);
+    encode(flags, bl);
     r = cls_cxx_map_set_val(hctx, "flags", &bl);
   } else {
     snap_meta.flags = flags;
 
     bufferlist bl;
-    ::encode(snap_meta, bl);
+    encode(snap_meta, bl);
     r = cls_cxx_map_set_val(hctx, snap_meta_key, &bl);
   }
 
@@ -941,7 +941,7 @@ int get_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(snap_id, iter);
+    decode(snap_id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -970,10 +970,10 @@ int get_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     }
   }
 
-  ::encode(parent.pool, *out);
-  ::encode(parent.id, *out);
-  ::encode(parent.snapid, *out);
-  ::encode(parent.overlap, *out);
+  encode(parent.pool, *out);
+  encode(parent.id, *out);
+  encode(parent.snapid, *out);
+  encode(parent.overlap, *out);
   return 0;
 }
 
@@ -997,10 +997,10 @@ int set_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(pool, iter);
-    ::decode(id, iter);
-    ::decode(snapid, iter);
-    ::decode(size, iter);
+    decode(pool, iter);
+    decode(id, iter);
+    decode(snapid, iter);
+    decode(size, iter);
   } catch (const buffer::error &err) {
     CLS_LOG(20, "cls_rbd::set_parent: invalid decode");
     return -EINVAL;
@@ -1048,7 +1048,7 @@ int set_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   parent.id = id;
   parent.snapid = snapid;
   parent.overlap = MIN(our_size, size);
-  ::encode(parent, parentbl);
+  encode(parent, parentbl);
   r = cls_cxx_map_set_val(hctx, "parent", &parentbl);
   if (r < 0) {
     CLS_ERR("error writing parent: %s", cpp_strerror(r).c_str());
@@ -1114,7 +1114,7 @@ int remove_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
         snap_meta.parent = cls_rbd_parent();
 
         bufferlist bl;
-        ::encode(snap_meta, bl);
+        encode(snap_meta, bl);
         r = cls_cxx_map_set_val(hctx, *it, &bl);
         if (r < 0) {
           CLS_ERR("Could not update snapshot: snap_id=%" PRIu64 ": %s",
@@ -1150,9 +1150,9 @@ static int decode_parent_common(bufferlist::iterator& it, uint64_t *pool_id,
                                string *image_id, snapid_t *snap_id)
 {
   try {
-    ::decode(*pool_id, it);
-    ::decode(*image_id, it);
-    ::decode(*snap_id, it);
+    decode(*pool_id, it);
+    decode(*image_id, it);
+    decode(*snap_id, it);
   } catch (const buffer::error &err) {
     CLS_ERR("error decoding parent spec");
     return -EINVAL;
@@ -1176,7 +1176,7 @@ static int decode_parent_and_child(bufferlist *in, uint64_t *pool_id,
   if (r < 0)
     return r;
   try {
-    ::decode(*c_image_id, it);
+    decode(*c_image_id, it);
   } catch (const buffer::error &err) {
     CLS_ERR("error decoding child image id");
     return -EINVAL;
@@ -1187,9 +1187,9 @@ static int decode_parent_and_child(bufferlist *in, uint64_t *pool_id,
 static string parent_key(uint64_t pool_id, string image_id, snapid_t snap_id)
 {
   bufferlist key_bl;
-  ::encode(pool_id, key_bl);
-  ::encode(image_id, key_bl);
-  ::encode(snap_id, key_bl);
+  encode(pool_id, key_bl);
+  encode(image_id, key_bl);
+  encode(snap_id, key_bl);
   return string(key_bl.c_str(), key_bl.length());
 }
 
@@ -1244,7 +1244,7 @@ int add_child(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   // write back
   bufferlist childbl;
-  ::encode(children, childbl);
+  encode(children, childbl);
   r = cls_cxx_map_set_val(hctx, key, &childbl);
   if (r < 0)
     CLS_LOG(20, "add_child: omap write failed: %s", cpp_strerror(r).c_str());
@@ -1306,7 +1306,7 @@ int remove_child(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   } else {
     // write back shortened children list
     bufferlist childbl;
-    ::encode(children, childbl);
+    encode(children, childbl);
     r = cls_cxx_map_set_val(hctx, key, &childbl);
     if (r < 0)
       CLS_LOG(20, "remove_child: write omap failed: %s", cpp_strerror(r).c_str());
@@ -1349,7 +1349,7 @@ int get_children(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       CLS_LOG(20, "get_children: read omap failed: %s", cpp_strerror(r).c_str());
     return r;
   }
-  ::encode(children, *out);
+  encode(children, *out);
   return 0;
 }
 
@@ -1400,8 +1400,8 @@ int get_snapcontext(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   // snap_ids must be descending in a snap context
   std::reverse(snap_ids.begin(), snap_ids.end());
 
-  ::encode(snap_seq, *out);
-  ::encode(snap_ids, *out);
+  encode(snap_seq, *out);
+  encode(snap_ids, *out);
 
   return 0;
 }
@@ -1423,7 +1423,7 @@ int get_object_prefix(cls_method_context_t hctx, bufferlist *in, bufferlist *out
     return r;
   }
 
-  ::encode(object_prefix, *out);
+  encode(object_prefix, *out);
 
   return 0;
 }
@@ -1449,7 +1449,7 @@ int get_data_pool(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     return r;
   }
 
-  ::encode(data_pool_id, *out);
+  encode(data_pool_id, *out);
   return 0;
 }
 
@@ -1459,7 +1459,7 @@ int get_snapshot_name(cls_method_context_t hctx, bufferlist *in, bufferlist *out
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(snap_id, iter);
+    decode(snap_id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -1476,7 +1476,7 @@ int get_snapshot_name(cls_method_context_t hctx, bufferlist *in, bufferlist *out
   if (r < 0)
     return r;
 
-  ::encode(snap.name, *out);
+  encode(snap.name, *out);
 
   return 0;
 }
@@ -1487,7 +1487,7 @@ int get_snapshot_timestamp(cls_method_context_t hctx, bufferlist *in, bufferlist
   
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(snap_id, iter);
+    decode(snap_id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -1506,7 +1506,7 @@ int get_snapshot_timestamp(cls_method_context_t hctx, bufferlist *in, bufferlist
     return r;
   }
 
-  ::encode(snap.timestamp, *out);
+  encode(snap.timestamp, *out);
   return 0;
 }
 
@@ -1526,7 +1526,7 @@ int get_snapshot_namespace(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(snap_id, iter);
+    decode(snap_id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -1545,7 +1545,7 @@ int get_snapshot_namespace(cls_method_context_t hctx, bufferlist *in, bufferlist
     return r;
   }
 
-  ::encode(snap.snapshot_namespace, *out);
+  encode(snap.snapshot_namespace, *out);
 
   return 0;
 }
@@ -1571,10 +1571,10 @@ int snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(snap_meta.name, iter);
-    ::decode(snap_meta.id, iter);
+    decode(snap_meta.name, iter);
+    decode(snap_meta.id, iter);
     if (!iter.end()) {
-      ::decode(snap_meta.snapshot_namespace, iter);
+      decode(snap_meta.snapshot_namespace, iter);
     }
   } catch (const buffer::error &err) {
     return -EINVAL;
@@ -1652,7 +1652,7 @@ int snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       cls_rbd_snap old_meta;
       bufferlist::iterator iter = it->second.begin();
       try {
-       ::decode(old_meta, iter);
+       decode(old_meta, iter);
       } catch (const buffer::error &err) {
        snapid_t snap_id = snap_id_from_key(it->first);
        CLS_ERR("error decoding snapshot metadata for snap_id: %llu",
@@ -1683,8 +1683,8 @@ int snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   }
 
   bufferlist snap_metabl, snap_seqbl;
-  ::encode(snap_meta, snap_metabl);
-  ::encode(snap_meta.id, snap_seqbl);
+  encode(snap_meta, snap_metabl);
+  encode(snap_meta.id, snap_seqbl);
 
   string snapshot_key;
   key_from_snap_id(snap_meta.id, &snapshot_key);
@@ -1721,8 +1721,8 @@ int snapshot_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(src_snap_id, iter);
-    ::decode(dst_snap_name, iter);
+    decode(src_snap_id, iter);
+    decode(dst_snap_name, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -1744,7 +1744,7 @@ int snapshot_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
         it != vals.end(); ++it) {
       bufferlist::iterator iter = it->second.begin();
       try {
-       ::decode(snap_meta, iter);
+       decode(snap_meta, iter);
       } catch (const buffer::error &err) {
        CLS_ERR("error decoding snapshot metadata for snap : %s",
                dst_snap_name.c_str());
@@ -1768,7 +1768,7 @@ int snapshot_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   }
   snap_meta.name = dst_snap_name;
   bufferlist snap_metabl;
-  ::encode(snap_meta, snap_metabl);
+  encode(snap_meta, snap_metabl);
 
   r = cls_cxx_map_set_val(hctx, src_snap_key, &snap_metabl);
   if (r < 0) {
@@ -1793,7 +1793,7 @@ int snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(snap_id, iter);
+    decode(snap_id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -1829,7 +1829,7 @@ int snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 int get_all_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
   uint64_t all_features = RBD_FEATURES_ALL;
-  ::encode(all_features, *out);
+  encode(all_features, *out);
   return 0;
 }
 
@@ -1891,12 +1891,12 @@ int get_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   string id;
   try {
     bufferlist::iterator iter = read_bl.begin();
-    ::decode(id, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     return -EIO;
   }
 
-  ::encode(id, *out);
+  encode(id, *out);
   return 0;
 }
 
@@ -1919,7 +1919,7 @@ int set_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   string id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -1939,7 +1939,7 @@ int set_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   CLS_LOG(20, "set_id: id=%s", id.c_str());
 
   bufferlist write_bl;
-  ::encode(id, write_bl);
+  encode(id, write_bl);
   return cls_cxx_write(hctx, 0, write_bl.length(), &write_bl);
 }
 
@@ -1986,8 +1986,8 @@ static int dir_add_image_helper(cls_method_context_t hctx,
     return -EBADF;
   }
   bufferlist id_bl, name_bl;
-  ::encode(id, id_bl);
-  ::encode(name, name_bl);
+  encode(id, id_bl);
+  encode(name, name_bl);
   map<string, bufferlist> omap_vals;
   omap_vals[name_key] = id_bl;
   omap_vals[id_key] = name_bl;
@@ -2059,9 +2059,9 @@ int dir_rename_image(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   string src, dest, id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(src, iter);
-    ::decode(dest, iter);
-    ::decode(id, iter);
+    decode(src, iter);
+    decode(dest, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2090,7 +2090,7 @@ int dir_get_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(name, iter);
+    decode(name, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2104,7 +2104,7 @@ int dir_get_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       CLS_ERR("error reading id for name '%s': %s", name.c_str(), cpp_strerror(r).c_str());
     return r;
   }
-  ::encode(id, *out);
+  encode(id, *out);
   return 0;
 }
 
@@ -2124,7 +2124,7 @@ int dir_get_name(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2137,7 +2137,7 @@ int dir_get_name(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     CLS_ERR("error reading name for id '%s': %s", id.c_str(), cpp_strerror(r).c_str());
     return r;
   }
-  ::encode(name, *out);
+  encode(name, *out);
   return 0;
 }
 
@@ -2161,8 +2161,8 @@ int dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(start_after, iter);
-    ::decode(max_return, iter);
+    decode(start_after, iter);
+    decode(max_return, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2187,7 +2187,7 @@ int dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       string id;
       bufferlist::iterator iter = it->second.begin();
       try {
-       ::decode(id, iter);
+       decode(id, iter);
       } catch (const buffer::error &err) {
        CLS_ERR("could not decode id of image '%s'", it->first.c_str());
        return -EIO;
@@ -2202,7 +2202,7 @@ int dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     }
   }
 
-  ::encode(images, *out);
+  encode(images, *out);
 
   return 0;
 }
@@ -2231,8 +2231,8 @@ int dir_add_image(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   string name, id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(name, iter);
-    ::decode(id, iter);
+    decode(name, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2256,8 +2256,8 @@ int dir_remove_image(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   string name, id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(name, iter);
-    ::decode(id, iter);
+    decode(name, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2359,8 +2359,8 @@ int object_map_resize(cls_method_context_t hctx, bufferlist *in, bufferlist *out
   uint8_t default_state;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(object_count, iter);
-    ::decode(default_state, iter);
+    decode(object_count, iter);
+    decode(default_state, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2420,10 +2420,10 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out
   boost::optional<uint8_t> current_object_state;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(start_object_no, iter);
-    ::decode(end_object_no, iter);
-    ::decode(new_object_state, iter);
-    ::decode(current_object_state, iter);
+    decode(start_object_no, iter);
+    decode(end_object_no, iter);
+    decode(new_object_state, iter);
+    decode(current_object_state, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("failed to decode message");
     return -EINVAL;
@@ -2644,8 +2644,8 @@ int metadata_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(start_after, iter);
-    ::decode(max_return, iter);
+    decode(start_after, iter);
+    decode(max_return, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2678,7 +2678,7 @@ int metadata_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     }
   }
 
-  ::encode(data, *out);
+  encode(data, *out);
   return 0;
 }
 
@@ -2695,7 +2695,7 @@ int metadata_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(data, iter);
+    decode(data, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2728,7 +2728,7 @@ int metadata_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(key, iter);
+    decode(key, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2759,7 +2759,7 @@ int metadata_get(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(key, iter);
+    decode(key, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2772,7 +2772,7 @@ int metadata_get(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     return r;
   }
 
-  ::encode(value, *out);
+  encode(value, *out);
   return 0;
 }
 
@@ -2789,7 +2789,7 @@ int snapshot_get_limit(cls_method_context_t hctx, bufferlist *in,
   }
 
   CLS_LOG(20, "read snapshot limit %" PRIu64, snap_limit);
-  ::encode(snap_limit, *out);
+  encode(snap_limit, *out);
 
   return 0;
 }
@@ -2804,7 +2804,7 @@ int snapshot_set_limit(cls_method_context_t hctx, bufferlist *in,
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(new_limit, iter);
+    decode(new_limit, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -2855,7 +2855,7 @@ int snapshot_set_limit(cls_method_context_t hctx, bufferlist *in,
   } else {
     CLS_LOG(20, "set snapshot limit to %" PRIu64 "\n", new_limit);
     bl.clear();
-    ::encode(new_limit, bl);
+    encode(new_limit, bl);
     rc = cls_cxx_map_set_val(hctx, "snap_limit", &bl);
   }
 
@@ -2882,14 +2882,14 @@ int old_snapshots_list(cls_method_context_t hctx, bufferlist *in, bufferlist *ou
          buf + sizeof(*header) + header->snap_count * sizeof(struct rbd_obj_snap_ondisk),
          header->snap_names_len);
 
-  ::encode(header->snap_seq, *out);
-  ::encode(header->snap_count, *out);
+  encode(header->snap_seq, *out);
+  encode(header->snap_count, *out);
 
   for (unsigned i = 0; i < header->snap_count; i++) {
     string s = name;
-    ::encode(header->snaps[i].id, *out);
-    ::encode(header->snaps[i].image_size, *out);
-    ::encode(s, *out);
+    encode(header->snaps[i].id, *out);
+    encode(header->snaps[i].image_size, *out);
+    encode(s, *out);
 
     name += strlen(name) + 1;
     if (name > end)
@@ -2923,8 +2923,8 @@ int old_snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   uint64_t snap_id;
 
   try {
-    ::decode(s, iter);
-    ::decode(snap_id, iter);
+    decode(s, iter);
+    decode(snap_id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -3012,7 +3012,7 @@ int old_snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *o
   struct rbd_obj_snap_ondisk snap;
 
   try {
-    ::decode(s, iter);
+    decode(s, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -3105,8 +3105,8 @@ int old_snapshot_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *o
   bool found = false;
 
   try {
-    ::decode(src_snap_id, iter);
-    ::decode(dst, iter);
+    decode(src_snap_id, iter);
+    decode(dst, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -3249,7 +3249,7 @@ int read_peers(cls_method_context_t hctx,
       try {
         bufferlist::iterator bl_it = it.second.begin();
         cls::rbd::MirrorPeer peer;
-       ::decode(peer, bl_it);
+       decode(peer, bl_it);
         peers->push_back(peer);
       } catch (const buffer::error &err) {
        CLS_ERR("could not decode peer '%s'", it.first.c_str());
@@ -3276,7 +3276,7 @@ int read_peer(cls_method_context_t hctx, const std::string &id,
 
   try {
     bufferlist::iterator bl_it = bl.begin();
-    ::decode(*peer, bl_it);
+    decode(*peer, bl_it);
   } catch (const buffer::error &err) {
     CLS_ERR("could not decode peer '%s'", id.c_str());
     return -EIO;
@@ -3287,7 +3287,7 @@ int read_peer(cls_method_context_t hctx, const std::string &id,
 int write_peer(cls_method_context_t hctx, const std::string &id,
                const cls::rbd::MirrorPeer &peer) {
   bufferlist bl;
-  ::encode(peer, bl);
+  encode(peer, bl);
 
   int r = cls_cxx_map_set_val(hctx, peer_key(id), &bl);
   if (r < 0) {
@@ -3312,7 +3312,7 @@ int image_get(cls_method_context_t hctx, const string &image_id,
 
   try {
     bufferlist::iterator it = bl.begin();
-    ::decode(*mirror_image, it);
+    decode(*mirror_image, it);
   } catch (const buffer::error &err) {
     CLS_ERR("could not decode mirrored image '%s'", image_id.c_str());
     return -EIO;
@@ -3324,7 +3324,7 @@ int image_get(cls_method_context_t hctx, const string &image_id,
 int image_set(cls_method_context_t hctx, const string &image_id,
              const cls::rbd::MirrorImage &mirror_image) {
   bufferlist bl;
-  ::encode(mirror_image, bl);
+  encode(mirror_image, bl);
 
   cls::rbd::MirrorImage existing_mirror_image;
   int r = image_get(hctx, image_id, &existing_mirror_image);
@@ -3364,7 +3364,7 @@ int image_set(cls_method_context_t hctx, const string &image_id,
   }
 
   bufferlist image_id_bl;
-  ::encode(image_id, image_id_bl);
+  encode(image_id, image_id_bl);
   r = cls_cxx_map_set_val(hctx, global_key(mirror_image.global_image_id),
                           &image_id_bl);
   if (r < 0) {
@@ -3427,7 +3427,7 @@ struct MirrorImageStatusOnDisk : cls::rbd::MirrorImageStatus {
 
   void encode_meta(bufferlist &bl, uint64_t features) const {
     ENCODE_START(1, 1, bl);
-    ::encode(origin, bl, features);
+    encode(origin, bl, features);
     ENCODE_FINISH(bl);
   }
 
@@ -3438,7 +3438,7 @@ struct MirrorImageStatusOnDisk : cls::rbd::MirrorImageStatus {
 
   void decode_meta(bufferlist::iterator &it) {
     DECODE_START(1, it);
-    ::decode(origin, it);
+    decode(origin, it);
     DECODE_FINISH(it);
   }
 
@@ -3543,7 +3543,7 @@ int image_status_list(cls_method_context_t hctx,
       cls::rbd::MirrorImage mirror_image;
       bufferlist::iterator iter = it->second.begin();
       try {
-       ::decode(mirror_image, iter);
+       decode(mirror_image, iter);
       } catch (const buffer::error &err) {
        CLS_ERR("could not decode mirror image payload of image '%s'",
                 image_id.c_str());
@@ -3601,7 +3601,7 @@ int image_status_get_summary(cls_method_context_t hctx,
       cls::rbd::MirrorImage mirror_image;
       bufferlist::iterator iter = list_it.second.begin();
       try {
-       ::decode(mirror_image, iter);
+       decode(mirror_image, iter);
       } catch (const buffer::error &err) {
        CLS_ERR("could not decode mirror image payload for key '%s'",
                 key.c_str());
@@ -3761,7 +3761,7 @@ int mirror_image_map_list(cls_method_context_t hctx,
       cls::rbd::MirrorImageMap mirror_image_map;
       bufferlist::iterator iter = it->second.begin();
       try {
-        ::decode(mirror_image_map, iter);
+        decode(mirror_image_map, iter);
       } catch (const buffer::error &err) {
         CLS_ERR("could not decode image map payload: %s", cpp_strerror(r).c_str());
         return -EINVAL;
@@ -3796,7 +3796,7 @@ int mirror_uuid_get(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(mirror_uuid, *out);
+  encode(mirror_uuid, *out);
   return 0;
 }
 
@@ -3812,7 +3812,7 @@ int mirror_uuid_set(cls_method_context_t hctx, bufferlist *in,
   std::string mirror_uuid;
   try {
     bufferlist::iterator bl_it = in->begin();
-    ::decode(mirror_uuid, bl_it);
+    decode(mirror_uuid, bl_it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -3857,7 +3857,7 @@ int mirror_mode_get(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(mirror_mode_decode, *out);
+  encode(mirror_mode_decode, *out);
   return 0;
 }
 
@@ -3873,7 +3873,7 @@ int mirror_mode_set(cls_method_context_t hctx, bufferlist *in,
   uint32_t mirror_mode_decode;
   try {
     bufferlist::iterator bl_it = in->begin();
-    ::decode(mirror_mode_decode, bl_it);
+    decode(mirror_mode_decode, bl_it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -3903,7 +3903,7 @@ int mirror_mode_set(cls_method_context_t hctx, bufferlist *in,
     }
 
     bufferlist bl;
-    ::encode(mirror_mode_decode, bl);
+    encode(mirror_mode_decode, bl);
 
     r = cls_cxx_map_set_val(hctx, mirror::MODE, &bl);
     if (r < 0) {
@@ -3951,7 +3951,7 @@ int mirror_peer_list(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(peers, *out);
+  encode(peers, *out);
   return 0;
 }
 
@@ -3967,7 +3967,7 @@ int mirror_peer_add(cls_method_context_t hctx, bufferlist *in,
   cls::rbd::MirrorPeer mirror_peer;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(mirror_peer, it);
+    decode(mirror_peer, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4017,7 +4017,7 @@ int mirror_peer_add(cls_method_context_t hctx, bufferlist *in,
   }
 
   bufferlist bl;
-  ::encode(mirror_peer, bl);
+  encode(mirror_peer, bl);
   r = cls_cxx_map_set_val(hctx, mirror::peer_key(mirror_peer.uuid),
                           &bl);
   if (r < 0) {
@@ -4039,7 +4039,7 @@ int mirror_peer_remove(cls_method_context_t hctx, bufferlist *in,
   std::string uuid;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(uuid, it);
+    decode(uuid, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4066,8 +4066,8 @@ int mirror_peer_set_client(cls_method_context_t hctx, bufferlist *in,
   std::string client_name;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(uuid, it);
-    ::decode(client_name, it);
+    decode(uuid, it);
+    decode(client_name, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4100,8 +4100,8 @@ int mirror_peer_set_cluster(cls_method_context_t hctx, bufferlist *in,
   std::string cluster_name;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(uuid, it);
-    ::decode(cluster_name, it);
+    decode(uuid, it);
+    decode(cluster_name, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4136,8 +4136,8 @@ int mirror_image_list(cls_method_context_t hctx, bufferlist *in,
   uint64_t max_return;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(start_after, iter);
-    ::decode(max_return, iter);
+    decode(start_after, iter);
+    decode(max_return, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4164,7 +4164,7 @@ int mirror_image_list(cls_method_context_t hctx, bufferlist *in,
       cls::rbd::MirrorImage mirror_image;
       bufferlist::iterator iter = it->second.begin();
       try {
-       ::decode(mirror_image, iter);
+       decode(mirror_image, iter);
       } catch (const buffer::error &err) {
        CLS_ERR("could not decode mirror image payload of image '%s'",
                 image_id.c_str());
@@ -4181,7 +4181,7 @@ int mirror_image_list(cls_method_context_t hctx, bufferlist *in,
     }
   }
 
-  ::encode(mirror_images, *out);
+  encode(mirror_images, *out);
   return 0;
 }
 
@@ -4198,7 +4198,7 @@ int mirror_image_get_image_id(cls_method_context_t hctx, bufferlist *in,
   std::string global_id;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(global_id, it);
+    decode(global_id, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4211,7 +4211,7 @@ int mirror_image_get_image_id(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(image_id, *out);
+  encode(image_id, *out);
   return 0;
 }
 
@@ -4228,7 +4228,7 @@ int mirror_image_get(cls_method_context_t hctx, bufferlist *in,
   string image_id;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(image_id, it);
+    decode(image_id, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4239,7 +4239,7 @@ int mirror_image_get(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(mirror_image, *out);
+  encode(mirror_image, *out);
   return 0;
 }
 
@@ -4258,8 +4258,8 @@ int mirror_image_set(cls_method_context_t hctx, bufferlist *in,
   cls::rbd::MirrorImage mirror_image;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(image_id, it);
-    ::decode(mirror_image, it);
+    decode(image_id, it);
+    decode(mirror_image, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4283,7 +4283,7 @@ int mirror_image_remove(cls_method_context_t hctx, bufferlist *in,
   string image_id;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(image_id, it);
+    decode(image_id, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4309,8 +4309,8 @@ int mirror_image_status_set(cls_method_context_t hctx, bufferlist *in,
   cls::rbd::MirrorImageStatus status;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(global_image_id, it);
-    ::decode(status, it);
+    decode(global_image_id, it);
+    decode(status, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4334,7 +4334,7 @@ int mirror_image_status_remove(cls_method_context_t hctx, bufferlist *in,
   string global_image_id;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(global_image_id, it);
+    decode(global_image_id, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4359,7 +4359,7 @@ int mirror_image_status_get(cls_method_context_t hctx, bufferlist *in,
   string global_image_id;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(global_image_id, it);
+    decode(global_image_id, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4376,7 +4376,7 @@ int mirror_image_status_get(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(status, *out);
+  encode(status, *out);
   return 0;
 }
 
@@ -4397,8 +4397,8 @@ int mirror_image_status_list(cls_method_context_t hctx, bufferlist *in,
   uint64_t max_return;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(start_after, iter);
-    ::decode(max_return, iter);
+    decode(start_after, iter);
+    decode(max_return, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4411,8 +4411,8 @@ int mirror_image_status_list(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(images, *out);
-  ::encode(statuses, *out);
+  encode(images, *out);
+  encode(statuses, *out);
   return 0;
 }
 
@@ -4433,7 +4433,7 @@ int mirror_image_status_get_summary(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(states, *out);
+  encode(states, *out);
   return 0;
 }
 
@@ -4470,7 +4470,7 @@ int mirror_instances_list(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(instance_ids, *out);
+  encode(instance_ids, *out);
   return 0;
 }
 
@@ -4486,7 +4486,7 @@ int mirror_instances_add(cls_method_context_t hctx, bufferlist *in,
   std::string instance_id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(instance_id, iter);
+    decode(instance_id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4510,7 +4510,7 @@ int mirror_instances_remove(cls_method_context_t hctx, bufferlist *in,
   std::string instance_id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(instance_id, iter);
+    decode(instance_id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4537,8 +4537,8 @@ int mirror_image_map_list(cls_method_context_t hctx, bufferlist *in,
   uint64_t max_return;
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(start_after, it);
-    ::decode(max_return, it);
+    decode(start_after, it);
+    decode(max_return, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4549,7 +4549,7 @@ int mirror_image_map_list(cls_method_context_t hctx, bufferlist *in,
     return r;
   }
 
-  ::encode(image_mapping, *out);
+  encode(image_mapping, *out);
   return 0;
 }
 
@@ -4568,14 +4568,14 @@ int mirror_image_map_update(cls_method_context_t hctx, bufferlist *in,
 
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(global_image_id, it);
-    ::decode(image_map, it);
+    decode(global_image_id, it);
+    decode(image_map, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
 
   bufferlist bl;
-  ::encode(image_map, bl);
+  encode(image_map, bl);
 
   const std::string key = mirror::mirror_image_map_key(global_image_id);
   int r = cls_cxx_map_set_val(hctx, key, &bl);
@@ -4601,7 +4601,7 @@ int mirror_image_map_remove(cls_method_context_t hctx, bufferlist *in,
 
   try {
     bufferlist::iterator it = in->begin();
-    ::decode(global_image_id, it);
+    decode(global_image_id, it);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4631,7 +4631,7 @@ int group_create(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
   bufferlist snap_seqbl;
   uint64_t snap_seq = 0;
-  ::encode(snap_seq, snap_seqbl);
+  encode(snap_seq, snap_seqbl);
   int r = cls_cxx_map_set_val(hctx, GROUP_SNAP_SEQ, &snap_seqbl);
   if (r < 0)
     return r;
@@ -4657,8 +4657,8 @@ int group_dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(start_after, iter);
-    ::decode(max_return, iter);
+    decode(start_after, iter);
+    decode(max_return, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4682,7 +4682,7 @@ int group_dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       string id;
       bufferlist::iterator iter = val.second.begin();
       try {
-       ::decode(id, iter);
+       decode(id, iter);
       } catch (const buffer::error &err) {
        CLS_ERR("could not decode id of consistency group '%s'", val.first.c_str());
        return -EIO;
@@ -4697,7 +4697,7 @@ int group_dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     }
   }
 
-  ::encode(groups, *out);
+  encode(groups, *out);
 
   return 0;
 }
@@ -4725,8 +4725,8 @@ int group_dir_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   string name, id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(name, iter);
-    ::decode(id, iter);
+    decode(name, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4753,8 +4753,8 @@ int group_dir_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     return -EBADF;
   }
   bufferlist id_bl, name_bl;
-  ::encode(id, id_bl);
-  ::encode(name, name_bl);
+  encode(id, id_bl);
+  encode(name, name_bl);
   map<string, bufferlist> omap_vals;
   omap_vals[name_key] = id_bl;
   omap_vals[id_key] = name_bl;
@@ -4776,8 +4776,8 @@ int group_dir_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   string name, id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(name, iter);
-    ::decode(id, iter);
+    decode(name, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4839,7 +4839,7 @@ int group_image_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   cls::rbd::GroupImageStatus st;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(st, iter);
+    decode(st, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4847,7 +4847,7 @@ int group_image_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   string image_key = st.spec.image_key();
 
   bufferlist image_val_bl;
-  ::encode(st.state, image_val_bl);
+  encode(st.state, image_val_bl);
   int r = cls_cxx_map_set_val(hctx, image_key, &image_val_bl);
   if (r < 0) {
     return r;
@@ -4872,7 +4872,7 @@ int group_image_remove(cls_method_context_t hctx,
   cls::rbd::GroupImageSpec spec;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(spec, iter);
+    decode(spec, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4908,8 +4908,8 @@ int group_image_list(cls_method_context_t hctx,
   uint64_t max_return;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(start_after, iter);
-    ::decode(max_return, iter);
+    decode(start_after, iter);
+    decode(max_return, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4931,7 +4931,7 @@ int group_image_list(cls_method_context_t hctx,
       bufferlist::iterator iter = it->second.begin();
       cls::rbd::GroupImageLinkState state;
       try {
-       ::decode(state, iter);
+       decode(state, iter);
       } catch (const buffer::error &err) {
        CLS_ERR("error decoding state for image: %s", it->first.c_str());
        return -EIO;
@@ -4951,7 +4951,7 @@ int group_image_list(cls_method_context_t hctx,
     }
 
   } while (more && (res.size() < max_return));
-  ::encode(res, *out);
+  encode(res, *out);
 
   return 0;
 }
@@ -4973,7 +4973,7 @@ int image_add_group(cls_method_context_t hctx,
   cls::rbd::GroupSpec new_group;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(new_group, iter);
+    decode(new_group, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -4987,7 +4987,7 @@ int image_add_group(cls_method_context_t hctx,
     cls::rbd::GroupSpec old_group;
     try {
       bufferlist::iterator iter = existing_refbl.begin();
-      ::decode(old_group, iter);
+      decode(old_group, iter);
     } catch (const buffer::error &err) {
       return -EINVAL;
     }
@@ -5003,7 +5003,7 @@ int image_add_group(cls_method_context_t hctx,
   }
 
   bufferlist refbl;
-  ::encode(new_group, refbl);
+  encode(new_group, refbl);
   r = cls_cxx_map_set_val(hctx, RBD_GROUP_REF, &refbl);
 
   if (r < 0) {
@@ -5031,7 +5031,7 @@ int image_remove_group(cls_method_context_t hctx,
   cls::rbd::GroupSpec spec;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(spec, iter);
+    decode(spec, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -5045,7 +5045,7 @@ int image_remove_group(cls_method_context_t hctx,
   cls::rbd::GroupSpec ref_spec;
   bufferlist::iterator iter = refbl.begin();
   try {
-    ::decode(ref_spec, iter);
+    decode(ref_spec, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -5087,13 +5087,13 @@ int image_get_group(cls_method_context_t hctx,
   if (r != -ENOENT) {
     bufferlist::iterator iter = refbl.begin();
     try {
-      ::decode(spec, iter);
+      decode(spec, iter);
     } catch (const buffer::error &err) {
       return -EINVAL;
     }
   }
 
-  ::encode(spec, *out);
+  encode(spec, *out);
   return 0;
 }
 
@@ -5135,8 +5135,8 @@ int trash_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   cls::rbd::TrashImageSpec trash_spec;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
-    ::decode(trash_spec, iter);
+    decode(id, iter);
+    decode(trash_spec, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -5161,7 +5161,7 @@ int trash_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   }
 
   map<string, bufferlist> omap_vals;
-  ::encode(trash_spec, omap_vals[key]);
+  encode(trash_spec, omap_vals[key]);
   return cls_cxx_map_set_vals(hctx, &omap_vals);
 }
 
@@ -5181,7 +5181,7 @@ int trash_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   string id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -5228,8 +5228,8 @@ int trash_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(start_after, iter);
-    ::decode(max_return, iter);
+    decode(start_after, iter);
+    decode(max_return, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
@@ -5256,7 +5256,7 @@ int trash_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
     map<string, bufferlist>::iterator it = raw_data.begin();
     for (; it != raw_data.end(); ++it) {
-      ::decode(data[trash::image_id_from_key(it->first)], it->second);
+      decode(data[trash::image_id_from_key(it->first)], it->second);
     }
 
     if (!more) {
@@ -5266,7 +5266,7 @@ int trash_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     last_read = raw_data.rbegin()->first;
   }
 
-  ::encode(data, *out);
+  encode(data, *out);
   return 0;
 }
 
@@ -5287,7 +5287,7 @@ int trash_get(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   string id;
   try {
     bufferlist::iterator iter = in->begin();
-    ::decode(id, iter);
+    decode(id, iter);
   } catch (const buffer::error &err) {
     return -EINVAL;
   }
index f08fc1b1f0a65861e10cde4c48668a7040f79637..d1a8948ad12aceec6cb64693585d2da5532576b4 100644 (file)
@@ -25,18 +25,18 @@ struct cls_rbd_parent {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(pool, bl);
-    ::encode(id, bl);
-    ::encode(snapid, bl);
-    ::encode(overlap, bl);
+    encode(pool, bl);
+    encode(id, bl);
+    encode(snapid, bl);
+    encode(overlap, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(pool, bl);
-    ::decode(id, bl);
-    ::decode(snapid, bl);
-    ::decode(overlap, bl);
+    decode(pool, bl);
+    decode(id, bl);
+    decode(snapid, bl);
+    decode(overlap, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const {
@@ -80,37 +80,37 @@ struct cls_rbd_snap {
     {}
   void encode(bufferlist& bl) const {
     ENCODE_START(6, 1, bl);
-    ::encode(id, bl);
-    ::encode(name, bl);
-    ::encode(image_size, bl);
-    ::encode(features, bl);
-    ::encode(parent, bl);
-    ::encode(protection_status, bl);
-    ::encode(flags, bl);
-    ::encode(snapshot_namespace, bl);
-    ::encode(timestamp, bl);
+    encode(id, bl);
+    encode(name, bl);
+    encode(image_size, bl);
+    encode(features, bl);
+    encode(parent, bl);
+    encode(protection_status, bl);
+    encode(flags, bl);
+    encode(snapshot_namespace, bl);
+    encode(timestamp, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& p) {
     DECODE_START(6, p);
-    ::decode(id, p);
-    ::decode(name, p);
-    ::decode(image_size, p);
-    ::decode(features, p);
+    decode(id, p);
+    decode(name, p);
+    decode(image_size, p);
+    decode(features, p);
     if (struct_v >= 2) {
-      ::decode(parent, p);
+      decode(parent, p);
     }
     if (struct_v >= 3) {
-      ::decode(protection_status, p);
+      decode(protection_status, p);
     }
     if (struct_v >= 4) {
-      ::decode(flags, p);
+      decode(flags, p);
     }
     if (struct_v >= 5) {
-      ::decode(snapshot_namespace, p);
+      decode(snapshot_namespace, p);
     }
     if (struct_v >= 6) {
-      ::decode(timestamp, p);
+      decode(timestamp, p);
     }
     DECODE_FINISH(p);
   }
index 9e12ab61584926b629d8f5bf13ac8ac88488ba57..bdfb17892ac4630cfbc891503a782dc9f9b9ef84 100644 (file)
@@ -16,12 +16,12 @@ namespace librbd {
     void get_initial_metadata_start(librados::ObjectReadOperation *op) {
       bufferlist bl, empty_bl, features_bl;
       snapid_t snap = CEPH_NOSNAP;
-      ::encode(snap, bl);
+      encode(snap, bl);
       op->exec("rbd", "get_size", bl);
       op->exec("rbd", "get_object_prefix", empty_bl);
 
-      ::encode(snap, features_bl);
-      ::encode(true, features_bl);
+      encode(snap, features_bl);
+      encode(true, features_bl);
       op->exec("rbd", "get_features", features_bl);
     }
 
@@ -33,13 +33,13 @@ namespace librbd {
        uint64_t size;
        uint64_t incompatible_features;
        // get_size
-       ::decode(*order, *it);
-       ::decode(size, *it);
+       decode(*order, *it);
+       decode(size, *it);
        // get_object_prefix
-       ::decode(*object_prefix, *it);
+       decode(*object_prefix, *it);
        // get_features
-       ::decode(*features, *it);
-       ::decode(incompatible_features, *it);
+       decode(*features, *it);
+       decode(incompatible_features, *it);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -67,19 +67,19 @@ namespace librbd {
                                     bool read_only) {
       snapid_t snap = CEPH_NOSNAP;
       bufferlist size_bl;
-      ::encode(snap, size_bl);
+      encode(snap, size_bl);
       op->exec("rbd", "get_size", size_bl);
 
       bufferlist features_bl;
-      ::encode(snap, features_bl);
-      ::encode(read_only, features_bl);
+      encode(snap, features_bl);
+      encode(read_only, features_bl);
       op->exec("rbd", "get_features", features_bl);
 
       bufferlist empty_bl;
       op->exec("rbd", "get_snapcontext", empty_bl);
 
       bufferlist parent_bl;
-      ::encode(snap, parent_bl);
+      encode(snap, parent_bl);
       op->exec("rbd", "get_parent", parent_bl);
 
       rados::cls::lock::get_lock_info_start(op, RBD_LOCK_NAME);
@@ -103,18 +103,18 @@ namespace librbd {
       try {
        uint8_t order;
        // get_size
-       ::decode(order, *it);
-       ::decode(*size, *it);
+       decode(order, *it);
+       decode(*size, *it);
        // get_features
-       ::decode(*features, *it);
-       ::decode(*incompatible_features, *it);
+       decode(*features, *it);
+       decode(*incompatible_features, *it);
        // get_snapcontext
-       ::decode(*snapc, *it);
+       decode(*snapc, *it);
        // get_parent
-       ::decode(parent->spec.pool_id, *it);
-       ::decode(parent->spec.image_id, *it);
-       ::decode(parent->spec.snap_id, *it);
-       ::decode(parent->overlap, *it);
+       decode(parent->spec.pool_id, *it);
+       decode(parent->spec.image_id, *it);
+       decode(parent->spec.snap_id, *it);
+       decode(parent->overlap, *it);
 
        // get_lock_info
        ClsLockType lock_type = LOCK_NONE;
@@ -163,11 +163,11 @@ namespace librbd {
                       const std::string &object_prefix, int64_t data_pool_id)
     {
       bufferlist bl;
-      ::encode(size, bl);
-      ::encode(order, bl);
-      ::encode(features, bl);
-      ::encode(object_prefix, bl);
-      ::encode(data_pool_id, bl);
+      encode(size, bl);
+      encode(order, bl);
+      encode(features, bl);
+      encode(object_prefix, bl);
+      encode(data_pool_id, bl);
 
       op->exec("rbd", "create", bl);
     }
@@ -186,7 +186,7 @@ namespace librbd {
                     snapid_t snap_id, uint64_t *features)
     {
       bufferlist inbl, outbl;
-      ::encode(snap_id, inbl);
+      encode(snap_id, inbl);
 
       int r = ioctx->exec(oid, "rbd", "get_features", inbl, outbl);
       if (r < 0)
@@ -194,7 +194,7 @@ namespace librbd {
 
       try {
        bufferlist::iterator iter = outbl.begin();
-       ::decode(*features, iter);
+       decode(*features, iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -206,8 +206,8 @@ namespace librbd {
                       uint64_t mask)
     {
       bufferlist bl;
-      ::encode(features, bl);
-      ::encode(mask, bl);
+      encode(features, bl);
+      encode(mask, bl);
 
       op->exec("rbd", "set_features", bl);
     }
@@ -231,7 +231,7 @@ namespace librbd {
 
       try {
        bufferlist::iterator iter = outbl.begin();
-       ::decode(*object_prefix, iter);
+       decode(*object_prefix, iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -246,7 +246,7 @@ namespace librbd {
 
     int get_data_pool_finish(bufferlist::iterator *it, int64_t *data_pool_id) {
       try {
-       ::decode(*data_pool_id, *it);
+       decode(*data_pool_id, *it);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -272,7 +272,7 @@ namespace librbd {
                 snapid_t snap_id, uint64_t *size, uint8_t *order)
     {
       bufferlist inbl, outbl;
-      ::encode(snap_id, inbl);
+      encode(snap_id, inbl);
 
       int r = ioctx->exec(oid, "rbd", "get_size", inbl, outbl);
       if (r < 0)
@@ -280,8 +280,8 @@ namespace librbd {
 
       try {
        bufferlist::iterator iter = outbl.begin();
-       ::decode(*order, iter);
-       ::decode(*size, iter);
+       decode(*order, iter);
+       decode(*size, iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -300,7 +300,7 @@ namespace librbd {
     void set_size(librados::ObjectWriteOperation *op, uint64_t size)
     {
       bufferlist bl;
-      ::encode(size, bl);
+      encode(size, bl);
       op->exec("rbd", "set_size", bl);
     }
 
@@ -309,7 +309,7 @@ namespace librbd {
                   uint64_t *parent_overlap)
     {
       bufferlist inbl, outbl;
-      ::encode(snap_id, inbl);
+      encode(snap_id, inbl);
 
       int r = ioctx->exec(oid, "rbd", "get_parent", inbl, outbl);
       if (r < 0)
@@ -317,10 +317,10 @@ namespace librbd {
 
       try {
        bufferlist::iterator iter = outbl.begin();
-       ::decode(pspec->pool_id, iter);
-       ::decode(pspec->image_id, iter);
-       ::decode(pspec->snap_id, iter);
-       ::decode(*parent_overlap, iter);
+       decode(pspec->pool_id, iter);
+       decode(pspec->image_id, iter);
+       decode(pspec->snap_id, iter);
+       decode(*parent_overlap, iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -339,10 +339,10 @@ namespace librbd {
     void set_parent(librados::ObjectWriteOperation *op,
                     const ParentSpec &pspec, uint64_t parent_overlap) {
       bufferlist in_bl;
-      ::encode(pspec.pool_id, in_bl);
-      ::encode(pspec.image_id, in_bl);
-      ::encode(pspec.snap_id, in_bl);
-      ::encode(parent_overlap, in_bl);
+      encode(pspec.pool_id, in_bl);
+      encode(pspec.image_id, in_bl);
+      encode(pspec.snap_id, in_bl);
+      encode(parent_overlap, in_bl);
 
       op->exec("rbd", "set_parent", in_bl);
     }
@@ -350,12 +350,12 @@ namespace librbd {
     void get_flags_start(librados::ObjectReadOperation *op,
                          const std::vector<snapid_t> &snap_ids) {
       bufferlist in_bl;
-      ::encode(static_cast<snapid_t>(CEPH_NOSNAP), in_bl);
+      encode(static_cast<snapid_t>(CEPH_NOSNAP), in_bl);
 
       op->exec("rbd", "get_flags", in_bl);
       for (size_t i = 0; i < snap_ids.size(); ++i) {
         bufferlist snap_bl;
-        ::encode(snap_ids[i], snap_bl);
+        encode(snap_ids[i], snap_bl);
         op->exec("rbd", "get_flags", snap_bl);
       }
 
@@ -366,9 +366,9 @@ namespace librbd {
                          std::vector<uint64_t> *snap_flags) {
       snap_flags->resize(snap_ids.size());
       try {
-        ::decode(*flags, *it);
+        decode(*flags, *it);
        for (size_t i = 0; i < snap_flags->size(); ++i) {
-         ::decode((*snap_flags)[i], *it);
+         decode((*snap_flags)[i], *it);
        }
       } catch (const buffer::error &err) {
         return -EBADMSG;
@@ -397,9 +397,9 @@ namespace librbd {
                    uint64_t flags, uint64_t mask)
     {
       bufferlist inbl;
-      ::encode(flags, inbl);
-      ::encode(mask, inbl);
-      ::encode(snap_id, inbl);
+      encode(flags, inbl);
+      encode(mask, inbl);
+      encode(snap_id, inbl);
       op->exec("rbd", "set_flags", inbl);
     }
 
@@ -428,10 +428,10 @@ namespace librbd {
                  const ParentSpec pspec, const std::string &c_imageid)
     {
       bufferlist in;
-      ::encode(pspec.pool_id, in);
-      ::encode(pspec.image_id, in);
-      ::encode(pspec.snap_id, in);
-      ::encode(c_imageid, in);
+      encode(pspec.pool_id, in);
+      encode(pspec.image_id, in);
+      encode(pspec.snap_id, in);
+      encode(c_imageid, in);
 
       op->exec("rbd", "add_child", in);
     }
@@ -440,10 +440,10 @@ namespace librbd {
                      const ParentSpec &pspec, const std::string &c_imageid)
     {
       bufferlist in;
-      ::encode(pspec.pool_id, in);
-      ::encode(pspec.image_id, in);
-      ::encode(pspec.snap_id, in);
-      ::encode(c_imageid, in);
+      encode(pspec.pool_id, in);
+      encode(pspec.image_id, in);
+      encode(pspec.snap_id, in);
+      encode(c_imageid, in);
       op->exec("rbd", "remove_child", in);
     }
 
@@ -458,16 +458,16 @@ namespace librbd {
     void get_children_start(librados::ObjectReadOperation *op,
                             const ParentSpec &pspec) {
       bufferlist in_bl;
-      ::encode(pspec.pool_id, in_bl);
-      ::encode(pspec.image_id, in_bl);
-      ::encode(pspec.snap_id, in_bl);
+      encode(pspec.pool_id, in_bl);
+      encode(pspec.image_id, in_bl);
+      encode(pspec.snap_id, in_bl);
       op->exec("rbd", "get_children", in_bl);
     }
 
     int get_children_finish(bufferlist::iterator *it,
                             std::set<std::string>* children) {
       try {
-        ::decode(*children, *it);
+        decode(*children, *it);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -494,16 +494,16 @@ namespace librbd {
                      const std::string &snap_name, const cls::rbd::SnapshotNamespace &snap_namespace)
     {
       bufferlist bl;
-      ::encode(snap_name, bl);
-      ::encode(snap_id, bl);
-      ::encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl);
+      encode(snap_name, bl);
+      encode(snap_id, bl);
+      encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl);
       op->exec("rbd", "snapshot_add", bl);
     }
 
     void snapshot_remove(librados::ObjectWriteOperation *op, snapid_t snap_id)
     {
       bufferlist bl;
-      ::encode(snap_id, bl);
+      encode(snap_id, bl);
       op->exec("rbd", "snapshot_remove", bl);
     }
 
@@ -512,8 +512,8 @@ namespace librbd {
                         const std::string &dst_name)
     {
       bufferlist bl;
-      ::encode(src_snap_id, bl);
-      ::encode(dst_name, bl);
+      encode(src_snap_id, bl);
+      encode(dst_name, bl);
       op->exec("rbd", "snapshot_rename", bl);
     }
 
@@ -527,7 +527,7 @@ namespace librbd {
                                ::SnapContext *snapc)
     {
       try {
-       ::decode(*snapc, *it);
+       decode(*snapc, *it);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -557,13 +557,13 @@ namespace librbd {
                              const std::vector<snapid_t> &ids) {
       for (auto snap_id : ids) {
         bufferlist bl1, bl2, bl3, bl4;
-        ::encode(snap_id, bl1);
+        encode(snap_id, bl1);
         op->exec("rbd", "get_snapshot_name", bl1);
-        ::encode(snap_id, bl2);
+        encode(snap_id, bl2);
         op->exec("rbd", "get_size", bl2);
-        ::encode(snap_id, bl3);
+        encode(snap_id, bl3);
         op->exec("rbd", "get_parent", bl3);
-        ::encode(snap_id, bl4);
+        encode(snap_id, bl4);
         op->exec("rbd", "get_protection_status", bl4);
       }
     }
@@ -583,17 +583,17 @@ namespace librbd {
        for (size_t i = 0; i < names->size(); ++i) {
          uint8_t order;
          // get_snapshot_name
-         ::decode((*names)[i], *it);
+         decode((*names)[i], *it);
          // get_size
-         ::decode(order, *it);
-         ::decode((*sizes)[i], *it);
+         decode(order, *it);
+         decode((*sizes)[i], *it);
          // get_parent
-         ::decode((*parents)[i].spec.pool_id, *it);
-         ::decode((*parents)[i].spec.image_id, *it);
-         ::decode((*parents)[i].spec.snap_id, *it);
-         ::decode((*parents)[i].overlap, *it);
+         decode((*parents)[i].spec.pool_id, *it);
+         decode((*parents)[i].spec.image_id, *it);
+         decode((*parents)[i].spec.snap_id, *it);
+         decode((*parents)[i].overlap, *it);
          // get_protection_status
-         ::decode((*protection_statuses)[i], *it);
+         decode((*protection_statuses)[i], *it);
        }
       } catch (const buffer::error &err) {
         return -EBADMSG;
@@ -627,7 +627,7 @@ namespace librbd {
     {
       for (auto snap_id : ids) {
         bufferlist bl;
-        ::encode(snap_id, bl);
+        encode(snap_id, bl);
         op->exec("rbd", "get_snapshot_timestamp", bl);
       }
     }
@@ -640,7 +640,7 @@ namespace librbd {
       try {
         for (size_t i = 0; i < timestamps->size(); ++i) {
           utime_t t;
-          ::decode(t, *it);
+          decode(t, *it);
           (*timestamps)[i] = t;
         }
       } catch (const buffer::error &err) {
@@ -671,7 +671,7 @@ namespace librbd {
     {
       for (auto snap_id : ids) {
         bufferlist bl;
-        ::encode(snap_id, bl);
+        encode(snap_id, bl);
         op->exec("rbd", "get_snapshot_namespace", bl);
       }
     }
@@ -684,7 +684,7 @@ namespace librbd {
       try {
        for (size_t i = 0; i < namespaces->size(); ++i) {
          cls::rbd::SnapshotNamespaceOnDisk e;
-         ::decode(e, *it);
+         decode(e, *it);
          (*namespaces)[i] = e.snapshot_namespace;
        }
       } catch (const buffer::error &err) {
@@ -714,8 +714,8 @@ namespace librbd {
                          snapid_t snap_id, const std::string &snap_name)
     {
       bufferlist bl;
-      ::encode(snap_name, bl);
-      ::encode(snap_id, bl);
+      encode(snap_name, bl);
+      encode(snap_id, bl);
       op->exec("rbd", "snap_add", bl);
     }
 
@@ -723,7 +723,7 @@ namespace librbd {
                             const std::string &snap_name)
     {
       bufferlist bl;
-      ::encode(snap_name, bl);
+      encode(snap_name, bl);
       op->exec("rbd", "snap_remove", bl);
     }
 
@@ -731,8 +731,8 @@ namespace librbd {
                             snapid_t src_snap_id, const std::string &dst_name)
     {
       bufferlist bl;
-      ::encode(src_snap_id, bl);
-      ::encode(dst_name, bl);
+      encode(src_snap_id, bl);
+      encode(dst_name, bl);
       op->exec("rbd", "snap_rename", bl);
     }
 
@@ -747,16 +747,16 @@ namespace librbd {
                                  ::SnapContext *snapc) {
       try {
        uint32_t num_snaps;
-       ::decode(snapc->seq, *it);
-       ::decode(num_snaps, *it);
+       decode(snapc->seq, *it);
+       decode(num_snaps, *it);
 
        names->resize(num_snaps);
        sizes->resize(num_snaps);
        snapc->snaps.resize(num_snaps);
        for (uint32_t i = 0; i < num_snaps; ++i) {
-         ::decode(snapc->snaps[i], *it);
-         ::decode((*sizes)[i], *it);
-         ::decode((*names)[i], *it);
+         decode(snapc->snaps[i], *it);
+         decode((*sizes)[i], *it);
+         decode((*names)[i], *it);
        }
       } catch (const buffer::error &err) {
         return -EBADMSG;
@@ -790,7 +790,7 @@ namespace librbd {
     int get_all_features_finish(bufferlist::iterator *it,
                                 uint64_t *all_features) {
       try {
-       ::decode(*all_features, *it);
+       decode(*all_features, *it);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -822,7 +822,7 @@ namespace librbd {
                              snapid_t snap_id, uint8_t *protection_status)
     {
       bufferlist in, out;
-      ::encode(snap_id.val, in);
+      encode(snap_id.val, in);
 
       int r = ioctx->exec(oid, "rbd", "get_protection_status", in, out);
       if (r < 0)
@@ -830,7 +830,7 @@ namespace librbd {
 
       try {
        bufferlist::iterator iter = out.begin();
-       ::decode(*protection_status, iter);
+       decode(*protection_status, iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -851,8 +851,8 @@ namespace librbd {
                                snapid_t snap_id, uint8_t protection_status)
     {
       bufferlist in;
-      ::encode(snap_id, in);
-      ::encode(protection_status, in);
+      encode(snap_id, in);
+      encode(protection_status, in);
       op->exec("rbd", "set_protection_status", in);
     }
 
@@ -868,7 +868,7 @@ namespace librbd {
 
       try {
        bufferlist::iterator iter = out.begin();
-       ::decode(*limit, iter);
+       decode(*limit, iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -879,7 +879,7 @@ namespace librbd {
     void snapshot_set_limit(librados::ObjectWriteOperation *op, uint64_t limit)
     {
       bufferlist in;
-      ::encode(limit, in);
+      encode(limit, in);
       op->exec("rbd", "snapshot_set_limit", in);
     }
 
@@ -895,8 +895,8 @@ namespace librbd {
       assert(stripe_count);
 
       try {
-       ::decode(*stripe_unit, *it);
-       ::decode(*stripe_count, *it);
+       decode(*stripe_unit, *it);
+       decode(*stripe_count, *it);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -923,8 +923,8 @@ namespace librbd {
                               uint64_t stripe_unit, uint64_t stripe_count)
     {
       bufferlist bl;
-      ::encode(stripe_unit, bl);
-      ::encode(stripe_count, bl);
+      encode(stripe_unit, bl);
+      encode(stripe_count, bl);
 
       op->exec("rbd", "set_stripe_unit_count", bl);
     }
@@ -948,7 +948,7 @@ namespace librbd {
       assert(timestamp);
 
       try {
-        ::decode(*timestamp, *it);
+        decode(*timestamp, *it);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -980,7 +980,7 @@ namespace librbd {
 
     int get_id_finish(bufferlist::iterator *it, std::string *id) {
       try {
-       ::decode(*id, *it);
+       decode(*id, *it);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -1005,7 +1005,7 @@ namespace librbd {
     void set_id(librados::ObjectWriteOperation *op, const std::string id)
     {
       bufferlist bl;
-      ::encode(id, bl);
+      encode(id, bl);
       op->exec("rbd", "set_id", bl);
     }
 
@@ -1022,14 +1022,14 @@ namespace librbd {
     void dir_get_id_start(librados::ObjectReadOperation *op,
                           const std::string &image_name) {
       bufferlist bl;
-      ::encode(image_name, bl);
+      encode(image_name, bl);
 
       op->exec("rbd", "dir_get_id", bl);
     }
 
     int dir_get_id_finish(bufferlist::iterator *iter, std::string *image_id) {
       try {
-        ::decode(*image_id, *iter);
+        decode(*image_id, *iter);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -1055,13 +1055,13 @@ namespace librbd {
     void dir_get_name_start(librados::ObjectReadOperation *op,
                            const std::string &id) {
       bufferlist in_bl;
-      ::encode(id, in_bl);
+      encode(id, in_bl);
       op->exec("rbd", "dir_get_name", in_bl);
     }
 
     int dir_get_name_finish(bufferlist::iterator *it, std::string *name) {
       try {
-       ::decode(*name, *it);
+       decode(*name, *it);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -1087,8 +1087,8 @@ namespace librbd {
                         const std::string &start, uint64_t max_return)
     {
       bufferlist in_bl;
-      ::encode(start, in_bl);
-      ::encode(max_return, in_bl);
+      encode(start, in_bl);
+      encode(max_return, in_bl);
 
       op->exec("rbd", "dir_list", in_bl);
     }
@@ -1096,7 +1096,7 @@ namespace librbd {
     int dir_list_finish(bufferlist::iterator *it, map<string, string> *images)
     {
       try {
-        ::decode(*images, *it);
+        decode(*images, *it);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -1124,8 +1124,8 @@ namespace librbd {
                       const std::string &name, const std::string &id)
     {
       bufferlist bl;
-      ::encode(name, bl);
-      ::encode(id, bl);
+      encode(name, bl);
+      encode(id, bl);
       op->exec("rbd", "dir_add_image", bl);
     }
 
@@ -1151,8 +1151,8 @@ namespace librbd {
                          const std::string &name, const std::string &id)
     {
       bufferlist bl;
-      ::encode(name, bl);
-      ::encode(id, bl);
+      encode(name, bl);
+      encode(id, bl);
 
       op->exec("rbd", "dir_remove_image", bl);
     }
@@ -1162,9 +1162,9 @@ namespace librbd {
                         const std::string &id)
     {
       bufferlist in;
-      ::encode(src, in);
-      ::encode(dest, in);
-      ::encode(id, in);
+      encode(src, in);
+      encode(dest, in);
+      encode(id, in);
       op->exec("rbd", "dir_rename_image", in);
     }
 
@@ -1214,8 +1214,8 @@ namespace librbd {
                            uint64_t object_count, uint8_t default_state)
     {
       bufferlist in;
-      ::encode(object_count, in);
-      ::encode(default_state, in);
+      encode(object_count, in);
+      encode(default_state, in);
       rados_op->exec("rbd", "object_map_resize", in);
     }
 
@@ -1225,10 +1225,10 @@ namespace librbd {
                           const boost::optional<uint8_t> &current_object_state)
     {
       bufferlist in;
-      ::encode(start_object_no, in);
-      ::encode(end_object_no, in);
-      ::encode(new_object_state, in);
-      ::encode(current_object_state, in);
+      encode(start_object_no, in);
+      encode(end_object_no, in);
+      encode(new_object_state, in);
+      encode(current_object_state, in);
       rados_op->exec("rbd", "object_map_update", in);
     }
 
@@ -1253,7 +1253,7 @@ namespace librbd {
                      const map<string, bufferlist> &data)
     {
       bufferlist bl;
-      ::encode(data, bl);
+      encode(data, bl);
 
       op->exec("rbd", "metadata_set", bl);
     }
@@ -1271,7 +1271,7 @@ namespace librbd {
                          const std::string &key)
     {
       bufferlist bl;
-      ::encode(key, bl);
+      encode(key, bl);
 
       op->exec("rbd", "metadata_remove", bl);
     }
@@ -1306,8 +1306,8 @@ namespace librbd {
                              const std::string &start, uint64_t max_return)
     {
       bufferlist in_bl;
-      ::encode(start, in_bl);
-      ::encode(max_return, in_bl);
+      encode(start, in_bl);
+      encode(max_return, in_bl);
       op->exec("rbd", "metadata_list", in_bl);
     }
 
@@ -1316,7 +1316,7 @@ namespace librbd {
     {
       assert(pairs);
       try {
-        ::decode(*pairs, *it);
+        decode(*pairs, *it);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -1328,14 +1328,14 @@ namespace librbd {
     {
       assert(s);
       bufferlist in, out;
-      ::encode(key, in);
+      encode(key, in);
       int r = ioctx->exec(oid, "rbd", "metadata_get", in, out);
       if (r < 0)
         return r;
 
       bufferlist::iterator iter = out.begin();
       try {
-        ::decode(*s, iter);
+        decode(*s, iter);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -1351,7 +1351,7 @@ namespace librbd {
     int mirror_uuid_get_finish(bufferlist::iterator *it,
                                std::string *uuid) {
       try {
-        ::decode(*uuid, *it);
+        decode(*uuid, *it);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -1378,7 +1378,7 @@ namespace librbd {
 
     int mirror_uuid_set(librados::IoCtx *ioctx, const std::string &uuid) {
       bufferlist in_bl;
-      ::encode(uuid, in_bl);
+      encode(uuid, in_bl);
 
       bufferlist out_bl;
       int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_uuid_set", in_bl,
@@ -1398,7 +1398,7 @@ namespace librbd {
                               cls::rbd::MirrorMode *mirror_mode) {
       try {
        uint32_t mirror_mode_decode;
-       ::decode(mirror_mode_decode, *it);
+       decode(mirror_mode_decode, *it);
        *mirror_mode = static_cast<cls::rbd::MirrorMode>(mirror_mode_decode);
       } catch (const buffer::error &err) {
        return -EBADMSG;
@@ -1432,7 +1432,7 @@ namespace librbd {
     int mirror_mode_set(librados::IoCtx *ioctx,
                         cls::rbd::MirrorMode mirror_mode) {
       bufferlist in_bl;
-      ::encode(static_cast<uint32_t>(mirror_mode), in_bl);
+      encode(static_cast<uint32_t>(mirror_mode), in_bl);
 
       bufferlist out_bl;
       int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_mode_set", in_bl,
@@ -1456,7 +1456,7 @@ namespace librbd {
       peers->clear();
       try {
         bufferlist::iterator bl_it = out_bl.begin();
-        ::decode(*peers, bl_it);
+        decode(*peers, bl_it);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -1468,7 +1468,7 @@ namespace librbd {
                         const std::string &client_name, int64_t pool_id) {
       cls::rbd::MirrorPeer peer(uuid, cluster_name, client_name, pool_id);
       bufferlist in_bl;
-      ::encode(peer, in_bl);
+      encode(peer, in_bl);
 
       bufferlist out_bl;
       int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_peer_add", in_bl,
@@ -1482,7 +1482,7 @@ namespace librbd {
     int mirror_peer_remove(librados::IoCtx *ioctx,
                            const std::string &uuid) {
       bufferlist in_bl;
-      ::encode(uuid, in_bl);
+      encode(uuid, in_bl);
 
       bufferlist out_bl;
       int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_peer_remove", in_bl,
@@ -1497,8 +1497,8 @@ namespace librbd {
                                const std::string &uuid,
                                const std::string &client_name) {
       bufferlist in_bl;
-      ::encode(uuid, in_bl);
-      ::encode(client_name, in_bl);
+      encode(uuid, in_bl);
+      encode(client_name, in_bl);
 
       bufferlist out_bl;
       int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_peer_set_client",
@@ -1513,8 +1513,8 @@ namespace librbd {
                                 const std::string &uuid,
                                 const std::string &cluster_name) {
       bufferlist in_bl;
-      ::encode(uuid, in_bl);
-      ::encode(cluster_name, in_bl);
+      encode(uuid, in_bl);
+      encode(cluster_name, in_bl);
 
       bufferlist out_bl;
       int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_peer_set_cluster",
@@ -1529,8 +1529,8 @@ namespace librbd {
                                  const std::string &start, uint64_t max_return)
     {
       bufferlist in_bl;
-      ::encode(start, in_bl);
-      ::encode(max_return, in_bl);
+      encode(start, in_bl);
+      encode(max_return, in_bl);
       op->exec("rbd", "mirror_image_list", in_bl);
     }
 
@@ -1538,7 +1538,7 @@ namespace librbd {
                                  std::map<string, string> *mirror_image_ids)
     {
       try {
-        ::decode(*mirror_image_ids, *it);
+        decode(*mirror_image_ids, *it);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -1564,14 +1564,14 @@ namespace librbd {
     void mirror_image_get_image_id_start(librados::ObjectReadOperation *op,
                                          const std::string &global_image_id) {
       bufferlist in_bl;
-      ::encode(global_image_id, in_bl);
+      encode(global_image_id, in_bl);
       op->exec( "rbd", "mirror_image_get_image_id", in_bl);
     }
 
     int mirror_image_get_image_id_finish(bufferlist::iterator *it,
                                          std::string *image_id) {
       try {
-       ::decode(*image_id, *it);
+       decode(*image_id, *it);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -1616,7 +1616,7 @@ namespace librbd {
     void mirror_image_get_start(librados::ObjectReadOperation *op,
                                 const std::string &image_id) {
       bufferlist in_bl;
-      ::encode(image_id, in_bl);
+      encode(image_id, in_bl);
 
       op->exec("rbd", "mirror_image_get", in_bl);
     }
@@ -1624,7 +1624,7 @@ namespace librbd {
     int mirror_image_get_finish(bufferlist::iterator *iter,
                                cls::rbd::MirrorImage *mirror_image) {
       try {
-        ::decode(*mirror_image, *iter);
+        decode(*mirror_image, *iter);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -1635,8 +1635,8 @@ namespace librbd {
                          const std::string &image_id,
                          const cls::rbd::MirrorImage &mirror_image) {
       bufferlist bl;
-      ::encode(image_id, bl);
-      ::encode(mirror_image, bl);
+      encode(image_id, bl);
+      encode(mirror_image, bl);
 
       op->exec("rbd", "mirror_image_set", bl);
     }
@@ -1656,7 +1656,7 @@ namespace librbd {
     void mirror_image_remove(librados::ObjectWriteOperation *op,
                             const std::string &image_id) {
       bufferlist bl;
-      ::encode(image_id, bl);
+      encode(image_id, bl);
 
       op->exec("rbd", "mirror_image_remove", bl);
     }
@@ -1684,8 +1684,8 @@ namespace librbd {
                                 const std::string &global_image_id,
                                 const cls::rbd::MirrorImageStatus &status) {
       bufferlist bl;
-      ::encode(global_image_id, bl);
-      ::encode(status, bl);
+      encode(global_image_id, bl);
+      encode(status, bl);
       op->exec("rbd", "mirror_image_status_set", bl);
     }
 
@@ -1699,7 +1699,7 @@ namespace librbd {
     void mirror_image_status_remove(librados::ObjectWriteOperation *op,
                                    const std::string &global_image_id) {
       bufferlist bl;
-      ::encode(global_image_id, bl);
+      encode(global_image_id, bl);
       op->exec("rbd", "mirror_image_status_remove", bl);
     }
 
@@ -1726,14 +1726,14 @@ namespace librbd {
     void mirror_image_status_get_start(librados::ObjectReadOperation *op,
                                       const std::string &global_image_id) {
       bufferlist bl;
-      ::encode(global_image_id, bl);
+      encode(global_image_id, bl);
       op->exec("rbd", "mirror_image_status_get", bl);
     }
 
     int mirror_image_status_get_finish(bufferlist::iterator *iter,
                                       cls::rbd::MirrorImageStatus *status) {
       try {
-       ::decode(*status, *iter);
+       decode(*status, *iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -1765,8 +1765,8 @@ namespace librbd {
                                        const std::string &start,
                                        uint64_t max_return) {
       bufferlist bl;
-      ::encode(start, bl);
-      ::encode(max_return, bl);
+      encode(start, bl);
+      encode(max_return, bl);
       op->exec("rbd", "mirror_image_status_list", bl);
     }
 
@@ -1776,8 +1776,8 @@ namespace librbd {
       images->clear();
       statuses->clear();
       try {
-       ::decode(*images, *iter);
-       ::decode(*statuses, *iter);
+       decode(*images, *iter);
+       decode(*statuses, *iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -1812,7 +1812,7 @@ namespace librbd {
     int mirror_image_status_get_summary_finish(bufferlist::iterator *iter,
        std::map<cls::rbd::MirrorImageStatusState, int> *states) {
       try {
-       ::decode(*states, *iter);
+       decode(*states, *iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -1839,7 +1839,7 @@ namespace librbd {
                                      std::vector<std::string> *instance_ids) {
       instance_ids->clear();
       try {
-       ::decode(*instance_ids, *iter);
+       decode(*instance_ids, *iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -1868,7 +1868,7 @@ namespace librbd {
     void mirror_instances_add(librados::ObjectWriteOperation *op,
                               const std::string &instance_id) {
       bufferlist bl;
-      ::encode(instance_id, bl);
+      encode(instance_id, bl);
       op->exec("rbd", "mirror_instances_add", bl);
     }
 
@@ -1882,7 +1882,7 @@ namespace librbd {
     void mirror_instances_remove(librados::ObjectWriteOperation *op,
                                  const std::string &instance_id) {
       bufferlist bl;
-      ::encode(instance_id, bl);
+      encode(instance_id, bl);
       op->exec("rbd", "mirror_instances_remove", bl);
     }
 
@@ -1897,8 +1897,8 @@ namespace librbd {
                                      const std::string &start_after,
                                      uint64_t max_read) {
       bufferlist bl;
-      ::encode(start_after, bl);
-      ::encode(max_read, bl);
+      encode(start_after, bl);
+      encode(max_read, bl);
 
       op->exec("rbd", "mirror_image_map_list", bl);
     }
@@ -1906,7 +1906,7 @@ namespace librbd {
     int mirror_image_map_list_finish(bufferlist::iterator *iter,
                                      std::map<std::string, cls::rbd::MirrorImageMap> *image_mapping) {
       try {
-        ::decode(*image_mapping, *iter);
+        decode(*image_mapping, *iter);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
@@ -1917,8 +1917,8 @@ namespace librbd {
                                  const std::string &global_image_id,
                                  const cls::rbd::MirrorImageMap &image_map) {
       bufferlist bl;
-      ::encode(global_image_id, bl);
-      ::encode(image_map, bl);
+      encode(global_image_id, bl);
+      encode(image_map, bl);
 
       op->exec("rbd", "mirror_image_map_update", bl);
     }
@@ -1926,7 +1926,7 @@ namespace librbd {
     void mirror_image_map_remove(librados::ObjectWriteOperation *op,
                                  const std::string &global_image_id) {
       bufferlist bl;
-      ::encode(global_image_id, bl);
+      encode(global_image_id, bl);
 
       op->exec("rbd", "mirror_image_map_remove", bl);
     }
@@ -1944,15 +1944,15 @@ namespace librbd {
                     map<string, string> *cgs)
     {
       bufferlist in, out;
-      ::encode(start, in);
-      ::encode(max_return, in);
+      encode(start, in);
+      encode(max_return, in);
       int r = ioctx->exec(oid, "rbd", "group_dir_list", in, out);
       if (r < 0)
        return r;
 
       bufferlist::iterator iter = out.begin();
       try {
-       ::decode(*cgs, iter);
+       decode(*cgs, iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -1964,8 +1964,8 @@ namespace librbd {
                   const std::string &name, const std::string &id)
     {
       bufferlist in, out;
-      ::encode(name, in);
-      ::encode(id, in);
+      encode(name, in);
+      encode(id, in);
       return ioctx->exec(oid, "rbd", "group_dir_add", in, out);
     }
 
@@ -1973,8 +1973,8 @@ namespace librbd {
                      const std::string &name, const std::string &id)
     {
       bufferlist in, out;
-      ::encode(name, in);
-      ::encode(id, in);
+      encode(name, in);
+      encode(id, in);
       return ioctx->exec(oid, "rbd", "group_dir_remove", in, out);
     }
 
@@ -1982,7 +1982,7 @@ namespace librbd {
                           const cls::rbd::GroupImageSpec &spec)
     {
       bufferlist bl, bl2;
-      ::encode(spec, bl);
+      encode(spec, bl);
 
       return ioctx->exec(oid, "rbd", "group_image_remove", bl, bl2);
     }
@@ -1994,8 +1994,8 @@ namespace librbd {
                         std::vector<cls::rbd::GroupImageStatus> *images)
     {
       bufferlist bl, bl2;
-      ::encode(start, bl);
-      ::encode(max_return, bl);
+      encode(start, bl);
+      encode(max_return, bl);
 
       int r = ioctx->exec(oid, "rbd", "group_image_list", bl, bl2);
       if (r < 0)
@@ -2003,7 +2003,7 @@ namespace librbd {
 
       bufferlist::iterator iter = bl2.begin();
       try {
-       ::decode(*images, iter);
+       decode(*images, iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -2015,7 +2015,7 @@ namespace librbd {
                        const cls::rbd::GroupImageStatus &st)
     {
       bufferlist bl, bl2;
-      ::encode(st, bl);
+      encode(st, bl);
 
       return ioctx->exec(oid, "rbd", "group_image_set", bl, bl2);
     }
@@ -2024,7 +2024,7 @@ namespace librbd {
                        const cls::rbd::GroupSpec &group_spec)
     {
       bufferlist bl, bl2;
-      ::encode(group_spec, bl);
+      encode(group_spec, bl);
 
       return ioctx->exec(oid, "rbd", "image_add_group", bl, bl2);
     }
@@ -2033,7 +2033,7 @@ namespace librbd {
                           const cls::rbd::GroupSpec &group_spec)
     {
       bufferlist bl, bl2;
-      ::encode(group_spec, bl);
+      encode(group_spec, bl);
 
       return ioctx->exec(oid, "rbd", "image_remove_group", bl, bl2);
     }
@@ -2048,7 +2048,7 @@ namespace librbd {
                                cls::rbd::GroupSpec *group_spec)
     {
       try {
-       ::decode(*group_spec, *iter);
+       decode(*group_spec, *iter);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -2077,8 +2077,8 @@ namespace librbd {
                    const cls::rbd::TrashImageSpec &trash_spec)
     {
       bufferlist bl;
-      ::encode(id, bl);
-      ::encode(trash_spec, bl);
+      encode(id, bl);
+      encode(trash_spec, bl);
       op->exec("rbd", "trash_add", bl);
     }
 
@@ -2095,7 +2095,7 @@ namespace librbd {
                      const std::string &id)
     {
       bufferlist bl;
-      ::encode(id, bl);
+      encode(id, bl);
       op->exec("rbd", "trash_remove", bl);
     }
 
@@ -2111,8 +2111,8 @@ namespace librbd {
                           const std::string &start, uint64_t max_return)
     {
       bufferlist bl;
-      ::encode(start, bl);
-      ::encode(max_return, bl);
+      encode(start, bl);
+      encode(max_return, bl);
       op->exec("rbd", "trash_list", bl);
     }
 
@@ -2122,7 +2122,7 @@ namespace librbd {
       assert(entries);
 
       try {
-       ::decode(*entries, *it);
+       decode(*entries, *it);
       } catch (const buffer::error &err) {
        return -EBADMSG;
       }
@@ -2151,7 +2151,7 @@ namespace librbd {
                         const std::string &id)
     {
       bufferlist bl;
-      ::encode(id, bl);
+      encode(id, bl);
       op->exec("rbd", "trash_get", bl);
     }
 
@@ -2159,7 +2159,7 @@ namespace librbd {
                           cls::rbd::TrashImageSpec *trash_spec) {
       assert(trash_spec);
       try {
-        ::decode(*trash_spec, *it);
+        decode(*trash_spec, *it);
       } catch (const buffer::error &err) {
         return -EBADMSG;
       }
index 8c1767c4edf8eabdc10ab8de3975d720fd4decb7..86a2a0d4da07022a1c68d3b0767d4f34bed795c7 100644 (file)
@@ -10,19 +10,19 @@ namespace rbd {
 
 void MirrorPeer::encode(bufferlist &bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(uuid, bl);
-  ::encode(cluster_name, bl);
-  ::encode(client_name, bl);
-  ::encode(pool_id, bl);
+  encode(uuid, bl);
+  encode(cluster_name, bl);
+  encode(client_name, bl);
+  encode(pool_id, bl);
   ENCODE_FINISH(bl);
 }
 
 void MirrorPeer::decode(bufferlist::iterator &it) {
   DECODE_START(1, it);
-  ::decode(uuid, it);
-  ::decode(cluster_name, it);
-  ::decode(client_name, it);
-  ::decode(pool_id, it);
+  decode(uuid, it);
+  decode(cluster_name, it);
+  decode(client_name, it);
+  decode(pool_id, it);
   DECODE_FINISH(it);
 }
 
@@ -77,16 +77,16 @@ std::ostream& operator<<(std::ostream& os, const MirrorPeer& peer) {
 
 void MirrorImage::encode(bufferlist &bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(global_image_id, bl);
-  ::encode(static_cast<uint8_t>(state), bl);
+  encode(global_image_id, bl);
+  encode(static_cast<uint8_t>(state), bl);
   ENCODE_FINISH(bl);
 }
 
 void MirrorImage::decode(bufferlist::iterator &it) {
   uint8_t int_state;
   DECODE_START(1, it);
-  ::decode(global_image_id, it);
-  ::decode(int_state, it);
+  decode(global_image_id, it);
+  decode(int_state, it);
   state = static_cast<MirrorImageState>(int_state);
   DECODE_FINISH(it);
 }
@@ -135,19 +135,19 @@ std::ostream& operator<<(std::ostream& os, const MirrorImage& mirror_image) {
 
 void MirrorImageStatus::encode(bufferlist &bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(state, bl);
-  ::encode(description, bl);
-  ::encode(last_update, bl);
-  ::encode(up, bl);
+  encode(state, bl);
+  encode(description, bl);
+  encode(last_update, bl);
+  encode(up, bl);
   ENCODE_FINISH(bl);
 }
 
 void MirrorImageStatus::decode(bufferlist::iterator &it) {
   DECODE_START(1, it);
-  ::decode(state, it);
-  ::decode(description, it);
-  ::decode(last_update, it);
-  ::decode(up, it);
+  decode(state, it);
+  decode(description, it);
+  decode(last_update, it);
+  decode(up, it);
   DECODE_FINISH(it);
 }
 
@@ -214,15 +214,15 @@ std::ostream& operator<<(std::ostream& os, const MirrorImageStatus& status) {
 
 void GroupImageSpec::encode(bufferlist &bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(image_id, bl);
-  ::encode(pool_id, bl);
+  encode(image_id, bl);
+  encode(pool_id, bl);
   ENCODE_FINISH(bl);
 }
 
 void GroupImageSpec::decode(bufferlist::iterator &it) {
   DECODE_START(1, it);
-  ::decode(image_id, it);
-  ::decode(pool_id, it);
+  decode(image_id, it);
+  decode(pool_id, it);
   DECODE_FINISH(it);
 }
 
@@ -266,15 +266,15 @@ std::string GroupImageSpec::image_key() {
 
 void GroupImageStatus::encode(bufferlist &bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(spec, bl);
-  ::encode(state, bl);
+  encode(spec, bl);
+  encode(state, bl);
   ENCODE_FINISH(bl);
 }
 
 void GroupImageStatus::decode(bufferlist::iterator &it) {
   DECODE_START(1, it);
-  ::decode(spec, it);
-  ::decode(state, it);
+  decode(spec, it);
+  decode(state, it);
   DECODE_FINISH(it);
 }
 
@@ -296,15 +296,15 @@ void GroupImageStatus::dump(Formatter *f) const {
 
 void GroupSpec::encode(bufferlist &bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(pool_id, bl);
-  ::encode(group_id, bl);
+  encode(pool_id, bl);
+  encode(group_id, bl);
   ENCODE_FINISH(bl);
 }
 
 void GroupSpec::decode(bufferlist::iterator &it) {
   DECODE_START(1, it);
-  ::decode(pool_id, it);
-  ::decode(group_id, it);
+  decode(pool_id, it);
+  decode(group_id, it);
   DECODE_FINISH(it);
 }
 
@@ -318,15 +318,17 @@ bool GroupSpec::is_valid() const {
 }
 
 void GroupSnapshotNamespace::encode(bufferlist& bl) const {
-  ::encode(group_pool, bl);
-  ::encode(group_id, bl);
-  ::encode(snapshot_id, bl);
+  using ceph::encode;
+  encode(group_pool, bl);
+  encode(group_id, bl);
+  encode(snapshot_id, bl);
 }
 
 void GroupSnapshotNamespace::decode(bufferlist::iterator& it) {
-  ::decode(group_pool, it);
-  ::decode(group_id, it);
-  ::decode(snapshot_id, it);
+  using ceph::decode;
+  decode(group_pool, it);
+  decode(group_id, it);
+  decode(snapshot_id, it);
 }
 
 void GroupSnapshotNamespace::dump(Formatter *f) const {
@@ -342,7 +344,8 @@ public:
 
   template <typename T>
   inline void operator()(const T& t) const {
-    ::encode(static_cast<uint32_t>(T::SNAPSHOT_NAMESPACE_TYPE), m_bl);
+    using ceph::encode;
+    encode(static_cast<uint32_t>(T::SNAPSHOT_NAMESPACE_TYPE), m_bl);
     t.encode(m_bl);
   }
 
@@ -404,7 +407,7 @@ void SnapshotNamespaceOnDisk::decode(bufferlist::iterator &p)
 {
   DECODE_START(1, p);
   uint32_t snap_type;
-  ::decode(snap_type, p);
+  decode(snap_type, p);
   switch (snap_type) {
     case cls::rbd::SNAPSHOT_NAMESPACE_TYPE_USER:
       snapshot_namespace = UserSnapshotNamespace();
@@ -450,19 +453,19 @@ std::ostream& operator<<(std::ostream& os, const UnknownSnapshotNamespace& ns) {
 
 void TrashImageSpec::encode(bufferlist& bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(source, bl);
-  ::encode(name, bl);
-  ::encode(deletion_time, bl);
-  ::encode(deferment_end_time, bl);
+  encode(source, bl);
+  encode(name, bl);
+  encode(deletion_time, bl);
+  encode(deferment_end_time, bl);
   ENCODE_FINISH(bl);
 }
 
 void TrashImageSpec::decode(bufferlist::iterator &it) {
   DECODE_START(1, it);
-  ::decode(source, it);
-  ::decode(name, it);
-  ::decode(deletion_time, it);
-  ::decode(deferment_end_time, it);
+  decode(source, it);
+  decode(name, it);
+  decode(deletion_time, it);
+  decode(deferment_end_time, it);
   DECODE_FINISH(it);
 }
 
@@ -481,17 +484,17 @@ void TrashImageSpec::dump(Formatter *f) const {
 
 void MirrorImageMap::encode(bufferlist &bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(instance_id, bl);
-  ::encode(mapped_time, bl);
-  ::encode(data, bl);
+  encode(instance_id, bl);
+  encode(mapped_time, bl);
+  encode(data, bl);
   ENCODE_FINISH(bl);
 }
 
 void MirrorImageMap::decode(bufferlist::iterator &it) {
   DECODE_START(1, it);
-  ::decode(instance_id, it);
-  ::decode(mapped_time, it);
-  ::decode(data, it);
+  decode(instance_id, it);
+  decode(mapped_time, it);
+  decode(data, it);
   DECODE_FINISH(it);
 }
 
index d50281d8bf4060599cd537c46a4eeff23f4c6941..266daac8c784353ddbd965966981de44da2437df 100644 (file)
@@ -37,13 +37,15 @@ enum GroupImageLinkState {
 inline void encode(const GroupImageLinkState &state, bufferlist& bl,
                   uint64_t features=0)
 {
-  ::encode(static_cast<uint8_t>(state), bl);
+  using ceph::encode;
+  encode(static_cast<uint8_t>(state), bl);
 }
 
 inline void decode(GroupImageLinkState &state, bufferlist::iterator& it)
 {
   uint8_t int_state;
-  ::decode(int_state, it);
+  using ceph::decode;
+  decode(int_state, it);
   state = static_cast<GroupImageLinkState>(int_state);
 }
 
@@ -121,13 +123,15 @@ enum MirrorImageStatusState {
 inline void encode(const MirrorImageStatusState &state, bufferlist& bl,
                   uint64_t features=0)
 {
-  ::encode(static_cast<uint8_t>(state), bl);
+  using ceph::encode;
+  encode(static_cast<uint8_t>(state), bl);
 }
 
 inline void decode(MirrorImageStatusState &state, bufferlist::iterator& it)
 {
   uint8_t int_state;
-  ::decode(int_state, it);
+  using ceph::decode;
+  decode(int_state, it);
   state = static_cast<MirrorImageStatusState>(int_state);
 }
 
@@ -336,13 +340,15 @@ enum TrashImageSource {
 inline void encode(const TrashImageSource &source, bufferlist& bl,
                   uint64_t features=0)
 {
-  ::encode(static_cast<uint8_t>(source), bl);
+  using ceph::encode;
+  encode(static_cast<uint8_t>(source), bl);
 }
 
 inline void decode(TrashImageSource &source, bufferlist::iterator& it)
 {
   uint8_t int_source;
-  ::decode(int_source, it);
+  using ceph::decode;
+  decode(int_source, it);
   source = static_cast<TrashImageSource>(int_source);
 }
 
@@ -405,7 +411,4 @@ WRITE_CLASS_ENCODER(MirrorImageMap);
 } // namespace rbd
 } // namespace cls
 
-using cls::rbd::encode;
-using cls::rbd::decode;
-
 #endif // CEPH_CLS_RBD_TYPES_H
index 8f06e6f855d72b956a2e3e41265211d2ca7b167e..11a600d50db3fd2d1feafcf6ba1ca7e12e26aa80 100644 (file)
@@ -22,16 +22,16 @@ struct obj_refcount {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 1, bl);
-    ::encode(refs, bl);
-    ::encode(retired_refs, bl);
+    encode(refs, bl);
+    encode(retired_refs, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(2, bl);
-    ::decode(refs, bl);
+    decode(refs, bl);
     if (struct_v >= 2) {
-      ::decode(retired_refs, bl);
+      decode(retired_refs, bl);
     }
     DECODE_FINISH(bl);
   }
@@ -56,7 +56,7 @@ static int read_refcount(cls_method_context_t hctx, bool implicit_ref, obj_refco
 
   try {
     bufferlist::iterator iter = bl.begin();
-    ::decode(*objr, iter);
+    decode(*objr, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: read_refcount(): failed to decode refcount entry\n");
     return -EIO;
@@ -69,7 +69,7 @@ static int set_refcount(cls_method_context_t hctx, const struct obj_refcount& ob
 {
   bufferlist bl;
 
-  ::encode(objr, bl);
+  encode(objr, bl);
 
   int ret = cls_cxx_setxattr(hctx, REFCOUNT_ATTR, &bl);
   if (ret < 0)
@@ -84,7 +84,7 @@ static int cls_rc_refcount_get(cls_method_context_t hctx, bufferlist *in, buffer
 
   cls_refcount_get_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rc_refcount_get(): failed to decode entry\n");
     return -EINVAL;
@@ -112,7 +112,7 @@ static int cls_rc_refcount_put(cls_method_context_t hctx, bufferlist *in, buffer
 
   cls_refcount_put_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rc_refcount_put(): failed to decode entry\n");
     return -EINVAL;
@@ -165,7 +165,7 @@ static int cls_rc_refcount_set(cls_method_context_t hctx, bufferlist *in, buffer
 
   cls_refcount_set_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_refcount_set(): failed to decode entry\n");
     return -EINVAL;
@@ -194,7 +194,7 @@ static int cls_rc_refcount_read(cls_method_context_t hctx, bufferlist *in, buffe
 
   cls_refcount_read_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rc_refcount_read(): failed to decode entry\n");
     return -EINVAL;
@@ -212,7 +212,7 @@ static int cls_rc_refcount_read(cls_method_context_t hctx, bufferlist *in, buffe
     read_ret.refs.push_back(iter->first);
   }
 
-  ::encode(read_ret, *out);
+  encode(read_ret, *out);
 
   return 0;
 }
index 1c27a80add436189a77ba36c38030fb001a4cc3d..14da2ff2b316f5c79e245348563ab272b688e127 100644 (file)
@@ -13,7 +13,7 @@ void cls_refcount_get(librados::ObjectWriteOperation& op, const string& tag, boo
   cls_refcount_get_op call;
   call.tag = tag;
   call.implicit_ref = implicit_ref;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("refcount", "get", in);
 }
 
@@ -23,7 +23,7 @@ void cls_refcount_put(librados::ObjectWriteOperation& op, const string& tag, boo
   cls_refcount_put_op call;
   call.tag = tag;
   call.implicit_ref = implicit_ref;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("refcount", "put", in);
 }
 
@@ -32,7 +32,7 @@ void cls_refcount_set(librados::ObjectWriteOperation& op, list<string>& refs)
   bufferlist in;
   cls_refcount_set_op call;
   call.refs = refs;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("refcount", "set", in);
 }
 
@@ -41,7 +41,7 @@ int cls_refcount_read(librados::IoCtx& io_ctx, string& oid, list<string> *refs,
   bufferlist in, out;
   cls_refcount_read_op call;
   call.implicit_ref = implicit_ref;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, "refcount", "read", in, out);
   if (r < 0)
     return r;
@@ -49,7 +49,7 @@ int cls_refcount_read(librados::IoCtx& io_ctx, string& oid, list<string> *refs,
   cls_refcount_read_ret ret;
   try {
     bufferlist::iterator iter = out.begin();
-    ::decode(ret, iter);
+    decode(ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
index 5cbfe3b8b655944960d0f84b8bf38acfd0a19130..24aa28482cae305cd63f6b8ebf79078abe08c1f7 100644 (file)
@@ -16,15 +16,15 @@ struct cls_refcount_get_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(tag, bl);
-    ::encode(implicit_ref, bl);
+    encode(tag, bl);
+    encode(implicit_ref, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(tag, bl);
-    ::decode(implicit_ref, bl);
+    decode(tag, bl);
+    decode(implicit_ref, bl);
     DECODE_FINISH(bl);
   }
   void dump(ceph::Formatter *f) const;
@@ -41,15 +41,15 @@ struct cls_refcount_put_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(tag, bl);
-    ::encode(implicit_ref, bl);
+    encode(tag, bl);
+    encode(implicit_ref, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(tag, bl);
-    ::decode(implicit_ref, bl);
+    decode(tag, bl);
+    decode(implicit_ref, bl);
     DECODE_FINISH(bl);
   }
 
@@ -65,13 +65,13 @@ struct cls_refcount_set_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(refs, bl);
+    encode(refs, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(refs, bl);
+    decode(refs, bl);
     DECODE_FINISH(bl);
   }
 
@@ -88,13 +88,13 @@ struct cls_refcount_read_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(implicit_ref, bl);
+    encode(implicit_ref, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(implicit_ref, bl);
+    decode(implicit_ref, bl);
     DECODE_FINISH(bl);
   }
 
@@ -110,13 +110,13 @@ struct cls_refcount_read_ret {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(refs, bl);
+    encode(refs, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(refs, bl);
+    decode(refs, bl);
     DECODE_FINISH(bl);
   }
 
index e8ae3bc3dedc6dd5a5c4ff53382be350d4fdd78d..35ed639e69e4529124685cc30ccb7ea54cc707ee 100644 (file)
@@ -30,7 +30,7 @@ static int get_bounds(cls_method_context_t hctx, cls_replica_log_bound& bound)
 
   try {
     bufferlist::iterator bounds_bl_i = bounds_bl.begin();
-    ::decode(bound, bounds_bl_i);
+    decode(bound, bounds_bl_i);
   } catch (buffer::error& err) {
     bound = cls_replica_log_bound();
     CLS_LOG(0, "ERROR: get_bounds(): failed to decode on-disk bounds object");
@@ -44,7 +44,7 @@ static int write_bounds(cls_method_context_t hctx,
                         const cls_replica_log_bound& bound)
 {
   bufferlist bounds_bl;
-  ::encode(bound, bounds_bl);
+  encode(bound, bounds_bl);
   return cls_cxx_map_set_val(hctx, replica_log_bounds, &bounds_bl);
 }
 
@@ -55,7 +55,7 @@ static int cls_replica_log_set(cls_method_context_t hctx,
 
   cls_replica_log_set_marker_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: cls_replica_log_set(): failed to decode op");
     return -EINVAL;
@@ -82,7 +82,7 @@ static int cls_replica_log_delete(cls_method_context_t hctx,
 
   cls_replica_log_delete_marker_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: cls_replica_log_delete(): failed to decode op");
     return -EINVAL;
@@ -109,7 +109,7 @@ static int cls_replica_log_get(cls_method_context_t hctx,
 
   cls_replica_log_get_bounds_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: cls_replica_log_get(): failed to decode op");
     return -EINVAL;
@@ -126,7 +126,7 @@ static int cls_replica_log_get(cls_method_context_t hctx,
   ret.position_marker = bound.get_lowest_marker_bound();
   bound.get_markers(ret.markers);
 
-  ::encode(ret, *out);
+  encode(ret, *out);
   return 0;
 }
 
index 13e876dc22e4e558aa8e63350b92b891edddf7dd..cb764e7430862aa4764f98493d3c3a29ea0314c2 100644 (file)
@@ -50,7 +50,7 @@ void cls_replica_log_update_bound(librados::ObjectWriteOperation& o,
 {
   cls_replica_log_set_marker_op op(progress);
   bufferlist in;
-  ::encode(op, in);
+  encode(op, in);
   o.exec("replica_log", "set", in);
 }
 
@@ -59,7 +59,7 @@ void cls_replica_log_delete_bound(librados::ObjectWriteOperation& o,
 {
   cls_replica_log_delete_marker_op op(entity);
   bufferlist in;
-  ::encode(op, in);
+  encode(op, in);
   o.exec("replica_log", "delete", in);
 }
 
@@ -71,7 +71,7 @@ int cls_replica_log_get_bounds(librados::IoCtx& io_ctx, const string& oid,
   bufferlist in;
   bufferlist out;
   cls_replica_log_get_bounds_op op;
-  ::encode(op, in);
+  encode(op, in);
   int r = io_ctx.exec(oid, "replica_log", "get", in, out);
   if (r < 0)
     return r;
@@ -79,7 +79,7 @@ int cls_replica_log_get_bounds(librados::IoCtx& io_ctx, const string& oid,
   cls_replica_log_get_bounds_ret ret;
   try {
     bufferlist::iterator i = out.begin();
-    ::decode(ret, i);
+    decode(ret, i);
   } catch (buffer::error& err) {
     return -EIO;
   }
index 85ba5e08de4178ba622aae63b280a8f627ed7cdd..07227de0fa2e5d3c50677da09d9178990d6b8c35 100644 (file)
@@ -19,13 +19,13 @@ struct cls_replica_log_delete_marker_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(entity_id, bl);
+    encode(entity_id, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(entity_id, bl);
+    decode(entity_id, bl);
     DECODE_FINISH(bl);
   }
 
@@ -43,13 +43,13 @@ struct cls_replica_log_set_marker_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(marker, bl);
+    encode(marker, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(marker, bl);
+    decode(marker, bl);
     DECODE_FINISH(bl);
   }
 
@@ -89,17 +89,17 @@ struct cls_replica_log_get_bounds_ret {
   {}
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(position_marker, bl);
-    ::encode(oldest_time, bl);
-    ::encode(markers, bl);
+    encode(position_marker, bl);
+    encode(oldest_time, bl);
+    encode(markers, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(position_marker, bl);
-    ::decode(oldest_time, bl);
-    ::decode(markers, bl);
+    decode(position_marker, bl);
+    decode(oldest_time, bl);
+    decode(markers, bl);
     DECODE_FINISH(bl);
   }
 
index b1cfe8e836bcda3e8970dd720972ddfbbef96eac..4121f1f87878c47b9dfccd8219b909a961036a2f 100644 (file)
@@ -29,15 +29,15 @@ struct cls_replica_log_item_marker {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(item_name, bl);
-    ::encode(item_timestamp, bl);
+    encode(item_name, bl);
+    encode(item_timestamp, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(item_name, bl);
-    ::decode(item_timestamp, bl);
+    decode(item_name, bl);
+    decode(item_timestamp, bl);
     DECODE_FINISH(bl);
   }
 
@@ -68,19 +68,19 @@ struct cls_replica_log_progress_marker {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(entity_id, bl);
-    ::encode(position_marker, bl);
-    ::encode(position_time, bl);
-    ::encode(items, bl);
+    encode(entity_id, bl);
+    encode(position_marker, bl);
+    encode(position_time, bl);
+    encode(items, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(entity_id, bl);
-    ::decode(position_marker, bl);
-    ::decode(position_time, bl);
-    ::decode(items, bl);
+    decode(entity_id, bl);
+    decode(position_marker, bl);
+    decode(position_time, bl);
+    decode(items, bl);
     DECODE_FINISH(bl);
   }
 
@@ -166,21 +166,21 @@ public:
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(position_marker, bl);
-    ::encode(position_time, bl);
-    ::encode(marker_exists, bl);
+    encode(position_marker, bl);
+    encode(position_time, bl);
+    encode(marker_exists, bl);
     if (marker_exists) {
-      ::encode(marker, bl);
+      encode(marker, bl);
     }
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(position_marker, bl);
-    ::decode(position_time, bl);
-    ::decode(marker_exists, bl);
+    decode(position_marker, bl);
+    decode(position_time, bl);
+    decode(marker_exists, bl);
     if (marker_exists) {
-      ::decode(marker, bl);
+      decode(marker, bl);
     }
     DECODE_FINISH(bl);
   }
index bd726c85e8d40ecd8aafa2bf1919e80abac4ed9d..ca404ca1e27fee8094f6152d25195f5582f80688 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include "include/types.h"
@@ -27,7 +27,7 @@ CLS_NAME(rgw)
 
 #define BI_BUCKET_LAST_INDEX          4
 
-static string bucket_index_prefixes[] = { "", /* special handling for the objs list index */
+static std::string bucket_index_prefixes[] = { "", /* special handling for the objs list index */
                                           "0_",     /* bucket log index */
                                           "1000_",  /* obj instance index */
                                           "1001_",  /* olh data index */
@@ -133,7 +133,7 @@ static int log_index_operation(cls_method_context_t hctx, cls_rgw_obj_key& obj_k
   string key;
   bi_log_index_key(hctx, key, entry.id, index_ver);
 
-  ::encode(entry, bl);
+  encode(entry, bl);
 
   if (entry.id > max_marker)
     max_marker = entry.id;
@@ -365,7 +365,7 @@ static int read_bucket_header(cls_method_context_t hctx, struct rgw_bucket_dir_h
   }
   bufferlist::iterator iter = bl.begin();
   try {
-    ::decode(*header, iter);
+    decode(*header, iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: read_bucket_header(): failed to decode header\n");
     return -EIO;
@@ -380,7 +380,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   struct rgw_cls_list_op op;
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode request\n");
     return -EINVAL;
@@ -422,7 +422,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       bufferlist& entrybl = kiter->second;
       bufferlist::iterator eiter = entrybl.begin();
       try {
-        ::decode(entry, eiter);
+        decode(entry, eiter);
       } catch (buffer::error& err) {
         CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode entry, key=%s\n", kiter->first.c_str());
         return -EINVAL;
@@ -456,7 +456,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   ret.is_truncated = more && !done;
 
-  ::encode(ret, *out);
+  encode(ret, *out);
   return 0;
 }
 
@@ -494,7 +494,7 @@ static int check_index(cls_method_context_t hctx, struct rgw_bucket_dir_header *
       struct rgw_bucket_dir_entry entry;
       bufferlist::iterator eiter = kiter->second.begin();
       try {
-        ::decode(entry, eiter);
+        decode(entry, eiter);
       } catch (buffer::error& err) {
         CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode entry, key=%s\n", kiter->first.c_str());
         return -EIO;
@@ -520,7 +520,7 @@ int rgw_bucket_check_index(cls_method_context_t hctx, bufferlist *in, bufferlist
   if (rc < 0)
     return rc;
 
-  ::encode(ret, *out);
+  encode(ret, *out);
 
   return 0;
 }
@@ -530,7 +530,7 @@ static int write_bucket_header(cls_method_context_t hctx, struct rgw_bucket_dir_
   header->ver++;
 
   bufferlist header_bl;
-  ::encode(*header, header_bl);
+  encode(*header, header_bl);
   return cls_cxx_map_write_header(hctx, &header_bl);
 }
 
@@ -552,7 +552,7 @@ int rgw_bucket_update_stats(cls_method_context_t hctx, bufferlist *in, bufferlis
   rgw_cls_bucket_update_stats_op op;
   auto iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: %s(): failed to decode request\n", __func__);
     return -EINVAL;
@@ -611,7 +611,7 @@ int rgw_bucket_set_tag_timeout(cls_method_context_t hctx, bufferlist *in, buffer
   rgw_cls_tag_timeout_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bucket_set_tag_timeout(): failed to decode request\n");
     return -EINVAL;
@@ -638,7 +638,7 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist
   rgw_cls_obj_prepare_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bucket_prepare_op(): failed to decode request\n");
     return -EINVAL;
@@ -694,7 +694,7 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   // write out new key to disk
   bufferlist info_bl;
-  ::encode(entry, info_bl);
+  encode(entry, info_bl);
   rc = cls_cxx_map_set_val(hctx, idx, &info_bl);
   if (rc < 0)
     return rc;
@@ -738,7 +738,7 @@ static int read_index_entry(cls_method_context_t hctx, string& name, T *entry)
 
   bufferlist::iterator cur_iter = current_entry.begin();
   try {
-    ::decode(*entry, cur_iter);
+    decode(*entry, cur_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: read_index_entry(): failed to decode entry\n");
     return -EIO;
@@ -786,7 +786,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
   rgw_cls_obj_complete_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bucket_complete_op(): failed to decode request\n");
     return -EINVAL;
@@ -853,7 +853,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
 
     if (op.tag.size()) {
       bufferlist new_key_bl;
-      ::encode(entry, new_key_bl);
+      encode(entry, new_key_bl);
       return cls_cxx_map_set_val(hctx, idx, &new_key_bl);
     } else {
       return 0;
@@ -876,7 +876,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
       } else {
         entry.exists = false;
         bufferlist new_key_bl;
-        ::encode(entry, new_key_bl);
+        encode(entry, new_key_bl);
        int ret = cls_cxx_map_set_val(hctx, idx, &new_key_bl);
        if (ret < 0)
          return ret;
@@ -898,7 +898,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
       stats.total_size_rounded += cls_rgw_get_rounded_size(meta.accounted_size);
       stats.actual_size += meta.size;
       bufferlist new_key_bl;
-      ::encode(entry, new_key_bl);
+      encode(entry, new_key_bl);
       int ret = cls_cxx_map_set_val(hctx, idx, &new_key_bl);
       if (ret < 0)
        return ret;
@@ -953,7 +953,7 @@ template <class T>
 static int write_entry(cls_method_context_t hctx, T& entry, const string& key)
 {
   bufferlist bl;
-  ::encode(entry, bl);
+  encode(entry, bl);
   return cls_cxx_map_set_val(hctx, key, &bl);
 }
 
@@ -1174,7 +1174,7 @@ public:
     map<string, bufferlist>::reverse_iterator last = keys.rbegin();
     try {
       bufferlist::iterator iter = last->second.begin();
-      ::decode(next_entry, iter);
+      decode(next_entry, iter);
     } catch (buffer::error& err) {
       CLS_LOG(0, "ERROR; failed to decode entry: %s", last->first.c_str());
       return -EIO;
@@ -1366,7 +1366,7 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
   rgw_cls_link_olh_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_bucket_link_olh_op(): failed to decode request\n");
     return -EINVAL;
@@ -1548,7 +1548,7 @@ static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in,
   rgw_cls_unlink_instance_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_bucket_rm_obj_instance_op(): failed to decode request\n");
     return -EINVAL;
@@ -1693,7 +1693,7 @@ static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bu
   rgw_cls_read_olh_log_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_bucket_read_olh_log(): failed to decode request\n");
     return -EINVAL;
@@ -1735,7 +1735,7 @@ static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bu
     op_ret.is_truncated = (iter != log.end());
   }
 
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
 
   return 0;
 }
@@ -1746,7 +1746,7 @@ static int rgw_bucket_trim_olh_log(cls_method_context_t hctx, bufferlist *in, bu
   rgw_cls_trim_olh_log_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_bucket_trim_olh_log(): failed to decode request\n");
     return -EINVAL;
@@ -1797,7 +1797,7 @@ static int rgw_bucket_clear_olh(cls_method_context_t hctx, bufferlist *in, buffe
   rgw_cls_bucket_clear_olh_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_bucket_clear_olh(): failed to decode request\n");
     return -EINVAL;
@@ -1882,8 +1882,8 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
     rgw_bucket_dir_entry cur_change;
     rgw_bucket_dir_entry cur_disk;
     try {
-      ::decode(op, in_iter);
-      ::decode(cur_change, in_iter);
+      decode(op, in_iter);
+      decode(cur_change, in_iter);
     } catch (buffer::error& err) {
       CLS_LOG(1, "ERROR: rgw_dir_suggest_changes(): failed to decode request\n");
       return -EINVAL;
@@ -1899,7 +1899,7 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
     if (cur_disk_bl.length()) {
       bufferlist::iterator cur_disk_iter = cur_disk_bl.begin();
       try {
-        ::decode(cur_disk, cur_disk_iter);
+        decode(cur_disk, cur_disk_iter);
       } catch (buffer::error& error) {
         CLS_LOG(1, "ERROR: rgw_dir_suggest_changes(): failed to decode cur_disk\n");
         return -EINVAL;
@@ -1972,7 +1972,7 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
         header_changed = true;
         cur_change.index_ver = header.ver;
         bufferlist cur_state_bl;
-        ::encode(cur_change, cur_state_bl);
+        encode(cur_change, cur_state_bl);
         ret = cls_cxx_map_set_val(hctx, cur_change_key, &cur_state_bl);
         if (ret < 0)
          return ret;
@@ -2001,7 +2001,7 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist
   rgw_cls_obj_remove_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -2074,7 +2074,7 @@ static int rgw_obj_store_pg_ver(cls_method_context_t hctx, bufferlist *in, buffe
   rgw_cls_obj_store_pg_ver_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -2082,7 +2082,7 @@ static int rgw_obj_store_pg_ver(cls_method_context_t hctx, bufferlist *in, buffe
 
   bufferlist bl;
   uint64_t ver = cls_current_version(hctx);
-  ::encode(ver, bl);
+  encode(ver, bl);
   int ret = cls_cxx_setxattr(hctx, op.attr.c_str(), &bl);
   if (ret < 0) {
     CLS_LOG(0, "ERROR: %s(): cls_cxx_setxattr (attr=%s) returned %d", __func__, op.attr.c_str(), ret);
@@ -2098,7 +2098,7 @@ static int rgw_obj_check_attrs_prefix(cls_method_context_t hctx, bufferlist *in,
   rgw_cls_obj_check_attrs_prefix op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -2141,7 +2141,7 @@ static int rgw_obj_check_mtime(cls_method_context_t hctx, bufferlist *in, buffer
   rgw_cls_obj_check_mtime op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -2204,7 +2204,7 @@ static int rgw_bi_get_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
   rgw_cls_bi_get_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -2240,7 +2240,7 @@ static int rgw_bi_get_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
       return r;
   }
 
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
 
   return 0;
 }
@@ -2251,7 +2251,7 @@ static int rgw_bi_put_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
   rgw_cls_bi_put_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -2299,7 +2299,7 @@ static int list_plain_entries(cls_method_context_t hctx, const string& name, con
 
     rgw_bucket_dir_entry e;
     try {
-      ::decode(e, biter);
+      decode(e, biter);
     } catch (buffer::error& err) {
       CLS_LOG(0, "ERROR: %s(): failed to decode buffer", __func__);
       return -EIO;
@@ -2379,7 +2379,7 @@ static int list_instance_entries(cls_method_context_t hctx, const string& name,
 
     rgw_bucket_dir_entry e;
     try {
-      ::decode(e, biter);
+      decode(e, biter);
     } catch (buffer::error& err) {
       CLS_LOG(0, "ERROR: %s(): failed to decode buffer (size=%d)", __func__, entry.data.length());
       return -EIO;
@@ -2456,7 +2456,7 @@ static int list_olh_entries(cls_method_context_t hctx, const string& name, const
 
     rgw_bucket_olh_entry e;
     try {
-      ::decode(e, biter);
+      decode(e, biter);
     } catch (buffer::error& err) {
       CLS_LOG(0, "ERROR: %s(): failed to decode buffer (size=%d)", __func__, entry.data.length());
       return -EIO;
@@ -2480,7 +2480,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx, bufferlist *in, bufferlist
   rgw_cls_bi_list_op op;
   bufferlist::iterator iter = in->begin();
   try {
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -2528,7 +2528,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx, bufferlist *in, bufferlist
     count--;
   }
 
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
 
   return 0;
 }
@@ -2537,7 +2537,7 @@ int bi_log_record_decode(bufferlist& bl, rgw_bi_log_entry& e)
 {
   bufferlist::iterator iter = bl.begin();
   try {
-    ::decode(e, iter);
+    decode(e, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: failed to decode rgw_bi_log_entry");
     return -EIO;
@@ -2645,7 +2645,7 @@ static int rgw_bi_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   cls_rgw_bi_log_list_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bi_log_list(): failed to decode entry\n");
     return -EINVAL;
@@ -2656,7 +2656,7 @@ static int rgw_bi_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist
   if (ret < 0)
     return ret;
 
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
 
   return 0;
 }
@@ -2696,7 +2696,7 @@ static int rgw_bi_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   cls_rgw_bi_log_trim_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bi_log_list(): failed to decode entry\n");
     return -EINVAL;
@@ -2745,7 +2745,7 @@ static int rgw_bi_log_resync(cls_method_context_t hctx, bufferlist *in, bufferli
   string key;
   bi_log_index_key(hctx, key, entry.id, header.ver);
 
-  ::encode(entry, bl);
+  encode(entry, bl);
 
   if (entry.id > header.max_marker)
     header.max_marker = entry.id;
@@ -2779,7 +2779,7 @@ static int rgw_bi_log_stop(cls_method_context_t hctx, bufferlist *in, bufferlist
   string key;
   bi_log_index_key(hctx, key, entry.id, header.ver);
 
-  ::encode(entry, bl);
+  encode(entry, bl);
 
   if (entry.id > header.max_marker)
     header.max_marker = entry.id;
@@ -2825,7 +2825,7 @@ static int usage_record_decode(bufferlist& record_bl, rgw_usage_log_entry& e)
 {
   bufferlist::iterator kiter = record_bl.begin();
   try {
-    ::decode(e, kiter);
+    decode(e, kiter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: usage_record_decode(): failed to decode record_bl\n");
     return -EINVAL;
@@ -2842,7 +2842,7 @@ int rgw_user_usage_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist
   rgw_cls_usage_log_add_op op;
 
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_user_usage_log_add(): failed to decode request\n");
     return -EINVAL;
@@ -2877,7 +2877,7 @@ int rgw_user_usage_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist
     }
 
     bufferlist new_record_bl;
-    ::encode(entry, new_record_bl);
+    encode(entry, new_record_bl);
     ret = cls_cxx_map_set_val(hctx, key_by_time, &new_record_bl);
     if (ret < 0)
       return ret;
@@ -3004,7 +3004,7 @@ int rgw_user_usage_log_read(cls_method_context_t hctx, bufferlist *in, bufferlis
   rgw_cls_usage_log_read_op op;
 
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_user_usage_log_read(): failed to decode request\n");
     return -EINVAL;
@@ -3022,7 +3022,7 @@ int rgw_user_usage_log_read(cls_method_context_t hctx, bufferlist *in, bufferlis
   if (ret_info.truncated)
     ret_info.next_iter = iter;
 
-  ::encode(ret_info, *out);
+  encode(ret_info, *out);
   return 0;
 }
 
@@ -3055,7 +3055,7 @@ int rgw_user_usage_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlis
   rgw_cls_usage_log_trim_op op;
 
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_user_log_usage_log_trim(): failed to decode request\n");
     return -EINVAL;
@@ -3103,7 +3103,7 @@ static int gc_omap_get(cls_method_context_t hctx, int type, const string& key, c
 
   try {
     bufferlist::iterator iter = bl.begin();
-    ::decode(*info, iter);
+    decode(*info, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_cls_gc_omap_get(): failed to decode index=%s\n", index.c_str());
   }
@@ -3114,7 +3114,7 @@ static int gc_omap_get(cls_method_context_t hctx, int type, const string& key, c
 static int gc_omap_set(cls_method_context_t hctx, int type, const string& key, const cls_rgw_gc_obj_info *info)
 {
   bufferlist bl;
-  ::encode(*info, bl);
+  encode(*info, bl);
 
   string index = gc_index_prefixes[type];
   index.append(key);
@@ -3194,7 +3194,7 @@ int gc_record_decode(bufferlist& bl, cls_rgw_gc_obj_info& e)
 {
   bufferlist::iterator iter = bl.begin();
   try {
-    ::decode(e, iter);
+    decode(e, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: failed to decode cls_rgw_gc_obj_info");
     return -EIO;
@@ -3208,7 +3208,7 @@ static int rgw_cls_gc_set_entry(cls_method_context_t hctx, bufferlist *in, buffe
 
   cls_rgw_gc_set_entry_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_gc_set_entry(): failed to decode entry\n");
     return -EINVAL;
@@ -3223,7 +3223,7 @@ static int rgw_cls_gc_defer_entry(cls_method_context_t hctx, bufferlist *in, buf
 
   cls_rgw_gc_defer_entry_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_gc_defer_entry(): failed to decode entry\n");
     return -EINVAL;
@@ -3327,7 +3327,7 @@ static int rgw_cls_gc_list(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   cls_rgw_gc_list_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_gc_list(): failed to decode entry\n");
     return -EINVAL;
@@ -3340,7 +3340,7 @@ static int rgw_cls_gc_list(cls_method_context_t hctx, bufferlist *in, bufferlist
   if (ret < 0)
     return ret;
 
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
 
   return 0;
 }
@@ -3384,7 +3384,7 @@ static int rgw_cls_gc_remove(cls_method_context_t hctx, bufferlist *in, bufferli
 
   cls_rgw_gc_remove_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_gc_remove(): failed to decode entry\n");
     return -EINVAL;
@@ -3399,14 +3399,14 @@ static int rgw_cls_lc_set_entry(cls_method_context_t hctx, bufferlist *in, buffe
 
   cls_rgw_lc_set_entry_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_set_entry(): failed to decode entry\n");
     return -EINVAL;
   }
 
   bufferlist bl;
-  ::encode(op.entry, bl);
+  encode(op.entry, bl);
 
   int ret = cls_cxx_map_set_val(hctx, op.entry.first, &bl);
   return ret;
@@ -3418,7 +3418,7 @@ static int rgw_cls_lc_rm_entry(cls_method_context_t hctx, bufferlist *in, buffer
 
   cls_rgw_lc_rm_entry_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_rm_entry(): failed to decode entry\n");
     return -EINVAL;
@@ -3434,7 +3434,7 @@ static int rgw_cls_lc_get_next_entry(cls_method_context_t hctx, bufferlist *in,
   cls_rgw_lc_get_next_entry_ret op_ret;
   cls_rgw_lc_get_next_entry_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_get_next_entry: failed to decode op\n");
     return -EINVAL;
@@ -3452,14 +3452,14 @@ static int rgw_cls_lc_get_next_entry(cls_method_context_t hctx, bufferlist *in,
     it=vals.begin();
     in_iter = it->second.begin();
     try {
-      ::decode(entry, in_iter);
+      decode(entry, in_iter);
     } catch (buffer::error& err) {
       CLS_LOG(1, "ERROR: rgw_cls_lc_get_next_entry(): failed to decode entry\n");
       return -EIO;
     }
   }
   op_ret.entry = entry;
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
   return 0;
 }
 
@@ -3468,7 +3468,7 @@ static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in, bu
   cls_rgw_lc_list_entries_op op;
   bufferlist::iterator in_iter = in->begin();
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_list_entries(): failed to decode op\n");
     return -EINVAL;
@@ -3486,14 +3486,14 @@ static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in, bu
   for (it = vals.begin(); it != vals.end(); ++it) {
     iter = it->second.begin();
     try {
-    ::decode(entry, iter);
+    decode(entry, iter);
     } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_list_entries(): failed to decode entry\n");
     return -EIO;
    }
    op_ret.entries.insert(entry);
   }
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
   return 0;
 }
 
@@ -3503,14 +3503,14 @@ static int rgw_cls_lc_put_head(cls_method_context_t hctx, bufferlist *in, buffer
 
   cls_rgw_lc_put_head_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_put_head(): failed to decode entry\n");
     return -EINVAL;
   }
 
   bufferlist bl;
-  ::encode(op.head, bl);
+  encode(op.head, bl);
   int ret = cls_cxx_map_write_header(hctx,&bl);
   return ret;
 }
@@ -3525,7 +3525,7 @@ static int rgw_cls_lc_get_head(cls_method_context_t hctx, bufferlist *in,  buffe
   if (bl.length() != 0) {
     bufferlist::iterator iter = bl.begin();
     try {
-      ::decode(head, iter);
+      decode(head, iter);
     } catch (buffer::error& err) {
       CLS_LOG(0, "ERROR: rgw_cls_lc_get_head(): failed to decode entry %s\n",err.what());
       return -EINVAL;
@@ -3536,7 +3536,7 @@ static int rgw_cls_lc_get_head(cls_method_context_t hctx, bufferlist *in,  buffe
   }
   cls_rgw_lc_get_head_ret op_ret;
   op_ret.head = head;
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
   return 0;
 }
 
@@ -3546,7 +3546,7 @@ static int rgw_reshard_add(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   cls_rgw_reshard_add_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_reshard_add: failed to decode entry\n");
     return -EINVAL;
@@ -3557,7 +3557,7 @@ static int rgw_reshard_add(cls_method_context_t hctx, bufferlist *in, bufferlist
   op.entry.get_key(&key);
 
   bufferlist bl;
-  ::encode(op.entry, bl);
+  encode(op.entry, bl);
   int ret = cls_cxx_map_set_val(hctx, key, &bl);
   if (ret < 0) {
     CLS_ERR("error adding reshard job for bucket %s with key %s",op.entry.bucket_name.c_str(), key.c_str());
@@ -3572,7 +3572,7 @@ static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlis
   cls_rgw_reshard_list_op op;
   bufferlist::iterator in_iter = in->begin();
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_rehard_list(): failed to decode entry\n");
     return -EINVAL;
@@ -3593,14 +3593,14 @@ static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlis
   for (it = vals.begin(); i < (int)op.max && it != vals.end(); ++it, ++i) {
     iter = it->second.begin();
     try {
-      ::decode(entry, iter);
+      decode(entry, iter);
     } catch (buffer::error& err) {
       CLS_LOG(1, "ERROR: rgw_cls_rehard_list(): failed to decode entry\n");
       return -EIO;
    }
     op_ret.entries.push_back(entry);
   }
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
   return 0;
 }
 
@@ -3612,7 +3612,7 @@ static int get_reshard_entry(cls_method_context_t hctx, const string& key, cls_r
     return ret;
   bufferlist::iterator iter = bl.begin();
   try {
-    ::decode(*entry, iter);
+    decode(*entry, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: %s : failed to decode entry %s\n", __func__, err.what());
     return -EIO;
@@ -3626,7 +3626,7 @@ static int rgw_reshard_get(cls_method_context_t hctx, bufferlist *in,  bufferlis
 
   cls_rgw_reshard_get_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_reshard_get: failed to decode entry\n");
     return -EINVAL;
@@ -3642,7 +3642,7 @@ static int rgw_reshard_get(cls_method_context_t hctx, bufferlist *in,  bufferlis
 
   cls_rgw_reshard_get_ret op_ret;
   op_ret.entry = entry;
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
   return 0;
 }
 
@@ -3652,7 +3652,7 @@ static int rgw_reshard_remove(cls_method_context_t hctx, bufferlist *in, bufferl
 
   cls_rgw_reshard_remove_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_rehard_remove: failed to decode entry\n");
     return -EINVAL;
@@ -3685,7 +3685,7 @@ static int rgw_set_bucket_resharding(cls_method_context_t hctx, bufferlist *in,
 
   bufferlist::iterator in_iter = in->begin();
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rgw_set_bucket_resharding: failed to decode entry\n");
     return -EINVAL;
@@ -3709,7 +3709,7 @@ static int rgw_clear_bucket_resharding(cls_method_context_t hctx, bufferlist *in
 
   bufferlist::iterator in_iter = in->begin();
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rgw_clear_bucket_resharding: failed to decode entry\n");
     return -EINVAL;
@@ -3732,7 +3732,7 @@ static int rgw_guard_bucket_resharding(cls_method_context_t hctx, bufferlist *in
 
   bufferlist::iterator in_iter = in->begin();
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rgw_clear_bucket_resharding: failed to decode entry\n");
     return -EINVAL;
@@ -3758,7 +3758,7 @@ static int rgw_get_bucket_resharding(cls_method_context_t hctx, bufferlist *in,
 
   bufferlist::iterator in_iter = in->begin();
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rgw_clear_bucket_resharding: failed to decode entry\n");
     return -EINVAL;
@@ -3774,7 +3774,7 @@ static int rgw_get_bucket_resharding(cls_method_context_t hctx, bufferlist *in,
   cls_rgw_get_bucket_resharding_ret op_ret;
   op_ret.new_instance = header.new_instance;
 
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
 
   return 0;
 }
index 3c4ed919a6de243a20d8d30978099aecb10d43c8..69fb45456ad44abd9aa0adc2ad725bf8dc14ddf4 100644 (file)
@@ -27,7 +27,7 @@ public:
     if (r >= 0) {
       try {
         bufferlist::iterator iter = outbl.begin();
-        ::decode((*data), iter);
+        decode((*data), iter);
       } catch (buffer::error& err) {
         r = -EIO;
       }
@@ -112,7 +112,7 @@ static bool issue_bucket_set_tag_timeout_op(librados::IoCtx& io_ctx,
   bufferlist in;
   struct rgw_cls_tag_timeout_op call;
   call.tag_timeout = timeout;
-  ::encode(call, in);
+  encode(call, in);
   ObjectWriteOperation op;
   op.exec(RGW_CLASS, RGW_BUCKET_SET_TAG_TIMEOUT, in);
   return manager->aio_operate(io_ctx, oid, &op);
@@ -143,7 +143,7 @@ void cls_rgw_bucket_update_stats(librados::ObjectWriteOperation& o, bool absolut
   call.absolute = absolute;
   call.stats = stats;
   bufferlist in;
-  ::encode(call, in);
+  encode(call, in);
   o.exec(RGW_CLASS, RGW_BUCKET_UPDATE_STATS, in);
 }
 
@@ -160,7 +160,7 @@ void cls_rgw_bucket_prepare_op(ObjectWriteOperation& o, RGWModifyOp op, string&
   call.bilog_flags = bilog_flags;
   call.zones_trace = zones_trace;
   bufferlist in;
-  ::encode(call, in);
+  encode(call, in);
   o.exec(RGW_CLASS, RGW_BUCKET_PREPARE_OP, in);
 }
 
@@ -187,7 +187,7 @@ void cls_rgw_bucket_complete_op(ObjectWriteOperation& o, RGWModifyOp op, string&
   if (zones_trace) {
     call.zones_trace = *zones_trace;
   }
-  ::encode(call, in);
+  encode(call, in);
   o.exec(RGW_CLASS, RGW_BUCKET_COMPLETE_OP, in);
 }
 
@@ -201,7 +201,7 @@ static bool issue_bucket_list_op(librados::IoCtx& io_ctx,
   call.filter_prefix = filter_prefix;
   call.num_entries = num_entries;
   call.list_versions = list_versions;
-  ::encode(call, in);
+  encode(call, in);
 
   librados::ObjectReadOperation op;
   op.exec(RGW_CLASS, RGW_BUCKET_LIST, in, new ClsBucketIndexOpCtx<struct rgw_cls_list_ret>(pdata, NULL));
@@ -218,7 +218,7 @@ void cls_rgw_remove_obj(librados::ObjectWriteOperation& o, list<string>& keep_at
   bufferlist in;
   struct rgw_cls_obj_remove_op call;
   call.keep_attr_prefixes = keep_attr_prefixes;
-  ::encode(call, in);
+  encode(call, in);
   o.exec(RGW_CLASS, RGW_OBJ_REMOVE, in);
 }
 
@@ -227,7 +227,7 @@ void cls_rgw_obj_store_pg_ver(librados::ObjectWriteOperation& o, const string& a
   bufferlist in;
   struct rgw_cls_obj_store_pg_ver_op call;
   call.attr = attr;
-  ::encode(call, in);
+  encode(call, in);
   o.exec(RGW_CLASS, RGW_OBJ_STORE_PG_VER, in);
 }
 
@@ -237,7 +237,7 @@ void cls_rgw_obj_check_attrs_prefix(librados::ObjectOperation& o, const string&
   struct rgw_cls_obj_check_attrs_prefix call;
   call.check_prefix = prefix;
   call.fail_if_exist = fail_if_exist;
-  ::encode(call, in);
+  encode(call, in);
   o.exec(RGW_CLASS, RGW_OBJ_CHECK_ATTRS_PREFIX, in);
 }
 
@@ -248,7 +248,7 @@ void cls_rgw_obj_check_mtime(librados::ObjectOperation& o, const real_time& mtim
   call.mtime = mtime;
   call.high_precision_time = high_precision_time;
   call.type = type;
-  ::encode(call, in);
+  encode(call, in);
   o.exec(RGW_CLASS, RGW_OBJ_CHECK_MTIME, in);
 }
 
@@ -260,7 +260,7 @@ int cls_rgw_bi_get(librados::IoCtx& io_ctx, const string oid,
   struct rgw_cls_bi_get_op call;
   call.key = key;
   call.type = index_type;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, RGW_CLASS, RGW_BI_GET, in, out);
   if (r < 0)
     return r;
@@ -268,7 +268,7 @@ int cls_rgw_bi_get(librados::IoCtx& io_ctx, const string oid,
   struct rgw_cls_bi_get_ret op_ret;
   bufferlist::iterator iter = out.begin();
   try {
-    ::decode(op_ret, iter);
+    decode(op_ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -283,7 +283,7 @@ int cls_rgw_bi_put(librados::IoCtx& io_ctx, const string oid, rgw_cls_bi_entry&
   bufferlist in, out;
   struct rgw_cls_bi_put_op call;
   call.entry = entry;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, RGW_CLASS, RGW_BI_PUT, in, out);
   if (r < 0)
     return r;
@@ -296,7 +296,7 @@ void cls_rgw_bi_put(ObjectWriteOperation& op, const string oid, rgw_cls_bi_entry
   bufferlist in, out;
   struct rgw_cls_bi_put_op call;
   call.entry = entry;
-  ::encode(call, in);
+  encode(call, in);
   op.exec(RGW_CLASS, RGW_BI_PUT, in);
 }
 
@@ -309,7 +309,7 @@ int cls_rgw_bi_list(librados::IoCtx& io_ctx, const string oid,
   call.name = name;
   call.marker = marker;
   call.max = max;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, RGW_CLASS, RGW_BI_LIST, in, out);
   if (r < 0)
     return r;
@@ -317,7 +317,7 @@ int cls_rgw_bi_list(librados::IoCtx& io_ctx, const string oid,
   struct rgw_cls_bi_list_ret op_ret;
   bufferlist::iterator iter = out.begin();
   try {
-    ::decode(op_ret, iter);
+    decode(op_ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -347,7 +347,7 @@ int cls_rgw_bucket_link_olh(librados::IoCtx& io_ctx, librados::ObjectWriteOperat
   call.unmod_since = unmod_since;
   call.high_precision_time = high_precision_time;
   call.zones_trace = zones_trace;
-  ::encode(call, in);
+  encode(call, in);
   op.exec(RGW_CLASS, RGW_BUCKET_LINK_OLH, in);
   int r = io_ctx.operate(oid, &op);
   if (r < 0)
@@ -369,7 +369,7 @@ int cls_rgw_bucket_unlink_instance(librados::IoCtx& io_ctx, librados::ObjectWrit
   call.olh_tag = olh_tag;
   call.log_op = log_op;
   call.zones_trace = zones_trace;
-  ::encode(call, in);
+  encode(call, in);
   op.exec(RGW_CLASS, RGW_BUCKET_UNLINK_INSTANCE, in);
   int r = io_ctx.operate(oid, &op);
   if (r < 0)
@@ -387,7 +387,7 @@ int cls_rgw_get_olh_log(IoCtx& io_ctx, string& oid, librados::ObjectReadOperatio
   call.olh = olh;
   call.ver_marker = ver_marker;
   call.olh_tag = olh_tag;
-  ::encode(call, in);
+  encode(call, in);
   int op_ret;
   op.exec(RGW_CLASS, RGW_BUCKET_READ_OLH_LOG, in, &out, &op_ret);
   int r = io_ctx.operate(oid, &op, NULL);
@@ -401,7 +401,7 @@ int cls_rgw_get_olh_log(IoCtx& io_ctx, string& oid, librados::ObjectReadOperatio
   struct rgw_cls_read_olh_log_ret ret;
   try {
     bufferlist::iterator iter = out.begin();
-    ::decode(ret, iter);
+    decode(ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -423,7 +423,7 @@ void cls_rgw_trim_olh_log(librados::ObjectWriteOperation& op, const cls_rgw_obj_
   call.olh = olh;
   call.ver = ver;
   call.olh_tag = olh_tag;
-  ::encode(call, in);
+  encode(call, in);
   op.exec(RGW_CLASS, RGW_BUCKET_TRIM_OLH_LOG, in);
 }
 
@@ -433,7 +433,7 @@ int cls_rgw_clear_olh(IoCtx& io_ctx, librados::ObjectWriteOperation& op, string&
   struct rgw_cls_bucket_clear_olh_op call;
   call.key = olh;
   call.olh_tag = olh_tag;
-  ::encode(call, in);
+  encode(call, in);
   int op_ret;
   op.exec(RGW_CLASS, RGW_BUCKET_CLEAR_OLH, in, &out, &op_ret);
   int r = io_ctx.operate(oid, &op);
@@ -450,7 +450,7 @@ static bool issue_bi_log_list_op(librados::IoCtx& io_ctx, const string& oid, int
   cls_rgw_bi_log_list_op call;
   call.marker = marker_mgr.get(shard_id, "");
   call.max = max;
-  ::encode(call, in);
+  encode(call, in);
 
   librados::ObjectReadOperation op;
   op.exec(RGW_CLASS, RGW_BI_LOG_LIST, in, new ClsBucketIndexOpCtx<struct cls_rgw_bi_log_list_ret>(pdata, NULL));
@@ -469,7 +469,7 @@ static bool issue_bi_log_trim(librados::IoCtx& io_ctx, const string& oid, int sh
   cls_rgw_bi_log_trim_op call;
   call.start_marker = start_marker_mgr.get(shard_id, "");
   call.end_marker = end_marker_mgr.get(shard_id, "");
-  ::encode(call, in);
+  encode(call, in);
   ObjectWriteOperation op;
   op.exec(RGW_CLASS, RGW_BI_LOG_TRIM, in);
   return manager->aio_operate(io_ctx, oid, &op);
@@ -510,7 +510,7 @@ int CLSRGWIssueBucketRebuild::issue_op(int shard_id, const string& oid)
 void cls_rgw_encode_suggestion(char op, rgw_bucket_dir_entry& dirent, bufferlist& updates)
 {
   updates.append(op);
-  ::encode(dirent, updates);
+  encode(dirent, updates);
 }
 
 void cls_rgw_suggest_changes(ObjectWriteOperation& o, bufferlist& updates)
@@ -561,7 +561,7 @@ public:
     struct rgw_cls_list_ret ret;
     try {
       bufferlist::iterator iter = outbl.begin();
-      ::decode(ret, iter);
+      decode(ret, iter);
     } catch (buffer::error& err) {
       r = -EIO;
     }
@@ -575,7 +575,7 @@ int cls_rgw_get_dir_header_async(IoCtx& io_ctx, string& oid, RGWGetDirHeader_CB
   bufferlist in, out;
   struct rgw_cls_list_op call;
   call.num_entries = 0;
-  ::encode(call, in);
+  encode(call, in);
   ObjectReadOperation op;
   GetDirHeaderCompletion *cb = new GetDirHeaderCompletion(ctx);
   op.exec(RGW_CLASS, RGW_BUCKET_LIST, in, cb);
@@ -603,7 +603,7 @@ int cls_rgw_usage_log_read(IoCtx& io_ctx, string& oid, string& user,
   call.owner = user;
   call.max_entries = max_entries;
   call.iter = read_iter;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, RGW_CLASS, RGW_USER_USAGE_LOG_READ, in, out);
   if (r < 0)
     return r;
@@ -611,7 +611,7 @@ int cls_rgw_usage_log_read(IoCtx& io_ctx, string& oid, string& user,
   try {
     rgw_cls_usage_log_read_ret result;
     bufferlist::iterator iter = out.begin();
-    ::decode(result, iter);
+    decode(result, iter);
     read_iter = result.next_iter;
     if (is_truncated)
       *is_truncated = result.truncated;
@@ -632,7 +632,7 @@ int cls_rgw_usage_log_trim(IoCtx& io_ctx, const string& oid, string& user,
   call.start_epoch = start_epoch;
   call.end_epoch = end_epoch;
   call.user = user;
-  ::encode(call, in);
+  encode(call, in);
 
   bool done = false;
   do {
@@ -655,7 +655,7 @@ void cls_rgw_usage_log_add(ObjectWriteOperation& op, rgw_usage_log_info& info)
   bufferlist in;
   rgw_cls_usage_log_add_op call;
   call.info = info;
-  ::encode(call, in);
+  encode(call, in);
   op.exec(RGW_CLASS, RGW_USER_USAGE_LOG_ADD, in);
 }
 
@@ -667,7 +667,7 @@ void cls_rgw_gc_set_entry(ObjectWriteOperation& op, uint32_t expiration_secs, cl
   cls_rgw_gc_set_entry_op call;
   call.expiration_secs = expiration_secs;
   call.info = info;
-  ::encode(call, in);
+  encode(call, in);
   op.exec(RGW_CLASS, RGW_GC_SET_ENTRY, in);
 }
 
@@ -677,7 +677,7 @@ void cls_rgw_gc_defer_entry(ObjectWriteOperation& op, uint32_t expiration_secs,
   cls_rgw_gc_defer_entry_op call;
   call.expiration_secs = expiration_secs;
   call.tag = tag;
-  ::encode(call, in);
+  encode(call, in);
   op.exec(RGW_CLASS, RGW_GC_DEFER_ENTRY, in);
 }
 
@@ -689,7 +689,7 @@ int cls_rgw_gc_list(IoCtx& io_ctx, string& oid, string& marker, uint32_t max, bo
   call.marker = marker;
   call.max = max;
   call.expired_only = expired_only;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, RGW_CLASS, RGW_GC_LIST, in, out);
   if (r < 0)
     return r;
@@ -697,7 +697,7 @@ int cls_rgw_gc_list(IoCtx& io_ctx, string& oid, string& marker, uint32_t max, bo
   cls_rgw_gc_list_ret ret;
   try {
     bufferlist::iterator iter = out.begin();
-    ::decode(ret, iter);
+    decode(ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -715,7 +715,7 @@ void cls_rgw_gc_remove(librados::ObjectWriteOperation& op, const list<string>& t
   bufferlist in;
   cls_rgw_gc_remove_op call;
   call.tags = tags;
-  ::encode(call, in);
+  encode(call, in);
   op.exec(RGW_CLASS, RGW_GC_REMOVE, in);
 }
 
@@ -729,7 +729,7 @@ int cls_rgw_lc_get_head(IoCtx& io_ctx, string& oid, cls_rgw_lc_obj_head& head)
   cls_rgw_lc_get_head_ret ret;
   try {
     bufferlist::iterator iter = out.begin();
-    ::decode(ret, iter);
+    decode(ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -743,7 +743,7 @@ int cls_rgw_lc_put_head(IoCtx& io_ctx, string& oid, cls_rgw_lc_obj_head& head)
   bufferlist in, out;
   cls_rgw_lc_put_head_op call;
   call.head = head;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, RGW_CLASS, RGW_LC_PUT_HEAD, in, out);
   return r;
 }
@@ -753,7 +753,7 @@ int cls_rgw_lc_get_next_entry(IoCtx& io_ctx, string& oid, string& marker, pair<s
   bufferlist in, out;
   cls_rgw_lc_get_next_entry_op call;
   call.marker = marker;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, RGW_CLASS, RGW_LC_GET_NEXT_ENTRY, in, out);
   if (r < 0)
     return r;
@@ -761,7 +761,7 @@ int cls_rgw_lc_get_next_entry(IoCtx& io_ctx, string& oid, string& marker, pair<s
   cls_rgw_lc_get_next_entry_ret ret;
   try {
     bufferlist::iterator iter = out.begin();
-    ::decode(ret, iter);
+    decode(ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -775,7 +775,7 @@ int cls_rgw_lc_rm_entry(IoCtx& io_ctx, string& oid, pair<string, int>& entry)
   bufferlist in, out;
   cls_rgw_lc_rm_entry_op call;
   call.entry = entry;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, RGW_CLASS, RGW_LC_RM_ENTRY, in, out);
  return r;
 }
@@ -785,7 +785,7 @@ int cls_rgw_lc_set_entry(IoCtx& io_ctx, string& oid, pair<string, int>& entry)
   bufferlist in, out;
   cls_rgw_lc_set_entry_op call;
   call.entry = entry;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, RGW_CLASS, RGW_LC_SET_ENTRY, in, out);
   return r;
 }
@@ -803,7 +803,7 @@ int cls_rgw_lc_list(IoCtx& io_ctx, string& oid,
   op.marker = marker;
   op.max_entries = max_entries;
 
-  ::encode(op, in);
+  encode(op, in);
 
   int r = io_ctx.exec(oid, RGW_CLASS, RGW_LC_LIST_ENTRIES, in, out);
   if (r < 0)
@@ -812,7 +812,7 @@ int cls_rgw_lc_list(IoCtx& io_ctx, string& oid,
   cls_rgw_lc_list_entries_ret ret;
   try {
     bufferlist::iterator iter = out.begin();
-    ::decode(ret, iter);
+    decode(ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -826,7 +826,7 @@ void cls_rgw_reshard_add(librados::ObjectWriteOperation& op, const cls_rgw_resha
   bufferlist in;
   struct cls_rgw_reshard_add_op call;
   call.entry = entry;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("rgw", "reshard_add", in);
 }
 
@@ -837,7 +837,7 @@ int cls_rgw_reshard_list(librados::IoCtx& io_ctx, const string& oid, string& mar
   struct cls_rgw_reshard_list_op call;
   call.marker = marker;
   call.max = max;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, "rgw", "reshard_list", in, out);
   if (r < 0)
     return r;
@@ -845,7 +845,7 @@ int cls_rgw_reshard_list(librados::IoCtx& io_ctx, const string& oid, string& mar
   struct cls_rgw_reshard_list_ret op_ret;
   bufferlist::iterator iter = out.begin();
   try {
-    ::decode(op_ret, iter);
+    decode(op_ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -861,7 +861,7 @@ int cls_rgw_reshard_get(librados::IoCtx& io_ctx, const string& oid, cls_rgw_resh
   bufferlist in, out;
   struct cls_rgw_reshard_get_op call;
   call.entry = entry;
-  ::encode(call, in);
+  encode(call, in);
   int r = io_ctx.exec(oid, "rgw", "reshard_get", in, out);
   if (r < 0)
     return r;
@@ -869,7 +869,7 @@ int cls_rgw_reshard_get(librados::IoCtx& io_ctx, const string& oid, cls_rgw_resh
   struct cls_rgw_reshard_get_ret op_ret;
   bufferlist::iterator iter = out.begin();
   try {
-    ::decode(op_ret, iter);
+    decode(op_ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -886,7 +886,7 @@ void cls_rgw_reshard_remove(librados::ObjectWriteOperation& op, const cls_rgw_re
   call.tenant = entry.tenant;
   call.bucket_name = entry.bucket_name;
   call.bucket_id = entry.bucket_id;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("rgw", "reshard_remove", in);
 }
 
@@ -896,7 +896,7 @@ int cls_rgw_set_bucket_resharding(librados::IoCtx& io_ctx, const string& oid,
   bufferlist in, out;
   struct cls_rgw_set_bucket_resharding_op call;
   call.entry = entry;
-  ::encode(call, in);
+  encode(call, in);
   return io_ctx.exec(oid, "rgw", "set_bucket_resharding", in, out);
 }
 
@@ -904,7 +904,7 @@ int cls_rgw_clear_bucket_resharding(librados::IoCtx& io_ctx, const string& oid)
 {
   bufferlist in, out;
   struct cls_rgw_clear_bucket_resharding_op call;
-  ::encode(call, in);
+  encode(call, in);
   return io_ctx.exec(oid, "rgw", "clear_bucket_resharding", in, out);
 }
 
@@ -913,7 +913,7 @@ int cls_rgw_get_bucket_resharding(librados::IoCtx& io_ctx, const string& oid,
 {
   bufferlist in, out;
   struct cls_rgw_get_bucket_resharding_op call;
-  ::encode(call, in);
+  encode(call, in);
   int r= io_ctx.exec(oid, "rgw", "get_bucket_resharding", in, out);
   if (r < 0)
     return r;
@@ -921,7 +921,7 @@ int cls_rgw_get_bucket_resharding(librados::IoCtx& io_ctx, const string& oid,
   struct cls_rgw_get_bucket_resharding_ret op_ret;
   bufferlist::iterator iter = out.begin();
   try {
-    ::decode(op_ret, iter);
+    decode(op_ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -936,7 +936,7 @@ void cls_rgw_guard_bucket_resharding(librados::ObjectOperation& op, int ret_err)
   bufferlist in, out;
   struct cls_rgw_guard_bucket_resharding_op call;
   call.ret_err = ret_err;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("rgw", "guard_bucket_resharding", in);
 }
 
@@ -946,7 +946,7 @@ static bool issue_set_bucket_resharding(librados::IoCtx& io_ctx, const string& o
   bufferlist in;
   struct cls_rgw_set_bucket_resharding_op call;
   call.entry = entry;
-  ::encode(call, in);
+  encode(call, in);
   librados::ObjectWriteOperation op;
   op.exec("rgw", "set_bucket_resharding", in);
   return manager->aio_operate(io_ctx, oid, &op);
index 234384f27453d60df16de8a23e3a0b15b0c937ec..931dd3c38e1bd94544c4af4870894a7bb8a3ecb1 100644 (file)
@@ -160,14 +160,14 @@ static void dump_bi_entry(bufferlist bl, BIIndexType index_type, Formatter *form
     case InstanceIdx:
       {
         rgw_bucket_dir_entry entry;
-        ::decode(entry, iter);
+        decode(entry, iter);
         encode_json("entry", entry, formatter);
       }
       break;
     case OLHIdx:
       {
         rgw_bucket_olh_entry entry;
-        ::decode(entry, iter);
+        decode(entry, iter);
         encode_json("entry", entry, formatter);
       }
       break;
@@ -189,13 +189,14 @@ void rgw_cls_bi_entry::decode_json(JSONObj *obj, cls_rgw_obj_key *effective_key)
   } else {
     type = InvalidIdx;
   }
+  using ceph::encode;
   switch (type) {
     case PlainIdx:
     case InstanceIdx:
       {
         rgw_bucket_dir_entry entry;
         JSONDecoder::decode_json("entry", entry, obj);
-        ::encode(entry, data);
+        encode(entry, data);
 
         if (effective_key) {
           *effective_key = entry.key;
@@ -206,7 +207,7 @@ void rgw_cls_bi_entry::decode_json(JSONObj *obj, cls_rgw_obj_key *effective_key)
       {
         rgw_bucket_olh_entry entry;
         JSONDecoder::decode_json("entry", entry, obj);
-        ::encode(entry, data);
+        encode(entry, data);
 
         if (effective_key) {
           *effective_key = entry.key;
@@ -243,12 +244,13 @@ bool rgw_cls_bi_entry::get_info(cls_rgw_obj_key *key, uint8_t *category, rgw_buc
 {
   bool account = false;
   bufferlist::iterator iter = data.begin();
+  using ceph::decode;
   switch (type) {
     case PlainIdx:
     case InstanceIdx:
       {
         rgw_bucket_dir_entry entry;
-        ::decode(entry, iter);
+        decode(entry, iter);
         *key = entry.key;
         *category = entry.meta.category;
         accounted_stats->num_entries++;
@@ -260,7 +262,7 @@ bool rgw_cls_bi_entry::get_info(cls_rgw_obj_key *key, uint8_t *category, rgw_buc
     case OLHIdx:
       {
         rgw_bucket_olh_entry entry;
-        ::decode(entry, iter);
+        decode(entry, iter);
         *key = entry.key;
       }
       break;
@@ -469,7 +471,7 @@ void rgw_bi_log_entry::generate_test_instances(list<rgw_bi_log_entry*>& ls)
   ls.push_back(new rgw_bi_log_entry);
   ls.back()->id = "midf";
   ls.back()->object = "obj";
-  ls.back()->timestamp = ceph::real_clock::from_ceph_timespec({2, 3});
+  ls.back()->timestamp = ceph::real_clock::from_ceph_timespec({{2}, {3}});
   ls.back()->index_ver = 4323;
   ls.back()->tag = "tagasdfds";
   ls.back()->op = CLS_RGW_OP_DEL;
@@ -603,7 +605,7 @@ void cls_rgw_reshard_entry::generate_test_instances(list<cls_rgw_reshard_entry*>
 {
   ls.push_back(new cls_rgw_reshard_entry);
   ls.push_back(new cls_rgw_reshard_entry);
-  ls.back()->time = ceph::real_clock::from_ceph_timespec({2, 3});
+  ls.back()->time = ceph::real_clock::from_ceph_timespec({{2}, {3}});
   ls.back()->tenant = "tenant";
   ls.back()->bucket_name = "bucket1""";
   ls.back()->bucket_id = "bucket_id";
index b2a13764d1e8f2cd6d0eb36e50b60427343d1f79..0a49ae79d40701bf01e74cfa3c318d7679a91d01 100644 (file)
@@ -18,7 +18,7 @@ static string statelog_index_by_object_prefix = "2_";
 static int write_statelog_entry(cls_method_context_t hctx, const string& index, const cls_statelog_entry& entry)
 {
   bufferlist bl;
-  ::encode(entry, bl);
+  encode(entry, bl);
 
   int ret = cls_cxx_map_set_val(hctx, index, &bl);
   if (ret < 0)
@@ -75,7 +75,7 @@ static int get_existing_entry(cls_method_context_t hctx, const string& client_id
   }
   try {
     bufferlist::iterator iter = bl.begin();
-    ::decode(entry, iter);
+    decode(entry, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: failed to decode entry %s", obj_index.c_str());
     return -EIO;
@@ -98,7 +98,7 @@ static int cls_statelog_add(cls_method_context_t hctx, bufferlist *in, bufferlis
 
   cls_statelog_add_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_statelog_add_op(): failed to decode op");
     return -EINVAL;
@@ -138,7 +138,7 @@ static int cls_statelog_list(cls_method_context_t hctx, bufferlist *in, bufferli
 
   cls_statelog_list_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_statelog_list_op(): failed to decode op");
     return -EINVAL;
@@ -189,7 +189,7 @@ static int cls_statelog_list(cls_method_context_t hctx, bufferlist *in, bufferli
     bufferlist::iterator biter = bl.begin();
     try {
       cls_statelog_entry e;
-      ::decode(e, biter);
+      decode(e, biter);
       entries.push_back(e);
     } catch (buffer::error& err) {
       CLS_LOG(0, "ERROR: cls_statelog_list: could not decode entry, index=%s", index.c_str());
@@ -200,7 +200,7 @@ static int cls_statelog_list(cls_method_context_t hctx, bufferlist *in, bufferli
     ret.marker = marker;
   }
 
-  ::encode(ret, *out);
+  encode(ret, *out);
 
   return 0;
 }
@@ -211,7 +211,7 @@ static int cls_statelog_remove(cls_method_context_t hctx, bufferlist *in, buffer
 
   cls_statelog_remove_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_statelog_remove_op(): failed to decode op");
     return -EINVAL;
@@ -250,7 +250,7 @@ static int cls_statelog_check_state(cls_method_context_t hctx, bufferlist *in, b
 
   cls_statelog_check_state_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_statelog_check_state_op(): failed to decode op");
     return -EINVAL;
index 895e26a6fa5a40210098014345427f51023d93c6..6a477a1b1876b2422217e0380f06419366abf461 100644 (file)
@@ -12,7 +12,7 @@ void cls_statelog_add(librados::ObjectWriteOperation& op, list<cls_statelog_entr
   bufferlist in;
   cls_statelog_add_op call;
   call.entries = entries;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("statelog", "add", in);
 }
 
@@ -21,7 +21,7 @@ void cls_statelog_add(librados::ObjectWriteOperation& op, cls_statelog_entry& en
   bufferlist in;
   cls_statelog_add_op call;
   call.entries.push_back(entry);
-  ::encode(call, in);
+  encode(call, in);
   op.exec("statelog", "add", in);
 }
 
@@ -52,7 +52,7 @@ void cls_statelog_remove_by_client(librados::ObjectWriteOperation& op, const str
   cls_statelog_remove_op call;
   call.client_id = client_id;
   call.op_id = op_id;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("statelog", "remove", in);
 }
 
@@ -62,7 +62,7 @@ void cls_statelog_remove_by_object(librados::ObjectWriteOperation& op, const str
   cls_statelog_remove_op call;
   call.object = object;
   call.op_id = op_id;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("statelog", "remove", in);
 }
 
@@ -78,7 +78,7 @@ public:
       cls_statelog_list_ret ret;
       try {
         bufferlist::iterator iter = outbl.begin();
-        ::decode(ret, iter);
+        decode(ret, iter);
         if (entries)
          *entries = ret.entries;
         if (truncated)
@@ -105,7 +105,7 @@ void cls_statelog_list(librados::ObjectReadOperation& op,
   call.marker = in_marker;
   call.max_entries = max_entries;
 
-  ::encode(call, inbl);
+  encode(call, inbl);
 
   op.exec("statelog", "list", inbl, new StateLogListCtx(&entries, out_marker, truncated));
 }
@@ -119,8 +119,7 @@ void cls_statelog_check_state(librados::ObjectOperation& op, const string& clien
   call.object = object;
   call.state = state;
 
-  ::encode(call, inbl);
+  encode(call, inbl);
 
   op.exec("statelog", "check_state", inbl, NULL);
 }
-
index 5a1622ea03fc25791b0d2a61d492d97bc46137ef..402999e7baf6a51b225093401939c1c0408b0871 100644 (file)
@@ -13,13 +13,13 @@ struct cls_statelog_add_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(entries, bl);
+    encode(entries, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(entries, bl);
+    decode(entries, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -37,21 +37,21 @@ struct cls_statelog_list_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(object, bl);
-    ::encode(client_id, bl);
-    ::encode(op_id, bl);
-    ::encode(marker, bl);
-    ::encode(max_entries, bl);
+    encode(object, bl);
+    encode(client_id, bl);
+    encode(op_id, bl);
+    encode(marker, bl);
+    encode(max_entries, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(object, bl);
-    ::decode(client_id, bl);
-    ::decode(op_id, bl);
-    ::decode(marker, bl);
-    ::decode(max_entries, bl);
+    decode(object, bl);
+    decode(client_id, bl);
+    decode(op_id, bl);
+    decode(marker, bl);
+    decode(max_entries, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -66,17 +66,17 @@ struct cls_statelog_list_ret {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(entries, bl);
-    ::encode(marker, bl);
-    ::encode(truncated, bl);
+    encode(entries, bl);
+    encode(marker, bl);
+    encode(truncated, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(entries, bl);
-    ::decode(marker, bl);
-    ::decode(truncated, bl);
+    decode(entries, bl);
+    decode(marker, bl);
+    decode(truncated, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -96,17 +96,17 @@ struct cls_statelog_remove_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(client_id, bl);
-    ::encode(op_id, bl);
-    ::encode(object, bl);
+    encode(client_id, bl);
+    encode(op_id, bl);
+    encode(object, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(client_id, bl);
-    ::decode(op_id, bl);
-    ::decode(object, bl);
+    decode(client_id, bl);
+    decode(op_id, bl);
+    decode(object, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -122,19 +122,19 @@ struct cls_statelog_check_state_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(client_id, bl);
-    ::encode(op_id, bl);
-    ::encode(object, bl);
-    ::encode(state, bl);
+    encode(client_id, bl);
+    encode(op_id, bl);
+    encode(object, bl);
+    encode(state, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(client_id, bl);
-    ::decode(op_id, bl);
-    ::decode(object, bl);
-    ::decode(state, bl);
+    decode(client_id, bl);
+    decode(op_id, bl);
+    decode(object, bl);
+    decode(state, bl);
     DECODE_FINISH(bl);
   }
 };
index 72147de0e9d12b2b52d4f803bf48c738f4690034..071b58930e2154d7eb8081ab5dc9c924851a2055 100644 (file)
@@ -20,23 +20,23 @@ struct cls_statelog_entry {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(client_id, bl);
-    ::encode(op_id, bl);
-    ::encode(object, bl);
-    ::encode(timestamp, bl);
-    ::encode(data, bl);
-    ::encode(state, bl);
+    encode(client_id, bl);
+    encode(op_id, bl);
+    encode(object, bl);
+    encode(timestamp, bl);
+    encode(data, bl);
+    encode(state, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(client_id, bl);
-    ::decode(op_id, bl);
-    ::decode(object, bl);
-    ::decode(timestamp, bl);
-    ::decode(data, bl);
-    ::decode(state, bl);
+    decode(client_id, bl);
+    decode(op_id, bl);
+    decode(object, bl);
+    decode(timestamp, bl);
+    decode(data, bl);
+    decode(state, bl);
     DECODE_FINISH(bl);
   }
 
@@ -47,5 +47,3 @@ WRITE_CLASS_ENCODER(cls_statelog_entry)
 
 
 #endif
-
-
index 5717471d8c1fafd80c77aec39a539ba835bc0a6d..7a5060bc86e9e145f471ac9159e42045c8248659 100644 (file)
@@ -60,7 +60,7 @@ static int cls_timeindex_add(cls_method_context_t hctx,
 
   cls_timeindex_add_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_timeindex_add_op(): failed to decode op");
     return -EINVAL;
@@ -93,7 +93,7 @@ static int cls_timeindex_list(cls_method_context_t hctx,
 
   cls_timeindex_list_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_timeindex_list_op(): failed to decode op");
     return -EINVAL;
@@ -160,7 +160,7 @@ static int cls_timeindex_list(cls_method_context_t hctx,
 
   ret.marker = marker;
 
-  ::encode(ret, *out);
+  encode(ret, *out);
 
   return 0;
 }
@@ -174,7 +174,7 @@ static int cls_timeindex_trim(cls_method_context_t hctx,
 
   cls_timeindex_trim_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_timeindex_trim: failed to decode entry");
     return -EINVAL;
index 502b9300ee095ac90969374d068d77753dee12a4..7a38ff5fa61ef585e252801ef0b43f45611a006e 100644 (file)
@@ -15,7 +15,7 @@ void cls_timeindex_add(
   cls_timeindex_add_op call;
   call.entries = entries;
 
-  ::encode(call, in);
+  encode(call, in);
   op.exec("timeindex", "add", in);
 }
 
@@ -27,7 +27,7 @@ void cls_timeindex_add(
   cls_timeindex_add_op call;
   call.entries.push_back(entry);
 
-  ::encode(call, in);
+  encode(call, in);
   op.exec("timeindex", "add", in);
 }
 
@@ -67,7 +67,7 @@ void cls_timeindex_trim(
   call.from_marker = from_marker;
   call.to_marker = to_marker;
 
-  ::encode(call, in);
+  encode(call, in);
 
   op.exec("timeindex", "trim", in);
 }
@@ -113,7 +113,7 @@ void cls_timeindex_list(
   call.marker = in_marker;
   call.max_entries = max_entries;
 
-  ::encode(call, in);
+  encode(call, in);
 
   op.exec("timeindex", "list", in,
           new TimeindexListCtx(&entries, out_marker, truncated));
index 30efccdc8dec87154636383ae98fdfab7a0a48ac..27ad929aa02e538248473788f2ace5ed581b537a 100644 (file)
@@ -38,7 +38,7 @@ public:
       cls_timeindex_list_ret ret;
       try {
         bufferlist::iterator iter = bl.begin();
-        ::decode(ret, iter);
+        decode(ret, iter);
         if (entries)
           *entries = ret.entries;
         if (truncated)
index 35c63b7474e8546c77bc3c0a09b29da43a8c65bd..54cf4271d592b5b9d095cf1b8a578fc6a45a165a 100644 (file)
@@ -13,13 +13,13 @@ struct cls_timeindex_add_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(entries, bl);
+    encode(entries, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(entries, bl);
+    decode(entries, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -36,19 +36,19 @@ struct cls_timeindex_list_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(from_time, bl);
-    ::encode(marker, bl);
-    ::encode(to_time, bl);
-    ::encode(max_entries, bl);
+    encode(from_time, bl);
+    encode(marker, bl);
+    encode(to_time, bl);
+    encode(max_entries, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(from_time, bl);
-    ::decode(marker, bl);
-    ::decode(to_time, bl);
-    ::decode(max_entries, bl);
+    decode(from_time, bl);
+    decode(marker, bl);
+    decode(to_time, bl);
+    decode(max_entries, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -63,17 +63,17 @@ struct cls_timeindex_list_ret {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(entries, bl);
-    ::encode(marker, bl);
-    ::encode(truncated, bl);
+    encode(entries, bl);
+    encode(marker, bl);
+    encode(truncated, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(entries, bl);
-    ::decode(marker, bl);
-    ::decode(truncated, bl);
+    decode(entries, bl);
+    decode(marker, bl);
+    decode(truncated, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -94,19 +94,19 @@ struct cls_timeindex_trim_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(from_time, bl);
-    ::encode(to_time, bl);
-    ::encode(from_marker, bl);
-    ::encode(to_marker, bl);
+    encode(from_time, bl);
+    encode(to_time, bl);
+    encode(from_marker, bl);
+    encode(to_marker, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(from_time, bl);
-    ::decode(to_time, bl);
-    ::decode(from_marker, bl);
-    ::decode(to_marker, bl);
+    decode(from_time, bl);
+    decode(to_time, bl);
+    decode(from_marker, bl);
+    decode(to_marker, bl);
     DECODE_FINISH(bl);
   }
 };
index afb7d07d7d65f3e3c5bfed17dc97ac0caf459a58..59f953f06ed909cd0bcba331239ca1e495727e11 100644 (file)
@@ -24,17 +24,17 @@ struct cls_timeindex_entry {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(key_ts, bl);
-    ::encode(key_ext, bl);
-    ::encode(value, bl);
+    encode(key_ts, bl);
+    encode(key_ext, bl);
+    encode(value, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(key_ts, bl);
-    ::decode(key_ext, bl);
-    ::decode(value, bl);
+    decode(key_ts, bl);
+    decode(key_ext, bl);
+    decode(value, bl);
     DECODE_FINISH(bl);
   }
 };
index 840470e9f4d9b665a6b0d647046759a39f2099bb..357ad2c84b3746c45241beb23aca909de206d1fb 100644 (file)
@@ -14,7 +14,7 @@ CLS_NAME(user)
 static int write_entry(cls_method_context_t hctx, const string& key, const cls_user_bucket_entry& entry)
 {
   bufferlist bl;
-  ::encode(entry, bl);
+  encode(entry, bl);
 
   int ret = cls_cxx_map_set_val(hctx, key, &bl);
   if (ret < 0)
@@ -55,7 +55,7 @@ static int get_existing_bucket_entry(cls_method_context_t hctx, const string& bu
   }
   try {
     bufferlist::iterator iter = bl.begin();
-    ::decode(entry, iter);
+    decode(entry, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: failed to decode entry %s", key.c_str());
     return -EIO;
@@ -78,7 +78,7 @@ static int read_header(cls_method_context_t hctx, cls_user_header *header)
   }
 
   try {
-    ::decode(*header, bl);
+    decode(*header, bl);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: failed to decode user header");
     return -EIO;
@@ -114,7 +114,7 @@ static int cls_user_set_buckets_info(cls_method_context_t hctx, bufferlist *in,
 
   cls_user_set_buckets_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_user_add_op(): failed to decode op");
     return -EINVAL;
@@ -179,7 +179,7 @@ static int cls_user_set_buckets_info(cls_method_context_t hctx, bufferlist *in,
   if (header.last_stats_update < op.time)
     header.last_stats_update = op.time;
 
-  ::encode(header, bl);
+  encode(header, bl);
   
   ret = cls_cxx_map_write_header(hctx, &bl);
   if (ret < 0)
@@ -194,7 +194,7 @@ static int cls_user_complete_stats_sync(cls_method_context_t hctx, bufferlist *i
 
   cls_user_complete_stats_sync_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_user_add_op(): failed to decode op");
     return -EINVAL;
@@ -212,7 +212,7 @@ static int cls_user_complete_stats_sync(cls_method_context_t hctx, bufferlist *i
 
   bufferlist bl;
 
-  ::encode(header, bl);
+  encode(header, bl);
 
   ret = cls_cxx_map_write_header(hctx, &bl);
   if (ret < 0)
@@ -227,7 +227,7 @@ static int cls_user_remove_bucket(cls_method_context_t hctx, bufferlist *in, buf
 
   cls_user_remove_bucket_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_user_add_op(): failed to decode op");
     return -EINVAL;
@@ -273,7 +273,7 @@ static int cls_user_list_buckets(cls_method_context_t hctx, bufferlist *in, buff
 
   cls_user_list_buckets_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_user_list_op(): failed to decode op");
     return -EINVAL;
@@ -320,7 +320,7 @@ static int cls_user_list_buckets(cls_method_context_t hctx, bufferlist *in, buff
     bufferlist::iterator biter = bl.begin();
     try {
       cls_user_bucket_entry e;
-      ::decode(e, biter);
+      decode(e, biter);
       entries.push_back(e);
     } catch (buffer::error& err) {
       CLS_LOG(0, "ERROR: cls_user_list: could not decode entry, index=%s", index.c_str());
@@ -331,7 +331,7 @@ static int cls_user_list_buckets(cls_method_context_t hctx, bufferlist *in, buff
     ret.marker = marker;
   }
 
-  ::encode(ret, *out);
+  encode(ret, *out);
 
   return 0;
 }
@@ -342,7 +342,7 @@ static int cls_user_get_header(cls_method_context_t hctx, bufferlist *in, buffer
 
   cls_user_get_header_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_user_get_header_op(): failed to decode op");
     return -EINVAL;
@@ -354,7 +354,7 @@ static int cls_user_get_header(cls_method_context_t hctx, bufferlist *in, buffer
   if (ret < 0)
     return ret;
 
-  ::encode(op_ret, *out);
+  encode(op_ret, *out);
 
   return 0;
 }
index c77075dcb24a72c1ceefb5adf936ac6aacf2b6b4..e98f5b651607b98f7dd4ccccfd1db7789fd1c982 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include <errno.h>
@@ -17,7 +17,7 @@ void cls_user_set_buckets(librados::ObjectWriteOperation& op, list<cls_user_buck
   call.entries = entries;
   call.add = add;
   call.time = real_clock::now();
-  ::encode(call, in);
+  encode(call, in);
   op.exec("user", "set_buckets_info", in);
 }
 
@@ -26,7 +26,7 @@ void cls_user_complete_stats_sync(librados::ObjectWriteOperation& op)
   bufferlist in;
   cls_user_complete_stats_sync_op call;
   call.time = real_clock::now();
-  ::encode(call, in);
+  encode(call, in);
   op.exec("user", "complete_stats_sync", in);
 }
 
@@ -35,7 +35,7 @@ void cls_user_remove_bucket(librados::ObjectWriteOperation& op, const cls_user_b
   bufferlist in;
   cls_user_remove_bucket_op call;
   call.bucket = bucket;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("user", "remove_bucket", in);
 }
 
@@ -52,7 +52,7 @@ public:
       cls_user_list_buckets_ret ret;
       try {
         bufferlist::iterator iter = outbl.begin();
-        ::decode(ret, iter);
+        decode(ret, iter);
         if (entries)
          *entries = ret.entries;
         if (truncated)
@@ -84,7 +84,7 @@ void cls_user_bucket_list(librados::ObjectReadOperation& op,
   call.end_marker = end_marker;
   call.max_entries = max_entries;
 
-  ::encode(call, inbl);
+  encode(call, inbl);
 
   op.exec("user", "list_buckets", inbl, new ClsUserListCtx(&entries, out_marker, truncated, pret));
 }
@@ -105,7 +105,7 @@ public:
       cls_user_get_header_ret ret;
       try {
         bufferlist::iterator iter = outbl.begin();
-        ::decode(ret, iter);
+        decode(ret, iter);
         if (header)
          *header = ret.header;
       } catch (buffer::error& err) {
@@ -127,7 +127,7 @@ void cls_user_get_header(librados::ObjectReadOperation& op,
   bufferlist inbl;
   cls_user_get_header_op call;
 
-  ::encode(call, inbl);
+  encode(call, inbl);
 
   op.exec("user", "get_header", inbl, new ClsUserGetHeaderCtx(header, NULL, pret));
 }
@@ -136,7 +136,7 @@ int cls_user_get_header_async(IoCtx& io_ctx, string& oid, RGWGetUserHeader_CB *c
 {
   bufferlist in, out;
   cls_user_get_header_op call;
-  ::encode(call, in);
+  encode(call, in);
   ObjectReadOperation op;
   op.exec("user", "get_header", in, new ClsUserGetHeaderCtx(NULL, ctx, NULL)); /* no need to pass pret, as we'll call ctx->handle_response() with correct error */
   AioCompletion *c = librados::Rados::aio_create_completion(NULL, NULL, NULL);
index c68f8c4e1ceaab2e2afd78a96658d216eafbd61d..d4ca638d91e5522654bdab55ad6d55cc12149278 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include <errno.h>
@@ -19,7 +19,7 @@ static int set_version(cls_method_context_t hctx, struct obj_version *objv)
 {
   bufferlist bl;
 
-  ::encode(*objv, bl);
+  encode(*objv, bl);
 
   CLS_LOG(20, "cls_version: set_version %s:%d", objv->tag.c_str(), (int)objv->ver);
 
@@ -65,7 +65,7 @@ static int read_version(cls_method_context_t hctx, obj_version *objv, bool impli
 
   try {
     bufferlist::iterator iter = bl.begin();
-    ::decode(*objv, iter);
+    decode(*objv, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: read_version(): failed to decode version entry\n");
     return -EIO;
@@ -80,7 +80,7 @@ static int cls_version_set(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   cls_version_set_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_version_get(): failed to decode entry\n");
     return -EINVAL;
@@ -146,7 +146,7 @@ static int cls_version_inc(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   cls_version_inc_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_version_get(): failed to decode entry\n");
     return -EINVAL;
@@ -175,7 +175,7 @@ static int cls_version_check(cls_method_context_t hctx, bufferlist *in, bufferli
 
   cls_version_check_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_version_get(): failed to decode entry\n");
     return -EINVAL;
@@ -204,7 +204,7 @@ static int cls_version_read(cls_method_context_t hctx, bufferlist *in, bufferlis
   if (ret < 0)
     return ret;
 
-  ::encode(read_ret, *out);
+  encode(read_ret, *out);
 
   return 0;
 }
index 36726d6cccb6089cf2a70babe3be569398d21c75..c26826e903c0c22fd4e7f585ab383df81eb9cb80 100644 (file)
@@ -12,7 +12,7 @@ void cls_version_set(librados::ObjectWriteOperation& op, obj_version& objv)
   bufferlist in;
   cls_version_set_op call;
   call.objv = objv;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("version", "set", in);
 }
 
@@ -20,7 +20,7 @@ void cls_version_inc(librados::ObjectWriteOperation& op)
 {
   bufferlist in;
   cls_version_inc_op call;
-  ::encode(call, in);
+  encode(call, in);
   op.exec("version", "inc", in);
 }
 
@@ -36,7 +36,7 @@ void cls_version_inc(librados::ObjectWriteOperation& op, obj_version& objv, Vers
 
   call.conds.push_back(c);
 
-  ::encode(call, in);
+  encode(call, in);
   op.exec("version", "inc_conds", in);
 }
 
@@ -52,7 +52,7 @@ void cls_version_check(librados::ObjectOperation& op, obj_version& objv, Version
 
   call.conds.push_back(c);
 
-  ::encode(call, in);
+  encode(call, in);
   op.exec("version", "check_conds", in);
 }
 
@@ -65,7 +65,7 @@ public:
       cls_version_read_ret ret;
       try {
         bufferlist::iterator iter = outbl.begin();
-        ::decode(ret, iter);
+        decode(ret, iter);
        *objv = ret.objv;
       } catch (buffer::error& err) {
         // nothing we can do about it atm
@@ -90,7 +90,7 @@ int cls_version_read(librados::IoCtx& io_ctx, string& oid, obj_version *ver)
   cls_version_read_ret ret;
   try {
     bufferlist::iterator iter = out.begin();
-    ::decode(ret, iter);
+    decode(ret, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
index 6007e9ade923a8bf0306a9f27e3a937c5d27c2c7..56e3f3577916df14879daa31bbd56a3f4a37b505 100644 (file)
@@ -13,13 +13,13 @@ struct cls_version_set_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(objv, bl);
+    encode(objv, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(objv, bl);
+    decode(objv, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -33,15 +33,15 @@ struct cls_version_inc_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(objv, bl);
-    ::encode(conds, bl);
+    encode(objv, bl);
+    encode(conds, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(objv, bl);
-    ::decode(conds, bl);
+    decode(objv, bl);
+    decode(conds, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -55,15 +55,15 @@ struct cls_version_check_op {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(objv, bl);
-    ::encode(conds, bl);
+    encode(objv, bl);
+    encode(conds, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(objv, bl);
-    ::decode(conds, bl);
+    decode(objv, bl);
+    decode(conds, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -76,13 +76,13 @@ struct cls_version_read_ret {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(objv, bl);
+    encode(objv, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(objv, bl);
+    decode(objv, bl);
     DECODE_FINISH(bl);
   }
 };
index 22ae0779ea308b718f86903cea6a142aeb2b4014..440b6d65507f52c6f77adf1ef2ae85d53da14c54 100644 (file)
@@ -15,15 +15,15 @@ struct obj_version {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(ver, bl);
-    ::encode(tag, bl);
+    encode(ver, bl);
+    encode(tag, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(ver, bl);
-    ::decode(tag, bl);
+    decode(ver, bl);
+    decode(tag, bl);
     DECODE_FINISH(bl);
   }
 
@@ -67,17 +67,17 @@ struct obj_version_cond {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(ver, bl);
+    encode(ver, bl);
     uint32_t c = (uint32_t)cond;
-    ::encode(c, bl);
+    encode(c, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(ver, bl);
+    decode(ver, bl);
     uint32_t c;
-    ::decode(c, bl);
+    decode(c, bl);
     cond = (VersionCond)c;
     DECODE_FINISH(bl);
   }
@@ -87,5 +87,3 @@ WRITE_CLASS_ENCODER(obj_version_cond)
 
 
 #endif
-
-
index 6a97f4159e9daa08dea8e22ccc54ddc0b2ec66d3..82d2dba44dfb3bb4d462e440408b0e5f18bedaaf 100644 (file)
@@ -186,15 +186,17 @@ void ResizePayload::dump(Formatter *f) const {
 }
 
 void SnapPayloadBase::encode(bufferlist &bl) const {
+  using ceph::encode;
   ::encode(snap_name, bl);
-  ::encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl);
+  encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl);
 }
 
 void SnapPayloadBase::decode(__u8 version, bufferlist::iterator &iter) {
+  using ceph::decode;
   ::decode(snap_name, iter);
   if (version >= 6) {
     cls::rbd::SnapshotNamespaceOnDisk sn;
-    ::decode(sn, iter);
+    decode(sn, iter);
     snap_namespace = sn.snapshot_namespace;
   }
 }
@@ -210,10 +212,11 @@ void SnapCreatePayload::encode(bufferlist &bl) const {
 }
 
 void SnapCreatePayload::decode(__u8 version, bufferlist::iterator &iter) {
+  using ceph::decode;
   SnapPayloadBase::decode(version, iter);
   if (version == 5) {
     cls::rbd::SnapshotNamespaceOnDisk sn;
-    ::decode(sn, iter);
+    decode(sn, iter);
     snap_namespace = sn.snapshot_namespace;
   }
 }
index 724690b93314103ace25d0d72fccccbe249f345e..2509780ac26e47ce11d1bb29dfb2a4437d9262f7 100644 (file)
@@ -189,17 +189,19 @@ void OpFinishEvent::dump(Formatter *f) const {
 }
 
 void SnapEventBase::encode(bufferlist& bl) const {
+  using ceph::encode;
   OpEventBase::encode(bl);
   ::encode(snap_name, bl);
-  ::encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl);
+  encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl);
 }
 
 void SnapEventBase::decode(__u8 version, bufferlist::iterator& it) {
+  using ceph::decode;
   OpEventBase::decode(version, it);
   ::decode(snap_name, it);
   if (version >= 4) {
     cls::rbd::SnapshotNamespaceOnDisk sn;
-    ::decode(sn, it);
+    decode(sn, it);
     snap_namespace = sn.snapshot_namespace;
   }
 }
@@ -215,10 +217,11 @@ void SnapCreateEvent::encode(bufferlist &bl) const {
 }
 
 void SnapCreateEvent::decode(__u8 version, bufferlist::iterator& it) {
+  using ceph::decode;
   SnapEventBase::decode(version, it);
   if (version == 3) {
     cls::rbd::SnapshotNamespaceOnDisk sn;
-    ::decode(sn, it);
+    decode(sn, it);
     snap_namespace = sn.snapshot_namespace;
   }
 }
@@ -540,19 +543,21 @@ void ImageClientMeta::dump(Formatter *f) const {
 }
 
 void MirrorPeerSyncPoint::encode(bufferlist& bl) const {
+  using ceph::encode;
   ::encode(snap_name, bl);
   ::encode(from_snap_name, bl);
   ::encode(object_number, bl);
-  ::encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl);
+  encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl);
 }
 
 void MirrorPeerSyncPoint::decode(__u8 version, bufferlist::iterator& it) {
+  using ceph::decode;
   ::decode(snap_name, it);
   ::decode(from_snap_name, it);
   ::decode(object_number, it);
   if (version >= 2) {
     cls::rbd::SnapshotNamespaceOnDisk sn;
-    ::decode(sn, it);
+    decode(sn, it);
     snap_namespace = sn.snapshot_namespace;
   }
 }
index 1cbfe7a1bf834e4785ac6689726f4b605254d1c0..d03bebaee1a062a88aae63668dda74d104d48f01 100644 (file)
@@ -30,13 +30,15 @@ private:
 } // anonymous namespace
 
 void ImageAddedPayload::encode(bufferlist &bl) const {
+  using ceph::encode;
   ::encode(image_id, bl);
-  ::encode(trash_image_spec, bl);
+  encode(trash_image_spec, bl);
 }
 
 void ImageAddedPayload::decode(__u8 version, bufferlist::iterator &iter) {
+  using ceph::decode;
   ::decode(image_id, iter);
-  ::decode(trash_image_spec, iter);
+  decode(trash_image_spec, iter);
 }
 
 void ImageAddedPayload::dump(Formatter *f) const {
index a13c183293116a15d02bcd097fa144288745d6bd..ce01a516ee34c16bcbfcef9f1cad04e19146a339 100644 (file)
@@ -2162,7 +2162,7 @@ TEST_F(TestClsRbd, group_image_clean) {
 
   cls::rbd::GroupImageLinkState ref_state;
   bufferlist::iterator it = vals[image_key].begin();
-  ::decode(ref_state, it);
+  decode(ref_state, it);
   ASSERT_EQ(cls::rbd::GROUP_IMAGE_LINK_STATE_ATTACHED, ref_state);
 }
 
@@ -2186,7 +2186,7 @@ TEST_F(TestClsRbd, image_add_group) {
 
   cls::rbd::GroupSpec val_spec;
   bufferlist::iterator it = vals[RBD_GROUP_REF].begin();
-  ::decode(val_spec, it);
+  decode(val_spec, it);
 
   ASSERT_EQ(group_id, val_spec.group_id);
   ASSERT_EQ(pool_id, val_spec.pool_id);
index 77892ca2f0d26c43a25f68f1e6a545e14bd8908a..3f0581cab8fe2b9e61444272904038e710f2c556 100644 (file)
@@ -190,6 +190,8 @@ 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;
index 6334e9b4f13354659727ca52bc31aa9698fd494c..65f7620d110801e23873f4b228290bb7d456db34 100644 (file)
@@ -117,8 +117,9 @@ public:
   void expect_get_mirror_image(MockTestImageCtx &mock_image_ctx,
                                const cls::rbd::MirrorImage &mirror_image,
                                int r) {
+    using ceph::encode;
     bufferlist bl;
-    ::encode(mirror_image, bl);
+    encode(mirror_image, bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
                 exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"),
index 7fdc36e757a9c18cac7fe87e6844fbd512aa36c7..43a31f89092fe13784ff0a47887bc6fab90e5849 100644 (file)
@@ -69,7 +69,7 @@ struct TestMockTrashMoveRequest : public TestMockFixture {
 
                              bufferlist::iterator bl_it = in_bl.begin();
                              ::decode(id, bl_it);
-                             ::decode(trash_image_spec, bl_it);
+                             decode(trash_image_spec, bl_it);
 
                              EXPECT_EQ(id, image_id);
                              EXPECT_EQ(trash_image_spec.source,
index 4e9074b6566b7b0568c42766c4c9cdc6b3545e01..19103b8f5bfd4e67888ad821c36ad64d6bb64601 100644 (file)
@@ -244,7 +244,7 @@ public:
 
     bufferlist bl;
     ::encode(image_id, bl);
-    ::encode(mirror_image, bl);
+    encode(mirror_image, bl);
 
     EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx),
                 exec(RBD_MIRRORING, _, StrEq("rbd"),
index 01931b0aeb9df5b9d619bb9f779a126a1adecc79..9c60e0689e71db81ade0af4fea3a4ca4fed0c005 100644 (file)
@@ -251,7 +251,7 @@ public:
     mirror_image.global_image_id = global_id;
 
     bufferlist bl;
-    ::encode(mirror_image, bl);
+    encode(mirror_image, bl);
 
     EXPECT_CALL(get_mock_io_ctx(io_ctx),
                 exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"), _, _, _))
index 279debead9bf0c39b8a626b2652c1d85cf42013c..f80cdffc7aa4cf8989082d58b8e34998de622361 100644 (file)
@@ -95,7 +95,7 @@ public:
     mirror_image.global_image_id = global_id;
 
     bufferlist bl;
-    ::encode(mirror_image, bl);
+    encode(mirror_image, bl);
 
     EXPECT_CALL(get_mock_io_ctx(io_ctx),
                 exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"), _, _, _))