*header = rgw_bucket_dir_header();
return 0;
}
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
decode(*header, iter);
} catch (buffer::error& err) {
int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
struct rgw_cls_list_op op;
try {
}
bufferlist& entrybl = kiter->second;
- bufferlist::iterator eiter = entrybl.begin();
+ auto eiter = entrybl.cbegin();
try {
decode(entry, eiter);
} catch (buffer::error& err) {
}
struct rgw_bucket_dir_entry entry;
- bufferlist::iterator eiter = kiter->second.begin();
+ auto eiter = kiter->second.cbegin();
try {
decode(entry, eiter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_bucket_update_stats_op op;
- auto iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
int rgw_bucket_init_index(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator iter;
-
bufferlist header_bl;
int rc = cls_cxx_map_read_header(hctx, &header_bl);
if (rc < 0) {
{
// decode request
rgw_cls_tag_timeout_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_obj_prepare_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
return rc;
}
- bufferlist::iterator cur_iter = current_entry.begin();
+ auto cur_iter = current_entry.cbegin();
try {
decode(*entry, cur_iter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_obj_complete_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
map<string, bufferlist>::reverse_iterator last = keys.rbegin();
try {
- bufferlist::iterator iter = last->second.begin();
+ auto iter = last->second.cbegin();
decode(next_entry, iter);
} catch (buffer::error& err) {
CLS_LOG(0, "ERROR; failed to decode entry: %s", last->first.c_str());
// decode request
rgw_cls_link_olh_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
// decode request
rgw_cls_unlink_instance_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_read_olh_log_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_trim_olh_log_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_bucket_clear_olh_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
std::chrono::seconds(
header.tag_timeout ? header.tag_timeout : CEPH_RGW_TAG_TIMEOUT));
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
while (!in_iter.end()) {
__u8 op;
return -EINVAL;
if (cur_disk_bl.length()) {
- bufferlist::iterator cur_disk_iter = cur_disk_bl.begin();
+ auto cur_disk_iter = cur_disk_bl.cbegin();
try {
decode(cur_disk, cur_disk_iter);
} catch (buffer::error& error) {
{
// decode request
rgw_cls_obj_remove_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_obj_store_pg_ver_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_obj_check_attrs_prefix op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_obj_check_mtime op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_bi_get_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
{
// decode request
rgw_cls_bi_put_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
entry.idx = iter->first;
entry.data = iter->second;
- bufferlist::iterator biter = entry.data.begin();
+ auto biter = entry.data.cbegin();
rgw_bucket_dir_entry e;
try {
CLS_LOG(20, "%s(): entry.idx=%s", __func__, escape_str(entry.idx).c_str());
- bufferlist::iterator biter = entry.data.begin();
+ auto biter = entry.data.cbegin();
rgw_bucket_dir_entry e;
try {
CLS_LOG(20, "%s(): entry.idx=%s", __func__, escape_str(entry.idx).c_str());
- bufferlist::iterator biter = entry.data.begin();
+ auto biter = entry.data.cbegin();
rgw_bucket_olh_entry e;
try {
{
// decode request
rgw_cls_bi_list_op op;
- bufferlist::iterator iter = in->begin();
+ auto iter = in->cbegin();
try {
decode(op, iter);
} catch (buffer::error& err) {
int bi_log_record_decode(bufferlist& bl, rgw_bi_log_entry& e)
{
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
decode(e, iter);
} catch (buffer::error& err) {
static int rgw_bi_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_bi_log_list_op op;
try {
static int rgw_bi_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_bi_log_trim_op op;
try {
static int usage_record_decode(bufferlist& record_bl, rgw_usage_log_entry& e)
{
- bufferlist::iterator kiter = record_bl.begin();
+ auto kiter = record_bl.cbegin();
try {
decode(e, kiter);
} catch (buffer::error& err) {
{
CLS_LOG(10, "rgw_user_usage_log_add()");
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
rgw_cls_usage_log_add_op op;
try {
{
CLS_LOG(10, "rgw_user_usage_log_read()");
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
rgw_cls_usage_log_read_op op;
try {
if (ret < 0)
return ret;
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
rgw_cls_usage_log_trim_op op;
try {
return ret;
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(*info, iter);
} catch (buffer::error& err) {
CLS_LOG(0, "ERROR: rgw_cls_gc_omap_get(): failed to decode index=%s\n", index.c_str());
int gc_record_decode(bufferlist& bl, cls_rgw_gc_obj_info& e)
{
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
decode(e, iter);
} catch (buffer::error& err) {
static int rgw_cls_gc_set_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_gc_set_entry_op op;
try {
static int rgw_cls_gc_defer_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_gc_defer_entry_op op;
try {
static int rgw_cls_gc_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_gc_list_op op;
try {
static int rgw_cls_gc_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_gc_remove_op op;
try {
static int rgw_cls_lc_set_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_lc_set_entry_op op;
try {
static int rgw_cls_lc_rm_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_lc_rm_entry_op op;
try {
static int rgw_cls_lc_get_next_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_lc_get_next_entry_ret op_ret;
cls_rgw_lc_get_next_entry_op op;
try {
static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
cls_rgw_lc_list_entries_op op;
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
try {
decode(op, in_iter);
} catch (buffer::error& err) {
}
cls_rgw_lc_list_entries_ret op_ret;
- bufferlist::iterator iter;
+ bufferlist::const_iterator iter;
map<string, bufferlist> vals;
string filter_prefix;
int ret = cls_cxx_map_get_vals(hctx, op.marker, filter_prefix, op.max_entries, &vals, &op_ret.is_truncated);
map<string, bufferlist>::iterator it;
pair<string, int> entry;
for (it = vals.begin(); it != vals.end(); ++it) {
- iter = it->second.begin();
+ iter = it->second.cbegin();
try {
decode(entry, iter);
} catch (buffer::error& err) {
static int rgw_cls_lc_put_head(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_lc_put_head_op op;
try {
return ret;
cls_rgw_lc_obj_head head;
if (bl.length() != 0) {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
decode(head, iter);
} catch (buffer::error& err) {
static int rgw_reshard_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_reshard_add_op op;
try {
static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
cls_rgw_reshard_list_op op;
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
try {
decode(op, in_iter);
} catch (buffer::error& err) {
return -EINVAL;
}
cls_rgw_reshard_list_ret op_ret;
- bufferlist::iterator iter;
+ bufferlist::const_iterator iter;
map<string, bufferlist> vals;
string filter_prefix;
#define MAX_RESHARD_LIST_ENTRIES 1000
cls_rgw_reshard_entry entry;
int i = 0;
for (it = vals.begin(); i < (int)op.max && it != vals.end(); ++it, ++i) {
- iter = it->second.begin();
+ iter = it->second.cbegin();
try {
decode(entry, iter);
} catch (buffer::error& err) {
int ret = cls_cxx_map_get_val(hctx, key, &bl);
if (ret < 0)
return ret;
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
decode(*entry, iter);
} catch (buffer::error& err) {
static int rgw_reshard_get(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_reshard_get_op op;
try {
static int rgw_reshard_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
{
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
cls_rgw_reshard_remove_op op;
try {
{
cls_rgw_set_bucket_resharding_op op;
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
try {
decode(op, in_iter);
} catch (buffer::error& err) {
{
cls_rgw_set_bucket_resharding_op op;
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
try {
decode(op, in_iter);
} catch (buffer::error& err) {
{
cls_rgw_guard_bucket_resharding_op op;
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
try {
decode(op, in_iter);
} catch (buffer::error& err) {
{
cls_rgw_get_bucket_resharding_op op;
- bufferlist::iterator in_iter = in->begin();
+ auto in_iter = in->cbegin();
try {
decode(op, in_iter);
} catch (buffer::error& err) {
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
try {
- bufferlist::iterator iter = outbl.begin();
+ auto iter = outbl.cbegin();
decode((*data), iter);
} catch (buffer::error& err) {
r = -EIO;
return r;
struct rgw_cls_bi_get_ret op_ret;
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
try {
decode(op_ret, iter);
} catch (buffer::error& err) {
return r;
struct rgw_cls_bi_list_ret op_ret;
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
try {
decode(op_ret, iter);
} catch (buffer::error& err) {
struct rgw_cls_read_olh_log_ret ret;
try {
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
decode(ret, iter);
} catch (buffer::error& err) {
return -EIO;
void handle_completion(int r, bufferlist& outbl) override {
struct rgw_cls_list_ret ret;
try {
- bufferlist::iterator iter = outbl.begin();
+ auto iter = outbl.cbegin();
decode(ret, iter);
} catch (buffer::error& err) {
r = -EIO;
try {
rgw_cls_usage_log_read_ret result;
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
decode(result, iter);
read_iter = result.next_iter;
if (is_truncated)
cls_rgw_gc_list_ret ret;
try {
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
decode(ret, iter);
} catch (buffer::error& err) {
return -EIO;
cls_rgw_lc_get_head_ret ret;
try {
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
decode(ret, iter);
} catch (buffer::error& err) {
return -EIO;
cls_rgw_lc_get_next_entry_ret ret;
try {
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
decode(ret, iter);
} catch (buffer::error& err) {
return -EIO;
cls_rgw_lc_list_entries_ret ret;
try {
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
decode(ret, iter);
} catch (buffer::error& err) {
return -EIO;
return r;
struct cls_rgw_reshard_list_ret op_ret;
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
try {
decode(op_ret, iter);
} catch (buffer::error& err) {
return r;
struct cls_rgw_reshard_get_ret op_ret;
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
try {
decode(op_ret, iter);
} catch (buffer::error& err) {
return r;
struct cls_rgw_get_bucket_resharding_ret op_ret;
- bufferlist::iterator iter = out.begin();
+ auto iter = out.cbegin();
try {
decode(op_ret, iter);
} catch (buffer::error& err) {
encode(tag_timeout, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(1, bl);
decode(tag_timeout, bl);
DECODE_FINISH(bl);
encode(zones_trace, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(7, 3, 3, bl);
uint8_t c;
decode(c, bl);
encode(zones_trace, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(9, 3, 3, bl);
uint8_t c;
decode(c, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(5, bl);
decode(key, bl);
decode(olh_tag, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(3, bl);
decode(key, bl);
decode(op_tag, bl);
encode(olh_tag, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(1, bl);
decode(olh, bl);
decode(ver_marker, bl);
encode(is_truncated, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(1, bl);
decode(log, bl);
decode(is_truncated, bl);
encode(olh_tag, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(1, bl);
decode(olh, bl);
decode(ver, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(key, bl);
decode(olh_tag, bl);
encode(list_versions, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 2, 2, bl);
if (struct_v < 4) {
decode(start_obj.name, bl);
encode(is_truncated, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
decode(dir, bl);
decode(is_truncated, bl);
encode(calculated_header, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(1, bl);
decode(existing_header, bl);
decode(calculated_header, bl);
encode(stats, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(1, bl);
decode(absolute, bl);
decode(stats, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(keep_attr_prefixes, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(attr, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(check_prefix, bl);
decode(fail_if_exist, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(mtime, bl);
uint8_t c;
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(info, bl);
if (struct_v >= 2) {
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(key, bl);
uint8_t c;
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entry, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entry, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(max, bl);
decode(name, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entries, bl);
decode(is_truncated, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(start_epoch, bl);
decode(end_epoch, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(usage, bl);
decode(truncated, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(start_epoch, bl);
decode(end_epoch, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(expiration_secs, bl);
decode(info, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(expiration_secs, bl);
decode(tag, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(marker, bl);
decode(max, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(entries, bl);
if (struct_v >= 2)
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(tags, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(marker, bl);
decode(max, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(start_marker, bl);
decode(end_marker, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entries, bl);
decode(truncated, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(marker, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entry, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entry, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entry, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(head, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(head, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(marker, bl);
decode(max_entries, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(entries, bl);
if (struct_v >= 2) {
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entry, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(max, bl);
decode(marker, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entries, bl);
decode(is_truncated, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entry, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entry, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(tenant, bl);
decode(bucket_name, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entry, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
DECODE_FINISH(bl);
}
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(ret_err, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
DECODE_FINISH(bl);
}
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(new_instance, bl);
DECODE_FINISH(bl);
static void dump_bi_entry(bufferlist bl, BIIndexType index_type, Formatter *formatter)
{
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
switch (index_type) {
case PlainIdx:
case InstanceIdx:
bool rgw_cls_bi_entry::get_info(cls_rgw_obj_key *key, uint8_t *category, rgw_bucket_category_stats *accounted_stats)
{
bool account = false;
- bufferlist::iterator iter = data.begin();
+ auto iter = data.cbegin();
using ceph::decode;
switch (type) {
case PlainIdx:
encode(op, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
uint8_t s;
decode(s, bl);
encode(user_data, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
decode(category, bl);
decode(size, bl);
}
template<class T>
-void decode_packed_val(T& val, bufferlist::iterator& bl)
+void decode_packed_val(T& val, bufferlist::const_iterator& bl)
{
using ceph::decode;
unsigned char c;
encode_packed_val(epoch, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(1, bl);
decode_packed_val(pool, bl);
decode_packed_val(epoch, bl);
encode(instance, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(1, bl);
decode(name, bl);
decode(instance, bl);
encode(versioned_epoch, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(8, 3, 3, bl);
decode(key.name, bl);
decode(ver.epoch, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
uint8_t c;
decode(c, bl);
encode(delete_marker, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(1, bl);
decode(epoch, bl);
uint8_t c;
encode(pending_removal, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(1, bl);
decode(key, bl);
decode(delete_marker, bl);
encode(zones_trace, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START(4, bl);
decode(id, bl);
decode(object, bl);
encode(actual_size, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
decode(total_size, bl);
decode(total_size_rounded, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
uint8_t s;
decode(s, bl);
encode(syncstopped,bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(6, 2, 2, bl);
decode(stats, bl);
if (struct_v > 2) {
encode(m, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
decode(header, bl);
decode(m, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(bytes_sent, bl);
decode(bytes_received, bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(3, bl);
string s;
decode(s, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entries, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(user, bl);
decode(bucket, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(pool, bl);
decode(key.name, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(objs, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(tag, bl);
decode(chain, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
uint64_t t;
decode(t, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(time, bl);
decode(tenant, bl);
encode(flags, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
decode(flags, bl);
DECODE_FINISH(bl);
encode(type, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
decode(type, bl);
DECODE_FINISH(bl);
encode(url_spec, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
decode(type, bl);
string s;
encode(perm, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
decode(url_spec, bl);
decode(perm, bl);
encode(referer_list, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(4, 3, 3, bl);
bool maps_initialized;
decode(maps_initialized, bl);
encode(display_name, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
string s;
decode(s, bl);
encode(acl, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
decode(owner, bl);
decode(acl, 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
+ void decode_owner(bufferlist::const_iterator& bl) { // sometimes we only need that, should be faster
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
decode(owner, bl);
DECODE_FINISH(bl);
void dump_bi_entry(bufferlist& bl, BIIndexType index_type, Formatter *formatter)
{
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
switch (index_type) {
case PlainIdx:
case InstanceIdx:
{
T t;
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
decode(t, iter);
try {
bufferlist& bl = iter->second;
- bufferlist::iterator biter = bl.begin();
+ auto biter = bl.cbegin();
decode(manifest, biter);
} catch (buffer::error& err) {
ldout(store->ctx(), 0) << "ERROR: failed to decode manifest" << dendl;
for (auto& cls_entry : entries) {
rgw_sync_error_info log_entry;
- auto iter = cls_entry.data.begin();
+ auto iter = cls_entry.data.cbegin();
try {
decode(log_entry, iter);
} catch (buffer::error& err) {
encode(id, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(tenant, bl);
decode(id, bl);
RGWAccessControlPolicy policy;
ACLOwner owner;
try {
- bufferlist::iterator iter = aclbl.begin();
+ auto iter = aclbl.cbegin();
decode(policy, iter);
owner = policy.get_owner();
} catch (buffer::error& err) {
int RGWBucket::policy_bl_to_stream(bufferlist& bl, ostream& o)
{
RGWAccessControlPolicy_S3 policy(g_ceph_context);
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
policy.decode(iter);
} catch (buffer::error& err) {
static int policy_decode(RGWRados *store, bufferlist& bl, RGWAccessControlPolicy& policy)
{
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
policy.decode(iter);
} catch (buffer::error& err) {
log_entry.log_id = iter->id;
real_time rt = iter->timestamp.to_real_time();
log_entry.log_timestamp = rt;
- bufferlist::iterator liter = iter->data.begin();
+ auto liter = iter->data.cbegin();
try {
decode(log_entry.entry, liter);
} catch (buffer::error& err) {
using ceph::encode;
encode(buckets, bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
using ceph::decode;
decode(buckets, bl);
}
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
uint8_t t;
decode(t, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(log_id, bl);
decode(log_timestamp, bl);
encode(mtime, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
decode(size, bl);
decode(mtime, bl);
encode(version, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
decode(status, bl);
decode(flags, bl);
encode(ns, obl);
ENCODE_FINISH(obl);
}
- void decode(bufferlist::iterator& ibl) {
+ void decode(bufferlist::const_iterator& ibl) {
DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, ibl);
decode(op, ibl);
decode(obj, ibl);
RGWCacheNotifyInfo info;
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(info, iter);
} catch (buffer::end_of_buffer& err) {
mydout(0) << "ERROR: got bad notification" << dendl;
return esc_name + ":" + esc_ns;
}
-void rgw_raw_obj::decode_from_rgw_obj(bufferlist::iterator& bl)
+void rgw_raw_obj::decode_from_rgw_obj(bufferlist::const_iterator& bl)
{
using ceph::decode;
rgw_obj old_obj;
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl);
decode(id, bl);
decode(key, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl);
decode(name, bl);
decode(perm_mask, bl);
encode(caps, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(caps, bl);
DECODE_FINISH(bl);
encode(mfa_ids, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN_32(20, 9, 9, bl);
if (struct_v >= 2) decode(auid, bl);
else auid = CEPH_AUTH_UID_DEFAULT;
ENCODE_FINISH(bl);
}
- void decode_from_bucket(bufferlist::iterator& bl);
+ void decode_from_bucket(bufferlist::const_iterator& bl);
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(10, 3, 3, bl);
decode(name, bl);
ENCODE_FINISH(bl);
}
- void decode_from_rgw_obj(bufferlist::iterator& bl);
+ void decode_from_rgw_obj(bufferlist::const_iterator& bl);
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
unsigned ofs = bl.get_off();
DECODE_START(6, bl);
if (struct_v < 6) {
}
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(10, 3, 3, bl);
decode(name, bl);
if (struct_v < 10) {
encode(new_bucket_instance_id, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN_32(19, 4, 4, bl);
decode(bucket, bl);
if (struct_v >= 2) {
encode(creation_time, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
- bufferlist::iterator orig_iter = bl;
+ void decode(bufferlist::const_iterator& bl) {
+ auto orig_iter = bl;
DECODE_START_LEGACY_COMPAT_LEN_32(10, 4, 4, bl);
if (struct_v < 8) {
/* ouch, old entry, contains the bucket info itself */
encode(ns, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(name, bl);
decode(instance, bl);
encode(placement_rule, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(6, 5, 5, bl);
__u32 mt;
uint64_t s;
// encode(placement_id, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(6, 3, 3, bl);
if (struct_v < 6) {
string s;
encode(exposable_hdrs, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(max_age, bl);
decode(allowed_methods, bl);
encode(rules, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(rules, bl);
DECODE_FINISH(bl);
/* decode policy */
map<string, bufferlist>::iterator iter = state->attrset.find(RGW_ATTR_ACL);
if (iter != state->attrset.end()) {
- bufferlist::iterator bliter = iter->second.begin();
+ auto bliter = iter->second.cbegin();
try {
policy.decode(bliter);
} catch (buffer::error& err) {
return ret;
}
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
if (iter.end()) {
// allow successful reads with empty buffers. ReadSyncStatus coroutines
// depend on this to be able to read without locking, because the
parts_len.clear();
RGWObjManifest manifest;
if (manifest_bl.length()) {
- bufferlist::iterator miter = manifest_bl.begin();
+ auto miter = manifest_bl.cbegin();
try {
decode(manifest, miter);
} catch (buffer::error& err) {
return;
}
- bufferlist::iterator biter = iter->second.begin();
+ auto biter = iter->second.cbegin();
try {
decode(*val, biter);
} catch (buffer::error& err) {
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(state, bl);
decode(num_shards, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(state, bl);
decode(marker, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(sync_info, bl);
/* sync markers are decoded separately */
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(position, bl);
decode(count, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(position, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(state, bl);
decode(full_marker, bl);
using ceph::decode;
DecodeAttrsResult dar { false, false };
fh_key fhk;
- auto bl_iter_key1 = const_cast<buffer::list*>(ux_key1)->begin();
+ auto bl_iter_key1 = ux_key1->cbegin();
decode(fhk, bl_iter_key1);
if (fhk.version >= 2) {
assert(this->fh.fh_hk == fhk.fh_hk);
get<0>(dar) = true;
}
- auto bl_iter_unix1 = const_cast<buffer::list*>(ux_attrs1)->begin();
+ auto bl_iter_unix1 = ux_attrs1->cbegin();
decode(*this, bl_iter_unix1);
if (this->state.version < 2) {
get<1>(dar) = true;
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(fh_hk.bucket, bl);
decode(fh_hk.object, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
uint32_t fh_type;
decode(fh_type, bl);
if (aiter == bucket_attrs.end())
return 0;
- bufferlist::iterator iter(&aiter->second);
+ bufferlist::const_iterator iter{&aiter->second};
try {
config.decode(iter);
} catch (const buffer::error& e) {
}
RGWObjTags dest_obj_tags;
try {
- auto iter = tags_bl.begin();
+ auto iter = tags_bl.cbegin();
dest_obj_tags.decode(iter);
} catch (buffer::error& err) {
ldout(cct,0) << "ERROR: caught buffer::error, couldn't decode TagSet" << dendl;
encode(date, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
decode(days, bl);
if (struct_v >= 3) {
encode(obj_tags, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(prefix, bl);
if (struct_v >= 2) {
encode(filter, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 1, 1, bl);
decode(id, bl);
decode(prefix, bl);
encode(rule_map, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
decode(rule_map, bl);
multimap<string, LCRule>::iterator iter;
encode(x_headers, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &p) {
+ void decode(bufferlist::const_iterator &p) {
DECODE_START_LEGACY_COMPAT_LEN(8, 5, 5, p);
decode(object_owner.id, p);
if (struct_v > 3)
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(state, bl);
decode(num_shards, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(state, bl);
decode(marker, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(sync_info, bl);
decode(sync_markers, bl);
ENCODE_FINISH(bl);
}
-void RGWMetadataLogData::decode(bufferlist::iterator& bl) {
+void RGWMetadataLogData::decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(read_version, bl);
decode(write_version, bl);
return -ENOENT;
}
try {
- auto p = bl.begin();
+ auto p = bl.cbegin();
state->decode(p);
} catch (buffer::error& e) {
ldout(store->ctx(), 1) << "failed to decode the mdlog history: "
try {
RGWMetadataLogData log_data;
- bufferlist::iterator iter = entry.data.begin();
+ auto iter = entry.data.cbegin();
decode(log_data, iter);
encode_json("data", log_data, f);
RGWMetadataLogData() : status(MDLOG_STATUS_UNKNOWN) {}
void encode(bufferlist& bl) const;
- void decode(bufferlist::iterator& bl);
+ void decode(bufferlist::const_iterator& bl);
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
};
encode(oldest_period_id, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& p) {
+ void decode(bufferlist::const_iterator& p) {
DECODE_START(1, p);
decode(oldest_realm_epoch, p);
decode(oldest_period_id, p);
for (i = 0, iter = parts_map.begin(); (i < num_parts || !sorted_omap) && iter != parts_map.end(); ++iter, ++i) {
bufferlist& bl = iter->second;
- bufferlist::iterator bli = bl.begin();
+ auto bli = bl.cbegin();
RGWUploadPartInfo info;
try {
decode(info, bli);
bufferlist& bl,
RGWAccessControlPolicy *policy)
{
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
policy->decode(iter);
} catch (buffer::error& err) {
static int rgw_iam_add_tags_from_bl(struct req_state* s, bufferlist& bl){
RGWObjTags tagset;
try {
- auto bliter = bl.begin();
+ auto bliter = bl.cbegin();
tagset.decode(bliter);
} catch (buffer::error& err) {
ldout(s->cct,0) << "ERROR: caught buffer::error, couldn't decode TagSet" << dendl;
bl = aiter->second;
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
bucket_cors.decode(iter);
} catch (buffer::error& err) {
int RGWGetObj::handle_slo_manifest(bufferlist& bl)
{
RGWSLOInfo slo_info;
- bufferlist::iterator bliter = bl.begin();
+ auto bliter = bl.cbegin();
try {
decode(slo_info, bliter);
} catch (buffer::error& err) {
int RGWDeleteObj::handle_slo_manifest(bufferlist& bl)
{
RGWSLOInfo slo_info;
- bufferlist::iterator bliter = bl.begin();
+ auto bliter = bl.cbegin();
try {
decode(slo_info, bliter);
} catch (buffer::error& err) {
string name = iter->first;
if (name.compare(RGW_ATTR_ACL) == 0) {
bufferlist& bl = iter->second;
- bufferlist::iterator bli = bl.begin();
+ auto bli = bl.cbegin();
try {
decode(*policy, bli);
} catch (buffer::error& err) {
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(path, bl);
decode(etag, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(entries, bl);
decode(total_size, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
int s;
decode(s, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(job_name, bl);
string s;
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(info, bl);
decode(stage, bl);
RGWPeriodPusher::~RGWPeriodPusher() = default;
void RGWPeriodPusher::handle_notify(RGWRealmNotify type,
- bufferlist::iterator& p)
+ bufferlist::const_iterator& p)
{
// decode the period
RGWZonesNeedPeriod info;
~RGWPeriodPusher() override;
/// respond to realm notifications by pushing new periods to other zones
- void handle_notify(RGWRealmNotify type, bufferlist::iterator& p) override;
+ void handle_notify(RGWRealmNotify type, bufferlist::const_iterator& p) override;
/// avoid accessing RGWRados while dynamic reconfiguration is in progress.
/// notifications will be enqueued until resume()
encode(check_on_raw, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(3, 1, 1, bl);
int64_t max_size_kb;
decode(max_size_kb, bl);
return ret;
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(default_info, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "error decoding data from " << pool << ":" << oid << dendl;
RGWNameToId nameToId;
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(nameToId, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode obj from " << pool << ":" << oid << dendl;
using ceph::decode;
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(*this, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode obj from " << pool << ":" << oid << dendl;
}
using ceph::decode;
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(*this, iter);
} catch (buffer::error& err) {
return -EIO;
return ret;
}
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
using ceph::decode;
decode(info, iter);
} catch (buffer::error& err) {
try {
using ceph::decode;
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(*this, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode obj from " << pool << ":" << get_period_oid() << dendl;
ENCODE_FINISH(bl);
}
-void RGWPeriodMap::decode(bufferlist::iterator& bl) {
+void RGWPeriodMap::decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(id, bl);
decode(zonegroups, bl);
ENCODE_FINISH(bl);
}
-void RGWRegionMap::decode(bufferlist::iterator& bl) {
+void RGWRegionMap::decode(bufferlist::const_iterator& bl) {
DECODE_START(3, bl);
decode(regions, bl);
decode(master_region, bl);
ENCODE_FINISH(bl);
}
-void RGWZoneGroupMap::decode(bufferlist::iterator& bl) {
+void RGWZoneGroupMap::decode(bufferlist::const_iterator& bl) {
DECODE_START(3, bl);
decode(zonegroups, bl);
decode(master_zonegroup, bl);
}
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(zonegroupmap, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "error decoding regionmap from " << pool << ":" << oid << dendl;
struct log_show_state {
librados::IoCtx io_ctx;
bufferlist bl;
- bufferlist::iterator p;
+ bufferlist::const_iterator p;
string name;
uint64_t pos;
bool eof;
state->bl.clear();
state->bl.claim(old);
state->bl.claim_append(more);
- state->p = state->bl.begin();
+ state->p = state->bl.cbegin();
if ((unsigned)r < chunk)
state->eof = true;
ldout(cct, 10) << " read " << r << dendl;
objexp_hint_entry& hint_entry) /* out */
{
try {
- bufferlist::iterator iter = ti_entry.value.begin();
+ auto iter = ti_entry.value.cbegin();
decode(hint_entry, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: couldn't decode avail_pools" << dendl;
int RGWRados::decode_policy(bufferlist& bl, ACLOwner *owner)
{
- bufferlist::iterator i = bl.begin();
+ auto i = bl.cbegin();
RGWAccessControlPolicy policy(cct);
try {
policy.decode_owner(i);
return -EIO;
bufferlist& bl = aiter->second;
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
policy->decode(iter);
} catch (buffer::error& err) {
}
try {
- bufferlist::iterator iter = map_bl.begin();
+ auto iter = map_bl.cbegin();
decode(m, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: couldn't decode avail_pools" << dendl;
uint64_t pg_ver = 0;
auto i = attrs.find(RGW_ATTR_PG_VER);
if (i != attrs.end() && i->second.length() > 0) {
- bufferlist::iterator iter = i->second.begin();
+ auto iter = i->second.cbegin();
try {
decode(pg_ver, iter);
} catch (buffer::error& err) {
if (state->get_attr(RGW_ATTR_DELETE_AT, bl)) {
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(delete_at, iter);
} catch (buffer::error& err) {
ldout(store->ctx(), 0) << "ERROR: couldn't decode RGW_ATTR_DELETE_AT" << dendl;
// use uncompressed size for accounted_size
try {
RGWCompressionInfo info;
- auto p = iter->second.begin();
+ auto p = iter->second.cbegin();
decode(info, p);
s->accounted_size = info.orig_size;
} catch (buffer::error&) {
bufferlist manifest_bl = s->attrset[RGW_ATTR_MANIFEST];
if (manifest_bl.length()) {
- bufferlist::iterator miter = manifest_bl.begin();
+ auto miter = manifest_bl.cbegin();
try {
decode(s->manifest, miter);
s->has_manifest = true;
if (aiter != s->attrset.end()) {
bufferlist& pg_ver_bl = aiter->second;
if (pg_ver_bl.length()) {
- bufferlist::iterator pgbl = pg_ver_bl.begin();
+ auto pgbl = pg_ver_bl.cbegin();
try {
decode(s->pg_ver, pgbl);
} catch (buffer::error& err) {
if (aiter != s->attrset.end()) {
bufferlist& zone_short_id_bl = aiter->second;
if (zone_short_id_bl.length()) {
- bufferlist::iterator zbl = zone_short_id_bl.begin();
+ auto zbl = zone_short_id_bl.cbegin();
try {
decode(s->zone_short_id, zbl);
} catch (buffer::error& err) {
map<string, bufferlist>::iterator iter = result.attrs.find(RGW_ATTR_MANIFEST);
if (iter != result.attrs.end()) {
bufferlist& bl = iter->second;
- bufferlist::iterator biter = bl.begin();
+ auto biter = bl.cbegin();
try {
decode(result.manifest, biter);
} catch (buffer::error& err) {
}
try {
- bufferlist::iterator biter = iter->second.begin();
+ auto biter = iter->second.cbegin();
decode(*olh, biter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode olh info" << dendl;
real_time now = real_clock::now();
while (iter != pending_entries.end()) {
- bufferlist::iterator biter = iter->second.begin();
+ auto biter = iter->second.cbegin();
RGWOLHPendingInfo pending_info;
try {
decode(pending_info, biter);
assert(iter != state->attrset.end());
RGWOLHInfo olh;
try {
- bufferlist::iterator biter = iter->second.begin();
+ auto biter = iter->second.cbegin();
decode(olh, biter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode olh info" << dendl;
return ret;
}
- bufferlist::iterator iter = epbl.begin();
+ auto iter = epbl.cbegin();
try {
decode(info, iter);
} catch (buffer::error& err) {
return ret;
}
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
decode(entry_point, iter);
} catch (buffer::error& err) {
if (r < 0) {
return r;
}
- bufferlist::iterator iter = bi_entry.data.begin();
+ auto iter = bi_entry.data.cbegin();
try {
decode(*dirent, iter);
} catch (buffer::error& err) {
int rgw_compression_info_from_attrset(map<string, bufferlist>& attrs, bool& need_decompress, RGWCompressionInfo& cs_info) {
map<string, bufferlist>::iterator value = attrs.find(RGW_ATTR_COMPRESSION);
if (value != attrs.end()) {
- bufferlist::iterator bliter = value->second.begin();
+ auto bliter = value->second.cbegin();
try {
decode(cs_info, bliter);
} catch (buffer::error& err) {
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(old_ofs, bl);
decode(new_ofs, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(compression_type, bl);
decode(orig_size, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(target, bl);
decode(removed, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(time, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl);
decode(loc, bl);
decode(loc_ofs, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(start_part_num, bl);
decode(start_ofs, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN_32(7, 2, 2, bl);
decode(obj_size, bl);
decode(objs, bl);
encode(accounted_size, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(4, 2, 2, bl);
decode(num, bl);
decode(size, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(default_id, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(obj_id, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- virtual void decode(bufferlist::iterator& bl) {
+ virtual void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(id, bl);
decode(name, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(6, bl);
string index_pool_str;
string data_pool_str;
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) override {
+ void decode(bufferlist::const_iterator& bl) override {
DECODE_START(12, bl);
decode(domain_root, bl);
decode(control_pool, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(7, bl);
decode(name, bl);
if (struct_v < 4) {
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(default_zonegroup, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(name, bl);
decode(tags, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) override {
+ void decode(bufferlist::const_iterator& bl) override {
DECODE_START(4, bl);
decode(name, bl);
decode(api_name, bl);
string master_zonegroup;
void encode(bufferlist& bl) const;
- void decode(bufferlist::iterator& bl);
+ void decode(bufferlist::const_iterator& bl);
int update(const RGWZoneGroup& zonegroup, CephContext *cct);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(bucket_quota, bl);
decode(user_quota, bl);
RGWQuotaInfo user_quota;
void encode(bufferlist& bl) const;
- void decode(bufferlist::iterator& bl);
+ void decode(bufferlist::const_iterator& bl);
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
int read(CephContext *cct, RGWRados *store);
void encode(bufferlist& bl) const;
- void decode(bufferlist::iterator& bl);
+ void decode(bufferlist::const_iterator& bl);
void dump(Formatter *f) const;
void decode_json(JSONObj *obj);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
// XXX Do we want DECODE_START_LEGACY_COMPAT_LEN(2, 1, 1, bl); ?
DECODE_START(2, bl);
decode(bucket_name, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) override {
+ void decode(bufferlist::const_iterator& bl) override {
DECODE_START(1, bl);
RGWSystemMetaObj::decode(bl);
decode(current_period, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(epoch, bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(id, bl);
decode(epoch, bl);
};
void RGWRealmReloader::handle_notify(RGWRealmNotify type,
- bufferlist::iterator& p)
+ bufferlist::const_iterator& p)
{
if (!store) {
/* we're in the middle of reload */
~RGWRealmReloader() override;
/// respond to realm notifications by scheduling a reload()
- void handle_notify(RGWRealmNotify type, bufferlist::iterator& p) override;
+ void handle_notify(RGWRealmNotify type, bufferlist::const_iterator& p) override;
private:
/// pause frontends and replace the RGWRados instance
pool_ctx.notify_ack(watch_oid, notify_id, cookie, reply);
try {
- auto p = bl.begin();
+ auto p = bl.cbegin();
while (!p.end()) {
RGWRealmNotify notify;
decode(notify, p);
virtual ~Watcher() = default;
virtual void handle_notify(RGWRealmNotify type,
- bufferlist::iterator& p) = 0;
+ bufferlist::const_iterator& p) = 0;
};
RGWRealmWatcher(CephContext* cct, RGWRealm& realm);
*result = def_val;
return 0;
}
- bufferlist::iterator bliter = bl.begin();
+ auto bliter = bl.cbegin();
try {
decode(*result, bliter);
} catch (buffer::error& err) {
} else if (iter->first.compare(RGW_ATTR_TAGS) == 0) {
RGWObjTags obj_tags;
try{
- bufferlist::iterator it = iter->second.begin();
+ auto it = iter->second.cbegin();
obj_tags.decode(it);
} catch (buffer::error &err) {
ldout(s->cct,0) << "Error caught buffer::error couldn't decode TagSet " << dendl;
s->formatter->open_object_section("TagSet");
if (has_tags){
RGWObjTagSet_S3 tagset;
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
tagset.decode(iter);
} catch (buffer::error& err) {
return;
}
- bufferlist::iterator iter(&aiter->second);
+ bufferlist::const_iterator iter{&aiter->second};
try {
config.decode(iter);
} catch (const buffer::error& e) {
RGWNameToId nameToId;
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
using ceph::decode;
decode(nameToId, iter);
} catch (buffer::error& err) {
try {
using ceph::decode;
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(*this, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode role info from pool: " << pool.name <<
RGWNameToId nameToId;
try {
using ceph::decode;
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(nameToId, iter);
} catch (buffer::error& err) {
ldout(cct, 0) << "ERROR: failed to decode role name from pool: " << pool.name << ": "
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(id, bl);
decode(name, bl);
std::string swift_user;
try {
- /*const*/ auto iter = tok_bl.begin();
+ auto iter = tok_bl.cbegin();
using ceph::decode;
decode(swift_user, iter);
name = le.name;
timestamp = le.timestamp.to_real_time();
try {
- bufferlist::iterator iter = le.data.begin();
+ auto iter = le.data.cbegin();
decode(log_data, iter);
} catch (buffer::error& err) {
return false;
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(source_zone, bl);
decode(error_code, bl);
struct TrimNotifyHandler {
virtual ~TrimNotifyHandler() = default;
- virtual void handle(bufferlist::iterator& input, bufferlist& output) = 0;
+ virtual void handle(bufferlist::const_iterator& input, bufferlist& output) = 0;
};
/// api to share the bucket trim counters between gateways in the same zone.
: bucket(bucket), count(count) {}
void encode(bufferlist& bl) const;
- void decode(bufferlist::iterator& p);
+ void decode(bufferlist::const_iterator& p);
};
using Vector = std::vector<BucketCounter>;
uint16_t max_buckets; //< maximum number of bucket counters to return
void encode(bufferlist& bl) const;
- void decode(bufferlist::iterator& p);
+ void decode(bufferlist::const_iterator& p);
};
/// return the current bucket trim counters
Vector bucket_counters;
void encode(bufferlist& bl) const;
- void decode(bufferlist::iterator& p);
+ void decode(bufferlist::const_iterator& p);
};
/// server interface to query the hottest buckets
public:
explicit Handler(Server *server) : server(server) {}
- void handle(bufferlist::iterator& input, bufferlist& output) override;
+ void handle(bufferlist::const_iterator& input, bufferlist& output) override;
};
};
std::ostream& operator<<(std::ostream& out, const TrimCounters::BucketCounter& rhs)
encode(bucket, bl);
encode(count, bl);
}
-void TrimCounters::BucketCounter::decode(bufferlist::iterator& p)
+void TrimCounters::BucketCounter::decode(bufferlist::const_iterator& p)
{
using ceph::decode;
decode(bucket, p);
encode(max_buckets, bl);
ENCODE_FINISH(bl);
}
-void TrimCounters::Request::decode(bufferlist::iterator& p)
+void TrimCounters::Request::decode(bufferlist::const_iterator& p)
{
DECODE_START(1, p);
decode(max_buckets, p);
encode(bucket_counters, bl);
ENCODE_FINISH(bl);
}
-void TrimCounters::Response::decode(bufferlist::iterator& p)
+void TrimCounters::Response::decode(bufferlist::const_iterator& p)
{
DECODE_START(1, p);
decode(bucket_counters, p);
}
WRITE_CLASS_ENCODER(TrimCounters::Response);
-void TrimCounters::Handler::handle(bufferlist::iterator& input,
+void TrimCounters::Handler::handle(bufferlist::const_iterator& input,
bufferlist& output)
{
Request request;
struct TrimComplete {
struct Request {
void encode(bufferlist& bl) const;
- void decode(bufferlist::iterator& p);
+ void decode(bufferlist::const_iterator& p);
};
struct Response {
void encode(bufferlist& bl) const;
- void decode(bufferlist::iterator& p);
+ void decode(bufferlist::const_iterator& p);
};
/// server interface to reset bucket counters
public:
explicit Handler(Server *server) : server(server) {}
- void handle(bufferlist::iterator& input, bufferlist& output) override;
+ void handle(bufferlist::const_iterator& input, bufferlist& output) override;
};
};
ENCODE_START(1, 1, bl);
ENCODE_FINISH(bl);
}
-void TrimComplete::Request::decode(bufferlist::iterator& p)
+void TrimComplete::Request::decode(bufferlist::const_iterator& p)
{
DECODE_START(1, p);
DECODE_FINISH(p);
ENCODE_START(1, 1, bl);
ENCODE_FINISH(bl);
}
-void TrimComplete::Response::decode(bufferlist::iterator& p)
+void TrimComplete::Response::decode(bufferlist::const_iterator& p)
{
DECODE_START(1, p);
DECODE_FINISH(p);
}
WRITE_CLASS_ENCODER(TrimComplete::Response);
-void TrimComplete::Handler::handle(bufferlist::iterator& input,
+void TrimComplete::Handler::handle(bufferlist::const_iterator& input,
bufferlist& output)
{
Request request;
}
bufferlist reply;
try {
- auto p = bl.begin();
+ auto p = bl.cbegin();
TrimNotifyType type;
decode(type, p);
try {
// decode notify responses
- auto p = bl.begin();
+ auto p = bl.cbegin();
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);
for (auto& peer : replies) {
- auto q = peer.second.begin();
+ auto q = peer.second.cbegin();
TrimCounters::Response response;
decode(response, q);
for (const auto& b : response.bucket_counters) {
encode(marker, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& p) {
+ void decode(bufferlist::const_iterator& p) {
DECODE_START(1, p);
decode(marker, p);
DECODE_FINISH(p);
auto aiter = attrs.find(RGW_ATTR_ACL);
if (aiter != attrs.end()) {
bufferlist& bl = aiter->second;
- bufferlist::iterator bliter = bl.begin();
+ auto bliter = bl.cbegin();
try {
info->acls.decode(bliter);
} catch (buffer::error& err) {
*result = def_val;
return 0;
}
- bufferlist::iterator bliter = bl.begin();
+ auto bliter = bl.cbegin();
try {
decode(*result, bliter);
} catch (buffer::error& err) {
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(part_num, bl);
decode(ofs, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(mtime, bl);
decode(etag, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(upload_id, bl);
decode(obj_size, bl);
if (name == "acl") {
try {
- auto i = val.begin();
+ auto i = val.cbegin();
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();
+ auto tags_bl = val.cbegin();
decode(obj_tags, tags_bl);
} else if (name == "compression") {
RGWCompressionInfo cs_info;
- auto vals_bl = val.begin();
+ auto vals_bl = val.cbegin();
decode(cs_info, vals_bl);
out_attrs[name] = cs_info.compression_type;
} else {
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator &bl) {
+ void decode(bufferlist::const_iterator &bl) {
DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
decode(tag_map,bl);
DECODE_FINISH(bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
string name;
string typestr;
uint32_t version;
rgw_cache_entry_info cache_info;
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
decode(uid, iter);
int ret = rgw_get_user_info_by_uid(store, uid.user_id, e.info, &e.objv_tracker, NULL, &cache_info);
return ret;
}
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
try {
decode(user_id, iter);
if (user_id.user_id.compare(uid) != 0) {
using ceph::encode;
encode(s, bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
string s;
using ceph::decode;
decode(s, bl);
encode(http_redirect_code, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(protocol, bl);
decode(hostname, bl);
encode(replace_key_with, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(redirect, bl);
decode(replace_key_prefix_with, bl);
encode(http_error_code_returned_equals, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(key_prefix_equals, bl);
decode(http_error_code_returned_equals, bl);
encode(redirect_info, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(condition, bl);
decode(redirect_info, bl);
encode(rules, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(1, bl);
decode(rules, bl);
DECODE_FINISH(bl);
encode(listing_enabled, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START(2, bl);
decode(index_doc_suffix, bl);
decode(error_doc, bl);
encode(tenant, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(8, 3, 3, bl);
decode(name, bl);
decode(data_pool, bl);
}
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
decode(bucket.name, bl);
decode(loc, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN_32(2, 2, 2, bl);
decode(loc, bl);
decode(loc_ofs, bl);
ENCODE_FINISH(bl);
}
- void decode(bufferlist::iterator& bl) {
+ void decode(bufferlist::const_iterator& bl) {
DECODE_START_LEGACY_COMPAT_LEN_32(6, 2, 2, bl);
decode(obj_size, bl);
decode(objs, bl);
RGWObjManifest manifest;
try {
- auto iter = bl.begin();
+ auto iter = bl.cbegin();
decode(manifest, iter);
} catch (buffer::error& err) {
ASSERT_TRUE(false);
rgw_raw_obj raw_obj;
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(new_obj, iter);
iter = bl.begin();
cout << "raw=" << raw_obj << std::endl;
try {
- bufferlist::iterator iter = bl.begin();
+ auto iter = bl.cbegin();
decode(new_obj2, iter);
/*