From fb264d77adac986a72775f08c0cab8857aed9d9f Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Tue, 26 Dec 2017 16:19:08 -0500 Subject: [PATCH] rgw: Use unqualified encode/decode 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 --- src/rgw/rgw_acl.h | 86 ++++++++++++++++----------------- src/rgw/rgw_admin.cc | 10 ++-- src/rgw/rgw_basic_types.h | 8 ++-- src/rgw/rgw_bucket.cc | 10 ++-- src/rgw/rgw_cache.h | 64 ++++++++++++------------- src/rgw/rgw_common.cc | 3 +- src/rgw/rgw_cors.h | 28 +++++------ src/rgw/rgw_cr_rados.cc | 2 +- src/rgw/rgw_cr_rados.h | 4 +- src/rgw/rgw_crypt.cc | 2 +- src/rgw/rgw_data_sync.cc | 11 +++-- src/rgw/rgw_data_sync.h | 75 +++++++++++++++-------------- src/rgw/rgw_dencoder.cc | 5 +- src/rgw/rgw_file.cc | 15 +++--- src/rgw/rgw_file.h | 48 +++++++++---------- src/rgw/rgw_lc.h | 52 ++++++++++---------- src/rgw/rgw_log.cc | 2 +- src/rgw/rgw_log.h | 90 +++++++++++++++++------------------ src/rgw/rgw_metadata.cc | 18 +++---- src/rgw/rgw_metadata.h | 8 ++-- src/rgw/rgw_multi.cc | 2 +- src/rgw/rgw_op.cc | 20 ++++---- src/rgw/rgw_orphan.cc | 6 +-- src/rgw/rgw_orphan.h | 36 +++++++------- src/rgw/rgw_period_pusher.cc | 2 +- src/rgw/rgw_quota.h | 22 ++++----- src/rgw/rgw_realm_watcher.cc | 2 +- src/rgw/rgw_rest_s3.cc | 8 ++-- src/rgw/rgw_rest_swift.cc | 4 +- src/rgw/rgw_role.cc | 15 ++++-- src/rgw/rgw_role.h | 39 ++++++++------- src/rgw/rgw_swift_auth.cc | 14 +++--- src/rgw/rgw_sync.cc | 4 +- src/rgw/rgw_sync.h | 25 +++++----- src/rgw/rgw_sync_log_trim.cc | 42 ++++++++-------- src/rgw/rgw_sync_log_trim.h | 4 +- src/rgw/rgw_sync_module_es.cc | 4 +- src/rgw/rgw_tag.h | 4 +- src/rgw/rgw_token.h | 20 ++++---- src/rgw/rgw_user.cc | 12 ++--- src/rgw/rgw_user.h | 6 ++- src/rgw/rgw_website.h | 74 ++++++++++++++-------------- 42 files changed, 470 insertions(+), 436 deletions(-) diff --git a/src/rgw/rgw_acl.h b/src/rgw/rgw_acl.h index 9931bd531a354..42a401d9133d7 100644 --- a/src/rgw/rgw_acl.h +++ b/src/rgw/rgw_acl.h @@ -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::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& 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); } diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 294248526c3da..5bf3ceec31234 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -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; diff --git a/src/rgw/rgw_basic_types.h b/src/rgw/rgw_basic_types.h index e935fff48ad92..76b065ad47740 100644 --- a/src/rgw/rgw_basic_types.h +++ b/src/rgw/rgw_basic_types.h @@ -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); } diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 10fac5fefa73c..b849db6744ced 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -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; diff --git a/src/rgw/rgw_cache.h b/src/rgw/rgw_cache.h index b6066b6b544d8..3089723913d87 100644 --- a/src/rgw/rgw_cache.h +++ b/src/rgw/rgw_cache.h @@ -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::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::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; diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 06e49df231c17..f724e3f34dbf2 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -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(); diff --git a/src/rgw/rgw_cors.h b/src/rgw/rgw_cors.h index 61b352dae57ce..b525ddcd0d804 100644 --- a/src/rgw/rgw_cors.h +++ b/src/rgw/rgw_cors.h @@ -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; diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index 71586bdce6fb8..9f9530eb4ab41 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -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); diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index cb0ba58089732..fe5fba7e3a067 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -256,7 +256,7 @@ int RGWSimpleRadosReadCR::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 { diff --git a/src/rgw/rgw_crypt.cc b/src/rgw/rgw_crypt.cc index 9e4e5c0a1dfe6..1b95bb1989e3e 100644 --- a/src/rgw/rgw_crypt.cc +++ b/src/rgw/rgw_crypt.cc @@ -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; diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 0b2e5c2882700..373676ed58d80 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1962,7 +1962,7 @@ static void decode_attr(CephContext *cct, map& 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& attrs void rgw_bucket_shard_sync_info::encode_state_attr(map& attrs) { - ::encode(state, attrs["state"]); + using ceph::encode; + encode(state, attrs["state"]); } void rgw_bucket_shard_full_sync_marker::encode_attr(map& attrs) { - ::encode(*this, attrs["full_marker"]); + using ceph::encode; + encode(*this, attrs["full_marker"]); } void rgw_bucket_shard_inc_sync_marker::encode_attr(map& attrs) { - ::encode(*this, attrs["inc_marker"]); + using ceph::encode; + encode(*this, attrs["inc_marker"]); } class RGWReadBucketSyncStatusCoroutine : public RGWCoroutine { diff --git a/src/rgw/rgw_data_sync.h b/src/rgw/rgw_data_sync.h index 4623836bb8722..d4fde49c409e4 100644 --- a/src/rgw/rgw_data_sync.h +++ b/src/rgw/rgw_data_sync.h @@ -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); } diff --git a/src/rgw/rgw_dencoder.cc b/src/rgw/rgw_dencoder.cc index 887161c390e33..891d66141cffa 100644 --- a/src/rgw/rgw_dencoder.cc +++ b/src/rgw/rgw_dencoder.cc @@ -358,14 +358,15 @@ void ObjectMetaInfo::generate_test_instances(list& o) void ObjectCacheInfo::generate_test_instances(list& 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; diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index 818afa44879c0..d37f05be30c69 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -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(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(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)); } diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 1fb0362781e9e..4843c95dc9877 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -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); } diff --git a/src/rgw/rgw_lc.h b/src/rgw/rgw_lc.h index df79a9cc9445c..a8ab9c461c6c5 100644 --- a/src/rgw/rgw_lc.h +++ b/src/rgw/rgw_lc.h @@ -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::iterator iter; for (iter = rule_map.begin(); iter != rule_map.end(); ++iter) { LCRule& rule = iter->second; diff --git a/src/rgw/rgw_log.cc b/src/rgw/rgw_log.cc index eac2f14e6f163..16f0a2931b235 100644 --- a/src/rgw/rgw_log.cc +++ b/src/rgw/rgw_log.cc @@ -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(); diff --git a/src/rgw/rgw_log.h b/src/rgw/rgw_log.h index 25e99e096dee3..20795a75156bf 100644 --- a/src/rgw/rgw_log.h +++ b/src/rgw/rgw_log.h @@ -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); } diff --git a/src/rgw/rgw_metadata.cc b/src/rgw/rgw_metadata.cc index c1e8f2b790b4b..d50782dfb3dc1 100644 --- a/src/rgw/rgw_metadata.cc +++ b/src/rgw/rgw_metadata.cc @@ -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); diff --git a/src/rgw/rgw_metadata.h b/src/rgw/rgw_metadata.h index 0dfc73f112de2..a3c8dab47fea3 100644 --- a/src/rgw/rgw_metadata.h +++ b/src/rgw/rgw_metadata.h @@ -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); } diff --git a/src/rgw/rgw_multi.cc b/src/rgw/rgw_multi.cc index 5c101397bbc9a..a48a1621d748e 100644 --- a/src/rgw/rgw_multi.cc +++ b/src/rgw/rgw_multi.cc @@ -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; diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index a1c4047f75096..fb26857806b75 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -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& 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)); } diff --git a/src/rgw/rgw_orphan.cc b/src/rgw/rgw_orphan.cc index d071777473164..6e7d03d8b013b 100644 --- a/src/rgw/rgw_orphan.cc +++ b/src/rgw/rgw_orphan.cc @@ -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 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 & 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; diff --git a/src/rgw/rgw_orphan.h b/src/rgw/rgw_orphan.h index fb30d699784a6..9f9763a50e428 100644 --- a/src/rgw/rgw_orphan.h +++ b/src/rgw/rgw_orphan.h @@ -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); } diff --git a/src/rgw/rgw_period_pusher.cc b/src/rgw/rgw_period_pusher.cc index e068da4376b37..6bf0f2c2a24b3 100644 --- a/src/rgw/rgw_period_pusher.cc +++ b/src/rgw/rgw_period_pusher.cc @@ -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; diff --git a/src/rgw/rgw_quota.h b/src/rgw/rgw_quota.h index 49ec14871815c..54e2f48a79ae5 100644 --- a/src/rgw/rgw_quota.h +++ b/src/rgw/rgw_quota.h @@ -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); } diff --git a/src/rgw/rgw_realm_watcher.cc b/src/rgw/rgw_realm_watcher.cc index 4817efd697bff..7389c3f80b95f 100644 --- a/src/rgw/rgw_realm_watcher.cc +++ b/src/rgw/rgw_realm_watcher.cc @@ -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 " diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index d660068e70820..c6efe16f451db 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -158,7 +158,7 @@ int decode_attr_bl_single_value(map& 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& 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& attrs, const char* key, const char* value) { bufferlist bl; - ::encode(value,bl); + encode(value,bl); attrs.emplace(key, std::move(bl)); } diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index a7bf4ea812fde..a21f31bfea8ea 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -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()); } diff --git a/src/rgw/rgw_role.cc b/src/rgw/rgw_role.cc index 61dca85bd0424..5c67e0980a525 100644 --- a/src/rgw/rgw_role.cc +++ b/src/rgw/rgw_role.cc @@ -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; diff --git a/src/rgw/rgw_role.h b/src/rgw/rgw_role.h index bccb576ed2d83..1aa96ca78b68e 100644 --- a/src/rgw/rgw_role.h +++ b/src/rgw/rgw_role.h @@ -1,8 +1,15 @@ #ifndef CEPH_RGW_ROLE_H #define CEPH_RGW_ROLE_H +#include + +#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); } diff --git a/src/rgw/rgw_swift_auth.cc b/src/rgw/rgw_swift_auth.cc index 0222a9f0dd809..9c2e7e33f8b99 100644 --- a/src/rgw/rgw_swift_auth.cc +++ b/src/rgw/rgw_swift_auth.cc @@ -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; diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index e2dcfa4672443..bbffba5ea452d 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -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); diff --git a/src/rgw/rgw_sync.h b/src/rgw/rgw_sync.h index 21f9a7ed1c2a5..f93592ce612bd 100644 --- a/src/rgw/rgw_sync.h +++ b/src/rgw/rgw_sync.h @@ -1,15 +1,18 @@ #ifndef CEPH_RGW_SYNC_H #define CEPH_RGW_SYNC_H +#include + +#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 #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); } diff --git a/src/rgw/rgw_sync_log_trim.cc b/src/rgw/rgw_sync_log_trim.cc index fb95f4bc01c2c..42b348312fb31 100644 --- a/src/rgw/rgw_sync_log_trim.cc +++ b/src/rgw/rgw_sync_log_trim.cc @@ -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(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, bufferlist> replies; std::set> 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, ¬ify_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)); } diff --git a/src/rgw/rgw_sync_log_trim.h b/src/rgw/rgw_sync_log_trim.h index 3d61b08dc1bcc..39823c1a7ee2b 100644 --- a/src/rgw/rgw_sync_log_trim.h +++ b/src/rgw/rgw_sync_log_trim.h @@ -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); } diff --git a/src/rgw/rgw_sync_module_es.cc b/src/rgw/rgw_sync_module_es.cc index 6c8c65c5a14cc..472a2d8fd8af8 100644 --- a/src/rgw/rgw_sync_module_es.cc +++ b/src/rgw/rgw_sync_module_es.cc @@ -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" && diff --git a/src/rgw/rgw_tag.h b/src/rgw/rgw_tag.h index 0db19cbe649f9..c18254b184039 100644 --- a/src/rgw/rgw_tag.h +++ b/src/rgw/rgw_tag.h @@ -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); } diff --git a/src/rgw/rgw_token.h b/src/rgw/rgw_token.h index 9235f54b8416b..38fc75a149002 100644 --- a/src/rgw/rgw_token.h +++ b/src/rgw/rgw_token.h @@ -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); } diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index 45430dab6900f..cc0af138bebd0 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -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; diff --git a/src/rgw/rgw_user.h b/src/rgw/rgw_user.h index 091f30d282578..35467be24cc27 100644 --- a/src/rgw/rgw_user.h +++ b/src/rgw/rgw_user.h @@ -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); } }; diff --git a/src/rgw/rgw_website.h b/src/rgw/rgw_website.h index 4d20787fc2ed1..53d89525d7dd7 100644 --- a/src/rgw/rgw_website.h +++ b/src/rgw/rgw_website.h @@ -18,6 +18,8 @@ #include #include +#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); } -- 2.39.5