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

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
42 files changed:
src/rgw/rgw_acl.h
src/rgw/rgw_admin.cc
src/rgw/rgw_basic_types.h
src/rgw/rgw_bucket.cc
src/rgw/rgw_cache.h
src/rgw/rgw_common.cc
src/rgw/rgw_cors.h
src/rgw/rgw_cr_rados.cc
src/rgw/rgw_cr_rados.h
src/rgw/rgw_crypt.cc
src/rgw/rgw_data_sync.cc
src/rgw/rgw_data_sync.h
src/rgw/rgw_dencoder.cc
src/rgw/rgw_file.cc
src/rgw/rgw_file.h
src/rgw/rgw_lc.h
src/rgw/rgw_log.cc
src/rgw/rgw_log.h
src/rgw/rgw_metadata.cc
src/rgw/rgw_metadata.h
src/rgw/rgw_multi.cc
src/rgw/rgw_op.cc
src/rgw/rgw_orphan.cc
src/rgw/rgw_orphan.h
src/rgw/rgw_period_pusher.cc
src/rgw/rgw_quota.h
src/rgw/rgw_realm_watcher.cc
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_swift.cc
src/rgw/rgw_role.cc
src/rgw/rgw_role.h
src/rgw/rgw_swift_auth.cc
src/rgw/rgw_sync.cc
src/rgw/rgw_sync.h
src/rgw/rgw_sync_log_trim.cc
src/rgw/rgw_sync_log_trim.h
src/rgw/rgw_sync_module_es.cc
src/rgw/rgw_tag.h
src/rgw/rgw_token.h
src/rgw/rgw_user.cc
src/rgw/rgw_user.h
src/rgw/rgw_website.h

index 9931bd531a35417a1b9a0ca52507a8c7cc600fdc..42a401d9133d74b3969b13867b371e048541683f 100644 (file)
@@ -57,12 +57,12 @@ public:
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 2, bl);
-    ::encode(flags, bl);
+    encode(flags, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
-    ::decode(flags, bl);
+    decode(flags, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -83,12 +83,12 @@ public:
 //  virtual void set(const char *s) = 0;
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 2, bl);
-    ::encode(type, bl);
+    encode(type, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
-    ::decode(type, bl);
+    decode(type, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -143,40 +143,40 @@ public:
 
   void encode(bufferlist& bl) const {
     ENCODE_START(5, 3, bl);
-    ::encode(type, bl);
+    encode(type, bl);
     string s;
     id.to_str(s);
-    ::encode(s, bl);
+    encode(s, bl);
     string uri;
-    ::encode(uri, bl);
-    ::encode(email, bl);
-    ::encode(permission, bl);
-    ::encode(name, bl);
+    encode(uri, bl);
+    encode(email, bl);
+    encode(permission, bl);
+    encode(name, bl);
     __u32 g = (__u32)group;
-    ::encode(g, bl);
-    ::encode(url_spec, bl);
+    encode(g, bl);
+    encode(url_spec, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
-    ::decode(type, bl);
+    decode(type, bl);
     string s;
-    ::decode(s, bl);
+    decode(s, bl);
     id.from_str(s);
     string uri;
-    ::decode(uri, bl);
-    ::decode(email, bl);
-    ::decode(permission, bl);
-    ::decode(name, bl);
+    decode(uri, bl);
+    decode(email, bl);
+    decode(permission, bl);
+    decode(name, bl);
     if (struct_v > 1) {
       __u32 g;
-      ::decode(g, bl);
+      decode(g, bl);
       group = (ACLGroupTypeEnum)g;
     } else {
       group = uri_to_group(uri);
     }
     if (struct_v >= 5) {
-      ::decode(url_spec, bl);
+      decode(url_spec, bl);
     } else {
       url_spec.clear();
     }
@@ -242,14 +242,14 @@ struct ACLReferer {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(url_spec, bl);
-    ::encode(perm, bl);
+    encode(url_spec, bl);
+    encode(perm, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(url_spec, bl);
-    ::decode(perm, bl);
+    decode(url_spec, bl);
+    decode(perm, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -312,21 +312,21 @@ public:
   void encode(bufferlist& bl) const {
     ENCODE_START(4, 3, bl);
     bool maps_initialized = true;
-    ::encode(maps_initialized, bl);
-    ::encode(acl_user_map, bl);
-    ::encode(grant_map, bl);
-    ::encode(acl_group_map, bl);
-    ::encode(referer_list, bl);
+    encode(maps_initialized, bl);
+    encode(acl_user_map, bl);
+    encode(grant_map, bl);
+    encode(acl_group_map, bl);
+    encode(referer_list, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(4, 3, 3, bl);
     bool maps_initialized;
-    ::decode(maps_initialized, bl);
-    ::decode(acl_user_map, bl);
-    ::decode(grant_map, bl);
+    decode(maps_initialized, bl);
+    decode(acl_user_map, bl);
+    decode(grant_map, bl);
     if (struct_v >= 2) {
-      ::decode(acl_group_map, bl);
+      decode(acl_group_map, bl);
     } else if (!maps_initialized) {
       multimap<string, ACLGrant>::iterator iter;
       for (iter = grant_map.begin(); iter != grant_map.end(); ++iter) {
@@ -335,7 +335,7 @@ public:
       }
     }
     if (struct_v >= 4) {
-      ::decode(referer_list, bl);
+      decode(referer_list, bl);
     }
     DECODE_FINISH(bl);
   }
@@ -372,16 +372,16 @@ public:
     ENCODE_START(3, 2, bl);
     string s;
     id.to_str(s);
-    ::encode(s, bl);
-    ::encode(display_name, bl);
+    encode(s, bl);
+    encode(display_name, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
     string s;
-    ::decode(s, bl);
+    decode(s, bl);
     id.from_str(s);
-    ::decode(display_name, bl);
+    decode(display_name, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -424,21 +424,21 @@ public:
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 2, bl);
-    ::encode(owner, bl);
-    ::encode(acl, bl);
+    encode(owner, bl);
+    encode(acl, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
-    ::decode(owner, bl);
-    ::decode(acl, bl);
+    decode(owner, bl);
+    decode(acl, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
   static void generate_test_instances(list<RGWAccessControlPolicy*>& o);
   void decode_owner(bufferlist::iterator& bl) { // sometimes we only need that, should be faster
     DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
-    ::decode(owner, bl);
+    decode(owner, bl);
     DECODE_FINISH(bl);
   }
 
index 294248526c3da2a5b39e05373a59124b3e46269c..5bf3ceec3123467f52082f9ebe74044865d4a7c8 100644 (file)
@@ -990,14 +990,14 @@ void dump_bi_entry(bufferlist& bl, BIIndexType index_type, Formatter *formatter)
     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;
@@ -1192,7 +1192,7 @@ static bool decode_dump(const char *field_name, bufferlist& bl, Formatter *f)
   bufferlist::iterator iter = bl.begin();
 
   try {
-    ::decode(t, iter);
+    decode(t, iter);
   } catch (buffer::error& err) {
     return false;
   }
@@ -1344,7 +1344,7 @@ int check_min_obj_stripe_size(RGWRados *store, RGWBucketInfo& bucket_info, rgw_o
   try {
     bufferlist& bl = iter->second;
     bufferlist::iterator biter = bl.begin();
-    ::decode(manifest, biter);
+    decode(manifest, biter);
   } catch (buffer::error& err) {
     ldout(store->ctx(), 0) << "ERROR: failed to decode manifest" << dendl;
     return -EIO;
@@ -6731,7 +6731,7 @@ next:
 
           auto iter = cls_entry.data.begin();
           try {
-            ::decode(log_entry, iter);
+            decode(log_entry, iter);
           } catch (buffer::error& err) {
             cerr << "ERROR: failed to decode log entry" << std::endl;
             continue;
index e935fff48ad92f3ca136781f575b27095845bff8..76b065ad4774050696e1db48f23c80d10415d4b8 100644 (file)
@@ -27,14 +27,14 @@ struct rgw_user {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(tenant, bl);
-    ::encode(id, bl);
+    encode(tenant, bl);
+    encode(id, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(tenant, bl);
-    ::decode(id, bl);
+    decode(tenant, bl);
+    decode(id, bl);
     DECODE_FINISH(bl);
   }
 
index 10fac5fefa73cbba3a94e140cea791e39ba9dd82..b849db6744ced8f1b31ec8f982a95773e50d8c5d 100644 (file)
@@ -420,7 +420,7 @@ int rgw_bucket_set_attrs(RGWRados *store, RGWBucketInfo& bucket_info,
   string key = bucket.get_key();
   bufferlist bl;
 
-  ::encode(bucket_info, bl);
+  encode(bucket_info, bl);
 
   return rgw_bucket_instance_store_info(store, key, bl, false, &attrs, objv_tracker, real_time());
 }
@@ -842,7 +842,7 @@ int RGWBucket::link(RGWBucketAdminOpState& op_state, std::string *err_msg)
     ACLOwner owner;
     try {
      bufferlist::iterator iter = aclbl.begin();
-     ::decode(policy, iter);
+     decode(policy, iter);
      owner = policy.get_owner();
     } catch (buffer::error& err) {
       set_err_msg(err_msg, "couldn't decode policy");
@@ -1732,7 +1732,7 @@ int RGWDataChangesLog::renew_entries()
     change.entity_type = ENTITY_TYPE_BUCKET;
     change.key = bs.get_key();
     change.timestamp = ut;
-    ::encode(change, bl);
+    encode(change, bl);
 
     store->time_log_prepare_entry(entry, ut, section, change.key, bl);
 
@@ -1867,7 +1867,7 @@ int RGWDataChangesLog::add_entry(rgw_bucket& bucket, int shard_id) {
     change.entity_type = ENTITY_TYPE_BUCKET;
     change.key = bs.get_key();
     change.timestamp = now;
-    ::encode(change, bl);
+    encode(change, bl);
     string section;
 
     ldout(cct, 20) << "RGWDataChangesLog::add_entry() sending update with now=" << now << " cur_expiration=" << expiration << dendl;
@@ -1918,7 +1918,7 @@ int RGWDataChangesLog::list_entries(int shard, const real_time& start_time, cons
     log_entry.log_timestamp = rt;
     bufferlist::iterator liter = iter->data.begin();
     try {
-      ::decode(log_entry.entry, liter);
+      decode(log_entry.entry, liter);
     } catch (buffer::error& err) {
       lderr(cct) << "ERROR: failed to decode data changes log entry" << dendl;
       return -EIO;
index b6066b6b544d83695a4dfb6b24a49a93a7629604..3089723913d87869aeb8b2eba31def95d650bed4 100644 (file)
@@ -34,14 +34,14 @@ struct ObjectMetaInfo {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 2, bl);
-    ::encode(size, bl);
-    ::encode(mtime, bl);
+    encode(size, bl);
+    encode(mtime, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
-    ::decode(size, bl);
-    ::decode(mtime, bl);
+    decode(size, bl);
+    decode(mtime, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -64,29 +64,29 @@ struct ObjectCacheInfo {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(5, 3, bl);
-    ::encode(status, bl);
-    ::encode(flags, bl);
-    ::encode(data, bl);
-    ::encode(xattrs, bl);
-    ::encode(meta, bl);
-    ::encode(rm_xattrs, bl);
-    ::encode(epoch, bl);
-    ::encode(version, bl);
+    encode(status, bl);
+    encode(flags, bl);
+    encode(data, bl);
+    encode(xattrs, bl);
+    encode(meta, bl);
+    encode(rm_xattrs, bl);
+    encode(epoch, bl);
+    encode(version, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
-    ::decode(status, bl);
-    ::decode(flags, bl);
-    ::decode(data, bl);
-    ::decode(xattrs, bl);
-    ::decode(meta, bl);
+    decode(status, bl);
+    decode(flags, bl);
+    decode(data, bl);
+    decode(xattrs, bl);
+    decode(meta, bl);
     if (struct_v >= 2)
-      ::decode(rm_xattrs, bl);
+      decode(rm_xattrs, bl);
     if (struct_v >= 4)
-      ::decode(epoch, bl);
+      decode(epoch, bl);
     if (struct_v >= 5)
-      ::decode(version, bl);
+      decode(version, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
@@ -105,20 +105,20 @@ struct RGWCacheNotifyInfo {
 
   void encode(bufferlist& obl) const {
     ENCODE_START(2, 2, obl);
-    ::encode(op, obl);
-    ::encode(obj, obl);
-    ::encode(obj_info, obl);
-    ::encode(ofs, obl);
-    ::encode(ns, obl);
+    encode(op, obl);
+    encode(obj, obl);
+    encode(obj_info, obl);
+    encode(ofs, obl);
+    encode(ns, obl);
     ENCODE_FINISH(obl);
   }
   void decode(bufferlist::iterator& ibl) {
     DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, ibl);
-    ::decode(op, ibl);
-    ::decode(obj, ibl);
-    ::decode(obj_info, ibl);
-    ::decode(ofs, ibl);
-    ::decode(ns, ibl);
+    decode(op, ibl);
+    decode(obj, ibl);
+    decode(obj_info, ibl);
+    decode(ofs, ibl);
+    decode(ns, ibl);
     DECODE_FINISH(ibl);
   }
   void dump(Formatter *f) const;
@@ -537,7 +537,7 @@ int RGWCache<T>::distribute_cache(const string& normal_name, rgw_raw_obj& obj, O
   info.obj_info = obj_info;
   info.obj = obj;
   bufferlist bl;
-  ::encode(info, bl);
+  encode(info, bl);
   return T::distribute(normal_name, bl);
 }
 
@@ -551,7 +551,7 @@ int RGWCache<T>::watch_cb(uint64_t notify_id,
 
   try {
     bufferlist::iterator iter = bl.begin();
-    ::decode(info, iter);
+    decode(info, iter);
   } catch (buffer::end_of_buffer& err) {
     mydout(0) << "ERROR: got bad notification" << dendl;
     return -EIO;
index 06e49df231c17240651df749d86e61d23fe7fa12..f724e3f34dbf21abf83d5ebfe6de0511f5f4f57b 100644 (file)
@@ -1815,8 +1815,9 @@ string rgw_pool::to_str() const
 
 void rgw_raw_obj::decode_from_rgw_obj(bufferlist::iterator& bl)
 {
+  using ceph::decode;
   rgw_obj old_obj;
-  ::decode(old_obj, bl);
+  decode(old_obj, bl);
 
   get_obj_bucket_and_oid_loc(old_obj, oid, loc);
   pool = old_obj.get_explicit_data_pool();
index 61b352dae57cedaee46eab0740ef540586db8434..b525ddcd0d804e0060b77851cd30a9891a2e101e 100644 (file)
@@ -62,22 +62,22 @@ public:
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(max_age, bl);
-    ::encode(allowed_methods, bl);
-    ::encode(id, bl);
-    ::encode(allowed_hdrs, bl);
-    ::encode(allowed_origins, bl);
-    ::encode(exposable_hdrs, bl);
+    encode(max_age, bl);
+    encode(allowed_methods, bl);
+    encode(id, bl);
+    encode(allowed_hdrs, bl);
+    encode(allowed_origins, bl);
+    encode(exposable_hdrs, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(max_age, bl);
-    ::decode(allowed_methods, bl);
-    ::decode(id, bl);
-    ::decode(allowed_hdrs, bl);
-    ::decode(allowed_origins, bl);
-    ::decode(exposable_hdrs, bl);
+    decode(max_age, bl);
+    decode(allowed_methods, bl);
+    decode(id, bl);
+    decode(allowed_hdrs, bl);
+    decode(allowed_origins, bl);
+    decode(exposable_hdrs, bl);
     DECODE_FINISH(bl);
   }
   bool has_wildcard_origin();
@@ -100,12 +100,12 @@ class RGWCORSConfiguration
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(rules, bl);
+    encode(rules, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(rules, bl);
+    decode(rules, bl);
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;
index 71586bdce6fb87685e31feddb178ce621e051968..9f9530eb4ab4187aa8ec2cd177761e8beb4b6385 100644 (file)
@@ -510,7 +510,7 @@ int RGWRadosBILogTrimCR::send_request()
   cls_rgw_bi_log_trim_op call;
   call.start_marker = std::move(start_marker);
   call.end_marker = std::move(end_marker);
-  ::encode(call, in);
+  encode(call, in);
 
   librados::ObjectWriteOperation op;
   op.exec(RGW_CLASS, RGW_BI_LOG_TRIM, in);
index cb0ba580897328069d84b7cab7bfb3fe23ad6dd2..fe5fba7e3a0674d784073442f4e6f73b9a75ce3f 100644 (file)
@@ -256,7 +256,7 @@ int RGWSimpleRadosReadCR<T>::request_complete()
         // exist
         *result = T();
       } else {
-        ::decode(*result, iter);
+        decode(*result, iter);
       }
     } catch (buffer::error& err) {
       return -EIO;
@@ -319,7 +319,7 @@ public:
                      const T& _data, RGWObjVersionTracker *objv_tracker = nullptr)
     : RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados),
       store(_store), obj(_obj), objv_tracker(objv_tracker) {
-    ::encode(_data, bl);
+    encode(_data, bl);
   }
 
   ~RGWSimpleRadosWriteCR() override {
index 9e4e5c0a1dfe6ac03f2d6c1f43b462b894dff21a..1b95bb1989e3eb05454c6def427b8a2938bc7ac9 100644 (file)
@@ -652,7 +652,7 @@ int RGWGetObj_BlockDecrypt::read_manifest(bufferlist& manifest_bl) {
   if (manifest_bl.length()) {
     bufferlist::iterator miter = manifest_bl.begin();
     try {
-      ::decode(manifest, miter);
+      decode(manifest, miter);
     } catch (buffer::error& err) {
       ldout(cct, 0) << "ERROR: couldn't decode manifest" << dendl;
       return -EIO;
index 0b2e5c2882700dd0e78abc2f1dc6bb464c93d910..373676ed58d80c19473b9d978f40b5bd9113f351 100644 (file)
@@ -1962,7 +1962,7 @@ static void decode_attr(CephContext *cct, map<string, bufferlist>& attrs, const
 
   bufferlist::iterator biter = iter->second.begin();
   try {
-    ::decode(*val, biter);
+    decode(*val, biter);
   } catch (buffer::error& err) {
     ldout(cct, 0) << "ERROR: failed to decode attribute: " << attr_name << dendl;
   }
@@ -1984,17 +1984,20 @@ void rgw_bucket_shard_sync_info::encode_all_attrs(map<string, bufferlist>& attrs
 
 void rgw_bucket_shard_sync_info::encode_state_attr(map<string, bufferlist>& attrs)
 {
-  ::encode(state, attrs["state"]);
+  using ceph::encode;
+  encode(state, attrs["state"]);
 }
 
 void rgw_bucket_shard_full_sync_marker::encode_attr(map<string, bufferlist>& attrs)
 {
-  ::encode(*this, attrs["full_marker"]);
+  using ceph::encode;
+  encode(*this, attrs["full_marker"]);
 }
 
 void rgw_bucket_shard_inc_sync_marker::encode_attr(map<string, bufferlist>& attrs)
 {
-  ::encode(*this, attrs["inc_marker"]);
+  using ceph::encode;
+  encode(*this, attrs["inc_marker"]);
 }
 
 class RGWReadBucketSyncStatusCoroutine : public RGWCoroutine {
index 4623836bb87222e10534dd51c07bc175c638b02a..d4fde49c409e4f0cb97b98b2c8defaa147d4fde7 100644 (file)
@@ -1,6 +1,12 @@
 #ifndef CEPH_RGW_DATA_SYNC_H
 #define CEPH_RGW_DATA_SYNC_H
 
+#include "include/encoding.h"
+
+#include "common/RWLock.h"
+#include "common/ceph_json.h"
+
+
 #include "rgw_coroutine.h"
 #include "rgw_http_client.h"
 #include "rgw_bucket.h"
@@ -8,11 +14,8 @@
 #include "rgw_sync_module.h"
 #include "rgw_sync_trace.h"
 
-#include "common/RWLock.h"
-#include "common/ceph_json.h"
-
 namespace rgw {
-class BucketChangeObserver;
+struct BucketChangeObserver;
 }
 
 struct rgw_datalog_info {
@@ -37,18 +40,18 @@ struct rgw_data_sync_info {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 1, bl);
-    ::encode(state, bl);
-    ::encode(num_shards, bl);
-    ::encode(instance_id, bl);
+    encode(state, bl);
+    encode(num_shards, bl);
+    encode(instance_id, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
      DECODE_START(2, bl);
-     ::decode(state, bl);
-     ::decode(num_shards, bl);
+     decode(state, bl);
+     decode(num_shards, bl);
      if (struct_v >= 2) {
-       ::decode(instance_id, bl);
+       decode(instance_id, bl);
      }
      DECODE_FINISH(bl);
   }
@@ -108,23 +111,23 @@ struct rgw_data_sync_marker {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(state, bl);
-    ::encode(marker, bl);
-    ::encode(next_step_marker, bl);
-    ::encode(total_entries, bl);
-    ::encode(pos, bl);
-    ::encode(timestamp, bl);
+    encode(state, bl);
+    encode(marker, bl);
+    encode(next_step_marker, bl);
+    encode(total_entries, bl);
+    encode(pos, bl);
+    encode(timestamp, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
      DECODE_START(1, bl);
-    ::decode(state, bl);
-    ::decode(marker, bl);
-    ::decode(next_step_marker, bl);
-    ::decode(total_entries, bl);
-    ::decode(pos, bl);
-    ::decode(timestamp, bl);
+    decode(state, bl);
+    decode(marker, bl);
+    decode(next_step_marker, bl);
+    decode(total_entries, bl);
+    decode(pos, bl);
+    decode(timestamp, bl);
      DECODE_FINISH(bl);
   }
 
@@ -160,14 +163,14 @@ struct rgw_data_sync_status {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(sync_info, bl);
+    encode(sync_info, bl);
     /* sync markers are encoded separately */
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
      DECODE_START(1, bl);
-    ::decode(sync_info, bl);
+    decode(sync_info, bl);
     /* sync markers are decoded separately */
      DECODE_FINISH(bl);
   }
@@ -362,15 +365,15 @@ struct rgw_bucket_shard_full_sync_marker {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(position, bl);
-    ::encode(count, bl);
+    encode(position, bl);
+    encode(count, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
      DECODE_START(1, bl);
-    ::decode(position, bl);
-    ::decode(count, bl);
+    decode(position, bl);
+    decode(count, bl);
      DECODE_FINISH(bl);
   }
 
@@ -388,13 +391,13 @@ struct rgw_bucket_shard_inc_sync_marker {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(position, bl);
+    encode(position, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
      DECODE_START(1, bl);
-    ::decode(position, bl);
+    decode(position, bl);
      DECODE_FINISH(bl);
   }
 
@@ -424,17 +427,17 @@ struct rgw_bucket_shard_sync_info {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(state, bl);
-    ::encode(full_marker, bl);
-    ::encode(inc_marker, bl);
+    encode(state, bl);
+    encode(full_marker, bl);
+    encode(inc_marker, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
      DECODE_START(1, bl);
-     ::decode(state, bl);
-     ::decode(full_marker, bl);
-     ::decode(inc_marker, bl);
+     decode(state, bl);
+     decode(full_marker, bl);
+     decode(inc_marker, bl);
      DECODE_FINISH(bl);
   }
 
index 887161c390e3321aa40ff616ad5b0c628ec2dd33..891d66141cffaf949ca6a37406fdb33c07495127 100644 (file)
@@ -358,14 +358,15 @@ void ObjectMetaInfo::generate_test_instances(list<ObjectMetaInfo*>& o)
 
 void ObjectCacheInfo::generate_test_instances(list<ObjectCacheInfo*>& o)
 {
+  using ceph::encode;
   ObjectCacheInfo *i = new ObjectCacheInfo;
   i->status = 0;
   i->flags = CACHE_FLAG_MODIFY_XATTRS;
   string s = "this is a string";
   string s2 = "this is a another string";
   bufferlist data, data2;
-  ::encode(s, data);
-  ::encode(s2, data2);
+  encode(s, data);
+  encode(s2, data2);
   i->data = data;
   i->xattrs["x1"] = data;
   i->xattrs["x2"] = data2;
index 818afa44879c0d5d2a16928b3f2cb8a5d5e85e73..d37f05be30c69b6ef1c7089bab68aa5429e2cead 100644 (file)
@@ -974,18 +974,20 @@ namespace rgw {
   void RGWFileHandle::encode_attrs(ceph::buffer::list& ux_key1,
                                   ceph::buffer::list& ux_attrs1)
   {
+    using ceph::encode;
     fh_key fhk(this->fh.fh_hk);
-    rgw::encode(fhk, ux_key1);
-    rgw::encode(*this, ux_attrs1);
+    encode(fhk, ux_key1);
+    encode(*this, ux_attrs1);
   } /* RGWFileHandle::encode_attrs */
 
   DecodeAttrsResult RGWFileHandle::decode_attrs(const ceph::buffer::list* ux_key1,
                                                 const ceph::buffer::list* ux_attrs1)
   {
+    using ceph::decode;
     DecodeAttrsResult dar { false, false };
     fh_key fhk;
     auto bl_iter_key1  = const_cast<buffer::list*>(ux_key1)->begin();
-    rgw::decode(fhk, bl_iter_key1);
+    decode(fhk, bl_iter_key1);
     if (fhk.version >= 2) {
       assert(this->fh.fh_hk == fhk.fh_hk);
     } else {
@@ -993,7 +995,7 @@ namespace rgw {
     }
 
     auto bl_iter_unix1 = const_cast<buffer::list*>(ux_attrs1)->begin();
-    rgw::decode(*this, bl_iter_unix1);
+    decode(*this, bl_iter_unix1);
     if (this->state.version < 2) {
       get<1>(dar) = true;
     }
@@ -1448,7 +1450,7 @@ namespace rgw {
       cs_info.compression_type = plugin->get_type_name();
       cs_info.orig_size = s->obj_size;
       cs_info.blocks = std::move(compressor->get_compression_blocks());
-      ::encode(cs_info, tmp);
+      encode(cs_info, tmp);
       attrs[RGW_ATTR_COMPRESSION] = tmp;
       ldout(s->cct, 20) << "storing " << RGW_ATTR_COMPRESSION
                        << " with type=" << cs_info.compression_type
@@ -1492,7 +1494,8 @@ namespace rgw {
      * processing any input from user in order to prohibit overwriting. */
     if (unlikely(!! slo_info)) {
       buffer::list slo_userindicator_bl;
-      ::encode("True", slo_userindicator_bl);
+      using ceph::encode;
+      encode("True", slo_userindicator_bl);
       emplace_attr(RGW_ATTR_SLO_UINDICATOR, std::move(slo_userindicator_bl));
     }
 
index 1fb0362781e9ec608f168da0fc1c2a4df2b84efa..4843c95dc987786705604caca9c2356c83113c66 100644 (file)
@@ -123,18 +123,18 @@ namespace rgw {
 
     void encode(buffer::list& bl) const {
       ENCODE_START(2, 1, bl);
-      ::encode(fh_hk.bucket, bl);
-      ::encode(fh_hk.object, bl);
-      ::encode((uint32_t)2, bl);
+      encode(fh_hk.bucket, bl);
+      encode(fh_hk.object, bl);
+      encode((uint32_t)2, bl);
       ENCODE_FINISH(bl);
     }
 
     void decode(bufferlist::iterator& bl) {
       DECODE_START(2, bl);
-      ::decode(fh_hk.bucket, bl);
-      ::decode(fh_hk.object, bl);
+      decode(fh_hk.bucket, bl);
+      decode(fh_hk.object, bl);
       if (struct_v >= 2) {
-       ::decode(version, bl);
+       decode(version, bl);
       }
       DECODE_FINISH(bl);
     }
@@ -619,38 +619,38 @@ namespace rgw {
 
     void encode(buffer::list& bl) const {
       ENCODE_START(2, 1, bl);
-      ::encode(uint32_t(fh.fh_type), bl);
-      ::encode(state.dev, bl);
-      ::encode(state.size, bl);
-      ::encode(state.nlink, bl);
-      ::encode(state.owner_uid, bl);
-      ::encode(state.owner_gid, bl);
-      ::encode(state.unix_mode, bl);
+      encode(uint32_t(fh.fh_type), bl);
+      encode(state.dev, bl);
+      encode(state.size, bl);
+      encode(state.nlink, bl);
+      encode(state.owner_uid, bl);
+      encode(state.owner_gid, bl);
+      encode(state.unix_mode, bl);
       for (const auto& t : { state.ctime, state.mtime, state.atime }) {
-       ::encode(real_clock::from_timespec(t), bl);
+       encode(real_clock::from_timespec(t), bl);
       }
-      ::encode((uint32_t)2, bl);
+      encode((uint32_t)2, bl);
       ENCODE_FINISH(bl);
     }
 
     void decode(bufferlist::iterator& bl) {
       DECODE_START(2, bl);
       uint32_t fh_type;
-      ::decode(fh_type, bl);
+      decode(fh_type, bl);
       assert(fh.fh_type == fh_type);
-      ::decode(state.dev, bl);
-      ::decode(state.size, bl);
-      ::decode(state.nlink, bl);
-      ::decode(state.owner_uid, bl);
-      ::decode(state.owner_gid, bl);
-      ::decode(state.unix_mode, bl);
+      decode(state.dev, bl);
+      decode(state.size, bl);
+      decode(state.nlink, bl);
+      decode(state.owner_uid, bl);
+      decode(state.owner_gid, bl);
+      decode(state.unix_mode, bl);
       ceph::real_time enc_time;
       for (auto t : { &(state.ctime), &(state.mtime), &(state.atime) }) {
-       ::decode(enc_time, bl);
+       decode(enc_time, bl);
        *t = real_clock::to_timespec(enc_time);
       }
       if (struct_v >= 2) {
-        ::decode(state.version, bl);
+        decode(state.version, bl);
       }
       DECODE_FINISH(bl);
     }
index df79a9cc9445c5b0cc126683d018b50b0d08c678..a8ab9c461c6c59bb20724598b798f4093ffd767b 100644 (file)
@@ -47,15 +47,15 @@ public:
 
   void encode(bufferlist& bl) const {
     ENCODE_START(3, 2, bl);
-    ::encode(days, bl);
-    ::encode(date, bl);
+    encode(days, bl);
+    encode(date, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
-    ::decode(days, bl);
+    decode(days, bl);
     if (struct_v >= 3) {
-      ::decode(date, bl);
+      decode(date, bl);
     }
     DECODE_FINISH(bl);
   }
@@ -131,15 +131,15 @@ class LCFilter
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 1, bl);
-    ::encode(prefix, bl);
-    ::encode(obj_tags, bl);
+    encode(prefix, bl);
+    encode(obj_tags, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(2, bl);
-    ::decode(prefix, bl);
+    decode(prefix, bl);
     if (struct_v >= 2) {
-      ::decode(obj_tags, bl);
+      decode(obj_tags, bl);
     }
     DECODE_FINISH(bl);
   }
@@ -231,33 +231,33 @@ public:
   
   void encode(bufferlist& bl) const {
      ENCODE_START(5, 1, bl);
-     ::encode(id, bl);
-     ::encode(prefix, bl);
-     ::encode(status, bl);
-     ::encode(expiration, bl);
-     ::encode(noncur_expiration, bl);
-     ::encode(mp_expiration, bl);
-     ::encode(dm_expiration, bl);
-     ::encode(filter, bl);
+     encode(id, bl);
+     encode(prefix, bl);
+     encode(status, bl);
+     encode(expiration, bl);
+     encode(noncur_expiration, bl);
+     encode(mp_expiration, bl);
+     encode(dm_expiration, bl);
+     encode(filter, bl);
      ENCODE_FINISH(bl);
    }
    void decode(bufferlist::iterator& bl) {
      DECODE_START_LEGACY_COMPAT_LEN(5, 1, 1, bl);
-     ::decode(id, bl);
-     ::decode(prefix, bl);
-     ::decode(status, bl);
-     ::decode(expiration, bl);
+     decode(id, bl);
+     decode(prefix, bl);
+     decode(status, bl);
+     decode(expiration, bl);
      if (struct_v >=2) {
-       ::decode(noncur_expiration, bl);
+       decode(noncur_expiration, bl);
      }
      if (struct_v >= 3) {
-       ::decode(mp_expiration, bl);
+       decode(mp_expiration, bl);
      }
      if (struct_v >= 4) {
-        ::decode(dm_expiration, bl);
+        decode(dm_expiration, bl);
      }
      if (struct_v >= 5) {
-       ::decode(filter, bl);
+       decode(filter, bl);
      }
      DECODE_FINISH(bl);
    }
@@ -302,12 +302,12 @@ public:
 //  int get_group_perm(ACLGroupTypeEnum group, int perm_mask);
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(rule_map, bl);
+    encode(rule_map, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(rule_map, bl);
+    decode(rule_map, bl);
     multimap<string, LCRule>::iterator iter;
     for (iter = rule_map.begin(); iter != rule_map.end(); ++iter) {
       LCRule& rule = iter->second;
index eac2f14e6f1631b0090a7e7de6149a736026006d..16f0a2931b235170ccda4bf7c314577bcca5dc6b 100644 (file)
@@ -420,7 +420,7 @@ int rgw_log_op(RGWRados *store, RGWREST* const rest, struct req_state *s,
   entry.bucket_id = bucket_id;
 
   bufferlist bl;
-  ::encode(entry, bl);
+  encode(entry, bl);
 
   struct tm bdt;
   time_t t = entry.time.sec();
index 25e99e096dee3d7a3f1d2a3a72d8bccb4acb7af1..20795a75156bfc35ed08a58ee08314e3a9814cbc 100644 (file)
@@ -37,76 +37,76 @@ struct rgw_log_entry {
 
   void encode(bufferlist &bl) const {
     ENCODE_START(9, 5, bl);
-    ::encode(object_owner.id, bl);
-    ::encode(bucket_owner.id, bl);
-    ::encode(bucket, bl);
-    ::encode(time, bl);
-    ::encode(remote_addr, bl);
-    ::encode(user, bl);
-    ::encode(obj.name, bl);
-    ::encode(op, bl);
-    ::encode(uri, bl);
-    ::encode(http_status, bl);
-    ::encode(error_code, bl);
-    ::encode(bytes_sent, bl);
-    ::encode(obj_size, bl);
-    ::encode(total_time, bl);
-    ::encode(user_agent, bl);
-    ::encode(referrer, bl);
-    ::encode(bytes_received, bl);
-    ::encode(bucket_id, bl);
-    ::encode(obj, bl);
-    ::encode(object_owner, bl);
-    ::encode(bucket_owner, bl);
-    ::encode(x_headers, bl);
+    encode(object_owner.id, bl);
+    encode(bucket_owner.id, bl);
+    encode(bucket, bl);
+    encode(time, bl);
+    encode(remote_addr, bl);
+    encode(user, bl);
+    encode(obj.name, bl);
+    encode(op, bl);
+    encode(uri, bl);
+    encode(http_status, bl);
+    encode(error_code, bl);
+    encode(bytes_sent, bl);
+    encode(obj_size, bl);
+    encode(total_time, bl);
+    encode(user_agent, bl);
+    encode(referrer, bl);
+    encode(bytes_received, bl);
+    encode(bucket_id, bl);
+    encode(obj, bl);
+    encode(object_owner, bl);
+    encode(bucket_owner, bl);
+    encode(x_headers, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &p) {
     DECODE_START_LEGACY_COMPAT_LEN(8, 5, 5, p);
-    ::decode(object_owner.id, p);
+    decode(object_owner.id, p);
     if (struct_v > 3)
-      ::decode(bucket_owner.id, p);
-    ::decode(bucket, p);
-    ::decode(time, p);
-    ::decode(remote_addr, p);
-    ::decode(user, p);
-    ::decode(obj.name, p);
-    ::decode(op, p);
-    ::decode(uri, p);
-    ::decode(http_status, p);
-    ::decode(error_code, p);
-    ::decode(bytes_sent, p);
-    ::decode(obj_size, p);
-    ::decode(total_time, p);
-    ::decode(user_agent, p);
-    ::decode(referrer, p);
+      decode(bucket_owner.id, p);
+    decode(bucket, p);
+    decode(time, p);
+    decode(remote_addr, p);
+    decode(user, p);
+    decode(obj.name, p);
+    decode(op, p);
+    decode(uri, p);
+    decode(http_status, p);
+    decode(error_code, p);
+    decode(bytes_sent, p);
+    decode(obj_size, p);
+    decode(total_time, p);
+    decode(user_agent, p);
+    decode(referrer, p);
     if (struct_v >= 2)
-      ::decode(bytes_received, p);
+      decode(bytes_received, p);
     else
       bytes_received = 0;
 
     if (struct_v >= 3) {
       if (struct_v <= 5) {
         uint64_t id;
-        ::decode(id, p);
+        decode(id, p);
         char buf[32];
         snprintf(buf, sizeof(buf), "%llu", (long long)id);
         bucket_id = buf;
       } else {
-        ::decode(bucket_id, p);
+        decode(bucket_id, p);
       }
     } else {
       bucket_id = "";
     }
     if (struct_v >= 7) {
-      ::decode(obj, p);
+      decode(obj, p);
     }
     if (struct_v >= 8) {
-      ::decode(object_owner, p);
-      ::decode(bucket_owner, p);
+      decode(object_owner, p);
+      decode(bucket_owner, p);
     }
     if (struct_v >= 9) {
-      ::decode(x_headers, p);
+      decode(x_headers, p);
     }
     DECODE_FINISH(p);
   }
index c1e8f2b790b4b5632d25568f462ee0c9f300c4b6..d50782dfb3dc1adac07421916e865850efa8635a 100644 (file)
@@ -45,19 +45,19 @@ void LogStatusDump::dump(Formatter *f) const {
 
 void RGWMetadataLogData::encode(bufferlist& bl) const {
   ENCODE_START(1, 1, bl);
-  ::encode(read_version, bl);
-  ::encode(write_version, bl);
+  encode(read_version, bl);
+  encode(write_version, bl);
   uint32_t s = (uint32_t)status;
-  ::encode(s, bl);
+  encode(s, bl);
   ENCODE_FINISH(bl);
 }
 
 void RGWMetadataLogData::decode(bufferlist::iterator& bl) {
    DECODE_START(1, bl);
-   ::decode(read_version, bl);
-   ::decode(write_version, bl);
+   decode(read_version, bl);
+   decode(write_version, bl);
    uint32_t s;
-   ::decode(s, bl);
+   decode(s, bl);
    status = (RGWMDLogStatus)s;
    DECODE_FINISH(bl);
 }
@@ -912,7 +912,7 @@ void RGWMetadataManager::dump_log_entry(cls_log_entry& entry, Formatter *f)
   try {
     RGWMetadataLogData log_data;
     bufferlist::iterator iter = entry.data.begin();
-    ::decode(log_data, iter);
+    decode(log_data, iter);
 
     encode_json("data", log_data, f);
   } catch (buffer::error& err) {
@@ -949,7 +949,7 @@ int RGWMetadataManager::pre_modify(RGWMetadataHandler *handler, string& section,
   log_data.status = op_type;
 
   bufferlist logbl;
-  ::encode(log_data, logbl);
+  encode(log_data, logbl);
 
   assert(current_log); // must have called init()
   int ret = current_log->add_entry(handler, section, key, logbl);
@@ -968,7 +968,7 @@ int RGWMetadataManager::post_modify(RGWMetadataHandler *handler, const string& s
     log_data.status = MDLOG_STATUS_ABORT;
 
   bufferlist logbl;
-  ::encode(log_data, logbl);
+  encode(log_data, logbl);
 
   assert(current_log); // must have called init()
   int r = current_log->add_entry(handler, section, key, logbl);
index 0dfc73f112de2ac6b82363cc5d77f23938d5bb0e..a3c8dab47fea3d483c6ddf406451a51799402722 100644 (file)
@@ -274,14 +274,14 @@ struct RGWMetadataLogHistory {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(oldest_realm_epoch, bl);
-    ::encode(oldest_period_id, bl);
+    encode(oldest_realm_epoch, bl);
+    encode(oldest_period_id, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& p) {
     DECODE_START(1, p);
-    ::decode(oldest_realm_epoch, p);
-    ::decode(oldest_period_id, p);
+    decode(oldest_realm_epoch, p);
+    decode(oldest_period_id, p);
     DECODE_FINISH(p);
   }
 
index 5c101397bbc9abd20082dff9d17226b80a187189..a48a1621d748e6a07450384b9d8749284b3fcf8d 100644 (file)
@@ -122,7 +122,7 @@ int list_multipart_parts(RGWRados *store, RGWBucketInfo& bucket_info, CephContex
     bufferlist::iterator bli = bl.begin();
     RGWUploadPartInfo info;
     try {
-      ::decode(info, bli);
+      decode(info, bli);
     } catch (buffer::error& err) {
       ldout(cct, 0) << "ERROR: could not part info, caught buffer::error" << dendl;
       return -EIO;
index a1c4047f750960825b64763d7b1dda468b8d4d48..fb26857806b75ad98ae88cb6dfaccae9c8b5e2f7 100644 (file)
@@ -1419,7 +1419,7 @@ int RGWGetObj::handle_slo_manifest(bufferlist& bl)
   RGWSLOInfo slo_info;
   bufferlist::iterator bliter = bl.begin();
   try {
-    ::decode(slo_info, bliter);
+    decode(slo_info, bliter);
   } catch (buffer::error& err) {
     ldout(s->cct, 0) << "ERROR: failed to decode slo manifest" << dendl;
     return -EIO;
@@ -1598,7 +1598,7 @@ static bool object_is_expired(map<string, bufferlist>& attrs) {
   if (iter != attrs.end()) {
     utime_t delete_at;
     try {
-      ::decode(delete_at, iter->second);
+      decode(delete_at, iter->second);
     } catch (buffer::error& err) {
       dout(0) << "ERROR: " << __func__ << ": failed to decode " RGW_ATTR_DELETE_AT " attr" << dendl;
       return false;
@@ -3118,7 +3118,7 @@ int RGWPutObjProcessor_Multipart::do_complete(size_t accounted_size,
     return r;
   }
 
-  ::encode(info, bl);
+  encode(info, bl);
 
   string multipart_meta_obj = mp.get_meta();
 
@@ -3546,7 +3546,7 @@ void RGWPutObj::execute()
     cs_info.compression_type = plugin->get_type_name();
     cs_info.orig_size = s->obj_size;
     cs_info.blocks = move(compressor->get_compression_blocks());
-    ::encode(cs_info, tmp);
+    encode(cs_info, tmp);
     attrs[RGW_ATTR_COMPRESSION] = tmp;
     ldout(s->cct, 20) << "storing " << RGW_ATTR_COMPRESSION
         << " with type=" << cs_info.compression_type
@@ -3578,7 +3578,7 @@ void RGWPutObj::execute()
 
   if (slo_info) {
     bufferlist manifest_bl;
-    ::encode(*slo_info, manifest_bl);
+    encode(*slo_info, manifest_bl);
     emplace_attr(RGW_ATTR_SLO_MANIFEST, std::move(manifest_bl));
 
     hash.Update((::byte *)slo_info->raw_data, slo_info->raw_data_len);
@@ -3835,7 +3835,7 @@ void RGWPostObj::execute()
       cs_info.compression_type = plugin->get_type_name();
       cs_info.orig_size = s->obj_size;
       cs_info.blocks = move(compressor->get_compression_blocks());
-      ::encode(cs_info, tmp);
+      encode(cs_info, tmp);
       emplace_attr(RGW_ATTR_COMPRESSION, std::move(tmp));
     }
 
@@ -4131,7 +4131,7 @@ int RGWDeleteObj::handle_slo_manifest(bufferlist& bl)
   RGWSLOInfo slo_info;
   bufferlist::iterator bliter = bl.begin();
   try {
-    ::decode(slo_info, bliter);
+    decode(slo_info, bliter);
   } catch (buffer::error& err) {
     ldout(s->cct, 0) << "ERROR: failed to decode slo manifest" << dendl;
     return -EIO;
@@ -5242,7 +5242,7 @@ static int get_multipart_info(RGWRados *store, struct req_state *s,
         bufferlist& bl = iter->second;
         bufferlist::iterator bli = bl.begin();
         try {
-          ::decode(*policy, bli);
+          decode(*policy, bli);
         } catch (buffer::error& err) {
           ldout(s->cct, 0) << "ERROR: could not decode policy, caught buffer::error" << dendl;
           return -EIO;
@@ -5503,7 +5503,7 @@ void RGWCompleteMultipart::execute()
   if (compressed) {
     // write compression attribute to full object
     bufferlist tmp;
-    ::encode(cs_info, tmp);
+    encode(cs_info, tmp);
     attrs[RGW_ATTR_COMPRESSION] = tmp;
   }
 
@@ -6472,7 +6472,7 @@ int RGWBulkUploadOp::handle_file(const boost::string_ref path,
     cs_info.compression_type = plugin->get_type_name();
     cs_info.orig_size = s->obj_size;
     cs_info.blocks = std::move(compressor->get_compression_blocks());
-    ::encode(cs_info, tmp);
+    encode(cs_info, tmp);
     attrs.emplace(RGW_ATTR_COMPRESSION, std::move(tmp));
   }
 
index d071777473164dd7017796c9ebff0b758559a5b8..6e7d03d8b013bb4ea947669e3f18464f56b06e0a 100644 (file)
@@ -69,7 +69,7 @@ int RGWOrphanStore::read_job(const string& job_name, RGWOrphanSearchState & stat
 
   try {
     bufferlist& bl = iter->second;
-    ::decode(state, bl);
+    decode(state, bl);
   } catch (buffer::error& err) {
     lderr(store->ctx()) << "ERROR: could not decode buffer" << dendl;
     return -EIO;
@@ -82,7 +82,7 @@ int RGWOrphanStore::write_job(const string& job_name, const RGWOrphanSearchState
 {
   map<string, bufferlist> vals;
   bufferlist bl;
-  ::encode(state, bl);
+  encode(state, bl);
   vals[job_name] = bl;
   int r = ioctx.omap_set(oid, vals);
   if (r < 0) {
@@ -127,7 +127,7 @@ int RGWOrphanStore::list_jobs(map <string,RGWOrphanSearchState>& job_list)
       RGWOrphanSearchState state;
       try {
         bufferlist bl = it.second;
-        ::decode(state, bl);
+        decode(state, bl);
       } catch (buffer::error& err) {
         lderr(store->ctx()) << "ERROR: could not decode buffer" << dendl;
         return -EIO;
index fb30d699784a6a3a847a73c46da826e295e33026..9f9763a50e428b81211866208ae0f8222575c991 100644 (file)
@@ -48,19 +48,19 @@ struct RGWOrphanSearchStage {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode((int)stage, bl);
-    ::encode(shard, bl);
-    ::encode(marker, bl);
+    encode((int)stage, bl);
+    encode(shard, bl);
+    encode(marker, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
     int s;
-    ::decode(s, bl);
+    decode(s, bl);
     stage = (RGWOrphanSearchStageId)s;
-    ::decode(shard, bl);
-    ::decode(marker, bl);
+    decode(shard, bl);
+    decode(marker, bl);
     DECODE_FINISH(bl);
   }
 
@@ -76,21 +76,21 @@ struct RGWOrphanSearchInfo {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 1, bl);
-    ::encode(job_name, bl);
-    ::encode(pool.to_str(), bl);
-    ::encode(num_shards, bl);
-    ::encode(start_time, bl);
+    encode(job_name, bl);
+    encode(pool.to_str(), bl);
+    encode(num_shards, bl);
+    encode(start_time, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(2, bl);
-    ::decode(job_name, bl);
+    decode(job_name, bl);
     string s;
-    ::decode(s, bl);
+    decode(s, bl);
     pool.from_str(s);
-    ::decode(num_shards, bl);
-    ::decode(start_time, bl);
+    decode(num_shards, bl);
+    decode(start_time, bl);
     DECODE_FINISH(bl);
   }
 
@@ -106,15 +106,15 @@ struct RGWOrphanSearchState {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(info, bl);
-    ::encode(stage, bl);
+    encode(info, bl);
+    encode(stage, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(info, bl);
-    ::decode(stage, bl);
+    decode(info, bl);
+    decode(stage, bl);
     DECODE_FINISH(bl);
   }
 
index e068da4376b3719a47a4a1f3fe5105be70247789..6bf0f2c2a24b33f5574db49207ebc6c0a355b50e 100644 (file)
@@ -180,7 +180,7 @@ void RGWPeriodPusher::handle_notify(RGWRealmNotify type,
   // decode the period
   RGWZonesNeedPeriod info;
   try {
-    ::decode(info, p);
+    decode(info, p);
   } catch (buffer::error& e) {
     lderr(cct) << "Failed to decode the period: " << e.what() << dendl;
     return;
index 49ec14871815c1ba43373e87379a349bcd7ac6dd..54e2f48a79ae535ff8c8c90e7760b06ede7a6458 100644 (file)
@@ -58,29 +58,29 @@ public:
   void encode(bufferlist& bl) const {
     ENCODE_START(3, 1, bl);
     if (max_size < 0) {
-      ::encode(-rgw_rounded_kb(abs(max_size)), bl);
+      encode(-rgw_rounded_kb(abs(max_size)), bl);
     } else {
-      ::encode(rgw_rounded_kb(max_size), bl);
+      encode(rgw_rounded_kb(max_size), bl);
     }
-    ::encode(max_objects, bl);
-    ::encode(enabled, bl);
-    ::encode(max_size, bl);
-    ::encode(check_on_raw, bl);
+    encode(max_objects, bl);
+    encode(enabled, bl);
+    encode(max_size, bl);
+    encode(check_on_raw, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(3, 1, 1, bl);
     int64_t max_size_kb;
-    ::decode(max_size_kb, bl);
-    ::decode(max_objects, bl);
-    ::decode(enabled, bl);
+    decode(max_size_kb, bl);
+    decode(max_objects, bl);
+    decode(enabled, bl);
     if (struct_v < 2) {
       max_size = max_size_kb * 1024;
     } else {
-      ::decode(max_size, bl);
+      decode(max_size, bl);
     }
     if (struct_v >= 3) {
-      ::decode(check_on_raw, bl);
+      decode(check_on_raw, bl);
     }
     DECODE_FINISH(bl);
   }
index 4817efd697bffb59199407dc6a3b48929a5f1135..7389c3f80b95fcd4670c9a7c63e13f1b35d216a8 100644 (file)
@@ -54,7 +54,7 @@ void RGWRealmWatcher::handle_notify(uint64_t notify_id, uint64_t cookie,
     auto p = bl.begin();
     while (!p.end()) {
       RGWRealmNotify notify;
-      ::decode(notify, p);
+      decode(notify, p);
       auto watcher = watchers.find(notify);
       if (watcher == watchers.end()) {
         lderr(cct) << "Failed to find a watcher for notify type "
index d660068e70820046c458c325c13df9b3063617d0..c6efe16f451dbb0b1103d9167535331746565829 100644 (file)
@@ -158,7 +158,7 @@ int decode_attr_bl_single_value(map<string, bufferlist>& attrs, const char *attr
   }
   bufferlist::iterator bliter = bl.begin();
   try {
-    ::decode(*result, bliter);
+    decode(*result, bliter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -287,7 +287,7 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs,
           content_type = iter->second.c_str();
         }
       } else if (strcmp(name, RGW_ATTR_SLO_UINDICATOR) == 0) {
-        // this attr has an extra length prefix from ::encode() in prior versions
+        // this attr has an extra length prefix from encode() in prior versions
         dump_header(s, "X-Object-Meta-Static-Large-Object", "True");
       } else if (strncmp(name, RGW_ATTR_META_PREFIX,
                         sizeof(RGW_ATTR_META_PREFIX)-1) == 0) {
@@ -1423,14 +1423,14 @@ static inline int get_obj_attrs(RGWRados *store, struct req_state *s, rgw_obj& o
 static inline void set_attr(map<string, bufferlist>& attrs, const char* key, const std::string& value)
 {
   bufferlist bl;
-  ::encode(value,bl);
+  encode(value,bl);
   attrs.emplace(key, std::move(bl));
 }
 
 static inline void set_attr(map<string, bufferlist>& attrs, const char* key, const char* value)
 {
   bufferlist bl;
-  ::encode(value,bl);
+  encode(value,bl);
   attrs.emplace(key, std::move(bl));
 }
 
index a7bf4ea812fde59129c393562f8d5615acaf2ecb..a21f31bfea8ea6c9193166a255021e249e2af1b1 100644 (file)
@@ -1220,7 +1220,7 @@ static void dump_object_metadata(struct req_state * const s,
     if (aiter != std::end(rgw_to_http_attrs)) {
       response_attrs[aiter->second] = kv.second.c_str();
     } else if (strcmp(name, RGW_ATTR_SLO_UINDICATOR) == 0) {
-      // this attr has an extra length prefix from ::encode() in prior versions
+      // this attr has an extra length prefix from encode() in prior versions
       dump_header(s, "X-Object-Meta-Static-Large-Object", "True");
     } else if (strncmp(name, RGW_ATTR_META_PREFIX,
                       sizeof(RGW_ATTR_META_PREFIX)-1) == 0) {
@@ -1252,7 +1252,7 @@ static void dump_object_metadata(struct req_state * const s,
   if (iter != std::end(attrs)) {
     utime_t delete_at;
     try {
-      ::decode(delete_at, iter->second);
+      decode(delete_at, iter->second);
       if (!delete_at.is_zero()) {
         dump_header(s, "X-Delete-At", delete_at.sec());
       }
index 61dca85bd04247735f404c8a64b8458207b8830f..5c67e0980a5259fb9e88251f102c844d0eb52c77 100644 (file)
@@ -25,10 +25,11 @@ const string RGWRole::role_arn_prefix = "arn:aws:iam::";
 
 int RGWRole::store_info(bool exclusive)
 {
+  using ceph::encode;
   string oid = get_info_oid_prefix() + id;
 
   bufferlist bl;
-  ::encode(*this, bl);
+  encode(*this, bl);
   return rgw_put_system_obj(store, store->get_zone_params().roles_pool, oid,
                 bl.c_str(), bl.length(), exclusive, NULL, real_time(), NULL);
 }
@@ -41,7 +42,8 @@ int RGWRole::store_name(bool exclusive)
   string oid = tenant + get_names_oid_prefix() + name;
 
   bufferlist bl;
-  ::encode(nameToId, bl);
+  using ceph::encode;
+  encode(nameToId, bl);
   return rgw_put_system_obj(store, store->get_zone_params().roles_pool, oid,
               bl.c_str(), bl.length(), exclusive, NULL, real_time(), NULL);
 }
@@ -301,7 +303,8 @@ int RGWRole::read_id(const string& role_name, const string& tenant, string& role
   RGWNameToId nameToId;
   try {
     bufferlist::iterator iter = bl.begin();
-    ::decode(nameToId, iter);
+    using ceph::decode;
+    decode(nameToId, iter);
   } catch (buffer::error& err) {
     ldout(cct, 0) << "ERROR: failed to decode role from pool: " << pool.name << ": "
                   << role_name << dendl;
@@ -326,8 +329,9 @@ int RGWRole::read_info()
   }
 
   try {
+    using ceph::decode;
     bufferlist::iterator iter = bl.begin();
-    ::decode(*this, iter);
+    decode(*this, iter);
   } catch (buffer::error& err) {
     ldout(cct, 0) << "ERROR: failed to decode role info from pool: " << pool.name <<
                   ": " << id << dendl;
@@ -353,8 +357,9 @@ int RGWRole::read_name()
 
   RGWNameToId nameToId;
   try {
+    using ceph::decode;
     bufferlist::iterator iter = bl.begin();
-    ::decode(nameToId, iter);
+    decode(nameToId, iter);
   } catch (buffer::error& err) {
     ldout(cct, 0) << "ERROR: failed to decode role name from pool: " << pool.name << ": "
                   << name << dendl;
index bccb576ed2d83c1e023d6687bcd22321e1afa929..1aa96ca78b68e91381dd3cf37f05e164351a8248 100644 (file)
@@ -1,8 +1,15 @@
 #ifndef CEPH_RGW_ROLE_H
 #define CEPH_RGW_ROLE_H
 
+#include <string>
+
+#include "common/ceph_context.h"
+
+#include "rgw/rgw_rados.h"
+
 class RGWRole
 {
+  using string = std::string;
   static const string role_name_oid_prefix;
   static const string role_oid_prefix;
   static const string role_path_oid_prefix;
@@ -78,28 +85,28 @@ public:
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 1, bl);
-    ::encode(id, bl);
-    ::encode(name, bl);
-    ::encode(path, bl);
-    ::encode(arn, bl);
-    ::encode(creation_date, bl);
-    ::encode(trust_policy, bl);
-    ::encode(perm_policy_map, bl);
-    ::encode(tenant, bl);
+    encode(id, bl);
+    encode(name, bl);
+    encode(path, bl);
+    encode(arn, bl);
+    encode(creation_date, bl);
+    encode(trust_policy, bl);
+    encode(perm_policy_map, bl);
+    encode(tenant, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(2, bl);
-    ::decode(id, bl);
-    ::decode(name, bl);
-    ::decode(path, bl);
-    ::decode(arn, bl);
-    ::decode(creation_date, bl);
-    ::decode(trust_policy, bl);
-    ::decode(perm_policy_map, bl);
+    decode(id, bl);
+    decode(name, bl);
+    decode(path, bl);
+    decode(arn, bl);
+    decode(creation_date, bl);
+    decode(trust_policy, bl);
+    decode(perm_policy_map, bl);
     if (struct_v >= 2) {
-      ::decode(tenant, bl);
+      decode(tenant, bl);
     }
     DECODE_FINISH(bl);
   }
index 0222a9f0dd80983a2311eb349f33046ab7834e76..9c2e7e33f8b9925e322a73b682a867dd2983d8e4 100644 (file)
@@ -428,9 +428,10 @@ static int build_token(const string& swift_user,
                        const utime_t& expiration,
                        bufferlist& bl)
 {
-  ::encode(swift_user, bl);
-  ::encode(nonce, bl);
-  ::encode(expiration, bl);
+  using ceph::encode;
+  encode(swift_user, bl);
+  encode(nonce, bl);
+  encode(expiration, bl);
 
   bufferptr p(CEPH_CRYPTO_HMACSHA1_DIGESTSIZE);
 
@@ -508,9 +509,10 @@ SignedTokenEngine::authenticate(const std::string& token,
   try {
     /*const*/ auto iter = tok_bl.begin();
 
-    ::decode(swift_user, iter);
-    ::decode(nonce, iter);
-    ::decode(expiration, iter);
+    using ceph::decode;
+    decode(swift_user, iter);
+    decode(nonce, iter);
+    decode(expiration, iter);
   } catch (buffer::error& err) {
     ldout(cct, 0) << "NOTICE: failed to decode token" << dendl;
     throw -EINVAL;
index e2dcfa4672443c784ef335247155b96814cabb10..bbffba5ea452def02ab04358c67b65fbb032a157 100644 (file)
@@ -51,7 +51,7 @@ RGWCoroutine *RGWSyncErrorLogger::log_error_cr(const string& source_zone, const
 
   rgw_sync_error_info info(source_zone, error_code, message);
   bufferlist bl;
-  ::encode(info, bl);
+  encode(info, bl);
   store->time_log_prepare_entry(entry, real_clock::now(), section, name, bl);
 
   uint32_t shard_id = ++counter % num_shards;
@@ -2400,7 +2400,7 @@ int RGWCloneMetaLogCoroutine::state_store_mdlog_entries()
     dest_entry.name = entry.name;
     dest_entry.timestamp = utime_t(entry.timestamp);
   
-    ::encode(entry.log_data, dest_entry.data);
+    encode(entry.log_data, dest_entry.data);
 
     dest_entries.push_back(dest_entry);
 
index 21f9a7ed1c2a5ae97bafd4173cfbbf909c6414da..f93592ce612bd287d1bb32e930f98fde1fac7d26 100644 (file)
@@ -1,15 +1,18 @@
 #ifndef CEPH_RGW_SYNC_H
 #define CEPH_RGW_SYNC_H
 
+#include <atomic>
+
+#include "include/stringify.h"
+#include "common/RWLock.h"
+
 #include "rgw_coroutine.h"
 #include "rgw_http_client.h"
+#include "rgw_metadata.h"
 #include "rgw_meta_sync_status.h"
+#include "rgw_rados.h"
 #include "rgw_sync_trace.h"
 
-#include "include/stringify.h"
-#include "common/RWLock.h"
-
-#include <atomic>
 
 #define ERROR_LOGGER_SHARDS 32
 #define RGW_SYNC_ERROR_LOG_SHARD_PREFIX "sync.error-log"
@@ -41,7 +44,7 @@ struct rgw_mdlog_entry {
     timestamp = le.timestamp.to_real_time();
     try {
       bufferlist::iterator iter = le.data.begin();
-      ::decode(log_data, iter);
+      decode(log_data, iter);
     } catch (buffer::error& err) {
       return false;
     }
@@ -87,17 +90,17 @@ struct rgw_sync_error_info {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(source_zone, bl);
-    ::encode(error_code, bl);
-    ::encode(message, bl);
+    encode(source_zone, bl);
+    encode(error_code, bl);
+    encode(message, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(source_zone, bl);
-    ::decode(error_code, bl);
-    ::decode(message, bl);
+    decode(source_zone, bl);
+    decode(error_code, bl);
+    decode(message, bl);
     DECODE_FINISH(bl);
   }
 
index fb95f4bc01c2cab92440cbf7c8046c0557a19029..42b348312fb315456d3d39efe2bebc55a557a33a 100644 (file)
@@ -113,27 +113,29 @@ std::ostream& operator<<(std::ostream& out, const TrimCounters::BucketCounter& r
 
 void TrimCounters::BucketCounter::encode(bufferlist& bl) const
 {
+  using ceph::encode;
   // no versioning to save space
-  ::encode(bucket, bl);
-  ::encode(count, bl);
+  encode(bucket, bl);
+  encode(count, bl);
 }
 void TrimCounters::BucketCounter::decode(bufferlist::iterator& p)
 {
-  ::decode(bucket, p);
-  ::decode(count, p);
+  using ceph::decode;
+  decode(bucket, p);
+  decode(count, p);
 }
 WRITE_CLASS_ENCODER(TrimCounters::BucketCounter);
 
 void TrimCounters::Request::encode(bufferlist& bl) const
 {
   ENCODE_START(1, 1, bl);
-  ::encode(max_buckets, bl);
+  encode(max_buckets, bl);
   ENCODE_FINISH(bl);
 }
 void TrimCounters::Request::decode(bufferlist::iterator& p)
 {
   DECODE_START(1, p);
-  ::decode(max_buckets, p);
+  decode(max_buckets, p);
   DECODE_FINISH(p);
 }
 WRITE_CLASS_ENCODER(TrimCounters::Request);
@@ -141,13 +143,13 @@ WRITE_CLASS_ENCODER(TrimCounters::Request);
 void TrimCounters::Response::encode(bufferlist& bl) const
 {
   ENCODE_START(1, 1, bl);
-  ::encode(bucket_counters, bl);
+  encode(bucket_counters, bl);
   ENCODE_FINISH(bl);
 }
 void TrimCounters::Response::decode(bufferlist::iterator& p)
 {
   DECODE_START(1, p);
-  ::decode(bucket_counters, p);
+  decode(bucket_counters, p);
   DECODE_FINISH(p);
 }
 WRITE_CLASS_ENCODER(TrimCounters::Response);
@@ -156,12 +158,12 @@ void TrimCounters::Handler::handle(bufferlist::iterator& input,
                                    bufferlist& output)
 {
   Request request;
-  ::decode(request, input);
+  decode(request, input);
   auto count = std::min<uint16_t>(request.max_buckets, 128);
 
   Response response;
   server->get_bucket_counters(count, response.bucket_counters);
-  ::encode(response, output);
+  encode(response, output);
 }
 
 /// api to notify peer gateways that trim has completed and their bucket change
@@ -217,12 +219,12 @@ void TrimComplete::Handler::handle(bufferlist::iterator& input,
                                    bufferlist& output)
 {
   Request request;
-  ::decode(request, input);
+  decode(request, input);
 
   server->reset_bucket_counters();
 
   Response response;
-  ::encode(response, output);
+  encode(response, output);
 }
 
 
@@ -306,7 +308,7 @@ class BucketTrimWatcher : public librados::WatchCtx2 {
     try {
       auto p = bl.begin();
       TrimNotifyType type;
-      ::decode(type, p);
+      decode(type, p);
 
       auto handler = handlers.find(type);
       if (handler != handlers.end()) {
@@ -546,13 +548,13 @@ int accumulate_peer_counters(bufferlist& bl, BucketChangeCounter& counter)
     auto p = bl.begin();
     std::map<std::pair<uint64_t, uint64_t>, bufferlist> replies;
     std::set<std::pair<uint64_t, uint64_t>> timeouts;
-    ::decode(replies, p);
-    ::decode(timeouts, p);
+    decode(replies, p);
+    decode(timeouts, p);
 
     for (auto& peer : replies) {
       auto q = peer.second.begin();
       TrimCounters::Response response;
-      ::decode(response, q);
+      decode(response, q);
       for (const auto& b : response.bucket_counters) {
         counter.insert(b.bucket, b.count);
       }
@@ -749,8 +751,8 @@ int BucketTrimCR::operate()
         const TrimNotifyType type = NotifyTrimCounters;
         TrimCounters::Request request{32};
         bufferlist bl;
-        ::encode(type, bl);
-        ::encode(request, bl);
+        encode(type, bl);
+        encode(request, bl);
         call(new RGWRadosNotifyCR(store, obj, bl, config.notify_timeout_ms,
                                   &notify_replies));
       }
@@ -852,8 +854,8 @@ int BucketTrimCR::operate()
       const TrimNotifyType type = NotifyTrimComplete;
       TrimComplete::Request request;
       bufferlist bl;
-      ::encode(type, bl);
-      ::encode(request, bl);
+      encode(type, bl);
+      encode(request, bl);
       call(new RGWRadosNotifyCR(store, obj, bl, config.notify_timeout_ms,
                                 nullptr));
     }
index 3d61b08dc1bcc8483b663ba51734db7b09f5b743..39823c1a7ee2b81057d36df17842a2e459caa499 100644 (file)
@@ -90,12 +90,12 @@ struct BucketTrimStatus {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(marker, bl);
+    encode(marker, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& p) {
     DECODE_START(1, p);
-    ::decode(marker, p);
+    decode(marker, p);
     DECODE_FINISH(p);
   }
 
index 6c8c65c5a14cc3f8f8e6cded4cacdbb89e89636f..472a2d8fd8af8dada3e2c4076f72f6c94ef0796c 100644 (file)
@@ -285,7 +285,7 @@ struct es_obj_metadata {
       if (name == "acl") {
         try {
           auto i = val.begin();
-          ::decode(policy, i);
+          decode(policy, i);
         } catch (buffer::error& err) {
           ldout(cct, 0) << "ERROR: failed to decode acl for " << bucket_info.bucket << "/" << key << dendl;
         }
@@ -305,7 +305,7 @@ struct es_obj_metadata {
         }
       } else if (name == "x-amz-tagging") {
         auto tags_bl = val.begin();
-        ::decode(obj_tags, tags_bl);
+        decode(obj_tags, tags_bl);
       } else {
         if (name != "pg_ver" &&
             name != "source_zone" &&
index 0db19cbe649f95a4358b1229b97fda206c31d4da..c18254b1840398a9f03b28e1a91b19dcc861a188 100644 (file)
@@ -18,13 +18,13 @@ class RGWObjTags
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1,1,bl);
-    ::encode(tag_map, bl);
+    encode(tag_map, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
-    ::decode(tag_map,bl);
+    decode(tag_map,bl);
     DECODE_FINISH(bl);
   }
 
index 9235f54b8416bb9f580dab859662ae650e1ffa9f..38fc75a14900262e2fd19a4bc5385400459adfac 100644 (file)
@@ -93,11 +93,11 @@ namespace rgw {
       uint32_t ver = version();
       string typestr{from_type(type)};
       ENCODE_START(1, 1, bl);
-      ::encode(type_name, bl);
-      ::encode(ver, bl);
-      ::encode(typestr, bl);
-      ::encode(id, bl);
-      ::encode(key, bl);
+      encode(type_name, bl);
+      encode(ver, bl);
+      encode(typestr, bl);
+      encode(id, bl);
+      encode(key, bl);
       ENCODE_FINISH(bl);
     }
 
@@ -106,12 +106,12 @@ namespace rgw {
       string typestr;
       uint32_t version;
       DECODE_START(1, bl);
-      ::decode(name, bl);
-      ::decode(version, bl);
-      ::decode(typestr, bl);
+      decode(name, bl);
+      decode(version, bl);
+      decode(typestr, bl);
       type = to_type(typestr);
-      ::decode(id, bl);
-      ::decode(key, bl);
+      decode(id, bl);
+      decode(key, bl);
       DECODE_FINISH(bl);
     }
 
index 45430dab6900f003f762bf394375623c18e91617..cc0af138bebd058066d24bc498c0140a9cf4e145 100644 (file)
@@ -192,11 +192,11 @@ int rgw_store_user_info(RGWRados *store,
   ui.user_id = info.user_id;
 
   bufferlist link_bl;
-  ::encode(ui, link_bl);
+  encode(ui, link_bl);
 
   bufferlist data_bl;
-  ::encode(ui, data_bl);
-  ::encode(info, data_bl);
+  encode(ui, data_bl);
+  encode(info, data_bl);
 
   string key;
   info.user_id.to_str(key);
@@ -283,7 +283,7 @@ int rgw_get_user_info_from_index(RGWRados * const store,
 
   bufferlist::iterator iter = bl.begin();
   try {
-    ::decode(uid, iter);
+    decode(uid, iter);
     int ret = rgw_get_user_info_by_uid(store, uid.user_id, e.info, &e.objv_tracker, NULL, &cache_info);
     if (ret < 0) {
       return ret;
@@ -328,13 +328,13 @@ int rgw_get_user_info_by_uid(RGWRados *store,
 
   bufferlist::iterator iter = bl.begin();
   try {
-    ::decode(user_id, iter);
+    decode(user_id, iter);
     if (user_id.user_id.compare(uid) != 0) {
       lderr(store->ctx())  << "ERROR: rgw_get_user_info_by_uid(): user id mismatch: " << user_id.user_id << " != " << uid << dendl;
       return -EIO;
     }
     if (!iter.end()) {
-      ::decode(info, iter);
+      decode(info, iter);
     }
   } catch (buffer::error& err) {
     ldout(store->ctx(), 0) << "ERROR: failed to decode user info, caught buffer::error" << dendl;
index 091f30d282578bf7bb21b3d59811d40e8299f88d..35467be24cc27ca620789c6abf71a7d44cdd0998 100644 (file)
@@ -37,11 +37,13 @@ struct RGWUID
   void encode(bufferlist& bl) const {
     string s;
     user_id.to_str(s);
-    ::encode(s, bl);
+    using ceph::encode;
+    encode(s, bl);
   }
   void decode(bufferlist::iterator& bl) {
     string s;
-    ::decode(s, bl);
+    using ceph::decode;
+    decode(s, bl);
     user_id.from_str(s);
   }
 };
index 4d20787fc2ed1ea767a534f6127d009d183cbbe0..53d89525d7dd7a6dcd0361ce3d018a1622ced4d2 100644 (file)
@@ -18,6 +18,8 @@
 #include <list>
 #include <string>
 
+#include "common/ceph_json.h"
+
 #include "rgw_xml.h"
 
 struct RGWRedirectInfo
@@ -28,16 +30,16 @@ struct RGWRedirectInfo
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(protocol, bl);
-    ::encode(hostname, bl);
-    ::encode(http_redirect_code, bl);
+    encode(protocol, bl);
+    encode(hostname, bl);
+    encode(http_redirect_code, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(protocol, bl);
-    ::decode(hostname, bl);
-    ::decode(http_redirect_code, bl);
+    decode(protocol, bl);
+    decode(hostname, bl);
+    decode(http_redirect_code, bl);
     DECODE_FINISH(bl);
   }
 
@@ -55,16 +57,16 @@ struct RGWBWRedirectInfo
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(redirect, bl);
-    ::encode(replace_key_prefix_with, bl);
-    ::encode(replace_key_with, bl);
+    encode(redirect, bl);
+    encode(replace_key_prefix_with, bl);
+    encode(replace_key_with, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(redirect, bl);
-    ::decode(replace_key_prefix_with, bl);
-    ::decode(replace_key_with, bl);
+    decode(redirect, bl);
+    decode(replace_key_prefix_with, bl);
+    decode(replace_key_with, bl);
     DECODE_FINISH(bl);
   }
 
@@ -82,14 +84,14 @@ struct RGWBWRoutingRuleCondition
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(key_prefix_equals, bl);
-    ::encode(http_error_code_returned_equals, bl);
+    encode(key_prefix_equals, bl);
+    encode(http_error_code_returned_equals, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(key_prefix_equals, bl);
-    ::decode(http_error_code_returned_equals, bl);
+    decode(key_prefix_equals, bl);
+    decode(http_error_code_returned_equals, bl);
     DECODE_FINISH(bl);
   }
 
@@ -112,14 +114,14 @@ struct RGWBWRoutingRule
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(condition, bl);
-    ::encode(redirect_info, bl);
+    encode(condition, bl);
+    encode(redirect_info, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(condition, bl);
-    ::decode(redirect_info, bl);
+    decode(condition, bl);
+    decode(redirect_info, bl);
     DECODE_FINISH(bl);
   }
 
@@ -149,12 +151,12 @@ struct RGWBWRoutingRules
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(rules, bl);
+    encode(rules, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(1, bl);
-    ::decode(rules, bl);
+    decode(rules, bl);
     DECODE_FINISH(bl);
   }
 
@@ -186,25 +188,25 @@ struct RGWBucketWebsiteConf
 
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 1, bl);
-    ::encode(index_doc_suffix, bl);
-    ::encode(error_doc, bl);
-    ::encode(routing_rules, bl);
-    ::encode(redirect_all, bl);
-    ::encode(subdir_marker, bl);
-    ::encode(listing_css_doc, bl);
-    ::encode(listing_enabled, bl);
+    encode(index_doc_suffix, bl);
+    encode(error_doc, bl);
+    encode(routing_rules, bl);
+    encode(redirect_all, bl);
+    encode(subdir_marker, bl);
+    encode(listing_css_doc, bl);
+    encode(listing_enabled, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(2, bl);
-    ::decode(index_doc_suffix, bl);
-    ::decode(error_doc, bl);
-    ::decode(routing_rules, bl);
-    ::decode(redirect_all, bl);
+    decode(index_doc_suffix, bl);
+    decode(error_doc, bl);
+    decode(routing_rules, bl);
+    decode(redirect_all, bl);
     if (struct_v >= 2) {
-      ::decode(subdir_marker, bl);
-      ::decode(listing_css_doc, bl);
-      ::decode(listing_enabled, bl);
+      decode(subdir_marker, bl);
+      decode(listing_css_doc, bl);
+      decode(listing_enabled, bl);
     }
     DECODE_FINISH(bl);
   }