void encode(bufferlist& bl) const {
ENCODE_START(2, 2, bl);
- ::encode(flags, bl);
+ encode(flags, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(flags, bl);
+ decode(flags, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
// virtual void set(const char *s) = 0;
void encode(bufferlist& bl) const {
ENCODE_START(2, 2, bl);
- ::encode(type, bl);
+ encode(type, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(type, bl);
+ decode(type, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
void encode(bufferlist& bl) const {
ENCODE_START(5, 3, bl);
- ::encode(type, bl);
+ encode(type, bl);
string s;
id.to_str(s);
- ::encode(s, bl);
+ encode(s, bl);
string uri;
- ::encode(uri, bl);
- ::encode(email, bl);
- ::encode(permission, bl);
- ::encode(name, bl);
+ encode(uri, bl);
+ encode(email, bl);
+ encode(permission, bl);
+ encode(name, bl);
__u32 g = (__u32)group;
- ::encode(g, bl);
- ::encode(url_spec, bl);
+ encode(g, bl);
+ encode(url_spec, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
- ::decode(type, bl);
+ decode(type, bl);
string s;
- ::decode(s, bl);
+ decode(s, bl);
id.from_str(s);
string uri;
- ::decode(uri, bl);
- ::decode(email, bl);
- ::decode(permission, bl);
- ::decode(name, bl);
+ decode(uri, bl);
+ decode(email, bl);
+ decode(permission, bl);
+ decode(name, bl);
if (struct_v > 1) {
__u32 g;
- ::decode(g, bl);
+ decode(g, bl);
group = (ACLGroupTypeEnum)g;
} else {
group = uri_to_group(uri);
}
if (struct_v >= 5) {
- ::decode(url_spec, bl);
+ decode(url_spec, bl);
} else {
url_spec.clear();
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(url_spec, bl);
- ::encode(perm, bl);
+ encode(url_spec, bl);
+ encode(perm, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
- ::decode(url_spec, bl);
- ::decode(perm, bl);
+ decode(url_spec, bl);
+ decode(perm, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
void encode(bufferlist& bl) const {
ENCODE_START(4, 3, bl);
bool maps_initialized = true;
- ::encode(maps_initialized, bl);
- ::encode(acl_user_map, bl);
- ::encode(grant_map, bl);
- ::encode(acl_group_map, bl);
- ::encode(referer_list, bl);
+ encode(maps_initialized, bl);
+ encode(acl_user_map, bl);
+ encode(grant_map, bl);
+ encode(acl_group_map, bl);
+ encode(referer_list, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(4, 3, 3, bl);
bool maps_initialized;
- ::decode(maps_initialized, bl);
- ::decode(acl_user_map, bl);
- ::decode(grant_map, bl);
+ decode(maps_initialized, bl);
+ decode(acl_user_map, bl);
+ decode(grant_map, bl);
if (struct_v >= 2) {
- ::decode(acl_group_map, bl);
+ decode(acl_group_map, bl);
} else if (!maps_initialized) {
multimap<string, ACLGrant>::iterator iter;
for (iter = grant_map.begin(); iter != grant_map.end(); ++iter) {
}
}
if (struct_v >= 4) {
- ::decode(referer_list, bl);
+ decode(referer_list, bl);
}
DECODE_FINISH(bl);
}
ENCODE_START(3, 2, bl);
string s;
id.to_str(s);
- ::encode(s, bl);
- ::encode(display_name, bl);
+ encode(s, bl);
+ encode(display_name, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
string s;
- ::decode(s, bl);
+ decode(s, bl);
id.from_str(s);
- ::decode(display_name, bl);
+ decode(display_name, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
void encode(bufferlist& bl) const {
ENCODE_START(2, 2, bl);
- ::encode(owner, bl);
- ::encode(acl, bl);
+ encode(owner, bl);
+ encode(acl, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(owner, bl);
- ::decode(acl, bl);
+ decode(owner, bl);
+ decode(acl, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
static void generate_test_instances(list<RGWAccessControlPolicy*>& o);
void decode_owner(bufferlist::iterator& bl) { // sometimes we only need that, should be faster
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(owner, bl);
+ decode(owner, bl);
DECODE_FINISH(bl);
}
case InstanceIdx:
{
rgw_bucket_dir_entry entry;
- ::decode(entry, iter);
+ decode(entry, iter);
encode_json("entry", entry, formatter);
}
break;
case OLHIdx:
{
rgw_bucket_olh_entry entry;
- ::decode(entry, iter);
+ decode(entry, iter);
encode_json("entry", entry, formatter);
}
break;
bufferlist::iterator iter = bl.begin();
try {
- ::decode(t, iter);
+ decode(t, iter);
} catch (buffer::error& err) {
return false;
}
try {
bufferlist& bl = iter->second;
bufferlist::iterator biter = bl.begin();
- ::decode(manifest, biter);
+ decode(manifest, biter);
} catch (buffer::error& err) {
ldout(store->ctx(), 0) << "ERROR: failed to decode manifest" << dendl;
return -EIO;
auto iter = cls_entry.data.begin();
try {
- ::decode(log_entry, iter);
+ decode(log_entry, iter);
} catch (buffer::error& err) {
cerr << "ERROR: failed to decode log entry" << std::endl;
continue;
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(tenant, bl);
- ::encode(id, bl);
+ encode(tenant, bl);
+ encode(id, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(tenant, bl);
- ::decode(id, bl);
+ decode(tenant, bl);
+ decode(id, bl);
DECODE_FINISH(bl);
}
string key = bucket.get_key();
bufferlist bl;
- ::encode(bucket_info, bl);
+ encode(bucket_info, bl);
return rgw_bucket_instance_store_info(store, key, bl, false, &attrs, objv_tracker, real_time());
}
ACLOwner owner;
try {
bufferlist::iterator iter = aclbl.begin();
- ::decode(policy, iter);
+ decode(policy, iter);
owner = policy.get_owner();
} catch (buffer::error& err) {
set_err_msg(err_msg, "couldn't decode policy");
change.entity_type = ENTITY_TYPE_BUCKET;
change.key = bs.get_key();
change.timestamp = ut;
- ::encode(change, bl);
+ encode(change, bl);
store->time_log_prepare_entry(entry, ut, section, change.key, bl);
change.entity_type = ENTITY_TYPE_BUCKET;
change.key = bs.get_key();
change.timestamp = now;
- ::encode(change, bl);
+ encode(change, bl);
string section;
ldout(cct, 20) << "RGWDataChangesLog::add_entry() sending update with now=" << now << " cur_expiration=" << expiration << dendl;
log_entry.log_timestamp = rt;
bufferlist::iterator liter = iter->data.begin();
try {
- ::decode(log_entry.entry, liter);
+ decode(log_entry.entry, liter);
} catch (buffer::error& err) {
lderr(cct) << "ERROR: failed to decode data changes log entry" << dendl;
return -EIO;
void encode(bufferlist& bl) const {
ENCODE_START(2, 2, bl);
- ::encode(size, bl);
- ::encode(mtime, bl);
+ encode(size, bl);
+ encode(mtime, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
- ::decode(size, bl);
- ::decode(mtime, bl);
+ decode(size, bl);
+ decode(mtime, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
void encode(bufferlist& bl) const {
ENCODE_START(5, 3, bl);
- ::encode(status, bl);
- ::encode(flags, bl);
- ::encode(data, bl);
- ::encode(xattrs, bl);
- ::encode(meta, bl);
- ::encode(rm_xattrs, bl);
- ::encode(epoch, bl);
- ::encode(version, bl);
+ encode(status, bl);
+ encode(flags, bl);
+ encode(data, bl);
+ encode(xattrs, bl);
+ encode(meta, bl);
+ encode(rm_xattrs, bl);
+ encode(epoch, bl);
+ encode(version, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
- ::decode(status, bl);
- ::decode(flags, bl);
- ::decode(data, bl);
- ::decode(xattrs, bl);
- ::decode(meta, bl);
+ decode(status, bl);
+ decode(flags, bl);
+ decode(data, bl);
+ decode(xattrs, bl);
+ decode(meta, bl);
if (struct_v >= 2)
- ::decode(rm_xattrs, bl);
+ decode(rm_xattrs, bl);
if (struct_v >= 4)
- ::decode(epoch, bl);
+ decode(epoch, bl);
if (struct_v >= 5)
- ::decode(version, bl);
+ decode(version, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
void encode(bufferlist& obl) const {
ENCODE_START(2, 2, obl);
- ::encode(op, obl);
- ::encode(obj, obl);
- ::encode(obj_info, obl);
- ::encode(ofs, obl);
- ::encode(ns, obl);
+ encode(op, obl);
+ encode(obj, obl);
+ encode(obj_info, obl);
+ encode(ofs, obl);
+ encode(ns, obl);
ENCODE_FINISH(obl);
}
void decode(bufferlist::iterator& ibl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, ibl);
- ::decode(op, ibl);
- ::decode(obj, ibl);
- ::decode(obj_info, ibl);
- ::decode(ofs, ibl);
- ::decode(ns, ibl);
+ decode(op, ibl);
+ decode(obj, ibl);
+ decode(obj_info, ibl);
+ decode(ofs, ibl);
+ decode(ns, ibl);
DECODE_FINISH(ibl);
}
void dump(Formatter *f) const;
info.obj_info = obj_info;
info.obj = obj;
bufferlist bl;
- ::encode(info, bl);
+ encode(info, bl);
return T::distribute(normal_name, bl);
}
try {
bufferlist::iterator iter = bl.begin();
- ::decode(info, iter);
+ decode(info, iter);
} catch (buffer::end_of_buffer& err) {
mydout(0) << "ERROR: got bad notification" << dendl;
return -EIO;
void rgw_raw_obj::decode_from_rgw_obj(bufferlist::iterator& bl)
{
+ using ceph::decode;
rgw_obj old_obj;
- ::decode(old_obj, bl);
+ decode(old_obj, bl);
get_obj_bucket_and_oid_loc(old_obj, oid, loc);
pool = old_obj.get_explicit_data_pool();
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(max_age, bl);
- ::encode(allowed_methods, bl);
- ::encode(id, bl);
- ::encode(allowed_hdrs, bl);
- ::encode(allowed_origins, bl);
- ::encode(exposable_hdrs, bl);
+ encode(max_age, bl);
+ encode(allowed_methods, bl);
+ encode(id, bl);
+ encode(allowed_hdrs, bl);
+ encode(allowed_origins, bl);
+ encode(exposable_hdrs, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(max_age, bl);
- ::decode(allowed_methods, bl);
- ::decode(id, bl);
- ::decode(allowed_hdrs, bl);
- ::decode(allowed_origins, bl);
- ::decode(exposable_hdrs, bl);
+ decode(max_age, bl);
+ decode(allowed_methods, bl);
+ decode(id, bl);
+ decode(allowed_hdrs, bl);
+ decode(allowed_origins, bl);
+ decode(exposable_hdrs, bl);
DECODE_FINISH(bl);
}
bool has_wildcard_origin();
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(rules, bl);
+ encode(rules, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(rules, bl);
+ decode(rules, bl);
DECODE_FINISH(bl);
}
void dump(Formatter *f) const;
cls_rgw_bi_log_trim_op call;
call.start_marker = std::move(start_marker);
call.end_marker = std::move(end_marker);
- ::encode(call, in);
+ encode(call, in);
librados::ObjectWriteOperation op;
op.exec(RGW_CLASS, RGW_BI_LOG_TRIM, in);
// exist
*result = T();
} else {
- ::decode(*result, iter);
+ decode(*result, iter);
}
} catch (buffer::error& err) {
return -EIO;
const T& _data, RGWObjVersionTracker *objv_tracker = nullptr)
: RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados),
store(_store), obj(_obj), objv_tracker(objv_tracker) {
- ::encode(_data, bl);
+ encode(_data, bl);
}
~RGWSimpleRadosWriteCR() override {
if (manifest_bl.length()) {
bufferlist::iterator miter = manifest_bl.begin();
try {
- ::decode(manifest, miter);
+ decode(manifest, miter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: couldn't decode manifest" << dendl;
return -EIO;
bufferlist::iterator biter = iter->second.begin();
try {
- ::decode(*val, biter);
+ decode(*val, biter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode attribute: " << attr_name << dendl;
}
void rgw_bucket_shard_sync_info::encode_state_attr(map<string, bufferlist>& attrs)
{
- ::encode(state, attrs["state"]);
+ using ceph::encode;
+ encode(state, attrs["state"]);
}
void rgw_bucket_shard_full_sync_marker::encode_attr(map<string, bufferlist>& attrs)
{
- ::encode(*this, attrs["full_marker"]);
+ using ceph::encode;
+ encode(*this, attrs["full_marker"]);
}
void rgw_bucket_shard_inc_sync_marker::encode_attr(map<string, bufferlist>& attrs)
{
- ::encode(*this, attrs["inc_marker"]);
+ using ceph::encode;
+ encode(*this, attrs["inc_marker"]);
}
class RGWReadBucketSyncStatusCoroutine : public RGWCoroutine {
#ifndef CEPH_RGW_DATA_SYNC_H
#define CEPH_RGW_DATA_SYNC_H
+#include "include/encoding.h"
+
+#include "common/RWLock.h"
+#include "common/ceph_json.h"
+
+
#include "rgw_coroutine.h"
#include "rgw_http_client.h"
#include "rgw_bucket.h"
#include "rgw_sync_module.h"
#include "rgw_sync_trace.h"
-#include "common/RWLock.h"
-#include "common/ceph_json.h"
-
namespace rgw {
-class BucketChangeObserver;
+struct BucketChangeObserver;
}
struct rgw_datalog_info {
void encode(bufferlist& bl) const {
ENCODE_START(2, 1, bl);
- ::encode(state, bl);
- ::encode(num_shards, bl);
- ::encode(instance_id, bl);
+ encode(state, bl);
+ encode(num_shards, bl);
+ encode(instance_id, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(2, bl);
- ::decode(state, bl);
- ::decode(num_shards, bl);
+ decode(state, bl);
+ decode(num_shards, bl);
if (struct_v >= 2) {
- ::decode(instance_id, bl);
+ decode(instance_id, bl);
}
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(state, bl);
- ::encode(marker, bl);
- ::encode(next_step_marker, bl);
- ::encode(total_entries, bl);
- ::encode(pos, bl);
- ::encode(timestamp, bl);
+ encode(state, bl);
+ encode(marker, bl);
+ encode(next_step_marker, bl);
+ encode(total_entries, bl);
+ encode(pos, bl);
+ encode(timestamp, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(state, bl);
- ::decode(marker, bl);
- ::decode(next_step_marker, bl);
- ::decode(total_entries, bl);
- ::decode(pos, bl);
- ::decode(timestamp, bl);
+ decode(state, bl);
+ decode(marker, bl);
+ decode(next_step_marker, bl);
+ decode(total_entries, bl);
+ decode(pos, bl);
+ decode(timestamp, bl);
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(sync_info, bl);
+ encode(sync_info, bl);
/* sync markers are encoded separately */
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(sync_info, bl);
+ decode(sync_info, bl);
/* sync markers are decoded separately */
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(position, bl);
- ::encode(count, bl);
+ encode(position, bl);
+ encode(count, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(position, bl);
- ::decode(count, bl);
+ decode(position, bl);
+ decode(count, bl);
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(position, bl);
+ encode(position, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(position, bl);
+ decode(position, bl);
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(state, bl);
- ::encode(full_marker, bl);
- ::encode(inc_marker, bl);
+ encode(state, bl);
+ encode(full_marker, bl);
+ encode(inc_marker, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(state, bl);
- ::decode(full_marker, bl);
- ::decode(inc_marker, bl);
+ decode(state, bl);
+ decode(full_marker, bl);
+ decode(inc_marker, bl);
DECODE_FINISH(bl);
}
void ObjectCacheInfo::generate_test_instances(list<ObjectCacheInfo*>& o)
{
+ using ceph::encode;
ObjectCacheInfo *i = new ObjectCacheInfo;
i->status = 0;
i->flags = CACHE_FLAG_MODIFY_XATTRS;
string s = "this is a string";
string s2 = "this is a another string";
bufferlist data, data2;
- ::encode(s, data);
- ::encode(s2, data2);
+ encode(s, data);
+ encode(s2, data2);
i->data = data;
i->xattrs["x1"] = data;
i->xattrs["x2"] = data2;
void RGWFileHandle::encode_attrs(ceph::buffer::list& ux_key1,
ceph::buffer::list& ux_attrs1)
{
+ using ceph::encode;
fh_key fhk(this->fh.fh_hk);
- rgw::encode(fhk, ux_key1);
- rgw::encode(*this, ux_attrs1);
+ encode(fhk, ux_key1);
+ encode(*this, ux_attrs1);
} /* RGWFileHandle::encode_attrs */
DecodeAttrsResult RGWFileHandle::decode_attrs(const ceph::buffer::list* ux_key1,
const ceph::buffer::list* ux_attrs1)
{
+ using ceph::decode;
DecodeAttrsResult dar { false, false };
fh_key fhk;
auto bl_iter_key1 = const_cast<buffer::list*>(ux_key1)->begin();
- rgw::decode(fhk, bl_iter_key1);
+ decode(fhk, bl_iter_key1);
if (fhk.version >= 2) {
assert(this->fh.fh_hk == fhk.fh_hk);
} else {
}
auto bl_iter_unix1 = const_cast<buffer::list*>(ux_attrs1)->begin();
- rgw::decode(*this, bl_iter_unix1);
+ decode(*this, bl_iter_unix1);
if (this->state.version < 2) {
get<1>(dar) = true;
}
cs_info.compression_type = plugin->get_type_name();
cs_info.orig_size = s->obj_size;
cs_info.blocks = std::move(compressor->get_compression_blocks());
- ::encode(cs_info, tmp);
+ encode(cs_info, tmp);
attrs[RGW_ATTR_COMPRESSION] = tmp;
ldout(s->cct, 20) << "storing " << RGW_ATTR_COMPRESSION
<< " with type=" << cs_info.compression_type
* processing any input from user in order to prohibit overwriting. */
if (unlikely(!! slo_info)) {
buffer::list slo_userindicator_bl;
- ::encode("True", slo_userindicator_bl);
+ using ceph::encode;
+ encode("True", slo_userindicator_bl);
emplace_attr(RGW_ATTR_SLO_UINDICATOR, std::move(slo_userindicator_bl));
}
void encode(buffer::list& bl) const {
ENCODE_START(2, 1, bl);
- ::encode(fh_hk.bucket, bl);
- ::encode(fh_hk.object, bl);
- ::encode((uint32_t)2, bl);
+ encode(fh_hk.bucket, bl);
+ encode(fh_hk.object, bl);
+ encode((uint32_t)2, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(2, bl);
- ::decode(fh_hk.bucket, bl);
- ::decode(fh_hk.object, bl);
+ decode(fh_hk.bucket, bl);
+ decode(fh_hk.object, bl);
if (struct_v >= 2) {
- ::decode(version, bl);
+ decode(version, bl);
}
DECODE_FINISH(bl);
}
void encode(buffer::list& bl) const {
ENCODE_START(2, 1, bl);
- ::encode(uint32_t(fh.fh_type), bl);
- ::encode(state.dev, bl);
- ::encode(state.size, bl);
- ::encode(state.nlink, bl);
- ::encode(state.owner_uid, bl);
- ::encode(state.owner_gid, bl);
- ::encode(state.unix_mode, bl);
+ encode(uint32_t(fh.fh_type), bl);
+ encode(state.dev, bl);
+ encode(state.size, bl);
+ encode(state.nlink, bl);
+ encode(state.owner_uid, bl);
+ encode(state.owner_gid, bl);
+ encode(state.unix_mode, bl);
for (const auto& t : { state.ctime, state.mtime, state.atime }) {
- ::encode(real_clock::from_timespec(t), bl);
+ encode(real_clock::from_timespec(t), bl);
}
- ::encode((uint32_t)2, bl);
+ encode((uint32_t)2, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(2, bl);
uint32_t fh_type;
- ::decode(fh_type, bl);
+ decode(fh_type, bl);
assert(fh.fh_type == fh_type);
- ::decode(state.dev, bl);
- ::decode(state.size, bl);
- ::decode(state.nlink, bl);
- ::decode(state.owner_uid, bl);
- ::decode(state.owner_gid, bl);
- ::decode(state.unix_mode, bl);
+ decode(state.dev, bl);
+ decode(state.size, bl);
+ decode(state.nlink, bl);
+ decode(state.owner_uid, bl);
+ decode(state.owner_gid, bl);
+ decode(state.unix_mode, bl);
ceph::real_time enc_time;
for (auto t : { &(state.ctime), &(state.mtime), &(state.atime) }) {
- ::decode(enc_time, bl);
+ decode(enc_time, bl);
*t = real_clock::to_timespec(enc_time);
}
if (struct_v >= 2) {
- ::decode(state.version, bl);
+ decode(state.version, bl);
}
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(3, 2, bl);
- ::encode(days, bl);
- ::encode(date, bl);
+ encode(days, bl);
+ encode(date, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
- ::decode(days, bl);
+ decode(days, bl);
if (struct_v >= 3) {
- ::decode(date, bl);
+ decode(date, bl);
}
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(2, 1, bl);
- ::encode(prefix, bl);
- ::encode(obj_tags, bl);
+ encode(prefix, bl);
+ encode(obj_tags, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(2, bl);
- ::decode(prefix, bl);
+ decode(prefix, bl);
if (struct_v >= 2) {
- ::decode(obj_tags, bl);
+ decode(obj_tags, bl);
}
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(5, 1, bl);
- ::encode(id, bl);
- ::encode(prefix, bl);
- ::encode(status, bl);
- ::encode(expiration, bl);
- ::encode(noncur_expiration, bl);
- ::encode(mp_expiration, bl);
- ::encode(dm_expiration, bl);
- ::encode(filter, bl);
+ encode(id, bl);
+ encode(prefix, bl);
+ encode(status, bl);
+ encode(expiration, bl);
+ encode(noncur_expiration, bl);
+ encode(mp_expiration, bl);
+ encode(dm_expiration, bl);
+ encode(filter, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 1, 1, bl);
- ::decode(id, bl);
- ::decode(prefix, bl);
- ::decode(status, bl);
- ::decode(expiration, bl);
+ decode(id, bl);
+ decode(prefix, bl);
+ decode(status, bl);
+ decode(expiration, bl);
if (struct_v >=2) {
- ::decode(noncur_expiration, bl);
+ decode(noncur_expiration, bl);
}
if (struct_v >= 3) {
- ::decode(mp_expiration, bl);
+ decode(mp_expiration, bl);
}
if (struct_v >= 4) {
- ::decode(dm_expiration, bl);
+ decode(dm_expiration, bl);
}
if (struct_v >= 5) {
- ::decode(filter, bl);
+ decode(filter, bl);
}
DECODE_FINISH(bl);
}
// int get_group_perm(ACLGroupTypeEnum group, int perm_mask);
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(rule_map, bl);
+ encode(rule_map, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
- ::decode(rule_map, bl);
+ decode(rule_map, bl);
multimap<string, LCRule>::iterator iter;
for (iter = rule_map.begin(); iter != rule_map.end(); ++iter) {
LCRule& rule = iter->second;
entry.bucket_id = bucket_id;
bufferlist bl;
- ::encode(entry, bl);
+ encode(entry, bl);
struct tm bdt;
time_t t = entry.time.sec();
void encode(bufferlist &bl) const {
ENCODE_START(9, 5, bl);
- ::encode(object_owner.id, bl);
- ::encode(bucket_owner.id, bl);
- ::encode(bucket, bl);
- ::encode(time, bl);
- ::encode(remote_addr, bl);
- ::encode(user, bl);
- ::encode(obj.name, bl);
- ::encode(op, bl);
- ::encode(uri, bl);
- ::encode(http_status, bl);
- ::encode(error_code, bl);
- ::encode(bytes_sent, bl);
- ::encode(obj_size, bl);
- ::encode(total_time, bl);
- ::encode(user_agent, bl);
- ::encode(referrer, bl);
- ::encode(bytes_received, bl);
- ::encode(bucket_id, bl);
- ::encode(obj, bl);
- ::encode(object_owner, bl);
- ::encode(bucket_owner, bl);
- ::encode(x_headers, bl);
+ encode(object_owner.id, bl);
+ encode(bucket_owner.id, bl);
+ encode(bucket, bl);
+ encode(time, bl);
+ encode(remote_addr, bl);
+ encode(user, bl);
+ encode(obj.name, bl);
+ encode(op, bl);
+ encode(uri, bl);
+ encode(http_status, bl);
+ encode(error_code, bl);
+ encode(bytes_sent, bl);
+ encode(obj_size, bl);
+ encode(total_time, bl);
+ encode(user_agent, bl);
+ encode(referrer, bl);
+ encode(bytes_received, bl);
+ encode(bucket_id, bl);
+ encode(obj, bl);
+ encode(object_owner, bl);
+ encode(bucket_owner, bl);
+ encode(x_headers, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &p) {
DECODE_START_LEGACY_COMPAT_LEN(8, 5, 5, p);
- ::decode(object_owner.id, p);
+ decode(object_owner.id, p);
if (struct_v > 3)
- ::decode(bucket_owner.id, p);
- ::decode(bucket, p);
- ::decode(time, p);
- ::decode(remote_addr, p);
- ::decode(user, p);
- ::decode(obj.name, p);
- ::decode(op, p);
- ::decode(uri, p);
- ::decode(http_status, p);
- ::decode(error_code, p);
- ::decode(bytes_sent, p);
- ::decode(obj_size, p);
- ::decode(total_time, p);
- ::decode(user_agent, p);
- ::decode(referrer, p);
+ decode(bucket_owner.id, p);
+ decode(bucket, p);
+ decode(time, p);
+ decode(remote_addr, p);
+ decode(user, p);
+ decode(obj.name, p);
+ decode(op, p);
+ decode(uri, p);
+ decode(http_status, p);
+ decode(error_code, p);
+ decode(bytes_sent, p);
+ decode(obj_size, p);
+ decode(total_time, p);
+ decode(user_agent, p);
+ decode(referrer, p);
if (struct_v >= 2)
- ::decode(bytes_received, p);
+ decode(bytes_received, p);
else
bytes_received = 0;
if (struct_v >= 3) {
if (struct_v <= 5) {
uint64_t id;
- ::decode(id, p);
+ decode(id, p);
char buf[32];
snprintf(buf, sizeof(buf), "%llu", (long long)id);
bucket_id = buf;
} else {
- ::decode(bucket_id, p);
+ decode(bucket_id, p);
}
} else {
bucket_id = "";
}
if (struct_v >= 7) {
- ::decode(obj, p);
+ decode(obj, p);
}
if (struct_v >= 8) {
- ::decode(object_owner, p);
- ::decode(bucket_owner, p);
+ decode(object_owner, p);
+ decode(bucket_owner, p);
}
if (struct_v >= 9) {
- ::decode(x_headers, p);
+ decode(x_headers, p);
}
DECODE_FINISH(p);
}
void RGWMetadataLogData::encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(read_version, bl);
- ::encode(write_version, bl);
+ encode(read_version, bl);
+ encode(write_version, bl);
uint32_t s = (uint32_t)status;
- ::encode(s, bl);
+ encode(s, bl);
ENCODE_FINISH(bl);
}
void RGWMetadataLogData::decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(read_version, bl);
- ::decode(write_version, bl);
+ decode(read_version, bl);
+ decode(write_version, bl);
uint32_t s;
- ::decode(s, bl);
+ decode(s, bl);
status = (RGWMDLogStatus)s;
DECODE_FINISH(bl);
}
try {
RGWMetadataLogData log_data;
bufferlist::iterator iter = entry.data.begin();
- ::decode(log_data, iter);
+ decode(log_data, iter);
encode_json("data", log_data, f);
} catch (buffer::error& err) {
log_data.status = op_type;
bufferlist logbl;
- ::encode(log_data, logbl);
+ encode(log_data, logbl);
assert(current_log); // must have called init()
int ret = current_log->add_entry(handler, section, key, logbl);
log_data.status = MDLOG_STATUS_ABORT;
bufferlist logbl;
- ::encode(log_data, logbl);
+ encode(log_data, logbl);
assert(current_log); // must have called init()
int r = current_log->add_entry(handler, section, key, logbl);
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(oldest_realm_epoch, bl);
- ::encode(oldest_period_id, bl);
+ encode(oldest_realm_epoch, bl);
+ encode(oldest_period_id, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& p) {
DECODE_START(1, p);
- ::decode(oldest_realm_epoch, p);
- ::decode(oldest_period_id, p);
+ decode(oldest_realm_epoch, p);
+ decode(oldest_period_id, p);
DECODE_FINISH(p);
}
bufferlist::iterator bli = bl.begin();
RGWUploadPartInfo info;
try {
- ::decode(info, bli);
+ decode(info, bli);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: could not part info, caught buffer::error" << dendl;
return -EIO;
RGWSLOInfo slo_info;
bufferlist::iterator bliter = bl.begin();
try {
- ::decode(slo_info, bliter);
+ decode(slo_info, bliter);
} catch (buffer::error& err) {
ldout(s->cct, 0) << "ERROR: failed to decode slo manifest" << dendl;
return -EIO;
if (iter != attrs.end()) {
utime_t delete_at;
try {
- ::decode(delete_at, iter->second);
+ decode(delete_at, iter->second);
} catch (buffer::error& err) {
dout(0) << "ERROR: " << __func__ << ": failed to decode " RGW_ATTR_DELETE_AT " attr" << dendl;
return false;
return r;
}
- ::encode(info, bl);
+ encode(info, bl);
string multipart_meta_obj = mp.get_meta();
cs_info.compression_type = plugin->get_type_name();
cs_info.orig_size = s->obj_size;
cs_info.blocks = move(compressor->get_compression_blocks());
- ::encode(cs_info, tmp);
+ encode(cs_info, tmp);
attrs[RGW_ATTR_COMPRESSION] = tmp;
ldout(s->cct, 20) << "storing " << RGW_ATTR_COMPRESSION
<< " with type=" << cs_info.compression_type
if (slo_info) {
bufferlist manifest_bl;
- ::encode(*slo_info, manifest_bl);
+ encode(*slo_info, manifest_bl);
emplace_attr(RGW_ATTR_SLO_MANIFEST, std::move(manifest_bl));
hash.Update((::byte *)slo_info->raw_data, slo_info->raw_data_len);
cs_info.compression_type = plugin->get_type_name();
cs_info.orig_size = s->obj_size;
cs_info.blocks = move(compressor->get_compression_blocks());
- ::encode(cs_info, tmp);
+ encode(cs_info, tmp);
emplace_attr(RGW_ATTR_COMPRESSION, std::move(tmp));
}
RGWSLOInfo slo_info;
bufferlist::iterator bliter = bl.begin();
try {
- ::decode(slo_info, bliter);
+ decode(slo_info, bliter);
} catch (buffer::error& err) {
ldout(s->cct, 0) << "ERROR: failed to decode slo manifest" << dendl;
return -EIO;
bufferlist& bl = iter->second;
bufferlist::iterator bli = bl.begin();
try {
- ::decode(*policy, bli);
+ decode(*policy, bli);
} catch (buffer::error& err) {
ldout(s->cct, 0) << "ERROR: could not decode policy, caught buffer::error" << dendl;
return -EIO;
if (compressed) {
// write compression attribute to full object
bufferlist tmp;
- ::encode(cs_info, tmp);
+ encode(cs_info, tmp);
attrs[RGW_ATTR_COMPRESSION] = tmp;
}
cs_info.compression_type = plugin->get_type_name();
cs_info.orig_size = s->obj_size;
cs_info.blocks = std::move(compressor->get_compression_blocks());
- ::encode(cs_info, tmp);
+ encode(cs_info, tmp);
attrs.emplace(RGW_ATTR_COMPRESSION, std::move(tmp));
}
try {
bufferlist& bl = iter->second;
- ::decode(state, bl);
+ decode(state, bl);
} catch (buffer::error& err) {
lderr(store->ctx()) << "ERROR: could not decode buffer" << dendl;
return -EIO;
{
map<string, bufferlist> vals;
bufferlist bl;
- ::encode(state, bl);
+ encode(state, bl);
vals[job_name] = bl;
int r = ioctx.omap_set(oid, vals);
if (r < 0) {
RGWOrphanSearchState state;
try {
bufferlist bl = it.second;
- ::decode(state, bl);
+ decode(state, bl);
} catch (buffer::error& err) {
lderr(store->ctx()) << "ERROR: could not decode buffer" << dendl;
return -EIO;
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode((int)stage, bl);
- ::encode(shard, bl);
- ::encode(marker, bl);
+ encode((int)stage, bl);
+ encode(shard, bl);
+ encode(marker, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
int s;
- ::decode(s, bl);
+ decode(s, bl);
stage = (RGWOrphanSearchStageId)s;
- ::decode(shard, bl);
- ::decode(marker, bl);
+ decode(shard, bl);
+ decode(marker, bl);
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(2, 1, bl);
- ::encode(job_name, bl);
- ::encode(pool.to_str(), bl);
- ::encode(num_shards, bl);
- ::encode(start_time, bl);
+ encode(job_name, bl);
+ encode(pool.to_str(), bl);
+ encode(num_shards, bl);
+ encode(start_time, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(2, bl);
- ::decode(job_name, bl);
+ decode(job_name, bl);
string s;
- ::decode(s, bl);
+ decode(s, bl);
pool.from_str(s);
- ::decode(num_shards, bl);
- ::decode(start_time, bl);
+ decode(num_shards, bl);
+ decode(start_time, bl);
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(info, bl);
- ::encode(stage, bl);
+ encode(info, bl);
+ encode(stage, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(info, bl);
- ::decode(stage, bl);
+ decode(info, bl);
+ decode(stage, bl);
DECODE_FINISH(bl);
}
// decode the period
RGWZonesNeedPeriod info;
try {
- ::decode(info, p);
+ decode(info, p);
} catch (buffer::error& e) {
lderr(cct) << "Failed to decode the period: " << e.what() << dendl;
return;
void encode(bufferlist& bl) const {
ENCODE_START(3, 1, bl);
if (max_size < 0) {
- ::encode(-rgw_rounded_kb(abs(max_size)), bl);
+ encode(-rgw_rounded_kb(abs(max_size)), bl);
} else {
- ::encode(rgw_rounded_kb(max_size), bl);
+ encode(rgw_rounded_kb(max_size), bl);
}
- ::encode(max_objects, bl);
- ::encode(enabled, bl);
- ::encode(max_size, bl);
- ::encode(check_on_raw, bl);
+ encode(max_objects, bl);
+ encode(enabled, bl);
+ encode(max_size, bl);
+ encode(check_on_raw, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(3, 1, 1, bl);
int64_t max_size_kb;
- ::decode(max_size_kb, bl);
- ::decode(max_objects, bl);
- ::decode(enabled, bl);
+ decode(max_size_kb, bl);
+ decode(max_objects, bl);
+ decode(enabled, bl);
if (struct_v < 2) {
max_size = max_size_kb * 1024;
} else {
- ::decode(max_size, bl);
+ decode(max_size, bl);
}
if (struct_v >= 3) {
- ::decode(check_on_raw, bl);
+ decode(check_on_raw, bl);
}
DECODE_FINISH(bl);
}
auto p = bl.begin();
while (!p.end()) {
RGWRealmNotify notify;
- ::decode(notify, p);
+ decode(notify, p);
auto watcher = watchers.find(notify);
if (watcher == watchers.end()) {
lderr(cct) << "Failed to find a watcher for notify type "
}
bufferlist::iterator bliter = bl.begin();
try {
- ::decode(*result, bliter);
+ decode(*result, bliter);
} catch (buffer::error& err) {
return -EIO;
}
content_type = iter->second.c_str();
}
} else if (strcmp(name, RGW_ATTR_SLO_UINDICATOR) == 0) {
- // this attr has an extra length prefix from ::encode() in prior versions
+ // this attr has an extra length prefix from encode() in prior versions
dump_header(s, "X-Object-Meta-Static-Large-Object", "True");
} else if (strncmp(name, RGW_ATTR_META_PREFIX,
sizeof(RGW_ATTR_META_PREFIX)-1) == 0) {
static inline void set_attr(map<string, bufferlist>& attrs, const char* key, const std::string& value)
{
bufferlist bl;
- ::encode(value,bl);
+ encode(value,bl);
attrs.emplace(key, std::move(bl));
}
static inline void set_attr(map<string, bufferlist>& attrs, const char* key, const char* value)
{
bufferlist bl;
- ::encode(value,bl);
+ encode(value,bl);
attrs.emplace(key, std::move(bl));
}
if (aiter != std::end(rgw_to_http_attrs)) {
response_attrs[aiter->second] = kv.second.c_str();
} else if (strcmp(name, RGW_ATTR_SLO_UINDICATOR) == 0) {
- // this attr has an extra length prefix from ::encode() in prior versions
+ // this attr has an extra length prefix from encode() in prior versions
dump_header(s, "X-Object-Meta-Static-Large-Object", "True");
} else if (strncmp(name, RGW_ATTR_META_PREFIX,
sizeof(RGW_ATTR_META_PREFIX)-1) == 0) {
if (iter != std::end(attrs)) {
utime_t delete_at;
try {
- ::decode(delete_at, iter->second);
+ decode(delete_at, iter->second);
if (!delete_at.is_zero()) {
dump_header(s, "X-Delete-At", delete_at.sec());
}
int RGWRole::store_info(bool exclusive)
{
+ using ceph::encode;
string oid = get_info_oid_prefix() + id;
bufferlist bl;
- ::encode(*this, bl);
+ encode(*this, bl);
return rgw_put_system_obj(store, store->get_zone_params().roles_pool, oid,
bl.c_str(), bl.length(), exclusive, NULL, real_time(), NULL);
}
string oid = tenant + get_names_oid_prefix() + name;
bufferlist bl;
- ::encode(nameToId, bl);
+ using ceph::encode;
+ encode(nameToId, bl);
return rgw_put_system_obj(store, store->get_zone_params().roles_pool, oid,
bl.c_str(), bl.length(), exclusive, NULL, real_time(), NULL);
}
RGWNameToId nameToId;
try {
bufferlist::iterator iter = bl.begin();
- ::decode(nameToId, iter);
+ using ceph::decode;
+ decode(nameToId, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode role from pool: " << pool.name << ": "
<< role_name << dendl;
}
try {
+ using ceph::decode;
bufferlist::iterator iter = bl.begin();
- ::decode(*this, iter);
+ decode(*this, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode role info from pool: " << pool.name <<
": " << id << dendl;
RGWNameToId nameToId;
try {
+ using ceph::decode;
bufferlist::iterator iter = bl.begin();
- ::decode(nameToId, iter);
+ decode(nameToId, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode role name from pool: " << pool.name << ": "
<< name << dendl;
#ifndef CEPH_RGW_ROLE_H
#define CEPH_RGW_ROLE_H
+#include <string>
+
+#include "common/ceph_context.h"
+
+#include "rgw/rgw_rados.h"
+
class RGWRole
{
+ using string = std::string;
static const string role_name_oid_prefix;
static const string role_oid_prefix;
static const string role_path_oid_prefix;
void encode(bufferlist& bl) const {
ENCODE_START(2, 1, bl);
- ::encode(id, bl);
- ::encode(name, bl);
- ::encode(path, bl);
- ::encode(arn, bl);
- ::encode(creation_date, bl);
- ::encode(trust_policy, bl);
- ::encode(perm_policy_map, bl);
- ::encode(tenant, bl);
+ encode(id, bl);
+ encode(name, bl);
+ encode(path, bl);
+ encode(arn, bl);
+ encode(creation_date, bl);
+ encode(trust_policy, bl);
+ encode(perm_policy_map, bl);
+ encode(tenant, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(2, bl);
- ::decode(id, bl);
- ::decode(name, bl);
- ::decode(path, bl);
- ::decode(arn, bl);
- ::decode(creation_date, bl);
- ::decode(trust_policy, bl);
- ::decode(perm_policy_map, bl);
+ decode(id, bl);
+ decode(name, bl);
+ decode(path, bl);
+ decode(arn, bl);
+ decode(creation_date, bl);
+ decode(trust_policy, bl);
+ decode(perm_policy_map, bl);
if (struct_v >= 2) {
- ::decode(tenant, bl);
+ decode(tenant, bl);
}
DECODE_FINISH(bl);
}
const utime_t& expiration,
bufferlist& bl)
{
- ::encode(swift_user, bl);
- ::encode(nonce, bl);
- ::encode(expiration, bl);
+ using ceph::encode;
+ encode(swift_user, bl);
+ encode(nonce, bl);
+ encode(expiration, bl);
bufferptr p(CEPH_CRYPTO_HMACSHA1_DIGESTSIZE);
try {
/*const*/ auto iter = tok_bl.begin();
- ::decode(swift_user, iter);
- ::decode(nonce, iter);
- ::decode(expiration, iter);
+ using ceph::decode;
+ decode(swift_user, iter);
+ decode(nonce, iter);
+ decode(expiration, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "NOTICE: failed to decode token" << dendl;
throw -EINVAL;
rgw_sync_error_info info(source_zone, error_code, message);
bufferlist bl;
- ::encode(info, bl);
+ encode(info, bl);
store->time_log_prepare_entry(entry, real_clock::now(), section, name, bl);
uint32_t shard_id = ++counter % num_shards;
dest_entry.name = entry.name;
dest_entry.timestamp = utime_t(entry.timestamp);
- ::encode(entry.log_data, dest_entry.data);
+ encode(entry.log_data, dest_entry.data);
dest_entries.push_back(dest_entry);
#ifndef CEPH_RGW_SYNC_H
#define CEPH_RGW_SYNC_H
+#include <atomic>
+
+#include "include/stringify.h"
+#include "common/RWLock.h"
+
#include "rgw_coroutine.h"
#include "rgw_http_client.h"
+#include "rgw_metadata.h"
#include "rgw_meta_sync_status.h"
+#include "rgw_rados.h"
#include "rgw_sync_trace.h"
-#include "include/stringify.h"
-#include "common/RWLock.h"
-
-#include <atomic>
#define ERROR_LOGGER_SHARDS 32
#define RGW_SYNC_ERROR_LOG_SHARD_PREFIX "sync.error-log"
timestamp = le.timestamp.to_real_time();
try {
bufferlist::iterator iter = le.data.begin();
- ::decode(log_data, iter);
+ decode(log_data, iter);
} catch (buffer::error& err) {
return false;
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(source_zone, bl);
- ::encode(error_code, bl);
- ::encode(message, bl);
+ encode(source_zone, bl);
+ encode(error_code, bl);
+ encode(message, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(source_zone, bl);
- ::decode(error_code, bl);
- ::decode(message, bl);
+ decode(source_zone, bl);
+ decode(error_code, bl);
+ decode(message, bl);
DECODE_FINISH(bl);
}
void TrimCounters::BucketCounter::encode(bufferlist& bl) const
{
+ using ceph::encode;
// no versioning to save space
- ::encode(bucket, bl);
- ::encode(count, bl);
+ encode(bucket, bl);
+ encode(count, bl);
}
void TrimCounters::BucketCounter::decode(bufferlist::iterator& p)
{
- ::decode(bucket, p);
- ::decode(count, p);
+ using ceph::decode;
+ decode(bucket, p);
+ decode(count, p);
}
WRITE_CLASS_ENCODER(TrimCounters::BucketCounter);
void TrimCounters::Request::encode(bufferlist& bl) const
{
ENCODE_START(1, 1, bl);
- ::encode(max_buckets, bl);
+ encode(max_buckets, bl);
ENCODE_FINISH(bl);
}
void TrimCounters::Request::decode(bufferlist::iterator& p)
{
DECODE_START(1, p);
- ::decode(max_buckets, p);
+ decode(max_buckets, p);
DECODE_FINISH(p);
}
WRITE_CLASS_ENCODER(TrimCounters::Request);
void TrimCounters::Response::encode(bufferlist& bl) const
{
ENCODE_START(1, 1, bl);
- ::encode(bucket_counters, bl);
+ encode(bucket_counters, bl);
ENCODE_FINISH(bl);
}
void TrimCounters::Response::decode(bufferlist::iterator& p)
{
DECODE_START(1, p);
- ::decode(bucket_counters, p);
+ decode(bucket_counters, p);
DECODE_FINISH(p);
}
WRITE_CLASS_ENCODER(TrimCounters::Response);
bufferlist& output)
{
Request request;
- ::decode(request, input);
+ decode(request, input);
auto count = std::min<uint16_t>(request.max_buckets, 128);
Response response;
server->get_bucket_counters(count, response.bucket_counters);
- ::encode(response, output);
+ encode(response, output);
}
/// api to notify peer gateways that trim has completed and their bucket change
bufferlist& output)
{
Request request;
- ::decode(request, input);
+ decode(request, input);
server->reset_bucket_counters();
Response response;
- ::encode(response, output);
+ encode(response, output);
}
try {
auto p = bl.begin();
TrimNotifyType type;
- ::decode(type, p);
+ decode(type, p);
auto handler = handlers.find(type);
if (handler != handlers.end()) {
auto p = bl.begin();
std::map<std::pair<uint64_t, uint64_t>, bufferlist> replies;
std::set<std::pair<uint64_t, uint64_t>> timeouts;
- ::decode(replies, p);
- ::decode(timeouts, p);
+ decode(replies, p);
+ decode(timeouts, p);
for (auto& peer : replies) {
auto q = peer.second.begin();
TrimCounters::Response response;
- ::decode(response, q);
+ decode(response, q);
for (const auto& b : response.bucket_counters) {
counter.insert(b.bucket, b.count);
}
const TrimNotifyType type = NotifyTrimCounters;
TrimCounters::Request request{32};
bufferlist bl;
- ::encode(type, bl);
- ::encode(request, bl);
+ encode(type, bl);
+ encode(request, bl);
call(new RGWRadosNotifyCR(store, obj, bl, config.notify_timeout_ms,
¬ify_replies));
}
const TrimNotifyType type = NotifyTrimComplete;
TrimComplete::Request request;
bufferlist bl;
- ::encode(type, bl);
- ::encode(request, bl);
+ encode(type, bl);
+ encode(request, bl);
call(new RGWRadosNotifyCR(store, obj, bl, config.notify_timeout_ms,
nullptr));
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(marker, bl);
+ encode(marker, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& p) {
DECODE_START(1, p);
- ::decode(marker, p);
+ decode(marker, p);
DECODE_FINISH(p);
}
if (name == "acl") {
try {
auto i = val.begin();
- ::decode(policy, i);
+ decode(policy, i);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode acl for " << bucket_info.bucket << "/" << key << dendl;
}
}
} else if (name == "x-amz-tagging") {
auto tags_bl = val.begin();
- ::decode(obj_tags, tags_bl);
+ decode(obj_tags, tags_bl);
} else {
if (name != "pg_ver" &&
name != "source_zone" &&
void encode(bufferlist& bl) const {
ENCODE_START(1,1,bl);
- ::encode(tag_map, bl);
+ encode(tag_map, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
- ::decode(tag_map,bl);
+ decode(tag_map,bl);
DECODE_FINISH(bl);
}
uint32_t ver = version();
string typestr{from_type(type)};
ENCODE_START(1, 1, bl);
- ::encode(type_name, bl);
- ::encode(ver, bl);
- ::encode(typestr, bl);
- ::encode(id, bl);
- ::encode(key, bl);
+ encode(type_name, bl);
+ encode(ver, bl);
+ encode(typestr, bl);
+ encode(id, bl);
+ encode(key, bl);
ENCODE_FINISH(bl);
}
string typestr;
uint32_t version;
DECODE_START(1, bl);
- ::decode(name, bl);
- ::decode(version, bl);
- ::decode(typestr, bl);
+ decode(name, bl);
+ decode(version, bl);
+ decode(typestr, bl);
type = to_type(typestr);
- ::decode(id, bl);
- ::decode(key, bl);
+ decode(id, bl);
+ decode(key, bl);
DECODE_FINISH(bl);
}
ui.user_id = info.user_id;
bufferlist link_bl;
- ::encode(ui, link_bl);
+ encode(ui, link_bl);
bufferlist data_bl;
- ::encode(ui, data_bl);
- ::encode(info, data_bl);
+ encode(ui, data_bl);
+ encode(info, data_bl);
string key;
info.user_id.to_str(key);
bufferlist::iterator iter = bl.begin();
try {
- ::decode(uid, iter);
+ decode(uid, iter);
int ret = rgw_get_user_info_by_uid(store, uid.user_id, e.info, &e.objv_tracker, NULL, &cache_info);
if (ret < 0) {
return ret;
bufferlist::iterator iter = bl.begin();
try {
- ::decode(user_id, iter);
+ decode(user_id, iter);
if (user_id.user_id.compare(uid) != 0) {
lderr(store->ctx()) << "ERROR: rgw_get_user_info_by_uid(): user id mismatch: " << user_id.user_id << " != " << uid << dendl;
return -EIO;
}
if (!iter.end()) {
- ::decode(info, iter);
+ decode(info, iter);
}
} catch (buffer::error& err) {
ldout(store->ctx(), 0) << "ERROR: failed to decode user info, caught buffer::error" << dendl;
void encode(bufferlist& bl) const {
string s;
user_id.to_str(s);
- ::encode(s, bl);
+ using ceph::encode;
+ encode(s, bl);
}
void decode(bufferlist::iterator& bl) {
string s;
- ::decode(s, bl);
+ using ceph::decode;
+ decode(s, bl);
user_id.from_str(s);
}
};
#include <list>
#include <string>
+#include "common/ceph_json.h"
+
#include "rgw_xml.h"
struct RGWRedirectInfo
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(protocol, bl);
- ::encode(hostname, bl);
- ::encode(http_redirect_code, bl);
+ encode(protocol, bl);
+ encode(hostname, bl);
+ encode(http_redirect_code, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(protocol, bl);
- ::decode(hostname, bl);
- ::decode(http_redirect_code, bl);
+ decode(protocol, bl);
+ decode(hostname, bl);
+ decode(http_redirect_code, bl);
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(redirect, bl);
- ::encode(replace_key_prefix_with, bl);
- ::encode(replace_key_with, bl);
+ encode(redirect, bl);
+ encode(replace_key_prefix_with, bl);
+ encode(replace_key_with, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(redirect, bl);
- ::decode(replace_key_prefix_with, bl);
- ::decode(replace_key_with, bl);
+ decode(redirect, bl);
+ decode(replace_key_prefix_with, bl);
+ decode(replace_key_with, bl);
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(key_prefix_equals, bl);
- ::encode(http_error_code_returned_equals, bl);
+ encode(key_prefix_equals, bl);
+ encode(http_error_code_returned_equals, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(key_prefix_equals, bl);
- ::decode(http_error_code_returned_equals, bl);
+ decode(key_prefix_equals, bl);
+ decode(http_error_code_returned_equals, bl);
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(condition, bl);
- ::encode(redirect_info, bl);
+ encode(condition, bl);
+ encode(redirect_info, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(condition, bl);
- ::decode(redirect_info, bl);
+ decode(condition, bl);
+ decode(redirect_info, bl);
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(rules, bl);
+ encode(rules, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(rules, bl);
+ decode(rules, bl);
DECODE_FINISH(bl);
}
void encode(bufferlist& bl) const {
ENCODE_START(2, 1, bl);
- ::encode(index_doc_suffix, bl);
- ::encode(error_doc, bl);
- ::encode(routing_rules, bl);
- ::encode(redirect_all, bl);
- ::encode(subdir_marker, bl);
- ::encode(listing_css_doc, bl);
- ::encode(listing_enabled, bl);
+ encode(index_doc_suffix, bl);
+ encode(error_doc, bl);
+ encode(routing_rules, bl);
+ encode(redirect_all, bl);
+ encode(subdir_marker, bl);
+ encode(listing_css_doc, bl);
+ encode(listing_enabled, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(2, bl);
- ::decode(index_doc_suffix, bl);
- ::decode(error_doc, bl);
- ::decode(routing_rules, bl);
- ::decode(redirect_all, bl);
+ decode(index_doc_suffix, bl);
+ decode(error_doc, bl);
+ decode(routing_rules, bl);
+ decode(redirect_all, bl);
if (struct_v >= 2) {
- ::decode(subdir_marker, bl);
- ::decode(listing_css_doc, bl);
- ::decode(listing_enabled, bl);
+ decode(subdir_marker, bl);
+ decode(listing_css_doc, bl);
+ decode(listing_enabled, bl);
}
DECODE_FINISH(bl);
}