From: Adam C. Emerson Date: Fri, 22 Dec 2017 05:38:05 +0000 (-0500) Subject: common: Use unqualified encoding in ceph_time.h X-Git-Tag: wip-pdonnell-testing-20180317.202121~583^2~26 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=16fbc7049f33580812610984d901532a98568ee7;p=ceph-ci.git common: Use unqualified encoding in ceph_time.h Well, actually move encode/decode into encoding.h and include ceph_time.h from there. Also in any function that encodes a timepoint. Also clean up a few include file problems that come out of having ceph_time.h not include encoding.h Signed-off-by: Adam C. Emerson --- diff --git a/src/cls/rgw/cls_rgw_ops.h b/src/cls/rgw/cls_rgw_ops.h index 33052cdf926..cbf059da6da 100644 --- a/src/cls/rgw/cls_rgw_ops.h +++ b/src/cls/rgw/cls_rgw_ops.h @@ -11,12 +11,12 @@ struct rgw_cls_tag_timeout_op void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(tag_timeout, bl); + encode(tag_timeout, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(tag_timeout, bl); + decode(tag_timeout, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -39,38 +39,38 @@ struct rgw_cls_obj_prepare_op void encode(bufferlist &bl) const { ENCODE_START(7, 5, bl); uint8_t c = (uint8_t)op; - ::encode(c, bl); - ::encode(tag, bl); - ::encode(locator, bl); - ::encode(log_op, bl); - ::encode(key, bl); - ::encode(bilog_flags, bl); - ::encode(zones_trace, bl); + encode(c, bl); + encode(tag, bl); + encode(locator, bl); + encode(log_op, bl); + encode(key, bl); + encode(bilog_flags, bl); + encode(zones_trace, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(7, 3, 3, bl); uint8_t c; - ::decode(c, bl); + decode(c, bl); op = (RGWModifyOp)c; if (struct_v < 5) { - ::decode(key.name, bl); + decode(key.name, bl); } - ::decode(tag, bl); + decode(tag, bl); if (struct_v >= 2) { - ::decode(locator, bl); + decode(locator, bl); } if (struct_v >= 4) { - ::decode(log_op, bl); + decode(log_op, bl); } if (struct_v >= 5) { - ::decode(key, bl); + decode(key, bl); } if (struct_v >= 6) { - ::decode(bilog_flags, bl); + decode(bilog_flags, bl); } if (struct_v >= 7) { - ::decode(zones_trace, bl); + decode(zones_trace, bl); } DECODE_FINISH(bl); } @@ -98,36 +98,36 @@ struct rgw_cls_obj_complete_op void encode(bufferlist &bl) const { ENCODE_START(9, 7, bl); uint8_t c = (uint8_t)op; - ::encode(c, bl); - ::encode(ver.epoch, bl); - ::encode(meta, bl); - ::encode(tag, bl); - ::encode(locator, bl); - ::encode(remove_objs, bl); - ::encode(ver, bl); - ::encode(log_op, bl); - ::encode(key, bl); - ::encode(bilog_flags, bl); - ::encode(zones_trace, bl); + encode(c, bl); + encode(ver.epoch, bl); + encode(meta, bl); + encode(tag, bl); + encode(locator, bl); + encode(remove_objs, bl); + encode(ver, bl); + encode(log_op, bl); + encode(key, bl); + encode(bilog_flags, bl); + encode(zones_trace, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(9, 3, 3, bl); uint8_t c; - ::decode(c, bl); + decode(c, bl); op = (RGWModifyOp)c; if (struct_v < 7) { - ::decode(key.name, bl); + decode(key.name, bl); } - ::decode(ver.epoch, bl); - ::decode(meta, bl); - ::decode(tag, bl); + decode(ver.epoch, bl); + decode(meta, bl); + decode(tag, bl); if (struct_v >= 2) { - ::decode(locator, bl); + decode(locator, bl); } if (struct_v >= 4 && struct_v < 7) { list old_remove_objs; - ::decode(old_remove_objs, bl); + decode(old_remove_objs, bl); for (list::iterator iter = old_remove_objs.begin(); iter != old_remove_objs.end(); ++iter) { @@ -136,24 +136,24 @@ struct rgw_cls_obj_complete_op remove_objs.push_back(k); } } else { - ::decode(remove_objs, bl); + decode(remove_objs, bl); } if (struct_v >= 5) { - ::decode(ver, bl); + decode(ver, bl); } else { ver.pool = -1; } if (struct_v >= 6) { - ::decode(log_op, bl); + decode(log_op, bl); } if (struct_v >= 7) { - ::decode(key, bl); + decode(key, bl); } if (struct_v >= 8) { - ::decode(bilog_flags, bl); + decode(bilog_flags, bl); } if (struct_v >= 9) { - ::decode(zones_trace, bl); + decode(zones_trace, bl); } DECODE_FINISH(bl); } @@ -179,47 +179,47 @@ struct rgw_cls_link_olh_op { void encode(bufferlist& bl) const { ENCODE_START(5, 1, bl); - ::encode(key, bl); - ::encode(olh_tag, bl); - ::encode(delete_marker, bl); - ::encode(op_tag, bl); - ::encode(meta, bl); - ::encode(olh_epoch, bl); - ::encode(log_op, bl); - ::encode(bilog_flags, bl); + encode(key, bl); + encode(olh_tag, bl); + encode(delete_marker, bl); + encode(op_tag, bl); + encode(meta, bl); + encode(olh_epoch, bl); + encode(log_op, bl); + encode(bilog_flags, bl); uint64_t t = ceph::real_clock::to_time_t(unmod_since); - ::encode(t, bl); - ::encode(unmod_since, bl); - ::encode(high_precision_time, bl); - ::encode(zones_trace, bl); + encode(t, bl); + encode(unmod_since, bl); + encode(high_precision_time, bl); + encode(zones_trace, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(5, bl); - ::decode(key, bl); - ::decode(olh_tag, bl); - ::decode(delete_marker, bl); - ::decode(op_tag, bl); - ::decode(meta, bl); - ::decode(olh_epoch, bl); - ::decode(log_op, bl); - ::decode(bilog_flags, bl); + decode(key, bl); + decode(olh_tag, bl); + decode(delete_marker, bl); + decode(op_tag, bl); + decode(meta, bl); + decode(olh_epoch, bl); + decode(log_op, bl); + decode(bilog_flags, bl); if (struct_v == 2) { uint64_t t; - ::decode(t, bl); + decode(t, bl); unmod_since = ceph::real_clock::from_time_t(static_cast(t)); } if (struct_v >= 3) { uint64_t t; - ::decode(t, bl); - ::decode(unmod_since, bl); + decode(t, bl); + decode(unmod_since, bl); } if (struct_v >= 4) { - ::decode(high_precision_time, bl); + decode(high_precision_time, bl); } if (struct_v >= 5) { - ::decode(zones_trace, bl); + decode(zones_trace, bl); } DECODE_FINISH(bl); } @@ -242,28 +242,28 @@ struct rgw_cls_unlink_instance_op { void encode(bufferlist& bl) const { ENCODE_START(3, 1, bl); - ::encode(key, bl); - ::encode(op_tag, bl); - ::encode(olh_epoch, bl); - ::encode(log_op, bl); - ::encode(bilog_flags, bl); - ::encode(olh_tag, bl); - ::encode(zones_trace, bl); + encode(key, bl); + encode(op_tag, bl); + encode(olh_epoch, bl); + encode(log_op, bl); + encode(bilog_flags, bl); + encode(olh_tag, bl); + encode(zones_trace, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(3, bl); - ::decode(key, bl); - ::decode(op_tag, bl); - ::decode(olh_epoch, bl); - ::decode(log_op, bl); - ::decode(bilog_flags, bl); + decode(key, bl); + decode(op_tag, bl); + decode(olh_epoch, bl); + decode(log_op, bl); + decode(bilog_flags, bl); if (struct_v >= 2) { - ::decode(olh_tag, bl); + decode(olh_tag, bl); } if (struct_v >= 3) { - ::decode(zones_trace, bl); + decode(zones_trace, bl); } DECODE_FINISH(bl); } @@ -283,16 +283,16 @@ struct rgw_cls_read_olh_log_op void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(olh, bl); - ::encode(ver_marker, bl); - ::encode(olh_tag, bl); + encode(olh, bl); + encode(ver_marker, bl); + encode(olh_tag, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(olh, bl); - ::decode(ver_marker, bl); - ::decode(olh_tag, bl); + decode(olh, bl); + decode(ver_marker, bl); + decode(olh_tag, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -310,14 +310,14 @@ struct rgw_cls_read_olh_log_ret void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(log, bl); - ::encode(is_truncated, bl); + encode(log, bl); + encode(is_truncated, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(log, bl); - ::decode(is_truncated, bl); + decode(log, bl); + decode(is_truncated, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -335,16 +335,16 @@ struct rgw_cls_trim_olh_log_op void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(olh, bl); - ::encode(ver, bl); - ::encode(olh_tag, bl); + encode(olh, bl); + encode(ver, bl); + encode(olh_tag, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(olh, bl); - ::decode(ver, bl); - ::decode(olh_tag, bl); + decode(olh, bl); + decode(ver, bl); + decode(olh_tag, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -360,15 +360,15 @@ struct rgw_cls_bucket_clear_olh_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(key, bl); - ::encode(olh_tag, bl); + encode(key, bl); + encode(olh_tag, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(key, bl); - ::decode(olh_tag, bl); + decode(key, bl); + decode(olh_tag, bl); DECODE_FINISH(bl); } @@ -388,24 +388,24 @@ struct rgw_cls_list_op void encode(bufferlist &bl) const { ENCODE_START(5, 4, bl); - ::encode(num_entries, bl); - ::encode(filter_prefix, bl); - ::encode(start_obj, bl); - ::encode(list_versions, bl); + encode(num_entries, bl); + encode(filter_prefix, bl); + encode(start_obj, bl); + encode(list_versions, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(5, 2, 2, bl); if (struct_v < 4) { - ::decode(start_obj.name, bl); + decode(start_obj.name, bl); } - ::decode(num_entries, bl); + decode(num_entries, bl); if (struct_v >= 3) - ::decode(filter_prefix, bl); + decode(filter_prefix, bl); if (struct_v >= 4) - ::decode(start_obj, bl); + decode(start_obj, bl); if (struct_v >= 5) - ::decode(list_versions, bl); + decode(list_versions, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -422,14 +422,14 @@ struct rgw_cls_list_ret void encode(bufferlist &bl) const { ENCODE_START(2, 2, bl); - ::encode(dir, bl); - ::encode(is_truncated, bl); + encode(dir, bl); + encode(is_truncated, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl); - ::decode(dir, bl); - ::decode(is_truncated, bl); + decode(dir, bl); + decode(is_truncated, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -446,14 +446,14 @@ struct rgw_cls_check_index_ret void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(existing_header, bl); - ::encode(calculated_header, bl); + encode(existing_header, bl); + encode(calculated_header, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(existing_header, bl); - ::decode(calculated_header, bl); + decode(existing_header, bl); + decode(calculated_header, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -470,14 +470,14 @@ struct rgw_cls_bucket_update_stats_op void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(absolute, bl); - ::encode(stats, bl); + encode(absolute, bl); + encode(stats, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(absolute, bl); - ::decode(stats, bl); + decode(absolute, bl); + decode(stats, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -490,13 +490,13 @@ struct rgw_cls_obj_remove_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(keep_attr_prefixes, bl); + encode(keep_attr_prefixes, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(keep_attr_prefixes, bl); + decode(keep_attr_prefixes, bl); DECODE_FINISH(bl); } }; @@ -507,13 +507,13 @@ struct rgw_cls_obj_store_pg_ver_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(attr, bl); + encode(attr, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(attr, bl); + decode(attr, bl); DECODE_FINISH(bl); } }; @@ -527,15 +527,15 @@ struct rgw_cls_obj_check_attrs_prefix { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(check_prefix, bl); - ::encode(fail_if_exist, bl); + encode(check_prefix, bl); + encode(fail_if_exist, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(check_prefix, bl); - ::decode(fail_if_exist, bl); + decode(check_prefix, bl); + decode(fail_if_exist, bl); DECODE_FINISH(bl); } }; @@ -550,20 +550,20 @@ struct rgw_cls_obj_check_mtime { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(mtime, bl); - ::encode((uint8_t)type, bl); - ::encode(high_precision_time, bl); + encode(mtime, bl); + encode((uint8_t)type, bl); + encode(high_precision_time, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(mtime, bl); + decode(mtime, bl); uint8_t c; - ::decode(c, bl); + decode(c, bl); type = (RGWCheckMTimeType)c; if (struct_v >= 2) { - ::decode(high_precision_time, bl); + decode(high_precision_time, bl); } DECODE_FINISH(bl); } @@ -576,17 +576,17 @@ struct rgw_cls_usage_log_add_op { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(info, bl); - ::encode(user.to_str(), bl); + encode(info, bl); + encode(user.to_str(), bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(info, bl); + decode(info, bl); if (struct_v >= 2) { string s; - ::decode(s, bl); + decode(s, bl); user.from_str(s); } DECODE_FINISH(bl); @@ -602,16 +602,16 @@ struct rgw_cls_bi_get_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(key, bl); - ::encode((uint8_t)type, bl); + encode(key, bl); + encode((uint8_t)type, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(key, bl); + decode(key, bl); uint8_t c; - ::decode(c, bl); + decode(c, bl); type = (BIIndexType)c; DECODE_FINISH(bl); } @@ -625,13 +625,13 @@ struct rgw_cls_bi_get_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entry, bl); + encode(entry, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entry, bl); + decode(entry, bl); DECODE_FINISH(bl); } }; @@ -644,13 +644,13 @@ struct rgw_cls_bi_put_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entry, bl); + encode(entry, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entry, bl); + decode(entry, bl); DECODE_FINISH(bl); } }; @@ -665,17 +665,17 @@ struct rgw_cls_bi_list_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(max, bl); - ::encode(name, bl); - ::encode(marker, bl); + encode(max, bl); + encode(name, bl); + encode(marker, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(max, bl); - ::decode(name, bl); - ::decode(marker, bl); + decode(max, bl); + decode(name, bl); + decode(marker, bl); DECODE_FINISH(bl); } }; @@ -689,15 +689,15 @@ struct rgw_cls_bi_list_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entries, bl); - ::encode(is_truncated, bl); + encode(entries, bl); + encode(is_truncated, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entries, bl); - ::decode(is_truncated, bl); + decode(entries, bl); + decode(is_truncated, bl); DECODE_FINISH(bl); } }; @@ -713,21 +713,21 @@ struct rgw_cls_usage_log_read_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(start_epoch, bl); - ::encode(end_epoch, bl); - ::encode(owner, bl); - ::encode(iter, bl); - ::encode(max_entries, bl); + encode(start_epoch, bl); + encode(end_epoch, bl); + encode(owner, bl); + encode(iter, bl); + encode(max_entries, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(start_epoch, bl); - ::decode(end_epoch, bl); - ::decode(owner, bl); - ::decode(iter, bl); - ::decode(max_entries, bl); + decode(start_epoch, bl); + decode(end_epoch, bl); + decode(owner, bl); + decode(iter, bl); + decode(max_entries, bl); DECODE_FINISH(bl); } }; @@ -740,17 +740,17 @@ struct rgw_cls_usage_log_read_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(usage, bl); - ::encode(truncated, bl); - ::encode(next_iter, bl); + encode(usage, bl); + encode(truncated, bl); + encode(next_iter, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(usage, bl); - ::decode(truncated, bl); - ::decode(next_iter, bl); + decode(usage, bl); + decode(truncated, bl); + decode(next_iter, bl); DECODE_FINISH(bl); } }; @@ -763,17 +763,17 @@ struct rgw_cls_usage_log_trim_op { void encode(bufferlist& bl) const { ENCODE_START(2, 2, bl); - ::encode(start_epoch, bl); - ::encode(end_epoch, bl); - ::encode(user, bl); + encode(start_epoch, bl); + encode(end_epoch, bl); + encode(user, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(start_epoch, bl); - ::decode(end_epoch, bl); - ::decode(user, bl); + decode(start_epoch, bl); + decode(end_epoch, bl); + decode(user, bl); DECODE_FINISH(bl); } }; @@ -786,15 +786,15 @@ struct cls_rgw_gc_set_entry_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(expiration_secs, bl); - ::encode(info, bl); + encode(expiration_secs, bl); + encode(info, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(expiration_secs, bl); - ::decode(info, bl); + decode(expiration_secs, bl); + decode(info, bl); DECODE_FINISH(bl); } @@ -810,15 +810,15 @@ struct cls_rgw_gc_defer_entry_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(expiration_secs, bl); - ::encode(tag, bl); + encode(expiration_secs, bl); + encode(tag, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(expiration_secs, bl); - ::decode(tag, bl); + decode(expiration_secs, bl); + decode(tag, bl); DECODE_FINISH(bl); } @@ -836,18 +836,18 @@ struct cls_rgw_gc_list_op { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(marker, bl); - ::encode(max, bl); - ::encode(expired_only, bl); + encode(marker, bl); + encode(max, bl); + encode(expired_only, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(marker, bl); - ::decode(max, bl); + decode(marker, bl); + decode(max, bl); if (struct_v >= 2) { - ::decode(expired_only, bl); + decode(expired_only, bl); } DECODE_FINISH(bl); } @@ -866,18 +866,18 @@ struct cls_rgw_gc_list_ret { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(entries, bl); - ::encode(next_marker, bl); - ::encode(truncated, bl); + encode(entries, bl); + encode(next_marker, bl); + encode(truncated, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(entries, bl); + decode(entries, bl); if (struct_v >= 2) - ::decode(next_marker, bl); - ::decode(truncated, bl); + decode(next_marker, bl); + decode(truncated, bl); DECODE_FINISH(bl); } @@ -893,13 +893,13 @@ struct cls_rgw_gc_remove_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(tags, bl); + encode(tags, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(tags, bl); + decode(tags, bl); DECODE_FINISH(bl); } @@ -916,15 +916,15 @@ struct cls_rgw_bi_log_list_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(marker, bl); - ::encode(max, bl); + encode(marker, bl); + encode(max, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(marker, bl); - ::decode(max, bl); + decode(marker, bl); + decode(max, bl); DECODE_FINISH(bl); } @@ -941,15 +941,15 @@ struct cls_rgw_bi_log_trim_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(start_marker, bl); - ::encode(end_marker, bl); + encode(start_marker, bl); + encode(end_marker, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(start_marker, bl); - ::decode(end_marker, bl); + decode(start_marker, bl); + decode(end_marker, bl); DECODE_FINISH(bl); } @@ -966,15 +966,15 @@ struct cls_rgw_bi_log_list_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entries, bl); - ::encode(truncated, bl); + encode(entries, bl); + encode(truncated, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entries, bl); - ::decode(truncated, bl); + decode(entries, bl); + decode(truncated, bl); DECODE_FINISH(bl); } @@ -989,13 +989,13 @@ struct cls_rgw_lc_get_next_entry_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(marker, bl); + encode(marker, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(marker, bl); + decode(marker, bl); DECODE_FINISH(bl); } }; @@ -1008,13 +1008,13 @@ struct cls_rgw_lc_get_next_entry_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entry, bl); + encode(entry, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entry, bl); + decode(entry, bl); DECODE_FINISH(bl); } @@ -1027,13 +1027,13 @@ struct cls_rgw_lc_rm_entry_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entry, bl); + encode(entry, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entry, bl); + decode(entry, bl); DECODE_FINISH(bl); } }; @@ -1045,13 +1045,13 @@ struct cls_rgw_lc_set_entry_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entry, bl); + encode(entry, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entry, bl); + decode(entry, bl); DECODE_FINISH(bl); } }; @@ -1065,13 +1065,13 @@ struct cls_rgw_lc_put_head_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(head, bl); + encode(head, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(head, bl); + decode(head, bl); DECODE_FINISH(bl); } @@ -1085,13 +1085,13 @@ struct cls_rgw_lc_get_head_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(head, bl); + encode(head, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(head, bl); + decode(head, bl); DECODE_FINISH(bl); } @@ -1106,15 +1106,15 @@ struct cls_rgw_lc_list_entries_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(marker, bl); - ::encode(max_entries, bl); + encode(marker, bl); + encode(max_entries, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(marker, bl); - ::decode(max_entries, bl); + decode(marker, bl); + decode(max_entries, bl); DECODE_FINISH(bl); } @@ -1129,16 +1129,16 @@ struct cls_rgw_lc_list_entries_ret { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(entries, bl); - ::encode(is_truncated, bl); + encode(entries, bl); + encode(is_truncated, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(entries, bl); + decode(entries, bl); if (struct_v >= 2) { - ::decode(is_truncated, bl); + decode(is_truncated, bl); } DECODE_FINISH(bl); } @@ -1153,13 +1153,13 @@ struct cls_rgw_reshard_add_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entry, bl); + encode(entry, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entry, bl); + decode(entry, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -1175,15 +1175,15 @@ struct cls_rgw_reshard_list_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(max, bl); - ::encode(marker, bl); + encode(max, bl); + encode(marker, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(max, bl); - ::decode(marker, bl); + decode(max, bl); + decode(marker, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -1200,15 +1200,15 @@ struct cls_rgw_reshard_list_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entries, bl); - ::encode(is_truncated, bl); + encode(entries, bl); + encode(is_truncated, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entries, bl); - ::decode(is_truncated, bl); + decode(entries, bl); + decode(is_truncated, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -1223,13 +1223,13 @@ struct cls_rgw_reshard_get_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entry, bl); + encode(entry, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entry, bl); + decode(entry, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -1244,13 +1244,13 @@ struct cls_rgw_reshard_get_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entry, bl); + encode(entry, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entry, bl); + decode(entry, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -1267,17 +1267,17 @@ struct cls_rgw_reshard_remove_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(tenant, bl); - ::encode(bucket_name, bl); - ::encode(bucket_id, bl); + encode(tenant, bl); + encode(bucket_name, bl); + encode(bucket_id, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(tenant, bl); - ::decode(bucket_name, bl); - ::decode(bucket_id, bl); + decode(tenant, bl); + decode(bucket_name, bl); + decode(bucket_id, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -1290,13 +1290,13 @@ struct cls_rgw_set_bucket_resharding_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entry, bl); + encode(entry, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entry, bl); + decode(entry, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -1324,13 +1324,13 @@ struct cls_rgw_guard_bucket_resharding_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(ret_err, bl); + encode(ret_err, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(ret_err, bl); + decode(ret_err, bl); DECODE_FINISH(bl); } @@ -1361,13 +1361,13 @@ struct cls_rgw_get_bucket_resharding_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(new_instance, bl); + encode(new_instance, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(new_instance, bl); + decode(new_instance, bl); DECODE_FINISH(bl); } diff --git a/src/cls/rgw/cls_rgw_types.h b/src/cls/rgw/cls_rgw_types.h index f524f33743f..fa08a48b9a1 100644 --- a/src/cls/rgw/cls_rgw_types.h +++ b/src/cls/rgw/cls_rgw_types.h @@ -17,6 +17,7 @@ class JSONObj; namespace ceph { class Formatter; } +using ceph::operator <<; using rgw_zone_set = std::set; @@ -67,18 +68,18 @@ struct rgw_bucket_pending_info { void encode(bufferlist &bl) const { ENCODE_START(2, 2, bl); uint8_t s = (uint8_t)state; - ::encode(s, bl); - ::encode(timestamp, bl); - ::encode(op, bl); + encode(s, bl); + encode(timestamp, bl); + encode(op, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl); uint8_t s; - ::decode(s, bl); + decode(s, bl); state = (RGWPendingState)s; - ::decode(timestamp, bl); - ::decode(op, bl); + decode(timestamp, bl); + decode(op, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -103,33 +104,33 @@ struct rgw_bucket_dir_entry_meta { void encode(bufferlist &bl) const { ENCODE_START(5, 3, bl); - ::encode(category, bl); - ::encode(size, bl); - ::encode(mtime, bl); - ::encode(etag, bl); - ::encode(owner, bl); - ::encode(owner_display_name, bl); - ::encode(content_type, bl); - ::encode(accounted_size, bl); - ::encode(user_data, bl); + encode(category, bl); + encode(size, bl); + encode(mtime, bl); + encode(etag, bl); + encode(owner, bl); + encode(owner_display_name, bl); + encode(content_type, bl); + encode(accounted_size, bl); + encode(user_data, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl); - ::decode(category, bl); - ::decode(size, bl); - ::decode(mtime, bl); - ::decode(etag, bl); - ::decode(owner, bl); - ::decode(owner_display_name, bl); + decode(category, bl); + decode(size, bl); + decode(mtime, bl); + decode(etag, bl); + decode(owner, bl); + decode(owner_display_name, bl); if (struct_v >= 2) - ::decode(content_type, bl); + decode(content_type, bl); if (struct_v >= 4) - ::decode(accounted_size, bl); + decode(accounted_size, bl); else accounted_size = size; if (struct_v >= 5) - ::decode(user_data, bl); + decode(user_data, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -141,27 +142,28 @@ WRITE_CLASS_ENCODER(rgw_bucket_dir_entry_meta) template void encode_packed_val(T val, bufferlist& bl) { + using ceph::encode; if ((uint64_t)val < 0x80) { - ::encode((uint8_t)val, bl); + encode((uint8_t)val, bl); } else { unsigned char c = 0x80; if ((uint64_t)val < 0x100) { c |= 1; - ::encode(c, bl); - ::encode((uint8_t)val, bl); + encode(c, bl); + encode((uint8_t)val, bl); } else if ((uint64_t)val <= 0x10000) { c |= 2; - ::encode(c, bl); - ::encode((uint16_t)val, bl); + encode(c, bl); + encode((uint16_t)val, bl); } else if ((uint64_t)val <= 0x1000000) { c |= 4; - ::encode(c, bl); - ::encode((uint32_t)val, bl); + encode(c, bl); + encode((uint32_t)val, bl); } else { c |= 8; - ::encode(c, bl); - ::encode((uint64_t)val, bl); + encode(c, bl); + encode((uint64_t)val, bl); } } } @@ -169,8 +171,9 @@ void encode_packed_val(T val, bufferlist& bl) template void decode_packed_val(T& val, bufferlist::iterator& bl) { + using ceph::decode; unsigned char c; - ::decode(c, bl); + decode(c, bl); if (c < 0x80) { val = c; return; @@ -182,28 +185,28 @@ void decode_packed_val(T& val, bufferlist::iterator& bl) case 1: { uint8_t v; - ::decode(v, bl); + decode(v, bl); val = v; } break; case 2: { uint16_t v; - ::decode(v, bl); + decode(v, bl); val = v; } break; case 4: { uint32_t v; - ::decode(v, bl); + decode(v, bl); val = v; } break; case 8: { uint64_t v; - ::decode(v, bl); + decode(v, bl); val = v; } break; @@ -220,14 +223,14 @@ struct rgw_bucket_entry_ver { void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode_packed_val(pool, bl); - ::encode_packed_val(epoch, bl); + encode_packed_val(pool, bl); + encode_packed_val(epoch, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode_packed_val(pool, bl); - ::decode_packed_val(epoch, bl); + decode_packed_val(pool, bl); + decode_packed_val(epoch, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -267,14 +270,14 @@ struct cls_rgw_obj_key { } void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(name, bl); - ::encode(instance, bl); + encode(name, bl); + encode(instance, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(name, bl); - ::decode(instance, bl); + decode(name, bl); + decode(instance, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const { @@ -314,47 +317,47 @@ struct rgw_bucket_dir_entry { void encode(bufferlist &bl) const { ENCODE_START(8, 3, bl); - ::encode(key.name, bl); - ::encode(ver.epoch, bl); - ::encode(exists, bl); - ::encode(meta, bl); - ::encode(pending_map, bl); - ::encode(locator, bl); - ::encode(ver, bl); - ::encode_packed_val(index_ver, bl); - ::encode(tag, bl); - ::encode(key.instance, bl); - ::encode(flags, bl); - ::encode(versioned_epoch, bl); + encode(key.name, bl); + encode(ver.epoch, bl); + encode(exists, bl); + encode(meta, bl); + encode(pending_map, bl); + encode(locator, bl); + encode(ver, bl); + encode_packed_val(index_ver, bl); + encode(tag, bl); + encode(key.instance, bl); + encode(flags, bl); + encode(versioned_epoch, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(8, 3, 3, bl); - ::decode(key.name, bl); - ::decode(ver.epoch, bl); - ::decode(exists, bl); - ::decode(meta, bl); - ::decode(pending_map, bl); + decode(key.name, bl); + decode(ver.epoch, bl); + decode(exists, bl); + decode(meta, bl); + decode(pending_map, bl); if (struct_v >= 2) { - ::decode(locator, bl); + decode(locator, bl); } if (struct_v >= 4) { - ::decode(ver, bl); + decode(ver, bl); } else { ver.pool = -1; } if (struct_v >= 5) { - ::decode_packed_val(index_ver, bl); - ::decode(tag, bl); + decode_packed_val(index_ver, bl); + decode(tag, bl); } if (struct_v >= 6) { - ::decode(key.instance, bl); + decode(key.instance, bl); } if (struct_v >= 7) { - ::decode(flags, bl); + decode(flags, bl); } if (struct_v >= 8) { - ::decode(versioned_epoch, bl); + decode(versioned_epoch, bl); } DECODE_FINISH(bl); } @@ -394,19 +397,19 @@ struct rgw_cls_bi_entry { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode((uint8_t)type, bl); - ::encode(idx, bl); - ::encode(data, bl); + encode((uint8_t)type, bl); + encode(idx, bl); + encode(data, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); uint8_t c; - ::decode(c, bl); + decode(c, bl); type = (BIIndexType)c; - ::decode(idx, bl); - ::decode(data, bl); + decode(idx, bl); + decode(data, bl); DECODE_FINISH(bl); } @@ -436,22 +439,22 @@ struct rgw_bucket_olh_log_entry { void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(epoch, bl); - ::encode((__u8)op, bl); - ::encode(op_tag, bl); - ::encode(key, bl); - ::encode(delete_marker, bl); + encode(epoch, bl); + encode((__u8)op, bl); + encode(op_tag, bl); + encode(key, bl); + encode(delete_marker, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(epoch, bl); + decode(epoch, bl); uint8_t c; - ::decode(c, bl); + decode(c, bl); op = (OLHLogOp)c; - ::decode(op_tag, bl); - ::decode(key, bl); - ::decode(delete_marker, bl); + decode(op_tag, bl); + decode(key, bl); + decode(delete_marker, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -473,24 +476,24 @@ struct rgw_bucket_olh_entry { void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(key, bl); - ::encode(delete_marker, bl); - ::encode(epoch, bl); - ::encode(pending_log, bl); - ::encode(tag, bl); - ::encode(exists, bl); - ::encode(pending_removal, bl); + encode(key, bl); + encode(delete_marker, bl); + encode(epoch, bl); + encode(pending_log, bl); + encode(tag, bl); + encode(exists, bl); + encode(pending_removal, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(key, bl); - ::decode(delete_marker, bl); - ::decode(epoch, bl); - ::decode(pending_log, bl); - ::decode(tag, bl); - ::decode(exists, bl); - ::decode(pending_removal, bl); + decode(key, bl); + decode(delete_marker, bl); + decode(epoch, bl); + decode(pending_log, bl); + decode(tag, bl); + decode(exists, bl); + decode(pending_removal, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -517,46 +520,46 @@ struct rgw_bi_log_entry { void encode(bufferlist &bl) const { ENCODE_START(4, 1, bl); - ::encode(id, bl); - ::encode(object, bl); - ::encode(timestamp, bl); - ::encode(ver, bl); - ::encode(tag, bl); + encode(id, bl); + encode(object, bl); + encode(timestamp, bl); + encode(ver, bl); + encode(tag, bl); uint8_t c = (uint8_t)op; - ::encode(c, bl); + encode(c, bl); c = (uint8_t)state; - ::encode(c, bl); + encode(c, bl); encode_packed_val(index_ver, bl); - ::encode(instance, bl); - ::encode(bilog_flags, bl); - ::encode(owner, bl); - ::encode(owner_display_name, bl); - ::encode(zones_trace, bl); + encode(instance, bl); + encode(bilog_flags, bl); + encode(owner, bl); + encode(owner_display_name, bl); + encode(zones_trace, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(4, bl); - ::decode(id, bl); - ::decode(object, bl); - ::decode(timestamp, bl); - ::decode(ver, bl); - ::decode(tag, bl); + decode(id, bl); + decode(object, bl); + decode(timestamp, bl); + decode(ver, bl); + decode(tag, bl); uint8_t c; - ::decode(c, bl); + decode(c, bl); op = (RGWModifyOp)c; - ::decode(c, bl); + decode(c, bl); state = (RGWPendingState)c; decode_packed_val(index_ver, bl); if (struct_v >= 2) { - ::decode(instance, bl); - ::decode(bilog_flags, bl); + decode(instance, bl); + decode(bilog_flags, bl); } if (struct_v >= 3) { - ::decode(owner, bl); - ::decode(owner_display_name, bl); + decode(owner, bl); + decode(owner_display_name, bl); } if (struct_v >= 4) { - ::decode(zones_trace, bl); + decode(zones_trace, bl); } DECODE_FINISH(bl); } @@ -580,19 +583,19 @@ struct rgw_bucket_category_stats { void encode(bufferlist &bl) const { ENCODE_START(3, 2, bl); - ::encode(total_size, bl); - ::encode(total_size_rounded, bl); - ::encode(num_entries, bl); - ::encode(actual_size, bl); + encode(total_size, bl); + encode(total_size_rounded, bl); + encode(num_entries, bl); + encode(actual_size, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl); - ::decode(total_size, bl); - ::decode(total_size_rounded, bl); - ::decode(num_entries, bl); + decode(total_size, bl); + decode(total_size_rounded, bl); + decode(num_entries, bl); if (struct_v >= 3) { - ::decode(actual_size, bl); + decode(actual_size, bl); } else { actual_size = total_size; } @@ -616,19 +619,19 @@ struct cls_rgw_bucket_instance_entry { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode((uint8_t)reshard_status, bl); - ::encode(new_bucket_instance_id, bl); - ::encode(num_shards, bl); + encode((uint8_t)reshard_status, bl); + encode(new_bucket_instance_id, bl); + encode(num_shards, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); uint8_t s; - ::decode(s, bl); + decode(s, bl); reshard_status = (cls_rgw_reshard_status)s; - ::decode(new_bucket_instance_id, bl); - ::decode(num_shards, bl); + decode(new_bucket_instance_id, bl); + decode(num_shards, bl); DECODE_FINISH(bl); } @@ -668,39 +671,39 @@ struct rgw_bucket_dir_header { void encode(bufferlist &bl) const { ENCODE_START(7, 2, bl); - ::encode(stats, bl); - ::encode(tag_timeout, bl); - ::encode(ver, bl); - ::encode(master_ver, bl); - ::encode(max_marker, bl); - ::encode(new_instance, bl); - ::encode(syncstopped,bl); + encode(stats, bl); + encode(tag_timeout, bl); + encode(ver, bl); + encode(master_ver, bl); + encode(max_marker, bl); + encode(new_instance, bl); + encode(syncstopped,bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(6, 2, 2, bl); - ::decode(stats, bl); + decode(stats, bl); if (struct_v > 2) { - ::decode(tag_timeout, bl); + decode(tag_timeout, bl); } else { tag_timeout = 0; } if (struct_v >= 4) { - ::decode(ver, bl); - ::decode(master_ver, bl); + decode(ver, bl); + decode(master_ver, bl); } else { ver = 0; } if (struct_v >= 5) { - ::decode(max_marker, bl); + decode(max_marker, bl); } if (struct_v >= 6) { - ::decode(new_instance, bl); + decode(new_instance, bl); } else { new_instance = cls_rgw_bucket_instance_entry(); } if (struct_v >= 7) { - ::decode(syncstopped,bl); + decode(syncstopped,bl); } DECODE_FINISH(bl); } @@ -722,14 +725,14 @@ struct rgw_bucket_dir { void encode(bufferlist &bl) const { ENCODE_START(2, 2, bl); - ::encode(header, bl); - ::encode(m, bl); + encode(header, bl); + encode(m, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl); - ::decode(header, bl); - ::decode(m, bl); + decode(header, bl); + decode(m, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -748,19 +751,19 @@ struct rgw_usage_data { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(bytes_sent, bl); - ::encode(bytes_received, bl); - ::encode(ops, bl); - ::encode(successful_ops, bl); + encode(bytes_sent, bl); + encode(bytes_received, bl); + encode(ops, bl); + encode(successful_ops, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(bytes_sent, bl); - ::decode(bytes_received, bl); - ::decode(ops, bl); - ::decode(successful_ops, bl); + decode(bytes_sent, bl); + decode(bytes_received, bl); + decode(ops, bl); + decode(successful_ops, bl); DECODE_FINISH(bl); } @@ -788,15 +791,15 @@ struct rgw_usage_log_entry { void encode(bufferlist& bl) const { ENCODE_START(3, 1, bl); - ::encode(owner.to_str(), bl); - ::encode(bucket, bl); - ::encode(epoch, bl); - ::encode(total_usage.bytes_sent, bl); - ::encode(total_usage.bytes_received, bl); - ::encode(total_usage.ops, bl); - ::encode(total_usage.successful_ops, bl); - ::encode(usage_map, bl); - ::encode(payer.to_str(), bl); + encode(owner.to_str(), bl); + encode(bucket, bl); + encode(epoch, bl); + encode(total_usage.bytes_sent, bl); + encode(total_usage.bytes_received, bl); + encode(total_usage.ops, bl); + encode(total_usage.successful_ops, bl); + encode(usage_map, bl); + encode(payer.to_str(), bl); ENCODE_FINISH(bl); } @@ -804,22 +807,22 @@ struct rgw_usage_log_entry { void decode(bufferlist::iterator& bl) { DECODE_START(3, bl); string s; - ::decode(s, bl); + decode(s, bl); owner.from_str(s); - ::decode(bucket, bl); - ::decode(epoch, bl); - ::decode(total_usage.bytes_sent, bl); - ::decode(total_usage.bytes_received, bl); - ::decode(total_usage.ops, bl); - ::decode(total_usage.successful_ops, bl); + decode(bucket, bl); + decode(epoch, bl); + decode(total_usage.bytes_sent, bl); + decode(total_usage.bytes_received, bl); + decode(total_usage.ops, bl); + decode(total_usage.successful_ops, bl); if (struct_v < 2) { usage_map[""] = total_usage; } else { - ::decode(usage_map, bl); + decode(usage_map, bl); } if (struct_v >= 3) { string p; - ::decode(p, bl); + decode(p, bl); payer.from_str(p); } DECODE_FINISH(bl); @@ -862,13 +865,13 @@ struct rgw_usage_log_info { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entries, bl); + encode(entries, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entries, bl); + decode(entries, bl); DECODE_FINISH(bl); } @@ -885,15 +888,15 @@ struct rgw_user_bucket { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(user, bl); - ::encode(bucket, bl); + encode(user, bl); + encode(bucket, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(user, bl); - ::decode(bucket, bl); + decode(user, bl); + decode(bucket, bl); DECODE_FINISH(bl); } @@ -924,20 +927,20 @@ struct cls_rgw_obj { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(pool, bl); - ::encode(key.name, bl); - ::encode(loc, bl); - ::encode(key, bl); + encode(pool, bl); + encode(key.name, bl); + encode(loc, bl); + encode(key, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(pool, bl); - ::decode(key.name, bl); - ::decode(loc, bl); + decode(pool, bl); + decode(key.name, bl); + decode(loc, bl); if (struct_v >= 2) { - ::decode(key, bl); + decode(key, bl); } DECODE_FINISH(bl); } @@ -973,13 +976,13 @@ struct cls_rgw_obj_chain { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(objs, bl); + encode(objs, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(objs, bl); + decode(objs, bl); DECODE_FINISH(bl); } @@ -1012,17 +1015,17 @@ struct cls_rgw_gc_obj_info void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(tag, bl); - ::encode(chain, bl); - ::encode(time, bl); + encode(tag, bl); + encode(chain, bl); + encode(time, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(tag, bl); - ::decode(chain, bl); - ::decode(time, bl); + decode(tag, bl); + decode(chain, bl); + decode(time, bl); DECODE_FINISH(bl); } @@ -1053,17 +1056,17 @@ struct cls_rgw_lc_obj_head void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); uint64_t t = start_date; - ::encode(t, bl); - ::encode(marker, bl); + encode(t, bl); + encode(marker, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); uint64_t t; - ::decode(t, bl); + decode(t, bl); start_date = static_cast(t); - ::decode(marker, bl); + decode(marker, bl); DECODE_FINISH(bl); } @@ -1086,25 +1089,25 @@ struct cls_rgw_reshard_entry void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(time, bl); - ::encode(tenant, bl); - ::encode(bucket_name, bl); - ::encode(bucket_id, bl); - ::encode(new_instance_id, bl); - ::encode(old_num_shards, bl); - ::encode(new_num_shards, bl); + encode(time, bl); + encode(tenant, bl); + encode(bucket_name, bl); + encode(bucket_id, bl); + encode(new_instance_id, bl); + encode(old_num_shards, bl); + encode(new_num_shards, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(time, bl); - ::decode(tenant, bl); - ::decode(bucket_name, bl); - ::decode(bucket_id, bl); - ::decode(new_instance_id, bl); - ::decode(old_num_shards, bl); - ::decode(new_num_shards, bl); + decode(time, bl); + decode(tenant, bl); + decode(bucket_name, bl); + decode(bucket_id, bl); + decode(new_instance_id, bl); + decode(old_num_shards, bl); + decode(new_num_shards, bl); DECODE_FINISH(bl); } diff --git a/src/cls/user/cls_user_ops.h b/src/cls/user/cls_user_ops.h index 2219a495962..6bf7b7d80ed 100644 --- a/src/cls/user/cls_user_ops.h +++ b/src/cls/user/cls_user_ops.h @@ -15,17 +15,17 @@ struct cls_user_set_buckets_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entries, bl); - ::encode(add, bl); - ::encode(time, bl); + encode(entries, bl); + encode(add, bl); + encode(time, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entries, bl); - ::decode(add, bl); - ::decode(time, bl); + decode(entries, bl); + decode(add, bl); + decode(time, bl); DECODE_FINISH(bl); } @@ -41,13 +41,13 @@ struct cls_user_remove_bucket_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(bucket, bl); + encode(bucket, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(bucket, bl); + decode(bucket, bl); DECODE_FINISH(bl); } @@ -67,18 +67,18 @@ struct cls_user_list_buckets_op { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(marker, bl); - ::encode(max_entries, bl); - ::encode(end_marker, bl); + encode(marker, bl); + encode(max_entries, bl); + encode(end_marker, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(marker, bl); - ::decode(max_entries, bl); + decode(marker, bl); + decode(max_entries, bl); if (struct_v >= 2) { - ::decode(end_marker, bl); + decode(end_marker, bl); } DECODE_FINISH(bl); } @@ -97,17 +97,17 @@ struct cls_user_list_buckets_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entries, bl); - ::encode(marker, bl); - ::encode(truncated, bl); + encode(entries, bl); + encode(marker, bl); + encode(truncated, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entries, bl); - ::decode(marker, bl); - ::decode(truncated, bl); + decode(entries, bl); + decode(marker, bl); + decode(truncated, bl); DECODE_FINISH(bl); } @@ -142,13 +142,13 @@ struct cls_user_get_header_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(header, bl); + encode(header, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(header, bl); + decode(header, bl); DECODE_FINISH(bl); } @@ -164,13 +164,13 @@ struct cls_user_complete_stats_sync_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(time, bl); + encode(time, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(time, bl); + decode(time, bl); DECODE_FINISH(bl); } diff --git a/src/cls/user/cls_user_types.h b/src/cls/user/cls_user_types.h index 6ffd9332316..9d033808947 100644 --- a/src/cls/user/cls_user_types.h +++ b/src/cls/user/cls_user_types.h @@ -31,55 +31,55 @@ struct cls_user_bucket { */ if (!placement_id.empty()) { ENCODE_START(9, 8, bl); - ::encode(name, bl); - ::encode(marker, bl); - ::encode(bucket_id, bl); - ::encode(placement_id, bl); + encode(name, bl); + encode(marker, bl); + encode(bucket_id, bl); + encode(placement_id, bl); ENCODE_FINISH(bl); } else { ENCODE_START(7, 3, bl); - ::encode(name, bl); - ::encode(explicit_placement.data_pool, bl); - ::encode(marker, bl); - ::encode(bucket_id, bl); - ::encode(explicit_placement.index_pool, bl); - ::encode(explicit_placement.data_extra_pool, bl); + encode(name, bl); + encode(explicit_placement.data_pool, bl); + encode(marker, bl); + encode(bucket_id, bl); + encode(explicit_placement.index_pool, bl); + encode(explicit_placement.data_extra_pool, bl); ENCODE_FINISH(bl); } } void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN(8, 3, 3, bl); - ::decode(name, bl); + decode(name, bl); if (struct_v < 8) { - ::decode(explicit_placement.data_pool, bl); + decode(explicit_placement.data_pool, bl); } if (struct_v >= 2) { - ::decode(marker, bl); + decode(marker, bl); if (struct_v <= 3) { uint64_t id; - ::decode(id, bl); + decode(id, bl); char buf[16]; snprintf(buf, sizeof(buf), "%llu", (long long)id); bucket_id = buf; } else { - ::decode(bucket_id, bl); + decode(bucket_id, bl); } } if (struct_v < 8) { if (struct_v >= 5) { - ::decode(explicit_placement.index_pool, bl); + decode(explicit_placement.index_pool, bl); } else { explicit_placement.index_pool = explicit_placement.data_pool; } if (struct_v >= 7) { - ::decode(explicit_placement.data_extra_pool, bl); + decode(explicit_placement.data_extra_pool, bl); } } else { - ::decode(placement_id, bl); + decode(placement_id, bl); if (struct_v == 8 && placement_id.empty()) { - ::decode(explicit_placement.data_pool, bl); - ::decode(explicit_placement.index_pool, bl); - ::decode(explicit_placement.data_extra_pool, bl); + decode(explicit_placement.data_pool, bl); + decode(explicit_placement.index_pool, bl); + decode(explicit_placement.data_extra_pool, bl); } } DECODE_FINISH(bl); @@ -112,15 +112,15 @@ struct cls_user_bucket_entry { uint64_t s = size; __u32 mt = ceph::real_clock::to_time_t(creation_time); string empty_str; // originally had the bucket name here, but we encode bucket later - ::encode(empty_str, bl); - ::encode(s, bl); - ::encode(mt, bl); - ::encode(count, bl); - ::encode(bucket, bl); + encode(empty_str, bl); + encode(s, bl); + encode(mt, bl); + encode(count, bl); + encode(bucket, bl); s = size_rounded; - ::encode(s, bl); - ::encode(user_stats_sync, bl); - ::encode(creation_time, bl); + encode(s, bl); + encode(user_stats_sync, bl); + encode(creation_time, bl); //::encode(placement_rule, bl); removed in v9 ENCODE_FINISH(bl); } @@ -129,27 +129,27 @@ struct cls_user_bucket_entry { __u32 mt; uint64_t s; string empty_str; // backward compatibility - ::decode(empty_str, bl); - ::decode(s, bl); - ::decode(mt, bl); + decode(empty_str, bl); + decode(s, bl); + decode(mt, bl); size = s; if (struct_v < 7) { creation_time = ceph::real_clock::from_time_t(mt); } if (struct_v >= 2) - ::decode(count, bl); + decode(count, bl); if (struct_v >= 3) - ::decode(bucket, bl); + decode(bucket, bl); if (struct_v >= 4) - ::decode(s, bl); + decode(s, bl); size_rounded = s; if (struct_v >= 6) - ::decode(user_stats_sync, bl); + decode(user_stats_sync, bl); if (struct_v >= 7) - ::decode(creation_time, bl); + decode(creation_time, bl); if (struct_v == 8) { // added in v8, removed in v9 std::string placement_rule; - ::decode(placement_rule, bl); + decode(placement_rule, bl); } DECODE_FINISH(bl); } @@ -170,16 +170,16 @@ struct cls_user_stats { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(total_entries, bl); - ::encode(total_bytes, bl); - ::encode(total_bytes_rounded, bl); + encode(total_entries, bl); + encode(total_bytes, bl); + encode(total_bytes_rounded, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(total_entries, bl); - ::decode(total_bytes, bl); - ::decode(total_bytes_rounded, bl); + decode(total_entries, bl); + decode(total_bytes, bl); + decode(total_bytes_rounded, bl); DECODE_FINISH(bl); } @@ -198,16 +198,16 @@ struct cls_user_header { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(stats, bl); - ::encode(last_stats_sync, bl); - ::encode(last_stats_update, bl); + encode(stats, bl); + encode(last_stats_sync, bl); + encode(last_stats_update, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(stats, bl); - ::decode(last_stats_sync, bl); - ::decode(last_stats_update, bl); + decode(stats, bl); + decode(last_stats_sync, bl); + decode(last_stats_update, bl); DECODE_FINISH(bl); } diff --git a/src/common/ceph_time.h b/src/common/ceph_time.h index afe8aead7ce..1d6a6803eb5 100644 --- a/src/common/ceph_time.h +++ b/src/common/ceph_time.h @@ -16,9 +16,9 @@ #define COMMON_CEPH_TIME_H #include +#include #include "include/assert.h" -#include "include/encoding.h" #if defined(__APPLE__) #include @@ -445,66 +445,16 @@ namespace ceph { // time_point + duration to assert on overflow, but I don't think we // should. -} // namespace ceph -// We need these definitions to be able to hande ::encode/::decode on -// time points. - -template -void encode(const std::chrono::time_point& t, - ceph::bufferlist &bl) { - auto ts = Clock::to_timespec(t); - // A 32 bit count of seconds causes me vast unhappiness. - uint32_t s = ts.tv_sec; - uint32_t ns = ts.tv_nsec; - ::encode(s, bl); - ::encode(ns, bl); +inline timespan abs(signedspan z) { + return z > signedspan::zero() ? + std::chrono::duration_cast(z) : + timespan(-z.count()); } - -template -void decode(std::chrono::time_point& t, - bufferlist::iterator& p) { - uint32_t s; - uint32_t ns; - ::decode(s, p); - ::decode(ns, p); - struct timespec ts = { - static_cast(s), - static_cast(ns)}; - - t = Clock::from_timespec(ts); +inline timespan to_timespan(signedspan z) { + ceph_assert(z >= signedspan::zero()); + return std::chrono::duration_cast(z); } - -// C++ Overload Resolution requires that our encode/decode functions -// be defined in the same namespace as the type. So we need this -// to handle things like ::encode(std::vector >) - -namespace std { - namespace chrono { - template - void encode(const time_point& t, - ceph::bufferlist &bl) { - ::encode(t, bl); - } - - template - void decode(time_point& t, bufferlist::iterator &p) { - ::decode(t, p); - } - } // namespace chrono - - // An overload of our own - namespace { - inline timespan abs(signedspan z) { - return z > signedspan::zero() ? - std::chrono::duration_cast(z) : - timespan(-z.count()); - } - inline timespan to_timespan(signedspan z) { - ceph_assert(z >= signedspan::zero()); - return std::chrono::duration_cast(z); - } - } -} // namespace std +} // namespace ceph #endif // COMMON_CEPH_TIME_H diff --git a/src/common/iso_8601.cc b/src/common/iso_8601.cc index 39e00e0b31f..8a8e37259ff 100644 --- a/src/common/iso_8601.cc +++ b/src/common/iso_8601.cc @@ -1,11 +1,12 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#include +#include + #include "iso_8601.h" #include "include/timegm.h" -#include - namespace ceph { using std::chrono::duration_cast; using std::chrono::nanoseconds; diff --git a/src/common/iso_8601.h b/src/common/iso_8601.h index 38de82848e7..5aa63983386 100644 --- a/src/common/iso_8601.h +++ b/src/common/iso_8601.h @@ -4,6 +4,7 @@ #ifndef CEPH_COMMON_ISO_8601_H #define CEPH_COMMON_ISO_8601_H +#include #include #include "common/ceph_time.h" diff --git a/src/include/encoding.h b/src/include/encoding.h index f3ae4ad42c0..a68af42056c 100644 --- a/src/include/encoding.h +++ b/src/include/encoding.h @@ -24,6 +24,7 @@ #include "include/unordered_map.h" #include "include/unordered_set.h" +#include "common/ceph_time.h" #include "include/int_types.h" @@ -268,16 +269,32 @@ inline void decode_nohead(int len, bufferlist& s, bufferlist::iterator& p) p.copy(len, s); } +// Time, since the templates are defined in std::chrono -// full bl decoder -template -inline void decode(T &o, bufferlist& bl) -{ - bufferlist::iterator p = bl.begin(); - decode(o, p); - assert(p.end()); +template +void encode(const std::chrono::time_point& t, + ceph::bufferlist &bl) { + auto ts = Clock::to_timespec(t); + // A 32 bit count of seconds causes me vast unhappiness. + uint32_t s = ts.tv_sec; + uint32_t ns = ts.tv_nsec; + encode(s, bl); + encode(ns, bl); } +template +void decode(std::chrono::time_point& t, + bufferlist::iterator& p) { + uint32_t s; + uint32_t ns; + decode(s, p); + decode(ns, p); + struct timespec ts = { + static_cast(s), + static_cast(ns)}; + + t = Clock::from_timespec(ts); +} // ----------------------------- // STL container types @@ -466,6 +483,17 @@ template> inline std::enable_if_t decode(std::array& v, bufferlist::iterator& p); +// full bl decoder +template +inline void decode(T &o, bufferlist& bl) +{ + bufferlist::iterator p = bl.begin(); + decode(o, p); + assert(p.end()); +} + + + // boost optional template diff --git a/src/include/rados.h b/src/include/rados.h index a7b1c61bda1..b63fca181fb 100644 --- a/src/include/rados.h +++ b/src/include/rados.h @@ -6,6 +6,7 @@ * (Reliable Autonomic Distributed Object Store). */ +#include #include "msgr.h" /* diff --git a/src/log/Log.h b/src/log/Log.h index acb8f38edda..9d5ae17bd56 100644 --- a/src/log/Log.h +++ b/src/log/Log.h @@ -4,6 +4,8 @@ #ifndef __CEPH_LOG_LOG_H #define __CEPH_LOG_LOG_H +#include + #include "common/Thread.h" #include "EntryQueue.h" @@ -46,7 +48,7 @@ class Log : private Thread std::string m_log_stderr_prefix; - shared_ptr m_graylog; + std::shared_ptr m_graylog; bool m_stop; @@ -85,7 +87,7 @@ public: void start_graylog(); void stop_graylog(); - shared_ptr graylog() { return m_graylog; } + std::shared_ptr graylog() { return m_graylog; } Entry *create_entry(int level, int subsys, const char* msg = nullptr); Entry *create_entry(int level, int subsys, size_t* expected_size); diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index cb9af1dbebb..c3861498198 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -161,7 +161,7 @@ struct ObjectOperation { OSDOp& osd_op = add_op(op); osd_op.op.pgls.count = count; osd_op.op.pgls.start_epoch = start_epoch; - ::encode(cookie, osd_op.indata); + encode(cookie, osd_op.indata); } void add_pgls_filter(int op, uint64_t count, const bufferlist& filter, collection_list_handle_t cookie, epoch_t start_epoch) { @@ -170,10 +170,10 @@ struct ObjectOperation { osd_op.op.pgls.start_epoch = start_epoch; string cname = "pg"; string mname = "filter"; - ::encode(cname, osd_op.indata); - ::encode(mname, osd_op.indata); + encode(cname, osd_op.indata); + encode(mname, osd_op.indata); osd_op.indata.append(filter); - ::encode(cookie, osd_op.indata); + encode(cookie, osd_op.indata); } void add_alloc_hint(int op, uint64_t expected_object_size, uint64_t expected_write_size, @@ -239,8 +239,8 @@ struct ObjectOperation { try { uint64_t size; ceph::real_time mtime; - ::decode(size, p); - ::decode(mtime, p); + decode(size, p); + decode(mtime, p); if (psize) *psize = size; if (pmtime) @@ -341,8 +341,8 @@ struct ObjectOperation { // potential IO path. if (bl.length() > 0) { try { - ::decode(*extents, iter); - ::decode(*data_bl, iter); + decode(*extents, iter); + decode(*data_bl, iter); } catch (buffer::error& e) { if (prval) *prval = -EIO; @@ -447,15 +447,15 @@ struct ObjectOperation { bufferlist::iterator p = bl.begin(); try { if (pattrs) - ::decode(*pattrs, p); + decode(*pattrs, p); if (ptruncated) { std::map ignore; if (!pattrs) { - ::decode(ignore, p); + decode(ignore, p); pattrs = &ignore; } if (!p.end()) { - ::decode(*ptruncated, p); + decode(*ptruncated, p); } else { // the OSD did not provide this. since old OSDs do not // enfoce omap result limits either, we can infer it from @@ -489,15 +489,15 @@ struct ObjectOperation { bufferlist::iterator p = bl.begin(); try { if (pattrs) - ::decode(*pattrs, p); + decode(*pattrs, p); if (ptruncated) { std::set ignore; if (!pattrs) { - ::decode(ignore, p); + decode(ignore, p); pattrs = &ignore; } if (!p.end()) { - ::decode(*ptruncated, p); + decode(*ptruncated, p); } else { // the OSD did not provide this. since old OSDs do not // enforce omap result limits either, we can infer it from @@ -524,7 +524,7 @@ struct ObjectOperation { bufferlist::iterator p = bl.begin(); try { obj_list_watch_response_t resp; - ::decode(resp, p); + decode(resp, p); if (pwatchers) { for (list::iterator i = resp.entries.begin() ; i != resp.entries.end() ; ++i) { @@ -557,7 +557,7 @@ struct ObjectOperation { bufferlist::iterator p = bl.begin(); try { obj_list_snap_response_t resp; - ::decode(resp, p); + decode(resp, p); if (psnaps) { psnaps->clones.clear(); for (vector::iterator ci = resp.clones.begin(); @@ -612,12 +612,12 @@ struct ObjectOperation { } void setxattrs(map& attrs) { bufferlist bl; - ::encode(attrs, bl); + encode(attrs, bl); add_xattr(CEPH_OSD_OP_RESETXATTRS, 0, bl.length()); } void resetxattrs(const char *prefix, map& attrs) { bufferlist bl; - ::encode(attrs, bl); + encode(attrs, bl); add_xattr(CEPH_OSD_OP_RESETXATTRS, prefix, bl); } @@ -651,8 +651,8 @@ struct ObjectOperation { int *prval) { OSDOp &op = add_op(CEPH_OSD_OP_OMAPGETKEYS); bufferlist bl; - ::encode(start_after, bl); - ::encode(max_to_get, bl); + encode(start_after, bl); + encode(max_to_get, bl); op.op.extent.offset = 0; op.op.extent.length = bl.length(); op.indata.claim_append(bl); @@ -674,9 +674,9 @@ struct ObjectOperation { int *prval) { OSDOp &op = add_op(CEPH_OSD_OP_OMAPGETVALS); bufferlist bl; - ::encode(start_after, bl); - ::encode(max_to_get, bl); - ::encode(filter_prefix, bl); + encode(start_after, bl); + encode(max_to_get, bl); + encode(filter_prefix, bl); op.op.extent.offset = 0; op.op.extent.length = bl.length(); op.indata.claim_append(bl); @@ -695,7 +695,7 @@ struct ObjectOperation { int *prval) { OSDOp &op = add_op(CEPH_OSD_OP_OMAPGETVALSBYKEYS); bufferlist bl; - ::encode(to_get, bl); + encode(to_get, bl); op.op.extent.offset = 0; op.op.extent.length = bl.length(); op.indata.claim_append(bl); @@ -713,7 +713,7 @@ struct ObjectOperation { int *prval) { OSDOp &op = add_op(CEPH_OSD_OP_OMAP_CMP); bufferlist bl; - ::encode(assertions, bl); + encode(assertions, bl); op.op.extent.offset = 0; op.op.extent.length = bl.length(); op.indata.claim_append(bl); @@ -770,7 +770,7 @@ struct ObjectOperation { try { bufferlist::iterator p = bl.begin(); object_copy_data_t copy_reply; - ::decode(copy_reply, p); + decode(copy_reply, p); if (r == -ENOENT) { if (out_reqids) *out_reqids = copy_reply.reqids; @@ -831,8 +831,8 @@ struct ObjectOperation { int *prval) { OSDOp& osd_op = add_op(CEPH_OSD_OP_COPY_GET); osd_op.op.copy_get.max = max; - ::encode(*cursor, osd_op.indata); - ::encode(max, osd_op.indata); + encode(*cursor, osd_op.indata); + encode(max, osd_op.indata); unsigned p = ops.size() - 1; out_rval[p] = prval; C_ObjectOperation_copyget *h = @@ -862,7 +862,7 @@ struct ObjectOperation { try { bufferlist::iterator p = bl.begin(); bool isdirty; - ::decode(isdirty, p); + decode(isdirty, p); if (pisdirty) *pisdirty = isdirty; } catch (buffer::error& e) { @@ -898,7 +898,7 @@ struct ObjectOperation { try { bufferlist::iterator p = bl.begin(); std::list< std::pair > ls; - ::decode(ls, p); + decode(ls, p); if (ptls) { ptls->clear(); for (auto p = ls.begin(); p != ls.end(); ++p) @@ -978,7 +978,7 @@ struct ObjectOperation { void omap_set(const map &map) { bufferlist bl; - ::encode(map, bl); + encode(map, bl); add_data(CEPH_OSD_OP_OMAPSETVALS, 0, bl.length(), bl); } @@ -992,7 +992,7 @@ struct ObjectOperation { void omap_rm_keys(const std::set &to_remove) { bufferlist bl; - ::encode(to_remove, bl); + encode(to_remove, bl); add_data(CEPH_OSD_OP_OMAPRMKEYS, 0, bl.length(), bl); } @@ -1018,9 +1018,9 @@ struct ObjectOperation { bufferlist &bl, bufferlist *inbl) { OSDOp& osd_op = add_op(CEPH_OSD_OP_NOTIFY); osd_op.op.notify.cookie = cookie; - ::encode(prot_ver, *inbl); - ::encode(timeout, *inbl); - ::encode(bl, *inbl); + encode(prot_ver, *inbl); + encode(timeout, *inbl); + encode(bl, *inbl); osd_op.indata.append(*inbl); } @@ -1028,9 +1028,9 @@ struct ObjectOperation { bufferlist& reply_bl) { OSDOp& osd_op = add_op(CEPH_OSD_OP_NOTIFY_ACK); bufferlist bl; - ::encode(notify_id, bl); - ::encode(cookie, bl); - ::encode(reply_bl, bl); + encode(notify_id, bl); + encode(cookie, bl); + encode(reply_bl, bl); osd_op.indata.append(bl); } @@ -1085,8 +1085,8 @@ struct ObjectOperation { osd_op.op.copy_from.src_version = src_version; osd_op.op.copy_from.flags = flags; osd_op.op.copy_from.src_fadvise_flags = src_fadvise_flags; - ::encode(src, osd_op.indata); - ::encode(src_oloc, osd_op.indata); + encode(src, osd_op.indata); + encode(src_oloc, osd_op.indata); } /** @@ -1138,18 +1138,18 @@ struct ObjectOperation { OSDOp& osd_op = add_op(CEPH_OSD_OP_SET_REDIRECT); osd_op.op.copy_from.snapid = snapid; osd_op.op.copy_from.src_version = tgt_version; - ::encode(tgt, osd_op.indata); - ::encode(tgt_oloc, osd_op.indata); + encode(tgt, osd_op.indata); + encode(tgt_oloc, osd_op.indata); } void set_chunk(uint64_t src_offset, uint64_t src_length, object_locator_t tgt_oloc, object_t tgt_oid, uint64_t tgt_offset) { OSDOp& osd_op = add_op(CEPH_OSD_OP_SET_CHUNK); - ::encode(src_offset, osd_op.indata); - ::encode(src_length, osd_op.indata); - ::encode(tgt_oloc, osd_op.indata); - ::encode(tgt_oid, osd_op.indata); - ::encode(tgt_offset, osd_op.indata); + encode(src_offset, osd_op.indata); + encode(src_length, osd_op.indata); + encode(tgt_oloc, osd_op.indata); + encode(tgt_oid, osd_op.indata); + encode(tgt_offset, osd_op.indata); } void set_alloc_hint(uint64_t expected_object_size, @@ -1480,8 +1480,8 @@ public: bufferlist::iterator p = bl.begin(); uint64_t s; ceph::real_time m; - ::decode(s, p); - ::decode(m, p); + decode(s, p); + decode(m, p); if (psize) *psize = s; if (pmtime) @@ -1500,7 +1500,7 @@ public: void finish(int r) override { if (r >= 0) { bufferlist::iterator p = bl.begin(); - ::decode(attrset, p); + decode(attrset, p); } fin->complete(r); } diff --git a/src/rgw/rgw_bucket.h b/src/rgw/rgw_bucket.h index be0625123b2..8148c6c42bf 100644 --- a/src/rgw/rgw_bucket.h +++ b/src/rgw/rgw_bucket.h @@ -113,10 +113,12 @@ public: RGWUserBuckets& operator=(const RGWUserBuckets&) = default; void encode(bufferlist& bl) const { - ::encode(buckets, bl); + using ceph::encode; + encode(buckets, bl); } void decode(bufferlist::iterator& bl) { - ::decode(buckets, bl); + using ceph::decode; + decode(buckets, bl); } /** * Check if the user owns a bucket by the given name. @@ -355,19 +357,19 @@ struct rgw_data_change { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); uint8_t t = (uint8_t)entity_type; - ::encode(t, bl); - ::encode(key, bl); - ::encode(timestamp, bl); + encode(t, bl); + encode(key, bl); + encode(timestamp, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); uint8_t t; - ::decode(t, bl); + decode(t, bl); entity_type = (DataLogEntityType)t; - ::decode(key, bl); - ::decode(timestamp, bl); + decode(key, bl); + decode(timestamp, bl); DECODE_FINISH(bl); } @@ -383,17 +385,17 @@ struct rgw_data_change_log_entry { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(log_id, bl); - ::encode(log_timestamp, bl); - ::encode(entry, bl); + encode(log_id, bl); + encode(log_timestamp, bl); + encode(entry, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(log_id, bl); - ::decode(log_timestamp, bl); - ::decode(entry, bl); + decode(log_id, bl); + decode(log_timestamp, bl); + decode(entry, bl); DECODE_FINISH(bl); } diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index dda079c26d2..2e111423168 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -520,17 +520,17 @@ struct RGWAccessKey { void encode(bufferlist& bl) const { ENCODE_START(2, 2, bl); - ::encode(id, bl); - ::encode(key, bl); - ::encode(subuser, bl); + encode(id, bl); + encode(key, bl); + encode(subuser, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl); - ::decode(id, bl); - ::decode(key, bl); - ::decode(subuser, bl); + decode(id, bl); + decode(key, bl); + decode(subuser, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -550,15 +550,15 @@ struct RGWSubUser { RGWSubUser() : perm_mask(0) {} void encode(bufferlist& bl) const { ENCODE_START(2, 2, bl); - ::encode(name, bl); - ::encode(perm_mask, bl); + encode(name, bl); + encode(perm_mask, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl); - ::decode(name, bl); - ::decode(perm_mask, bl); + decode(name, bl); + decode(perm_mask, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -583,12 +583,12 @@ public: void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(caps, bl); + encode(caps, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(caps, bl); + decode(caps, bl); DECODE_FINISH(bl); } int check_cap(const string& cap, uint32_t perm); @@ -654,7 +654,7 @@ struct RGWUserInfo void encode(bufferlist& bl) const { ENCODE_START(19, 9, bl); - ::encode(auid, bl); + encode(auid, bl); string access_key; string secret_key; if (!access_keys.empty()) { @@ -663,10 +663,10 @@ struct RGWUserInfo access_key = k.id; secret_key = k.key; } - ::encode(access_key, bl); - ::encode(secret_key, bl); - ::encode(display_name, bl); - ::encode(user_email, bl); + encode(access_key, bl); + encode(secret_key, bl); + encode(display_name, bl); + encode(user_email, bl); string swift_name; string swift_key; if (!swift_keys.empty()) { @@ -675,100 +675,100 @@ struct RGWUserInfo swift_name = k.id; swift_key = k.key; } - ::encode(swift_name, bl); - ::encode(swift_key, bl); - ::encode(user_id.id, bl); - ::encode(access_keys, bl); - ::encode(subusers, bl); - ::encode(suspended, bl); - ::encode(swift_keys, bl); - ::encode(max_buckets, bl); - ::encode(caps, bl); - ::encode(op_mask, bl); - ::encode(system, bl); - ::encode(default_placement, bl); - ::encode(placement_tags, bl); - ::encode(bucket_quota, bl); - ::encode(temp_url_keys, bl); - ::encode(user_quota, bl); - ::encode(user_id.tenant, bl); - ::encode(admin, bl); - ::encode(type, bl); + encode(swift_name, bl); + encode(swift_key, bl); + encode(user_id.id, bl); + encode(access_keys, bl); + encode(subusers, bl); + encode(suspended, bl); + encode(swift_keys, bl); + encode(max_buckets, bl); + encode(caps, bl); + encode(op_mask, bl); + encode(system, bl); + encode(default_placement, bl); + encode(placement_tags, bl); + encode(bucket_quota, bl); + encode(temp_url_keys, bl); + encode(user_quota, bl); + encode(user_id.tenant, bl); + encode(admin, bl); + encode(type, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN_32(19, 9, 9, bl); - if (struct_v >= 2) ::decode(auid, bl); + if (struct_v >= 2) decode(auid, bl); else auid = CEPH_AUTH_UID_DEFAULT; string access_key; string secret_key; - ::decode(access_key, bl); - ::decode(secret_key, bl); + decode(access_key, bl); + decode(secret_key, bl); if (struct_v < 6) { RGWAccessKey k; k.id = access_key; k.key = secret_key; access_keys[access_key] = k; } - ::decode(display_name, bl); - ::decode(user_email, bl); + decode(display_name, bl); + decode(user_email, bl); /* We populate swift_keys map later nowadays, but we have to decode. */ string swift_name; string swift_key; - if (struct_v >= 3) ::decode(swift_name, bl); - if (struct_v >= 4) ::decode(swift_key, bl); + if (struct_v >= 3) decode(swift_name, bl); + if (struct_v >= 4) decode(swift_key, bl); if (struct_v >= 5) - ::decode(user_id.id, bl); + decode(user_id.id, bl); else user_id.id = access_key; if (struct_v >= 6) { - ::decode(access_keys, bl); - ::decode(subusers, bl); + decode(access_keys, bl); + decode(subusers, bl); } suspended = 0; if (struct_v >= 7) { - ::decode(suspended, bl); + decode(suspended, bl); } if (struct_v >= 8) { - ::decode(swift_keys, bl); + decode(swift_keys, bl); } if (struct_v >= 10) { - ::decode(max_buckets, bl); + decode(max_buckets, bl); } else { max_buckets = RGW_DEFAULT_MAX_BUCKETS; } if (struct_v >= 11) { - ::decode(caps, bl); + decode(caps, bl); } if (struct_v >= 12) { - ::decode(op_mask, bl); + decode(op_mask, bl); } else { op_mask = RGW_OP_TYPE_ALL; } if (struct_v >= 13) { - ::decode(system, bl); - ::decode(default_placement, bl); - ::decode(placement_tags, bl); /* tags of allowed placement rules */ + decode(system, bl); + decode(default_placement, bl); + decode(placement_tags, bl); /* tags of allowed placement rules */ } if (struct_v >= 14) { - ::decode(bucket_quota, bl); + decode(bucket_quota, bl); } if (struct_v >= 15) { - ::decode(temp_url_keys, bl); + decode(temp_url_keys, bl); } if (struct_v >= 16) { - ::decode(user_quota, bl); + decode(user_quota, bl); } if (struct_v >= 17) { - ::decode(user_id.tenant, bl); + decode(user_id.tenant, bl); } else { user_id.tenant.clear(); } if (struct_v >= 18) { - ::decode(admin, bl); + decode(admin, bl); } if (struct_v >= 19) { - ::decode(type, bl); + decode(type, bl); } DECODE_FINISH(bl); } @@ -812,8 +812,8 @@ struct rgw_pool { void encode(bufferlist& bl) const { ENCODE_START(10, 10, bl); - ::encode(name, bl); - ::encode(ns, bl); + encode(name, bl); + encode(ns, bl); ENCODE_FINISH(bl); } @@ -822,7 +822,7 @@ struct rgw_pool { void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN(10, 3, 3, bl); - ::decode(name, bl); + decode(name, bl); if (struct_v < 10) { @@ -835,7 +835,7 @@ struct rgw_pool { */ } else { - ::decode(ns, bl); + decode(ns, bl); } DECODE_FINISH(bl); @@ -931,9 +931,9 @@ struct rgw_raw_obj { void encode(bufferlist& bl) const { ENCODE_START(6, 6, bl); - ::encode(pool, bl); - ::encode(oid, bl); - ::encode(loc, bl); + encode(pool, bl); + encode(oid, bl); + encode(loc, bl); ENCODE_FINISH(bl); } @@ -951,9 +951,9 @@ struct rgw_raw_obj { decode_from_rgw_obj(bl); return; } - ::decode(pool, bl); - ::decode(oid, bl); - ::decode(loc, bl); + decode(pool, bl); + decode(oid, bl); + decode(loc, bl); DECODE_FINISH(bl); } @@ -1017,57 +1017,57 @@ struct rgw_bucket { void encode(bufferlist& bl) const { ENCODE_START(10, 10, bl); - ::encode(name, bl); - ::encode(marker, bl); - ::encode(bucket_id, bl); - ::encode(tenant, bl); + encode(name, bl); + encode(marker, bl); + encode(bucket_id, bl); + encode(tenant, bl); bool encode_explicit = !explicit_placement.data_pool.empty(); - ::encode(encode_explicit, bl); + encode(encode_explicit, bl); if (encode_explicit) { - ::encode(explicit_placement.data_pool, bl); - ::encode(explicit_placement.data_extra_pool, bl); - ::encode(explicit_placement.index_pool, bl); + encode(explicit_placement.data_pool, bl); + encode(explicit_placement.data_extra_pool, bl); + encode(explicit_placement.index_pool, bl); } ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN(10, 3, 3, bl); - ::decode(name, bl); + decode(name, bl); if (struct_v < 10) { - ::decode(explicit_placement.data_pool.name, bl); + decode(explicit_placement.data_pool.name, bl); } if (struct_v >= 2) { - ::decode(marker, bl); + decode(marker, bl); if (struct_v <= 3) { uint64_t id; - ::decode(id, bl); + decode(id, bl); char buf[16]; snprintf(buf, sizeof(buf), "%llu", (long long)id); bucket_id = buf; } else { - ::decode(bucket_id, bl); + decode(bucket_id, bl); } } if (struct_v < 10) { if (struct_v >= 5) { - ::decode(explicit_placement.index_pool.name, bl); + decode(explicit_placement.index_pool.name, bl); } else { explicit_placement.index_pool = explicit_placement.data_pool; } if (struct_v >= 7) { - ::decode(explicit_placement.data_extra_pool.name, bl); + decode(explicit_placement.data_extra_pool.name, bl); } } if (struct_v >= 8) { - ::decode(tenant, bl); + decode(tenant, bl); } if (struct_v >= 10) { bool decode_explicit = !explicit_placement.data_pool.empty(); - ::decode(decode_explicit, bl); + decode(decode_explicit, bl); if (decode_explicit) { - ::decode(explicit_placement.data_pool, bl); - ::decode(explicit_placement.data_extra_pool, bl); - ::decode(explicit_placement.index_pool, bl); + decode(explicit_placement.data_pool, bl); + decode(explicit_placement.data_extra_pool, bl); + decode(explicit_placement.index_pool, bl); } } DECODE_FINISH(bl); @@ -1244,77 +1244,77 @@ struct RGWBucketInfo void encode(bufferlist& bl) const { ENCODE_START(19, 4, bl); - ::encode(bucket, bl); - ::encode(owner.id, bl); - ::encode(flags, bl); - ::encode(zonegroup, bl); + encode(bucket, bl); + encode(owner.id, bl); + encode(flags, bl); + encode(zonegroup, bl); uint64_t ct = real_clock::to_time_t(creation_time); - ::encode(ct, bl); - ::encode(placement_rule, bl); - ::encode(has_instance_obj, bl); - ::encode(quota, bl); - ::encode(num_shards, bl); - ::encode(bucket_index_shard_hash_type, bl); - ::encode(requester_pays, bl); - ::encode(owner.tenant, bl); - ::encode(has_website, bl); + encode(ct, bl); + encode(placement_rule, bl); + encode(has_instance_obj, bl); + encode(quota, bl); + encode(num_shards, bl); + encode(bucket_index_shard_hash_type, bl); + encode(requester_pays, bl); + encode(owner.tenant, bl); + encode(has_website, bl); if (has_website) { - ::encode(website_conf, bl); + encode(website_conf, bl); } - ::encode((uint32_t)index_type, bl); - ::encode(swift_versioning, bl); + encode((uint32_t)index_type, bl); + encode(swift_versioning, bl); if (swift_versioning) { - ::encode(swift_ver_location, bl); + encode(swift_ver_location, bl); } - ::encode(creation_time, bl); - ::encode(mdsearch_config, bl); - ::encode(reshard_status, bl); - ::encode(new_bucket_instance_id, bl); + encode(creation_time, bl); + encode(mdsearch_config, bl); + encode(reshard_status, bl); + encode(new_bucket_instance_id, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN_32(19, 4, 4, bl); - ::decode(bucket, bl); + decode(bucket, bl); if (struct_v >= 2) { string s; - ::decode(s, bl); + decode(s, bl); owner.from_str(s); } if (struct_v >= 3) - ::decode(flags, bl); + decode(flags, bl); if (struct_v >= 5) - ::decode(zonegroup, bl); + decode(zonegroup, bl); if (struct_v >= 6) { uint64_t ct; - ::decode(ct, bl); + decode(ct, bl); if (struct_v < 17) creation_time = ceph::real_clock::from_time_t((time_t)ct); } if (struct_v >= 7) - ::decode(placement_rule, bl); + decode(placement_rule, bl); if (struct_v >= 8) - ::decode(has_instance_obj, bl); + decode(has_instance_obj, bl); if (struct_v >= 9) - ::decode(quota, bl); + decode(quota, bl); if (struct_v >= 10) - ::decode(num_shards, bl); + decode(num_shards, bl); if (struct_v >= 11) - ::decode(bucket_index_shard_hash_type, bl); + decode(bucket_index_shard_hash_type, bl); if (struct_v >= 12) - ::decode(requester_pays, bl); + decode(requester_pays, bl); if (struct_v >= 13) - ::decode(owner.tenant, bl); + decode(owner.tenant, bl); if (struct_v >= 14) { - ::decode(has_website, bl); + decode(has_website, bl); if (has_website) { - ::decode(website_conf, bl); + decode(website_conf, bl); } else { website_conf = RGWBucketWebsiteConf(); } } if (struct_v >= 15) { uint32_t it; - ::decode(it, bl); + decode(it, bl); index_type = (RGWBucketIndexType)it; } else { index_type = RGWBIType_Normal; @@ -1322,20 +1322,20 @@ struct RGWBucketInfo swift_versioning = false; swift_ver_location.clear(); if (struct_v >= 16) { - ::decode(swift_versioning, bl); + decode(swift_versioning, bl); if (swift_versioning) { - ::decode(swift_ver_location, bl); + decode(swift_ver_location, bl); } } if (struct_v >= 17) { - ::decode(creation_time, bl); + decode(creation_time, bl); } if (struct_v >= 18) { - ::decode(mdsearch_config, bl); + decode(mdsearch_config, bl); } if (struct_v >= 19) { - ::decode(reshard_status, bl); - ::decode(new_bucket_instance_id, bl); + decode(reshard_status, bl); + decode(new_bucket_instance_id, bl); } DECODE_FINISH(bl); } @@ -1373,13 +1373,13 @@ struct RGWBucketEntryPoint void encode(bufferlist& bl) const { ENCODE_START(10, 8, bl); - ::encode(bucket, bl); - ::encode(owner.id, bl); - ::encode(linked, bl); + encode(bucket, bl); + encode(owner.id, bl); + encode(linked, bl); uint64_t ctime = (uint64_t)real_clock::to_time_t(creation_time); - ::encode(ctime, bl); - ::encode(owner, bl); - ::encode(creation_time, bl); + encode(ctime, bl); + encode(owner, bl); + encode(creation_time, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { @@ -1392,19 +1392,19 @@ struct RGWBucketEntryPoint return; } has_bucket_info = false; - ::decode(bucket, bl); - ::decode(owner.id, bl); - ::decode(linked, bl); + decode(bucket, bl); + decode(owner.id, bl); + decode(linked, bl); uint64_t ctime; - ::decode(ctime, bl); + decode(ctime, bl); if (struct_v < 10) { creation_time = real_clock::from_time_t((time_t)ctime); } if (struct_v >= 9) { - ::decode(owner, bl); + decode(owner, bl); } if (struct_v >= 10) { - ::decode(creation_time, bl); + decode(creation_time, bl); } DECODE_FINISH(bl); } @@ -1717,17 +1717,17 @@ struct rgw_obj_key { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(name, bl); - ::encode(instance, bl); - ::encode(ns, bl); + encode(name, bl); + encode(instance, bl); + encode(ns, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(name, bl); - ::decode(instance, bl); + decode(name, bl); + decode(instance, bl); if (struct_v >= 2) { - ::decode(ns, bl); + decode(ns, bl); } DECODE_FINISH(bl); } @@ -1934,15 +1934,15 @@ struct RGWBucketEnt { uint64_t s = size; __u32 mt = ceph::real_clock::to_time_t(creation_time); string empty_str; // originally had the bucket name here, but we encode bucket later - ::encode(empty_str, bl); - ::encode(s, bl); - ::encode(mt, bl); - ::encode(count, bl); - ::encode(bucket, bl); + encode(empty_str, bl); + encode(s, bl); + encode(mt, bl); + encode(count, bl); + encode(bucket, bl); s = size_rounded; - ::encode(s, bl); - ::encode(creation_time, bl); - ::encode(placement_rule, bl); + encode(s, bl); + encode(creation_time, bl); + encode(placement_rule, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { @@ -1950,24 +1950,24 @@ struct RGWBucketEnt { __u32 mt; uint64_t s; string empty_str; // backward compatibility - ::decode(empty_str, bl); - ::decode(s, bl); - ::decode(mt, bl); + decode(empty_str, bl); + decode(s, bl); + decode(mt, bl); size = s; if (struct_v < 6) { creation_time = ceph::real_clock::from_time_t(mt); } if (struct_v >= 2) - ::decode(count, bl); + decode(count, bl); if (struct_v >= 3) - ::decode(bucket, bl); + decode(bucket, bl); if (struct_v >= 4) - ::decode(s, bl); + decode(s, bl); size_rounded = s; if (struct_v >= 6) - ::decode(creation_time, bl); + decode(creation_time, bl); if (struct_v >= 7) - ::decode(placement_rule, bl); + decode(placement_rule, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -2030,32 +2030,32 @@ struct rgw_obj { void encode(bufferlist& bl) const { ENCODE_START(6, 6, bl); - ::encode(bucket, bl); - ::encode(key.ns, bl); - ::encode(key.name, bl); - ::encode(key.instance, bl); -// ::encode(placement_id, bl); + encode(bucket, bl); + encode(key.ns, bl); + encode(key.name, bl); + encode(key.instance, bl); +// encode(placement_id, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN(6, 3, 3, bl); if (struct_v < 6) { string s; - ::decode(bucket.name, bl); /* bucket.name */ - ::decode(s, bl); /* loc */ - ::decode(key.ns, bl); - ::decode(key.name, bl); + decode(bucket.name, bl); /* bucket.name */ + decode(s, bl); /* loc */ + decode(key.ns, bl); + decode(key.name, bl); if (struct_v >= 2) - ::decode(bucket, bl); + decode(bucket, bl); if (struct_v >= 4) - ::decode(key.instance, bl); + decode(key.instance, bl); if (key.ns.empty() && key.instance.empty()) { if (key.name[0] == '_') { key.name = key.name.substr(1); } } else { if (struct_v >= 5) { - ::decode(key.name, bl); + decode(key.name, bl); } else { ssize_t pos = key.name.find('_', 1); if (pos < 0) { @@ -2065,11 +2065,11 @@ struct rgw_obj { } } } else { - ::decode(bucket, bl); - ::decode(key.ns, bl); - ::decode(key.name, bl); - ::decode(key.instance, bl); -// ::decode(placement_id, bl); + decode(bucket, bl); + decode(key.ns, bl); + decode(key.name, bl); + decode(key.instance, bl); +// decode(placement_id, bl); } DECODE_FINISH(bl); } diff --git a/src/rgw/rgw_meta_sync_status.h b/src/rgw/rgw_meta_sync_status.h index f896ac2ad0d..2935b8727e8 100644 --- a/src/rgw/rgw_meta_sync_status.h +++ b/src/rgw/rgw_meta_sync_status.h @@ -19,20 +19,20 @@ struct rgw_meta_sync_info { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(state, bl); - ::encode(num_shards, bl); - ::encode(period, bl); - ::encode(realm_epoch, bl); + encode(state, bl); + encode(num_shards, bl); + encode(period, bl); + encode(realm_epoch, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(state, bl); - ::decode(num_shards, bl); + decode(state, bl); + decode(num_shards, bl); if (struct_v >= 2) { - ::decode(period, bl); - ::decode(realm_epoch, bl); + decode(period, bl); + decode(realm_epoch, bl); } DECODE_FINISH(bl); } @@ -62,26 +62,26 @@ struct rgw_meta_sync_marker { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(state, bl); - ::encode(marker, bl); - ::encode(next_step_marker, bl); - ::encode(total_entries, bl); - ::encode(pos, bl); - ::encode(timestamp, bl); - ::encode(realm_epoch, bl); + encode(state, bl); + encode(marker, bl); + encode(next_step_marker, bl); + encode(total_entries, bl); + encode(pos, bl); + encode(timestamp, bl); + encode(realm_epoch, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, 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); if (struct_v >= 2) { - ::decode(realm_epoch, bl); + decode(realm_epoch, bl); } DECODE_FINISH(bl); } @@ -100,15 +100,15 @@ struct rgw_meta_sync_status { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(sync_info, bl); - ::encode(sync_markers, bl); + encode(sync_info, bl); + encode(sync_markers, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(sync_info, bl); - ::decode(sync_markers, bl); + decode(sync_info, bl); + decode(sync_markers, bl); DECODE_FINISH(bl); } diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index dfa9058e2c8..50fbb6865f4 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -920,17 +920,17 @@ struct rgw_slo_entry { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(path, bl); - ::encode(etag, bl); - ::encode(size_bytes, bl); + encode(path, bl); + encode(etag, bl); + encode(size_bytes, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(path, bl); - ::decode(etag, bl); - ::decode(size_bytes, bl); + decode(path, bl); + decode(etag, bl); + decode(size_bytes, bl); DECODE_FINISH(bl); } @@ -953,15 +953,15 @@ struct RGWSLOInfo { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entries, bl); - ::encode(total_size, bl); + encode(entries, bl); + encode(total_size, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entries, bl); - ::decode(total_size, bl); + decode(entries, bl); + decode(total_size, bl); DECODE_FINISH(bl); } }; @@ -1999,7 +1999,7 @@ static inline void encode_delete_at_attr(boost::optional delete } bufferlist delatbl; - ::encode(*delete_at, delatbl); + encode(*delete_at, delatbl); attrs[RGW_ATTR_DELETE_AT] = delatbl; } /* encode_delete_at_attr */ diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 668d5e0573c..cca45ea3814 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -557,6 +557,7 @@ int RGWSystemMetaObj::init(CephContext *_cct, RGWRados *_store, bool setup_obj, int RGWSystemMetaObj::read_default(RGWDefaultSystemMetaObjInfo& default_info, const string& oid) { + using ceph::decode; auto pool = get_pool(cct); bufferlist bl; RGWObjectCtx obj_ctx(store); @@ -566,7 +567,7 @@ int RGWSystemMetaObj::read_default(RGWDefaultSystemMetaObjInfo& default_info, co try { bufferlist::iterator iter = bl.begin(); - ::decode(default_info, iter); + decode(default_info, iter); } catch (buffer::error& err) { ldout(cct, 0) << "error decoding data from " << pool << ":" << oid << dendl; return -EIO; @@ -596,6 +597,7 @@ int RGWSystemMetaObj::use_default(bool old_format) int RGWSystemMetaObj::set_as_default(bool exclusive) { + using ceph::encode; string oid = get_default_oid(); rgw_pool pool(get_pool(cct)); @@ -604,7 +606,7 @@ int RGWSystemMetaObj::set_as_default(bool exclusive) RGWDefaultSystemMetaObjInfo default_info; default_info.default_id = id; - ::encode(default_info, bl); + encode(default_info, bl); int ret = rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), exclusive, NULL, real_time(), NULL); @@ -616,6 +618,7 @@ int RGWSystemMetaObj::set_as_default(bool exclusive) int RGWSystemMetaObj::read_id(const string& obj_name, string& object_id) { + using ceph::decode; rgw_pool pool(get_pool(cct)); bufferlist bl; @@ -630,7 +633,7 @@ int RGWSystemMetaObj::read_id(const string& obj_name, string& object_id) RGWNameToId nameToId; try { bufferlist::iterator iter = bl.begin(); - ::decode(nameToId, iter); + decode(nameToId, iter); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: failed to decode obj from " << pool << ":" << oid << dendl; return -EIO; @@ -692,7 +695,8 @@ int RGWSystemMetaObj::store_name(bool exclusive) nameToId.obj_id = id; bufferlist bl; - ::encode(nameToId, bl); + using ceph::encode; + encode(nameToId, bl); return rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), exclusive, NULL, real_time(), NULL); } @@ -746,10 +750,11 @@ int RGWSystemMetaObj::read_info(const string& obj_id, bool old_format) ldout(cct, 0) << "failed reading obj info from " << pool << ":" << oid << ": " << cpp_strerror(-ret) << dendl; return ret; } + using ceph::decode; try { bufferlist::iterator iter = bl.begin(); - ::decode(*this, iter); + decode(*this, iter); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: failed to decode obj from " << pool << ":" << oid << dendl; return -EIO; @@ -807,7 +812,8 @@ int RGWSystemMetaObj::store_info(bool exclusive) string oid = get_info_oid_prefix() + id; bufferlist bl; - ::encode(*this, bl); + using ceph::encode; + encode(*this, bl); return rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), exclusive, NULL, real_time(), NULL); } @@ -989,11 +995,12 @@ int RGWRealm::notify_zone(bufferlist& bl) int RGWRealm::notify_new_period(const RGWPeriod& period) { bufferlist bl; + using ceph::encode; // push the period to dependent zonegroups/zones - ::encode(RGWRealmNotify::ZonesNeedPeriod, bl); - ::encode(period, bl); + encode(RGWRealmNotify::ZonesNeedPeriod, bl); + encode(period, bl); // reload the gateway with the new period - ::encode(RGWRealmNotify::Reload, bl); + encode(RGWRealmNotify::Reload, bl); return notify_zone(bl); } @@ -1026,9 +1033,10 @@ int RGWPeriodConfig::read(RGWRados *store, const std::string& realm_id) if (ret < 0) { return ret; } + using ceph::decode; try { bufferlist::iterator iter = bl.begin(); - ::decode(*this, iter); + decode(*this, iter); } catch (buffer::error& err) { return -EIO; } @@ -1040,7 +1048,8 @@ int RGWPeriodConfig::write(RGWRados *store, const std::string& realm_id) const auto& pool = get_pool(store->ctx()); const auto& oid = get_oid(realm_id); bufferlist bl; - ::encode(*this, bl); + using ceph::encode; + encode(*this, bl); return rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), false, nullptr, real_time(), nullptr); } @@ -1174,7 +1183,8 @@ int RGWPeriod::read_latest_epoch(RGWPeriodLatestEpochInfo& info, } try { bufferlist::iterator iter = bl.begin(); - ::decode(info, iter); + using ceph::decode; + decode(info, iter); } catch (buffer::error& err) { ldout(cct, 0) << "error decoding data from " << pool << ":" << oid << dendl; return -EIO; @@ -1221,7 +1231,8 @@ int RGWPeriod::set_latest_epoch(epoch_t epoch, bool exclusive, RGWPeriodLatestEpochInfo info; info.epoch = epoch; - ::encode(info, bl); + using ceph::encode; + encode(info, bl); return rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), exclusive, objv, real_time(), nullptr); @@ -1311,8 +1322,9 @@ int RGWPeriod::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 obj from " << pool << ":" << get_period_oid() << dendl; return -EIO; @@ -1356,7 +1368,8 @@ int RGWPeriod::store_info(bool exclusive) string oid = get_period_oid(); bufferlist bl; - ::encode(*this, bl); + using ceph::encode; + encode(*this, bl); return rgw_put_system_obj(store, pool, oid, bl.c_str(), bl.length(), exclusive, NULL, real_time(), NULL); @@ -1882,20 +1895,20 @@ const string& RGWZoneParams::get_compression_type(const string& placement_rule) void RGWPeriodMap::encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(id, bl); - ::encode(zonegroups, bl); - ::encode(master_zonegroup, bl); - ::encode(short_zone_ids, bl); + encode(id, bl); + encode(zonegroups, bl); + encode(master_zonegroup, bl); + encode(short_zone_ids, bl); ENCODE_FINISH(bl); } void RGWPeriodMap::decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(id, bl); - ::decode(zonegroups, bl); - ::decode(master_zonegroup, bl); + decode(id, bl); + decode(zonegroups, bl); + decode(master_zonegroup, bl); if (struct_v >= 2) { - ::decode(short_zone_ids, bl); + decode(short_zone_ids, bl); } DECODE_FINISH(bl); @@ -2003,41 +2016,41 @@ int RGWZoneGroupMap::read(CephContext *cct, RGWRados *store) void RGWRegionMap::encode(bufferlist& bl) const { ENCODE_START( 3, 1, bl); - ::encode(regions, bl); - ::encode(master_region, bl); - ::encode(bucket_quota, bl); - ::encode(user_quota, bl); + encode(regions, bl); + encode(master_region, bl); + encode(bucket_quota, bl); + encode(user_quota, bl); ENCODE_FINISH(bl); } void RGWRegionMap::decode(bufferlist::iterator& bl) { DECODE_START(3, bl); - ::decode(regions, bl); - ::decode(master_region, bl); + decode(regions, bl); + decode(master_region, bl); if (struct_v >= 2) - ::decode(bucket_quota, bl); + decode(bucket_quota, bl); if (struct_v >= 3) - ::decode(user_quota, bl); + decode(user_quota, bl); DECODE_FINISH(bl); } void RGWZoneGroupMap::encode(bufferlist& bl) const { ENCODE_START( 3, 1, bl); - ::encode(zonegroups, bl); - ::encode(master_zonegroup, bl); - ::encode(bucket_quota, bl); - ::encode(user_quota, bl); + encode(zonegroups, bl); + encode(master_zonegroup, bl); + encode(bucket_quota, bl); + encode(user_quota, bl); ENCODE_FINISH(bl); } void RGWZoneGroupMap::decode(bufferlist::iterator& bl) { DECODE_START(3, bl); - ::decode(zonegroups, bl); - ::decode(master_zonegroup, bl); + decode(zonegroups, bl); + decode(master_zonegroup, bl); if (struct_v >= 2) - ::decode(bucket_quota, bl); + decode(bucket_quota, bl); if (struct_v >= 3) - ::decode(user_quota, bl); + decode(user_quota, bl); DECODE_FINISH(bl); zonegroups_by_api.clear(); @@ -3860,7 +3873,7 @@ int RGWRados::convert_regionmap() try { bufferlist::iterator iter = bl.begin(); - ::decode(zonegroupmap, iter); + decode(zonegroupmap, iter); } catch (buffer::error& err) { ldout(cct, 0) << "error decoding regionmap from " << pool << ":" << oid << dendl; return -EIO; @@ -5033,7 +5046,7 @@ int RGWRados::log_show_next(RGWAccessHandle handle, rgw_log_entry *entry) if (state->p.end()) return 0; // end of file try { - ::decode(*entry, state->p); + decode(*entry, state->p); } catch (const buffer::error &e) { return -EINVAL; @@ -5388,7 +5401,7 @@ int RGWRados::objexp_hint_add(const ceph::real_time& delete_at, .obj_key = obj_key, .exp_time = delete_at }; bufferlist hebl; - ::encode(he, hebl); + encode(he, hebl); ObjectWriteOperation op; cls_timeindex_add(op, utime_t(delete_at), keyext, hebl); @@ -5434,7 +5447,7 @@ int RGWRados::objexp_hint_parse(cls_timeindex_entry &ti_entry, /* in */ { try { bufferlist::iterator iter = ti_entry.value.begin(); - ::decode(hint_entry, iter); + decode(hint_entry, iter); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: couldn't decode avail_pools" << dendl; } @@ -6026,7 +6039,7 @@ int RGWRados::select_legacy_bucket_placement(RGWZonePlacementInfo *rule_info) try { bufferlist::iterator iter = map_bl.begin(); - ::decode(m, iter); + decode(m, iter); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: couldn't decode avail_pools" << dendl; } @@ -6056,7 +6069,7 @@ read_omap: if (write_map) { bufferlist new_bl; - ::encode(m, new_bl); + encode(m, new_bl); ret = put_system_obj_data(NULL, obj, new_bl, -1, false); if (ret < 0) { ldout(cct, 0) << "WARNING: could not save avail pools map info ret=" << ret << dendl; @@ -6101,7 +6114,7 @@ int RGWRados::update_placement_map() return ret; bufferlist new_bl; - ::encode(m, new_bl); + encode(m, new_bl); ret = put_system_obj_data(NULL, obj, new_bl, -1, false); if (ret < 0) { ldout(cct, 0) << "WARNING: could not save avail pools map info ret=" << ret << dendl; @@ -6914,7 +6927,7 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si attrs.erase(iter); bufferlist bl; - ::encode(*meta.manifest, bl); + encode(*meta.manifest, bl); op.setxattr(RGW_ATTR_MANIFEST, bl); } @@ -6941,7 +6954,7 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si if (attrs.find(RGW_ATTR_SOURCE_ZONE) == attrs.end()) { bufferlist bl; - ::encode(store->get_zone_short_id(), bl); + encode(store->get_zone_short_id(), bl); op.setxattr(RGW_ATTR_SOURCE_ZONE, bl); } @@ -7810,7 +7823,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx, cs_info.compression_type = plugin->get_type_name(); cs_info.orig_size = cb.get_data_len(); cs_info.blocks = move(compressor->get_compression_blocks()); - ::encode(cs_info, tmp); + encode(cs_info, tmp); cb.get_attrs()[RGW_ATTR_COMPRESSION] = tmp; } @@ -7820,7 +7833,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx, map::iterator iter = cb.get_attrs().find(RGW_ATTR_DELETE_AT); if (iter != cb.get_attrs().end()) { try { - ::decode(delete_at, iter->second); + decode(delete_at, iter->second); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: failed to decode delete_at field in intra zone copy" << dendl; } @@ -7850,7 +7863,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx, if (i != attrs.end() && i->second.length() > 0) { bufferlist::iterator iter = i->second.begin(); try { - ::decode(pg_ver, iter); + decode(pg_ver, iter); } catch (buffer::error& err) { ldout(ctx(), 0) << "ERROR: failed to decode pg ver attribute, ignoring" << dendl; /* non critical error */ @@ -8886,7 +8899,7 @@ int RGWRados::Object::Delete::delete_obj() if (state->get_attr(RGW_ATTR_DELETE_AT, bl)) { try { bufferlist::iterator iter = bl.begin(); - ::decode(delete_at, iter); + decode(delete_at, iter); } catch (buffer::error& err) { ldout(store->ctx(), 0) << "ERROR: couldn't decode RGW_ATTR_DELETE_AT" << dendl; return -EIO; @@ -9222,7 +9235,7 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket try { RGWCompressionInfo info; auto p = iter->second.begin(); - ::decode(info, p); + decode(info, p); s->accounted_size = info.orig_size; } catch (buffer::error&) { dout(0) << "ERROR: could not decode compression info for object: " << obj << dendl; @@ -9247,7 +9260,7 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket if (manifest_bl.length()) { bufferlist::iterator miter = manifest_bl.begin(); try { - ::decode(s->manifest, miter); + decode(s->manifest, miter); s->has_manifest = true; s->manifest.set_head(bucket_info.placement_rule, obj, s->size); /* patch manifest to reflect the head we just read, some manifests might be broken due to old bugs */ @@ -9281,7 +9294,7 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket if (pg_ver_bl.length()) { bufferlist::iterator pgbl = pg_ver_bl.begin(); try { - ::decode(s->pg_ver, pgbl); + decode(s->pg_ver, pgbl); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: couldn't decode pg ver attr for object " << s->obj << ", non-critical error, ignoring" << dendl; } @@ -9293,7 +9306,7 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket if (zone_short_id_bl.length()) { bufferlist::iterator zbl = zone_short_id_bl.begin(); try { - ::decode(s->zone_short_id, zbl); + decode(s->zone_short_id, zbl); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: couldn't decode zone short id attr for object " << s->obj << ", non-critical error, ignoring" << dendl; } @@ -9433,7 +9446,7 @@ int RGWRados::Object::Stat::finish() bufferlist& bl = iter->second; bufferlist::iterator biter = bl.begin(); try { - ::decode(result.manifest, biter); + decode(result.manifest, biter); } catch (buffer::error& err) { RGWRados *store = source->get_store(); ldout(store->ctx(), 0) << "ERROR: " << __func__ << ": failed to decode manifest" << dendl; @@ -9715,7 +9728,7 @@ int RGWRados::set_attrs(void *ctx, const RGWBucketInfo& bucket_info, rgw_obj& ob if (name.compare(RGW_ATTR_DELETE_AT) == 0) { real_time ts; try { - ::decode(ts, bl); + decode(ts, bl); rgw_obj_index_key obj_key; obj.key.get_index_key(&obj_key); @@ -10869,7 +10882,7 @@ int RGWRados::olh_init_modification_impl(const RGWBucketInfo& bucket_info, RGWOb bufferlist bl; RGWOLHPendingInfo pending_info; pending_info.time = real_clock::now(); - ::encode(pending_info, bl); + encode(pending_info, bl); #define OLH_PENDING_TAG_LEN 32 /* tag will start with current time epoch, this so that entries are sorted by time */ @@ -11204,7 +11217,7 @@ int RGWRados::apply_olh_log(RGWObjectCtx& obj_ctx, RGWObjState& state, const RGW info.target = target; info.removed = delete_marker; bufferlist bl; - ::encode(info, bl); + encode(info, bl); op.setxattr(RGW_ATTR_OLH_INFO, bl); } @@ -11454,7 +11467,7 @@ int RGWRados::get_olh(const RGWBucketInfo& bucket_info, const rgw_obj& obj, RGWO try { bufferlist::iterator biter = iter->second.begin(); - ::decode(*olh, biter); + decode(*olh, biter); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: failed to decode olh info" << dendl; return -EIO; @@ -11474,7 +11487,7 @@ void RGWRados::check_pending_olh_entries(map& pending_entrie bufferlist::iterator biter = iter->second.begin(); RGWOLHPendingInfo pending_info; try { - ::decode(pending_info, biter); + decode(pending_info, biter); } catch (buffer::error& err) { /* skipping bad entry, we could remove it but it might hide a bug */ ldout(cct, 0) << "ERROR: failed to decode pending entry " << iter->first << dendl; @@ -11553,7 +11566,7 @@ int RGWRados::follow_olh(const RGWBucketInfo& bucket_info, RGWObjectCtx& obj_ctx RGWOLHInfo olh; try { bufferlist::iterator biter = iter->second.begin(); - ::decode(olh, biter); + decode(olh, biter); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: failed to decode olh info" << dendl; return -EIO; @@ -11853,7 +11866,7 @@ int RGWRados::get_bucket_instance_from_oid(RGWObjectCtx& obj_ctx, const string& bufferlist::iterator iter = epbl.begin(); try { - ::decode(info, iter); + decode(info, iter); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: could not decode buffer info, caught buffer::error" << dendl; return -EIO; @@ -11885,7 +11898,7 @@ int RGWRados::get_bucket_entrypoint_info(RGWObjectCtx& obj_ctx, bufferlist::iterator iter = bl.begin(); try { - ::decode(entry_point, iter); + decode(entry_point, iter); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: could not decode buffer info, caught buffer::error" << dendl; return -EIO; @@ -12057,7 +12070,7 @@ int RGWRados::put_bucket_entrypoint_info(const string& tenant_name, const string map *pattrs) { bufferlist epbl; - ::encode(entry_point, epbl); + encode(entry_point, epbl); string bucket_entry; rgw_make_bucket_entry_name(tenant_name, bucket_name, bucket_entry); return rgw_bucket_store_info(this, bucket_entry, epbl, exclusive, pattrs, &objv_tracker, mtime); @@ -12069,7 +12082,7 @@ int RGWRados::put_bucket_instance_info(RGWBucketInfo& info, bool exclusive, info.has_instance_obj = true; bufferlist bl; - ::encode(info, bl); + encode(info, bl); string key = info.bucket.get_key(); /* when we go through meta api, we don't use oid directly */ int ret = rgw_bucket_instance_store_info(this, key, bl, exclusive, pattrs, &info.objv_tracker, mtime); @@ -12586,7 +12599,7 @@ int RGWRados::bi_get_instance(const RGWBucketInfo& bucket_info, rgw_obj& obj, rg } bufferlist::iterator iter = bi_entry.data.begin(); try { - ::decode(*dirent, iter); + decode(*dirent, iter); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: failed to decode bi_entry()" << dendl; return -EIO; @@ -13004,7 +13017,7 @@ int RGWRados::remove_objs_from_index(RGWBucketInfo& bucket_info, list& attrs, bool& need if (value != attrs.end()) { bufferlist::iterator bliter = value->second.begin(); try { - ::decode(cs_info, bliter); + decode(cs_info, bliter); } catch (buffer::error& err) { return -EIO; } diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 2b9b9c468ca..985bd449e50 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -183,17 +183,17 @@ struct compression_block { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(old_ofs, bl); - ::encode(new_ofs, bl); - ::encode(len, bl); + encode(old_ofs, bl); + encode(new_ofs, bl); + encode(len, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(old_ofs, bl); - ::decode(new_ofs, bl); - ::decode(len, bl); + decode(old_ofs, bl); + decode(new_ofs, bl); + decode(len, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -212,17 +212,17 @@ struct RGWCompressionInfo { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(compression_type, bl); - ::encode(orig_size, bl); - ::encode(blocks, bl); + encode(compression_type, bl); + encode(orig_size, bl); + encode(blocks, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(compression_type, bl); - ::decode(orig_size, bl); - ::decode(blocks, bl); + decode(compression_type, bl); + decode(orig_size, bl); + decode(blocks, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -239,15 +239,15 @@ struct RGWOLHInfo { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(target, bl); - ::encode(removed, bl); + encode(target, bl); + encode(removed, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(target, bl); - ::decode(removed, bl); + decode(target, bl); + decode(removed, bl); DECODE_FINISH(bl); } static void generate_test_instances(list& o); @@ -262,13 +262,13 @@ struct RGWOLHPendingInfo { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(time, bl); + encode(time, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(time, bl); + decode(time, bl); DECODE_FINISH(bl); } @@ -340,17 +340,17 @@ struct RGWObjManifestPart { void encode(bufferlist& bl) const { ENCODE_START(2, 2, bl); - ::encode(loc, bl); - ::encode(loc_ofs, bl); - ::encode(size, bl); + encode(loc, bl); + encode(loc_ofs, bl); + encode(size, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl); - ::decode(loc, bl); - ::decode(loc_ofs, bl); - ::decode(size, bl); + decode(loc, bl); + decode(loc_ofs, bl); + decode(size, bl); DECODE_FINISH(bl); } @@ -388,22 +388,22 @@ struct RGWObjManifestRule { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(start_part_num, bl); - ::encode(start_ofs, bl); - ::encode(part_size, bl); - ::encode(stripe_max_size, bl); - ::encode(override_prefix, bl); + encode(start_part_num, bl); + encode(start_ofs, bl); + encode(part_size, bl); + encode(stripe_max_size, bl); + encode(override_prefix, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(start_part_num, bl); - ::decode(start_ofs, bl); - ::decode(part_size, bl); - ::decode(stripe_max_size, bl); + decode(start_part_num, bl); + decode(start_ofs, bl); + decode(part_size, bl); + decode(stripe_max_size, bl); if (struct_v >= 2) - ::decode(override_prefix, bl); + decode(override_prefix, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -493,40 +493,40 @@ public: void encode(bufferlist& bl) const { ENCODE_START(7, 6, bl); - ::encode(obj_size, bl); - ::encode(objs, bl); - ::encode(explicit_objs, bl); - ::encode(obj, bl); - ::encode(head_size, bl); - ::encode(max_head_size, bl); - ::encode(prefix, bl); - ::encode(rules, bl); + encode(obj_size, bl); + encode(objs, bl); + encode(explicit_objs, bl); + encode(obj, bl); + encode(head_size, bl); + encode(max_head_size, bl); + encode(prefix, bl); + encode(rules, bl); bool encode_tail_bucket = !(tail_placement.bucket == obj.bucket); - ::encode(encode_tail_bucket, bl); + encode(encode_tail_bucket, bl); if (encode_tail_bucket) { - ::encode(tail_placement.bucket, bl); + encode(tail_placement.bucket, bl); } bool encode_tail_instance = (tail_instance != obj.key.instance); - ::encode(encode_tail_instance, bl); + encode(encode_tail_instance, bl); if (encode_tail_instance) { - ::encode(tail_instance, bl); + encode(tail_instance, bl); } - ::encode(head_placement_rule, bl); - ::encode(tail_placement.placement_rule, bl); + encode(head_placement_rule, bl); + encode(tail_placement.placement_rule, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN_32(7, 2, 2, bl); - ::decode(obj_size, bl); - ::decode(objs, bl); + decode(obj_size, bl); + decode(objs, bl); if (struct_v >= 3) { - ::decode(explicit_objs, bl); - ::decode(obj, bl); - ::decode(head_size, bl); - ::decode(max_head_size, bl); - ::decode(prefix, bl); - ::decode(rules, bl); + decode(explicit_objs, bl); + decode(obj, bl); + decode(head_size, bl); + decode(max_head_size, bl); + decode(prefix, bl); + decode(rules, bl); } else { explicit_objs = true; if (!objs.empty()) { @@ -552,12 +552,12 @@ public: if (struct_v >= 4) { if (struct_v < 6) { - ::decode(tail_placement.bucket, bl); + decode(tail_placement.bucket, bl); } else { bool need_to_decode; - ::decode(need_to_decode, bl); + decode(need_to_decode, bl); if (need_to_decode) { - ::decode(tail_placement.bucket, bl); + decode(tail_placement.bucket, bl); } else { tail_placement.bucket = obj.bucket; } @@ -566,12 +566,12 @@ public: if (struct_v >= 5) { if (struct_v < 6) { - ::decode(tail_instance, bl); + decode(tail_instance, bl); } else { bool need_to_decode; - ::decode(need_to_decode, bl); + decode(need_to_decode, bl); if (need_to_decode) { - ::decode(tail_instance, bl); + decode(tail_instance, bl); } else { tail_instance = obj.key.instance; } @@ -581,8 +581,8 @@ public: } if (struct_v >= 7) { - ::decode(head_placement_rule, bl); - ::decode(tail_placement.placement_rule, bl); + decode(head_placement_rule, bl); + decode(tail_placement.placement_rule, bl); } update_iterators(); @@ -849,26 +849,26 @@ struct RGWUploadPartInfo { void encode(bufferlist& bl) const { ENCODE_START(4, 2, bl); - ::encode(num, bl); - ::encode(size, bl); - ::encode(etag, bl); - ::encode(modified, bl); - ::encode(manifest, bl); - ::encode(cs_info, bl); - ::encode(accounted_size, bl); + encode(num, bl); + encode(size, bl); + encode(etag, bl); + encode(modified, bl); + encode(manifest, bl); + encode(cs_info, bl); + encode(accounted_size, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START_LEGACY_COMPAT_LEN(4, 2, 2, bl); - ::decode(num, bl); - ::decode(size, bl); - ::decode(etag, bl); - ::decode(modified, bl); + decode(num, bl); + decode(size, bl); + decode(etag, bl); + decode(modified, bl); if (struct_v >= 3) - ::decode(manifest, bl); + decode(manifest, bl); if (struct_v >= 4) { - ::decode(cs_info, bl); - ::decode(accounted_size, bl); + decode(cs_info, bl); + decode(accounted_size, bl); } else { accounted_size = size; } @@ -1010,13 +1010,13 @@ struct RGWDefaultSystemMetaObjInfo { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(default_id, bl); + encode(default_id, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(default_id, bl); + decode(default_id, bl); DECODE_FINISH(bl); } @@ -1030,13 +1030,13 @@ struct RGWNameToId { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(obj_id, bl); + encode(obj_id, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(obj_id, bl); + decode(obj_id, bl); DECODE_FINISH(bl); } @@ -1079,15 +1079,15 @@ public: virtual void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(id, bl); - ::encode(name, bl); + encode(id, bl); + encode(name, bl); ENCODE_FINISH(bl); } virtual void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(id, bl); - ::decode(name, bl); + decode(id, bl); + decode(name, bl); DECODE_FINISH(bl); } @@ -1129,11 +1129,11 @@ struct RGWZonePlacementInfo { void encode(bufferlist& bl) const { ENCODE_START(6, 1, bl); - ::encode(index_pool.to_str(), bl); - ::encode(data_pool.to_str(), bl); - ::encode(data_extra_pool.to_str(), bl); - ::encode((uint32_t)index_type, bl); - ::encode(compression_type, bl); + encode(index_pool.to_str(), bl); + encode(data_pool.to_str(), bl); + encode(data_extra_pool.to_str(), bl); + encode((uint32_t)index_type, bl); + encode(compression_type, bl); ENCODE_FINISH(bl); } @@ -1141,22 +1141,22 @@ struct RGWZonePlacementInfo { DECODE_START(6, bl); string index_pool_str; string data_pool_str; - ::decode(index_pool_str, bl); + decode(index_pool_str, bl); index_pool = rgw_pool(index_pool_str); - ::decode(data_pool_str, bl); + decode(data_pool_str, bl); data_pool = rgw_pool(data_pool_str); if (struct_v >= 4) { string data_extra_pool_str; - ::decode(data_extra_pool_str, bl); + decode(data_extra_pool_str, bl); data_extra_pool = rgw_pool(data_extra_pool_str); } if (struct_v >= 5) { uint32_t it; - ::decode(it, bl); + decode(it, bl); index_type = (RGWBucketIndexType)it; } if (struct_v >= 6) { - ::decode(compression_type, bl); + decode(compression_type, bl); } DECODE_FINISH(bl); } @@ -1221,70 +1221,70 @@ struct RGWZoneParams : RGWSystemMetaObj { void encode(bufferlist& bl) const override { ENCODE_START(10, 1, bl); - ::encode(domain_root, bl); - ::encode(control_pool, bl); - ::encode(gc_pool, bl); - ::encode(log_pool, bl); - ::encode(intent_log_pool, bl); - ::encode(usage_log_pool, bl); - ::encode(user_keys_pool, bl); - ::encode(user_email_pool, bl); - ::encode(user_swift_pool, bl); - ::encode(user_uid_pool, bl); + encode(domain_root, bl); + encode(control_pool, bl); + encode(gc_pool, bl); + encode(log_pool, bl); + encode(intent_log_pool, bl); + encode(usage_log_pool, bl); + encode(user_keys_pool, bl); + encode(user_email_pool, bl); + encode(user_swift_pool, bl); + encode(user_uid_pool, bl); RGWSystemMetaObj::encode(bl); - ::encode(system_key, bl); - ::encode(placement_pools, bl); - ::encode(metadata_heap, bl); - ::encode(realm_id, bl); - ::encode(lc_pool, bl); - ::encode(tier_config, bl); - ::encode(roles_pool, bl); - ::encode(reshard_pool, bl); + encode(system_key, bl); + encode(placement_pools, bl); + encode(metadata_heap, bl); + encode(realm_id, bl); + encode(lc_pool, bl); + encode(tier_config, bl); + encode(roles_pool, bl); + encode(reshard_pool, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) override { DECODE_START(10, bl); - ::decode(domain_root, bl); - ::decode(control_pool, bl); - ::decode(gc_pool, bl); - ::decode(log_pool, bl); - ::decode(intent_log_pool, bl); - ::decode(usage_log_pool, bl); - ::decode(user_keys_pool, bl); - ::decode(user_email_pool, bl); - ::decode(user_swift_pool, bl); - ::decode(user_uid_pool, bl); + decode(domain_root, bl); + decode(control_pool, bl); + decode(gc_pool, bl); + decode(log_pool, bl); + decode(intent_log_pool, bl); + decode(usage_log_pool, bl); + decode(user_keys_pool, bl); + decode(user_email_pool, bl); + decode(user_swift_pool, bl); + decode(user_uid_pool, bl); if (struct_v >= 6) { RGWSystemMetaObj::decode(bl); } else if (struct_v >= 2) { - ::decode(name, bl); + decode(name, bl); id = name; } if (struct_v >= 3) - ::decode(system_key, bl); + decode(system_key, bl); if (struct_v >= 4) - ::decode(placement_pools, bl); + decode(placement_pools, bl); if (struct_v >= 5) - ::decode(metadata_heap, bl); + decode(metadata_heap, bl); if (struct_v >= 6) { - ::decode(realm_id, bl); + decode(realm_id, bl); } if (struct_v >= 7) { - ::decode(lc_pool, bl); + decode(lc_pool, bl); } else { lc_pool = log_pool.name + ":lc"; } if (struct_v >= 8) { - ::decode(tier_config, bl); + decode(tier_config, bl); } if (struct_v >= 9) { - ::decode(roles_pool, bl); + decode(roles_pool, bl); } else { roles_pool = name + ".rgw.meta:roles"; } if (struct_v >= 10) { - ::decode(reshard_pool, bl); + decode(reshard_pool, bl); } else { reshard_pool = log_pool.name + ":reshard"; } @@ -1361,47 +1361,47 @@ struct RGWZone { void encode(bufferlist& bl) const { ENCODE_START(7, 1, bl); - ::encode(name, bl); - ::encode(endpoints, bl); - ::encode(log_meta, bl); - ::encode(log_data, bl); - ::encode(bucket_index_max_shards, bl); - ::encode(id, bl); - ::encode(read_only, bl); - ::encode(tier_type, bl); - ::encode(sync_from_all, bl); - ::encode(sync_from, bl); - ::encode(redirect_zone, bl); + encode(name, bl); + encode(endpoints, bl); + encode(log_meta, bl); + encode(log_data, bl); + encode(bucket_index_max_shards, bl); + encode(id, bl); + encode(read_only, bl); + encode(tier_type, bl); + encode(sync_from_all, bl); + encode(sync_from, bl); + encode(redirect_zone, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(7, bl); - ::decode(name, bl); + decode(name, bl); if (struct_v < 4) { id = name; } - ::decode(endpoints, bl); + decode(endpoints, bl); if (struct_v >= 2) { - ::decode(log_meta, bl); - ::decode(log_data, bl); + decode(log_meta, bl); + decode(log_data, bl); } if (struct_v >= 3) { - ::decode(bucket_index_max_shards, bl); + decode(bucket_index_max_shards, bl); } if (struct_v >= 4) { - ::decode(id, bl); - ::decode(read_only, bl); + decode(id, bl); + decode(read_only, bl); } if (struct_v >= 5) { - ::decode(tier_type, bl); + decode(tier_type, bl); } if (struct_v >= 6) { - ::decode(sync_from_all, bl); - ::decode(sync_from, bl); + decode(sync_from_all, bl); + decode(sync_from, bl); } if (struct_v >= 7) { - ::decode(redirect_zone, bl); + decode(redirect_zone, bl); } DECODE_FINISH(bl); } @@ -1422,13 +1422,13 @@ struct RGWDefaultZoneGroupInfo { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(default_zonegroup, bl); + encode(default_zonegroup, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(default_zonegroup, bl); + decode(default_zonegroup, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -1455,15 +1455,15 @@ struct RGWZoneGroupPlacementTarget { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(name, bl); - ::encode(tags, bl); + encode(name, bl); + encode(tags, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(name, bl); - ::decode(tags, bl); + decode(name, bl); + decode(tags, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -1521,40 +1521,40 @@ struct RGWZoneGroup : public RGWSystemMetaObj { void encode(bufferlist& bl) const override { ENCODE_START(4, 1, bl); - ::encode(name, bl); - ::encode(api_name, bl); - ::encode(is_master, bl); - ::encode(endpoints, bl); - ::encode(master_zone, bl); - ::encode(zones, bl); - ::encode(placement_targets, bl); - ::encode(default_placement, bl); - ::encode(hostnames, bl); - ::encode(hostnames_s3website, bl); + encode(name, bl); + encode(api_name, bl); + encode(is_master, bl); + encode(endpoints, bl); + encode(master_zone, bl); + encode(zones, bl); + encode(placement_targets, bl); + encode(default_placement, bl); + encode(hostnames, bl); + encode(hostnames_s3website, bl); RGWSystemMetaObj::encode(bl); - ::encode(realm_id, bl); + encode(realm_id, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) override { DECODE_START(4, bl); - ::decode(name, bl); - ::decode(api_name, bl); - ::decode(is_master, bl); - ::decode(endpoints, bl); - ::decode(master_zone, bl); - ::decode(zones, bl); - ::decode(placement_targets, bl); - ::decode(default_placement, bl); + decode(name, bl); + decode(api_name, bl); + decode(is_master, bl); + decode(endpoints, bl); + decode(master_zone, bl); + decode(zones, bl); + decode(placement_targets, bl); + decode(default_placement, bl); if (struct_v >= 2) { - ::decode(hostnames, bl); + decode(hostnames, bl); } if (struct_v >= 3) { - ::decode(hostnames_s3website, bl); + decode(hostnames_s3website, bl); } if (struct_v >= 4) { RGWSystemMetaObj::decode(bl); - ::decode(realm_id, bl); + decode(realm_id, bl); } else { id = name; } @@ -1617,15 +1617,15 @@ struct RGWPeriodConfig void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(bucket_quota, bl); - ::encode(user_quota, bl); + encode(bucket_quota, bl); + encode(user_quota, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(bucket_quota, bl); - ::decode(user_quota, bl); + decode(bucket_quota, bl); + decode(user_quota, bl); DECODE_FINISH(bl); } @@ -1693,23 +1693,23 @@ struct objexp_hint_entry { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(bucket_name, bl); - ::encode(bucket_id, bl); - ::encode(obj_key, bl); - ::encode(exp_time, bl); - ::encode(tenant, bl); + encode(bucket_name, bl); + encode(bucket_id, bl); + encode(obj_key, bl); + encode(exp_time, bl); + encode(tenant, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { // XXX Do we want DECODE_START_LEGACY_COMPAT_LEN(2, 1, 1, bl); ? DECODE_START(2, bl); - ::decode(bucket_name, bl); - ::decode(bucket_id, bl); - ::decode(obj_key, bl); - ::decode(exp_time, bl); + decode(bucket_name, bl); + decode(bucket_id, bl); + decode(obj_key, bl); + decode(exp_time, bl); if (struct_v >= 2) { - ::decode(tenant, bl); + decode(tenant, bl); } else { tenant.clear(); } @@ -1736,16 +1736,16 @@ public: void encode(bufferlist& bl) const override { ENCODE_START(1, 1, bl); RGWSystemMetaObj::encode(bl); - ::encode(current_period, bl); - ::encode(epoch, bl); + encode(current_period, bl); + encode(epoch, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) override { DECODE_START(1, bl); RGWSystemMetaObj::decode(bl); - ::decode(current_period, bl); - ::decode(epoch, bl); + decode(current_period, bl); + decode(epoch, bl); DECODE_FINISH(bl); } @@ -1785,13 +1785,13 @@ struct RGWPeriodLatestEpochInfo { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(epoch, bl); + encode(epoch, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(epoch, bl); + decode(epoch, bl); DECODE_FINISH(bl); } @@ -1927,33 +1927,33 @@ public: void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(id, bl); - ::encode(epoch, bl); - ::encode(realm_epoch, bl); - ::encode(predecessor_uuid, bl); - ::encode(sync_status, bl); - ::encode(period_map, bl); - ::encode(master_zone, bl); - ::encode(master_zonegroup, bl); - ::encode(period_config, bl); - ::encode(realm_id, bl); - ::encode(realm_name, bl); + encode(id, bl); + encode(epoch, bl); + encode(realm_epoch, bl); + encode(predecessor_uuid, bl); + encode(sync_status, bl); + encode(period_map, bl); + encode(master_zone, bl); + encode(master_zonegroup, bl); + encode(period_config, bl); + encode(realm_id, bl); + encode(realm_name, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(id, bl); - ::decode(epoch, bl); - ::decode(realm_epoch, bl); - ::decode(predecessor_uuid, bl); - ::decode(sync_status, bl); - ::decode(period_map, bl); - ::decode(master_zone, bl); - ::decode(master_zonegroup, bl); - ::decode(period_config, bl); - ::decode(realm_id, bl); - ::decode(realm_name, bl); + decode(id, bl); + decode(epoch, bl); + decode(realm_epoch, bl); + decode(predecessor_uuid, bl); + decode(sync_status, bl); + decode(period_map, bl); + decode(master_zone, bl); + decode(master_zonegroup, bl); + decode(period_config, bl); + decode(realm_id, bl); + decode(realm_name, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const;