]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use const_iterator for decode
authorKefu Chai <kchai@redhat.com>
Tue, 15 May 2018 15:54:47 +0000 (23:54 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 17 May 2018 05:56:49 +0000 (13:56 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
58 files changed:
src/cls/rgw/cls_rgw.cc
src/cls/rgw/cls_rgw_client.cc
src/cls/rgw/cls_rgw_ops.h
src/cls/rgw/cls_rgw_types.cc
src/cls/rgw/cls_rgw_types.h
src/rgw/rgw_acl.h
src/rgw/rgw_admin.cc
src/rgw/rgw_basic_types.h
src/rgw/rgw_bucket.cc
src/rgw/rgw_bucket.h
src/rgw/rgw_cache.h
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_cors.h
src/rgw/rgw_cr_rados.cc
src/rgw/rgw_cr_rados.h
src/rgw/rgw_crypt.cc
src/rgw/rgw_data_sync.cc
src/rgw/rgw_data_sync.h
src/rgw/rgw_file.cc
src/rgw/rgw_file.h
src/rgw/rgw_lc.cc
src/rgw/rgw_lc.h
src/rgw/rgw_log.h
src/rgw/rgw_meta_sync_status.h
src/rgw/rgw_metadata.cc
src/rgw/rgw_metadata.h
src/rgw/rgw_multi.cc
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_orphan.h
src/rgw/rgw_period_pusher.cc
src/rgw/rgw_period_pusher.h
src/rgw/rgw_quota.h
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h
src/rgw/rgw_realm_reloader.cc
src/rgw/rgw_realm_reloader.h
src/rgw/rgw_realm_watcher.cc
src/rgw/rgw_realm_watcher.h
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_role.cc
src/rgw/rgw_role.h
src/rgw/rgw_swift_auth.cc
src/rgw/rgw_sync.h
src/rgw/rgw_sync_log_trim.cc
src/rgw/rgw_sync_log_trim.h
src/rgw/rgw_sync_module_aws.cc
src/rgw/rgw_sync_module_aws.h
src/rgw/rgw_sync_module_es.cc
src/rgw/rgw_tag.h
src/rgw/rgw_token.h
src/rgw/rgw_user.cc
src/rgw/rgw_user.h
src/rgw/rgw_website.h
src/test/rgw/test_rgw_common.h
src/test/rgw/test_rgw_manifest.cc
src/test/rgw/test_rgw_obj.cc

index bb8876cf8a4fa620cb08c93714dfd09fcfae6bbe..0a4c6238f0fa901a4c2990a553064fa061eaf087 100644 (file)
@@ -363,7 +363,7 @@ static int read_bucket_header(cls_method_context_t hctx, struct rgw_bucket_dir_h
       *header = rgw_bucket_dir_header();
       return 0;
   }
-  bufferlist::iterator iter = bl.begin();
+  auto iter = bl.cbegin();
   try {
     decode(*header, iter);
   } catch (buffer::error& err) {
@@ -376,7 +376,7 @@ static int read_bucket_header(cls_method_context_t hctx, struct rgw_bucket_dir_h
 
 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 {
@@ -420,7 +420,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       }
 
       bufferlist& entrybl = kiter->second;
-      bufferlist::iterator eiter = entrybl.begin();
+      auto eiter = entrybl.cbegin();
       try {
         decode(entry, eiter);
       } catch (buffer::error& err) {
@@ -492,7 +492,7 @@ static int check_index(cls_method_context_t hctx, struct rgw_bucket_dir_header *
       }
 
       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) {
@@ -550,7 +550,7 @@ int rgw_bucket_update_stats(cls_method_context_t hctx, bufferlist *in, bufferlis
 {
   // 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) {
@@ -581,8 +581,6 @@ int rgw_bucket_update_stats(cls_method_context_t hctx, bufferlist *in, bufferlis
 
 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) {
@@ -609,7 +607,7 @@ int rgw_bucket_set_tag_timeout(cls_method_context_t hctx, bufferlist *in, buffer
 {
   // 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) {
@@ -636,7 +634,7 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist
 {
   // 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) {
@@ -736,7 +734,7 @@ static int read_index_entry(cls_method_context_t hctx, string& name, T *entry)
     return rc;
   }
 
-  bufferlist::iterator cur_iter = current_entry.begin();
+  auto cur_iter = current_entry.cbegin();
   try {
     decode(*entry, cur_iter);
   } catch (buffer::error& err) {
@@ -784,7 +782,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
 {
   // 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) {
@@ -1178,7 +1176,7 @@ public:
 
     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());
@@ -1369,7 +1367,7 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
 
   // 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) {
@@ -1551,7 +1549,7 @@ static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in,
 
   // 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) {
@@ -1696,7 +1694,7 @@ static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bu
 {
   // 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) {
@@ -1749,7 +1747,7 @@ static int rgw_bucket_trim_olh_log(cls_method_context_t hctx, bufferlist *in, bu
 {
   // 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) {
@@ -1800,7 +1798,7 @@ static int rgw_bucket_clear_olh(cls_method_context_t hctx, bufferlist *in, buffe
 {
   // 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) {
@@ -1880,7 +1878,7 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
     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;
@@ -1902,7 +1900,7 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
       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) {
@@ -2004,7 +2002,7 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist
 {
   // 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) {
@@ -2077,7 +2075,7 @@ static int rgw_obj_store_pg_ver(cls_method_context_t hctx, bufferlist *in, buffe
 {
   // 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) {
@@ -2101,7 +2099,7 @@ static int rgw_obj_check_attrs_prefix(cls_method_context_t hctx, bufferlist *in,
 {
   // 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) {
@@ -2144,7 +2142,7 @@ static int rgw_obj_check_mtime(cls_method_context_t hctx, bufferlist *in, buffer
 {
   // 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) {
@@ -2207,7 +2205,7 @@ static int rgw_bi_get_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
 {
   // 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) {
@@ -2254,7 +2252,7 @@ static int rgw_bi_put_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
 {
   // 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) {
@@ -2303,7 +2301,7 @@ static int list_plain_entries(cls_method_context_t hctx, const string& name, con
     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 {
@@ -2391,7 +2389,7 @@ static int list_instance_entries(cls_method_context_t hctx, const string& name,
 
     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 {
@@ -2476,7 +2474,7 @@ static int list_olh_entries(cls_method_context_t hctx, const string& name, const
 
     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 {
@@ -2506,7 +2504,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx, bufferlist *in, bufferlist
 {
   // 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) {
@@ -2563,7 +2561,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx, bufferlist *in, bufferlist
 
 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) {
@@ -2672,7 +2670,7 @@ static int bi_log_list_entries(cls_method_context_t hctx, const string& marker,
 
 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 {
@@ -2723,7 +2721,7 @@ static int bi_log_list_trim_entries(cls_method_context_t hctx,
 
 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 {
@@ -2854,7 +2852,7 @@ static void usage_record_name_by_user(const string& user, uint64_t epoch, string
 
 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) {
@@ -2869,7 +2867,7 @@ int rgw_user_usage_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist
 {
   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 {
@@ -3035,7 +3033,7 @@ int rgw_user_usage_log_read(cls_method_context_t hctx, bufferlist *in, bufferlis
 {
   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 {
@@ -3090,7 +3088,7 @@ int rgw_user_usage_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlis
   if (ret < 0)
     return ret;
 
-  bufferlist::iterator in_iter = in->begin();
+  auto in_iter = in->cbegin();
   rgw_cls_usage_log_trim_op op;
 
   try {
@@ -3153,7 +3151,7 @@ static int gc_omap_get(cls_method_context_t hctx, int type, const string& key, c
     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());
@@ -3243,7 +3241,7 @@ static int gc_defer_entry(cls_method_context_t hctx, const string& tag, uint32_t
 
 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) {
@@ -3255,7 +3253,7 @@ int gc_record_decode(bufferlist& bl, cls_rgw_gc_obj_info& e)
 
 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 {
@@ -3270,7 +3268,7 @@ static int rgw_cls_gc_set_entry(cls_method_context_t hctx, bufferlist *in, buffe
 
 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 {
@@ -3374,7 +3372,7 @@ static int gc_list_entries(cls_method_context_t hctx, const string& marker,
 
 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 {
@@ -3429,7 +3427,7 @@ static int gc_remove(cls_method_context_t hctx, vector<string>& tags)
 
 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 {
@@ -3444,7 +3442,7 @@ static int rgw_cls_gc_remove(cls_method_context_t hctx, bufferlist *in, bufferli
 
 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 {
@@ -3463,7 +3461,7 @@ static int rgw_cls_lc_set_entry(cls_method_context_t hctx, bufferlist *in, buffe
 
 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 {
@@ -3479,7 +3477,7 @@ static int rgw_cls_lc_rm_entry(cls_method_context_t hctx, bufferlist *in, buffer
 
 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 {
@@ -3515,7 +3513,7 @@ static int rgw_cls_lc_get_next_entry(cls_method_context_t hctx, bufferlist *in,
 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) {
@@ -3524,7 +3522,7 @@ static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in, bu
   }
 
   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);
@@ -3533,7 +3531,7 @@ static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in, bu
   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) {
@@ -3548,7 +3546,7 @@ static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in, bu
 
 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 {
@@ -3572,7 +3570,7 @@ static int rgw_cls_lc_get_head(cls_method_context_t hctx, bufferlist *in,  buffe
     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) {
@@ -3591,7 +3589,7 @@ static int rgw_cls_lc_get_head(cls_method_context_t hctx, bufferlist *in,  buffe
 
 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 {
@@ -3619,7 +3617,7 @@ static int rgw_reshard_add(cls_method_context_t hctx, bufferlist *in, bufferlist
 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) {
@@ -3627,7 +3625,7 @@ static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlis
     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
@@ -3640,7 +3638,7 @@ static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlis
   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) {
@@ -3659,7 +3657,7 @@ static int get_reshard_entry(cls_method_context_t hctx, const string& key, cls_r
   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) {
@@ -3671,7 +3669,7 @@ static int get_reshard_entry(cls_method_context_t hctx, const string& key, cls_r
 
 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 {
@@ -3697,7 +3695,7 @@ static int rgw_reshard_get(cls_method_context_t hctx, bufferlist *in,  bufferlis
 
 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 {
@@ -3732,7 +3730,7 @@ static int rgw_set_bucket_resharding(cls_method_context_t hctx, bufferlist *in,
 {
   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) {
@@ -3756,7 +3754,7 @@ static int rgw_clear_bucket_resharding(cls_method_context_t hctx, bufferlist *in
 {
   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) {
@@ -3779,7 +3777,7 @@ static int rgw_guard_bucket_resharding(cls_method_context_t hctx, bufferlist *in
 {
   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) {
@@ -3805,7 +3803,7 @@ static int rgw_get_bucket_resharding(cls_method_context_t hctx, bufferlist *in,
 {
   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) {
index a0560b2b36f48062ba60a190baa17fc2e7f40aa7..361a08d20e4b87b03ebb432255ade14f45059f05 100644 (file)
@@ -26,7 +26,7 @@ public:
   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;
@@ -266,7 +266,7 @@ int cls_rgw_bi_get(librados::IoCtx& io_ctx, const string oid,
     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) {
@@ -315,7 +315,7 @@ int cls_rgw_bi_list(librados::IoCtx& io_ctx, const string oid,
     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) {
@@ -400,7 +400,7 @@ int cls_rgw_get_olh_log(IoCtx& io_ctx, string& oid, librados::ObjectReadOperatio
 
   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;
@@ -560,7 +560,7 @@ public:
   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;
@@ -610,7 +610,7 @@ int cls_rgw_usage_log_read(IoCtx& io_ctx, string& oid, string& user,
 
   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)
@@ -700,7 +700,7 @@ int cls_rgw_gc_list(IoCtx& io_ctx, string& oid, string& marker, uint32_t max, bo
 
   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;
@@ -732,7 +732,7 @@ int cls_rgw_lc_get_head(IoCtx& io_ctx, string& oid, cls_rgw_lc_obj_head& head)
 
   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;
@@ -764,7 +764,7 @@ int cls_rgw_lc_get_next_entry(IoCtx& io_ctx, string& oid, string& marker, pair<s
 
   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;
@@ -815,7 +815,7 @@ int cls_rgw_lc_list(IoCtx& io_ctx, string& oid,
 
   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;
@@ -847,7 +847,7 @@ int cls_rgw_reshard_list(librados::IoCtx& io_ctx, const string& oid, string& mar
     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) {
@@ -871,7 +871,7 @@ int cls_rgw_reshard_get(librados::IoCtx& io_ctx, const string& oid, cls_rgw_resh
     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) {
@@ -923,7 +923,7 @@ int cls_rgw_get_bucket_resharding(librados::IoCtx& io_ctx, const string& oid,
     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) {
index 37db81e53639488c9f5cdb6dd816d967dbaf0583..5ce5badc9ecfd04b37c6c4c2f49850d6664a1f4f 100644 (file)
@@ -14,7 +14,7 @@ struct rgw_cls_tag_timeout_op
     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);
@@ -48,7 +48,7 @@ struct rgw_cls_obj_prepare_op
     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);
@@ -111,7 +111,7 @@ struct rgw_cls_obj_complete_op
     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);
@@ -195,7 +195,7 @@ struct rgw_cls_link_olh_op {
     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);
@@ -252,7 +252,7 @@ struct rgw_cls_unlink_instance_op {
     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);
@@ -288,7 +288,7 @@ struct rgw_cls_read_olh_log_op
     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);
@@ -314,7 +314,7 @@ struct rgw_cls_read_olh_log_ret
     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);
@@ -340,7 +340,7 @@ struct rgw_cls_trim_olh_log_op
     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);
@@ -365,7 +365,7 @@ struct rgw_cls_bucket_clear_olh_op {
     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);
@@ -394,7 +394,7 @@ struct rgw_cls_list_op
     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);
@@ -425,7 +425,7 @@ struct rgw_cls_list_ret {
     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);
@@ -449,7 +449,7 @@ struct rgw_cls_check_index_ret
     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);
@@ -473,7 +473,7 @@ struct rgw_cls_bucket_update_stats_op
     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);
@@ -493,7 +493,7 @@ struct rgw_cls_obj_remove_op {
     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);
@@ -510,7 +510,7 @@ struct rgw_cls_obj_store_pg_ver_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(attr, bl);
     DECODE_FINISH(bl);
@@ -531,7 +531,7 @@ struct rgw_cls_obj_check_attrs_prefix {
     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);
@@ -555,7 +555,7 @@ struct rgw_cls_obj_check_mtime {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(mtime, bl);
     uint8_t c;
@@ -580,7 +580,7 @@ struct rgw_cls_usage_log_add_op {
     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) {
@@ -606,7 +606,7 @@ struct rgw_cls_bi_get_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(key, bl);
     uint8_t c;
@@ -628,7 +628,7 @@ struct rgw_cls_bi_get_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -647,7 +647,7 @@ struct rgw_cls_bi_put_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -670,7 +670,7 @@ struct rgw_cls_bi_list_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(max, bl);
     decode(name, bl);
@@ -693,7 +693,7 @@ struct rgw_cls_bi_list_ret {
     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);
@@ -720,7 +720,7 @@ struct rgw_cls_usage_log_read_op {
     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);
@@ -745,7 +745,7 @@ struct rgw_cls_usage_log_read_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(usage, bl);
     decode(truncated, bl);
@@ -768,7 +768,7 @@ struct rgw_cls_usage_log_trim_op {
     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);
@@ -790,7 +790,7 @@ struct cls_rgw_gc_set_entry_op {
     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);
@@ -814,7 +814,7 @@ struct cls_rgw_gc_defer_entry_op {
     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);
@@ -841,7 +841,7 @@ struct cls_rgw_gc_list_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(marker, bl);
     decode(max, bl);
@@ -871,7 +871,7 @@ struct cls_rgw_gc_list_ret {
     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)
@@ -896,7 +896,7 @@ struct cls_rgw_gc_remove_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(tags, bl);
     DECODE_FINISH(bl);
@@ -920,7 +920,7 @@ struct cls_rgw_bi_log_list_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(marker, bl);
     decode(max, bl);
@@ -945,7 +945,7 @@ struct cls_rgw_bi_log_trim_op {
     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);
@@ -970,7 +970,7 @@ struct cls_rgw_bi_log_list_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     decode(truncated, bl);
@@ -992,7 +992,7 @@ struct cls_rgw_lc_get_next_entry_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(marker, bl);
     DECODE_FINISH(bl);
@@ -1011,7 +1011,7 @@ struct cls_rgw_lc_get_next_entry_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1030,7 +1030,7 @@ struct cls_rgw_lc_rm_entry_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1048,7 +1048,7 @@ struct cls_rgw_lc_set_entry_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1068,7 +1068,7 @@ struct cls_rgw_lc_put_head_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(head, bl);
     DECODE_FINISH(bl);
@@ -1088,7 +1088,7 @@ struct cls_rgw_lc_get_head_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(head, bl);
     DECODE_FINISH(bl);
@@ -1110,7 +1110,7 @@ struct cls_rgw_lc_list_entries_op {
     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);
@@ -1133,7 +1133,7 @@ struct cls_rgw_lc_list_entries_ret {
     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) {
@@ -1156,7 +1156,7 @@ struct cls_rgw_reshard_add_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1179,7 +1179,7 @@ struct cls_rgw_reshard_list_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(max, bl);
     decode(marker, bl);
@@ -1204,7 +1204,7 @@ struct cls_rgw_reshard_list_ret {
     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);
@@ -1226,7 +1226,7 @@ struct cls_rgw_reshard_get_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1247,7 +1247,7 @@ struct cls_rgw_reshard_get_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1272,7 +1272,7 @@ struct cls_rgw_reshard_remove_op {
     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);
@@ -1293,7 +1293,7 @@ struct cls_rgw_set_bucket_resharding_op  {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1309,7 +1309,7 @@ struct cls_rgw_clear_bucket_resharding_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     DECODE_FINISH(bl);
   }
@@ -1327,7 +1327,7 @@ struct cls_rgw_guard_bucket_resharding_op  {
     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);
@@ -1345,7 +1345,7 @@ struct cls_rgw_get_bucket_resharding_op  {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     DECODE_FINISH(bl);
   }
@@ -1364,7 +1364,7 @@ struct cls_rgw_get_bucket_resharding_ret  {
     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);
index 931dd3c38e1bd94544c4af4870894a7bb8a3ecb1..9430c0022825b870d4fdb53ea756d965f77ea3d5 100644 (file)
@@ -154,7 +154,7 @@ void rgw_bucket_dir_entry::decode_json(JSONObj *obj) {
 
 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:
@@ -243,7 +243,7 @@ void rgw_cls_bi_entry::dump(Formatter *f) const
 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:
index fa08a48b9a133b504b357c025bd75c81f959916f..d1af718afe6e213a61c94a152637bb4ec3a6b42b 100644 (file)
@@ -73,7 +73,7 @@ struct rgw_bucket_pending_info {
     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);
@@ -115,7 +115,7 @@ struct rgw_bucket_dir_entry_meta {
     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);
@@ -169,7 +169,7 @@ void encode_packed_val(T val, bufferlist& 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;
@@ -227,7 +227,7 @@ struct rgw_bucket_entry_ver {
     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);
@@ -274,7 +274,7 @@ struct cls_rgw_obj_key {
     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);
@@ -331,7 +331,7 @@ struct rgw_bucket_dir_entry {
     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);
@@ -403,7 +403,7 @@ struct rgw_cls_bi_entry {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     uint8_t c;
     decode(c, bl);
@@ -446,7 +446,7 @@ struct rgw_bucket_olh_log_entry {
     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;
@@ -485,7 +485,7 @@ struct rgw_bucket_olh_entry {
     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);
@@ -537,7 +537,7 @@ struct rgw_bi_log_entry {
     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);
@@ -589,7 +589,7 @@ struct rgw_bucket_category_stats {
     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);
@@ -625,7 +625,7 @@ struct cls_rgw_bucket_instance_entry {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     uint8_t s;
     decode(s, bl);
@@ -680,7 +680,7 @@ struct rgw_bucket_dir_header {
     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) {
@@ -729,7 +729,7 @@ struct rgw_bucket_dir {
     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);
@@ -758,7 +758,7 @@ struct rgw_usage_data {
     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);
@@ -804,7 +804,7 @@ struct rgw_usage_log_entry {
   }
 
 
-   void decode(bufferlist::iterator& bl) {
+   void decode(bufferlist::const_iterator& bl) {
     DECODE_START(3, bl);
     string s;
     decode(s, bl);
@@ -869,7 +869,7 @@ struct rgw_usage_log_info {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     DECODE_FINISH(bl);
@@ -893,7 +893,7 @@ struct rgw_user_bucket {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(user, bl);
     decode(bucket, bl);
@@ -934,7 +934,7 @@ struct cls_rgw_obj {
     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);
@@ -980,7 +980,7 @@ struct cls_rgw_obj_chain {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(objs, bl);
     DECODE_FINISH(bl);
@@ -1021,7 +1021,7 @@ struct cls_rgw_gc_obj_info
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(tag, bl);
     decode(chain, bl);
@@ -1061,7 +1061,7 @@ struct cls_rgw_lc_obj_head
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     uint64_t t;
     decode(t, bl);
@@ -1099,7 +1099,7 @@ struct cls_rgw_reshard_entry
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(time, bl);
     decode(tenant, bl);
index 42a401d9133d74b3969b13867b371e048541683f..32736663965d8c7181226546ff23d63ef6432a90 100644 (file)
@@ -60,7 +60,7 @@ public:
     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);
@@ -86,7 +86,7 @@ public:
     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);
@@ -157,7 +157,7 @@ public:
     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;
@@ -246,7 +246,7 @@ struct ACLReferer {
     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);
@@ -319,7 +319,7 @@ public:
     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);
@@ -376,7 +376,7 @@ public:
     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);
@@ -428,7 +428,7 @@ public:
     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);
@@ -436,7 +436,7 @@ public:
   }
   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);
index f9bfc861d83133752f34eab284d4cb54e2ecd0b4..6a5651474762b255379869893f2e46db9340d14f 100644 (file)
@@ -984,7 +984,7 @@ BIIndexType get_bi_index_type(const string& type_str) {
 
 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:
@@ -1190,7 +1190,7 @@ static bool decode_dump(const char *field_name, bufferlist& bl, Formatter *f)
 {
   T t;
 
-  bufferlist::iterator iter = bl.begin();
+  auto iter = bl.cbegin();
 
   try {
     decode(t, iter);
@@ -1344,7 +1344,7 @@ int check_min_obj_stripe_size(RGWRados *store, RGWBucketInfo& bucket_info, rgw_o
 
   try {
     bufferlist& bl = iter->second;
-    bufferlist::iterator biter = bl.begin();
+    auto biter = bl.cbegin();
     decode(manifest, biter);
   } catch (buffer::error& err) {
     ldout(store->ctx(), 0) << "ERROR: failed to decode manifest" << dendl;
@@ -7119,7 +7119,7 @@ next:
         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) {
index 179f2b94a7e094ab996cc9d8ca59c1153792093c..21e7a81ba9334e4105f87fa2680e9537d472b285 100644 (file)
@@ -31,7 +31,7 @@ struct rgw_user {
     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);
index 6e4c56858bb7a2f58ea0c3fc2c8cbce95e50500a..34036572848d3cbaad83ac6f21468b524d74c46e 100644 (file)
@@ -840,7 +840,7 @@ int RGWBucket::link(RGWBucketAdminOpState& op_state, std::string *err_msg)
     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) {
@@ -1196,7 +1196,7 @@ int RGWBucket::check_index(RGWBucketAdminOpState& op_state,
 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) {
@@ -1209,7 +1209,7 @@ int RGWBucket::policy_bl_to_stream(bufferlist& bl, ostream& o)
 
 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) {
@@ -1914,7 +1914,7 @@ int RGWDataChangesLog::list_entries(int shard, const real_time& start_time, cons
     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) {
index 3079a936163d67c45cea25969dc4a3278d7a90a8..6542b5bf87951de7285651d96f1863fa465684f5 100644 (file)
@@ -116,7 +116,7 @@ public:
     using ceph::encode;
     encode(buckets, bl);
   }
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     using ceph::decode;
     decode(buckets, bl);
   }
@@ -359,7 +359,7 @@ struct rgw_data_change {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
      DECODE_START(1, bl);
      uint8_t t;
      decode(t, bl);
@@ -387,7 +387,7 @@ struct rgw_data_change_log_entry {
     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);
index d62f0a391b7eff60911a3160e107752e7e934d6b..1911db9bcf4ba0ca8e23a3eb8d179da47c61390c 100644 (file)
@@ -38,7 +38,7 @@ struct ObjectMetaInfo {
     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);
@@ -74,7 +74,7 @@ struct ObjectCacheInfo {
     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);
@@ -112,7 +112,7 @@ struct RGWCacheNotifyInfo {
     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);
@@ -583,7 +583,7 @@ int RGWCache<T>::watch_cb(uint64_t notify_id,
   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;
index 42c7e979da3bc4e2bb872726e5ae22e377ba50bb..788deafe4d718839fd155ee9055442d99335b54d 100644 (file)
@@ -1800,7 +1800,7 @@ string rgw_pool::to_str() const
   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;
index 9cc0a96aed64a45e7107fc3f5a2ec8912adc0f68..44b3e23693c0417d37b4a557d112d5858ff9d860 100644 (file)
@@ -531,7 +531,7 @@ struct RGWAccessKey {
     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);
@@ -560,7 +560,7 @@ struct RGWSubUser {
     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);
@@ -591,7 +591,7 @@ public:
      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);
@@ -703,7 +703,7 @@ struct RGWUserInfo
      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;
@@ -827,9 +827,9 @@ struct rgw_pool {
     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);
@@ -947,9 +947,9 @@ struct rgw_raw_obj {
     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) {
@@ -1040,7 +1040,7 @@ struct rgw_bucket {
     }
     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) {
@@ -1282,7 +1282,7 @@ struct RGWBucketInfo {
      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) {
@@ -1393,8 +1393,8 @@ struct RGWBucketEntryPoint
     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 */
@@ -1733,7 +1733,7 @@ struct rgw_obj_key {
     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);
@@ -1963,7 +1963,7 @@ struct RGWBucketEnt {
     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;
@@ -2055,7 +2055,7 @@ struct rgw_obj {
 //    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;
index b525ddcd0d804e0060b77851cd30a9891a2e101e..892cda787ce4092bbb8da22c4e14b70d2514a64b 100644 (file)
@@ -70,7 +70,7 @@ public:
     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);
@@ -103,7 +103,7 @@ class RGWCORSConfiguration
     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);
index dbd863a5846d1871d80618f174fed5409e688c10..283af95c3a65a1711919233f40959e0e8b9faf36 100644 (file)
@@ -657,7 +657,7 @@ int RGWAsyncRemoveObj::_send_request()
   /* 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) {
index e275ffa9b64468363348178766814642d6795cb3..1bf0271e0e271067eff1b995183a102629f9039c 100644 (file)
@@ -248,7 +248,7 @@ int RGWSimpleRadosReadCR<T>::request_complete()
       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
index 2143bf0c1aaeeb539961247b57ca9cab86247dde..26aeb719ff2af3012280eb0e89a74dac4fbde7af 100644 (file)
@@ -536,7 +536,7 @@ int RGWGetObj_BlockDecrypt::read_manifest(bufferlist& manifest_bl) {
   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) {
index 7edc3d6ab1c3e1e77d63962e2e0ea61b04091f5a..7fb4c14e5bb208795044e2b89c88bdf5a872d89c 100644 (file)
@@ -2013,7 +2013,7 @@ static void decode_attr(CephContext *cct, map<string, bufferlist>& attrs, const
     return;
   }
 
-  bufferlist::iterator biter = iter->second.begin();
+  auto biter = iter->second.cbegin();
   try {
     decode(*val, biter);
   } catch (buffer::error& err) {
index 8c6b7e2a888511a51f03f489ed0b8cad743a7c05..d5d2e3534da8c27c724cf80b94a30b2d056fdcb7 100644 (file)
@@ -46,7 +46,7 @@ struct rgw_data_sync_info {
     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);
@@ -120,7 +120,7 @@ struct rgw_data_sync_marker {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
      DECODE_START(1, bl);
     decode(state, bl);
     decode(marker, bl);
@@ -184,7 +184,7 @@ struct rgw_data_sync_status {
     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 */
@@ -396,7 +396,7 @@ struct rgw_bucket_shard_full_sync_marker {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
      DECODE_START(1, bl);
     decode(position, bl);
     decode(count, bl);
@@ -421,7 +421,7 @@ struct rgw_bucket_shard_inc_sync_marker {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
      DECODE_START(1, bl);
     decode(position, bl);
      DECODE_FINISH(bl);
@@ -459,7 +459,7 @@ struct rgw_bucket_shard_sync_info {
     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);
index e363d7d96341d3b4b5fe6118a2c74719035fba4f..ab6b27f13e06040ba1251f3c343e01839407e4ac 100644 (file)
@@ -984,7 +984,7 @@ namespace rgw {
     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);
@@ -992,7 +992,7 @@ namespace rgw {
       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;
index 5e0c86d0bfbe0a193003fba77f4fae54efda612f..62a1401ca75ba527476f4cb173adfe7e0e27c94d 100644 (file)
@@ -129,7 +129,7 @@ namespace rgw {
       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);
@@ -633,7 +633,7 @@ namespace rgw {
       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);
index 5aa57d384dc7f5c6d37e9c0e1dc47c307a061960..84bc59df171bbe9f2829eb0d6cc24ec69897ffaa 100644 (file)
@@ -376,7 +376,7 @@ int RGWLC::bucket_lc_process(string& shard_id)
   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) {
@@ -425,7 +425,7 @@ int RGWLC::bucket_lc_process(string& shard_id)
             }
             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;
index ec8a0e20fea2a1068085e3ce6cf267b26462d895..8a7edb994a0cdf21dfe8cbe4b32fc1a25bf1a1ba 100644 (file)
@@ -51,7 +51,7 @@ public:
     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) {
@@ -135,7 +135,7 @@ class LCFilter
     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) {
@@ -241,7 +241,7 @@ public:
      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);
@@ -305,7 +305,7 @@ public:
     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;
index 23a00c10ecfb97f974cd161997d1ea06873285e1..9614624d6a9ec668475f8cd1a2393970213d5ec5 100644 (file)
@@ -61,7 +61,7 @@ struct rgw_log_entry {
     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)
index 2935b8727e86a0e71d3917a5dd46f4da83d30a89..0fdc5cabaf1032a35c62960326e92013727927da 100644 (file)
@@ -26,7 +26,7 @@ struct rgw_meta_sync_info {
     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);
@@ -72,7 +72,7 @@ struct rgw_meta_sync_marker {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(state, bl);
     decode(marker, bl);
@@ -105,7 +105,7 @@ struct rgw_meta_sync_status {
     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);
index d432612ced966c5eec0c493f0e0d33ded73fff4f..8ee97ce55496ca8df7ed58f6e678cccacb009c4f 100644 (file)
@@ -52,7 +52,7 @@ void RGWMetadataLogData::encode(bufferlist& bl) const {
   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);
@@ -375,7 +375,7 @@ int read_history(RGWRados *store, RGWMetadataLogHistory *state,
     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: "
@@ -953,7 +953,7 @@ void RGWMetadataManager::dump_log_entry(cls_log_entry& entry, Formatter *f)
 
   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);
index b2337587588c61d755ccf2076bcf6d5babd130fc..b4f39f16d74deedbe8341498133d25cf450a62e3 100644 (file)
@@ -263,7 +263,7 @@ struct RGWMetadataLogData {
   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);
 };
@@ -279,7 +279,7 @@ struct RGWMetadataLogHistory {
     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);
index 20fd44a03051498db161cc3fa63be8bf8a41e740..d2af62ae8ca75fe5a025a1ab1fdd21997847e688 100644 (file)
@@ -119,7 +119,7 @@ int list_multipart_parts(RGWRados *store, RGWBucketInfo& bucket_info, CephContex
 
   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);
index 4e3e327fc74bcd9ed0ec21768763d05da2dbacbf..789999e8695e4ed106a8c023f5e9e64081dca1f5 100644 (file)
@@ -146,7 +146,7 @@ static int decode_policy(CephContext *cct,
                          bufferlist& bl,
                          RGWAccessControlPolicy *policy)
 {
-  bufferlist::iterator iter = bl.begin();
+  auto iter = bl.cbegin();
   try {
     policy->decode(iter);
   } catch (buffer::error& err) {
@@ -590,7 +590,7 @@ void rgw_add_to_iam_environment(rgw::IAM::Environment& e, std::string_view key,
 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;
@@ -1023,7 +1023,7 @@ int RGWOp::read_bucket_cors()
 
   bl = aiter->second;
 
-  bufferlist::iterator iter = bl.begin();
+  auto iter = bl.cbegin();
   try {
     bucket_cors.decode(iter);
   } catch (buffer::error& err) {
@@ -1513,7 +1513,7 @@ int RGWGetObj::handle_user_manifest(const char *prefix)
 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) {
@@ -4296,7 +4296,7 @@ void RGWPutMetadataObject::execute()
 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) {
@@ -5444,7 +5444,7 @@ static int get_multipart_info(RGWRados *store, struct req_state *s,
       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) {
index 4c58277bf574d21bc3ebfb909e4aeb8008571fd6..554c7a55bd67baceff52a1537d4fd18d7d9fdf16 100644 (file)
@@ -941,7 +941,7 @@ struct rgw_slo_entry {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
      DECODE_START(1, bl);
      decode(path, bl);
      decode(etag, bl);
@@ -973,7 +973,7 @@ struct RGWSLOInfo {
     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);
index 9f9763a50e428b81211866208ae0f8222575c991..f0f4b5136ff4d4018a28384ddb51c4f937479af7 100644 (file)
@@ -54,7 +54,7 @@ struct RGWOrphanSearchStage {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     int s;
     decode(s, bl);
@@ -83,7 +83,7 @@ struct RGWOrphanSearchInfo {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(job_name, bl);
     string s;
@@ -111,7 +111,7 @@ struct RGWOrphanSearchState {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(info, bl);
     decode(stage, bl);
index ec676c239437624b2c4f8b18a66996a7a26f6e3f..df5d3aea25dabb0b58d827694be16c7507f6a044 100644 (file)
@@ -175,7 +175,7 @@ RGWPeriodPusher::RGWPeriodPusher(RGWRados* store)
 RGWPeriodPusher::~RGWPeriodPusher() = default;
 
 void RGWPeriodPusher::handle_notify(RGWRealmNotify type,
-                                    bufferlist::iterator& p)
+                                    bufferlist::const_iterator& p)
 {
   // decode the period
   RGWZonesNeedPeriod info;
index be833f5fc036e042b9406a4975d65cf9ae6ee38d..fdadd226621665f0a958f8f353370be277729ddd 100644 (file)
@@ -27,7 +27,7 @@ class RGWPeriodPusher final : public RGWRealmWatcher::Watcher,
   ~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()
index 54e2f48a79ae535ff8c8c90e7760b06ede7a6458..5b7bdea778226bd6f10561a44888daef0fa06468 100644 (file)
@@ -68,7 +68,7 @@ public:
     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);
index 51c6ef990dfd766bf4ccee7d6a53e5c55d7f211a..c52c423efb960dd241cd1387ac453c363a61059d 100644 (file)
@@ -584,7 +584,7 @@ int RGWSystemMetaObj::read_default(RGWDefaultSystemMetaObjInfo& default_info, co
     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;
@@ -650,7 +650,7 @@ int RGWSystemMetaObj::read_id(const string& obj_name, string& object_id)
 
   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;
@@ -771,7 +771,7 @@ int RGWSystemMetaObj::read_info(const string& obj_id, bool old_format)
   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;
@@ -1054,7 +1054,7 @@ int RGWPeriodConfig::read(RGWRados *store, const std::string& realm_id)
   }
   using ceph::decode;
   try {
-    bufferlist::iterator iter = bl.begin();
+    auto iter = bl.cbegin();
     decode(*this, iter);
   } catch (buffer::error& err) {
     return -EIO;
@@ -1201,7 +1201,7 @@ int RGWPeriod::read_latest_epoch(RGWPeriodLatestEpochInfo& info,
     return ret;
   }
   try {
-    bufferlist::iterator iter = bl.begin();
+    auto iter = bl.cbegin();
     using ceph::decode;
     decode(info, iter);
   } catch (buffer::error& err) {
@@ -1342,7 +1342,7 @@ int RGWPeriod::read_info()
 
   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;
@@ -1923,7 +1923,7 @@ void RGWPeriodMap::encode(bufferlist& bl) const {
   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);
@@ -2044,7 +2044,7 @@ void RGWRegionMap::encode(bufferlist& bl) const {
   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);
@@ -2064,7 +2064,7 @@ void RGWZoneGroupMap::encode(bufferlist& bl) const {
   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);
@@ -3913,7 +3913,7 @@ int RGWRados::convert_regionmap()
   }
 
   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;
@@ -5020,7 +5020,7 @@ int RGWRados::log_remove(const string& name)
 struct log_show_state {
   librados::IoCtx io_ctx;
   bufferlist bl;
-  bufferlist::iterator p;
+  bufferlist::const_iterator p;
   string name;
   uint64_t pos;
   bool eof;
@@ -5066,7 +5066,7 @@ int RGWRados::log_show_next(RGWAccessHandle handle, rgw_log_entry *entry)
     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;
@@ -5491,7 +5491,7 @@ int RGWRados::objexp_hint_parse(cls_timeindex_entry &ti_entry,  /* in */
                                 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;
@@ -5552,7 +5552,7 @@ int RGWRados::unlock(rgw_pool& pool, const string& oid, string& zone_id, string&
 
 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);
@@ -5571,7 +5571,7 @@ int rgw_policy_from_attrset(CephContext *cct, map<string, bufferlist>& attrset,
     return -EIO;
 
   bufferlist& bl = aiter->second;
-  bufferlist::iterator iter = bl.begin();
+  auto iter = bl.cbegin();
   try {
     policy->decode(iter);
   } catch (buffer::error& err) {
@@ -6204,7 +6204,7 @@ int RGWRados::select_legacy_bucket_placement(RGWZonePlacementInfo *rule_info)
   }
 
   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;
@@ -8104,7 +8104,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
     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) {
@@ -9163,7 +9163,7 @@ int RGWRados::Object::Delete::delete_obj()
 
     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;
@@ -9507,7 +9507,7 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket
     // 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&) {
@@ -9531,7 +9531,7 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket
 
   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;
@@ -9566,7 +9566,7 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket
   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) {
@@ -9578,7 +9578,7 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket
   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) {
@@ -9718,7 +9718,7 @@ int RGWRados::Object::Stat::finish()
   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) {
@@ -11740,7 +11740,7 @@ int RGWRados::get_olh(const RGWBucketInfo& bucket_info, const rgw_obj& obj, RGWO
   }
 
   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;
@@ -11758,7 +11758,7 @@ void RGWRados::check_pending_olh_entries(map<string, bufferlist>& pending_entrie
   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);
@@ -11839,7 +11839,7 @@ int RGWRados::follow_olh(const RGWBucketInfo& bucket_info, RGWObjectCtx& obj_ctx
   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;
@@ -12138,7 +12138,7 @@ int RGWRados::get_bucket_instance_from_oid(RGWObjectCtx& obj_ctx, const string&
     return ret;
   }
 
-  bufferlist::iterator iter = epbl.begin();
+  auto iter = epbl.cbegin();
   try {
     decode(info, iter);
   } catch (buffer::error& err) {
@@ -12170,7 +12170,7 @@ int RGWRados::get_bucket_entrypoint_info(RGWObjectCtx& obj_ctx,
     return ret;
   }
 
-  bufferlist::iterator iter = bl.begin();
+  auto iter = bl.cbegin();
   try {
     decode(entry_point, iter);
   } catch (buffer::error& err) {
@@ -12875,7 +12875,7 @@ int RGWRados::bi_get_instance(const RGWBucketInfo& bucket_info, rgw_obj& obj, rg
   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) {
@@ -14424,7 +14424,7 @@ int RGWRados::delete_obj_aio(const rgw_obj& obj,
 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) {
index dcfea619cb41b35ef299e3486244bb2cb8c4ec88..06335368467b56ff03f0fd1b261d393a49ecf999 100644 (file)
@@ -193,7 +193,7 @@ struct compression_block {
     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);
@@ -222,7 +222,7 @@ struct RGWCompressionInfo {
     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);
@@ -248,7 +248,7 @@ struct RGWOLHInfo {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
      DECODE_START(1, bl);
      decode(target, bl);
      decode(removed, bl);
@@ -270,7 +270,7 @@ struct RGWOLHPendingInfo {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
      DECODE_START(1, bl);
      decode(time, bl);
      DECODE_FINISH(bl);
@@ -332,7 +332,7 @@ struct RGWObjManifestPart {
     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);
@@ -382,7 +382,7 @@ struct RGWObjManifestRule {
     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);
@@ -502,7 +502,7 @@ public:
     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);
@@ -845,7 +845,7 @@ struct RGWUploadPartInfo {
     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);
@@ -1001,7 +1001,7 @@ struct RGWDefaultSystemMetaObjInfo {
     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);
@@ -1021,7 +1021,7 @@ struct RGWNameToId {
     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);
@@ -1071,7 +1071,7 @@ public:
     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);
@@ -1124,7 +1124,7 @@ struct RGWZonePlacementInfo {
     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;
@@ -1234,7 +1234,7 @@ struct RGWZoneParams : RGWSystemMetaObj {
     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);
@@ -1379,7 +1379,7 @@ struct RGWZone {
     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) {
@@ -1430,7 +1430,7 @@ struct RGWDefaultZoneGroupInfo {
     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);
@@ -1464,7 +1464,7 @@ struct RGWZoneGroupPlacementTarget {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(name, bl);
     decode(tags, bl);
@@ -1540,7 +1540,7 @@ struct RGWZoneGroup : public RGWSystemMetaObj {
     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);
@@ -1597,7 +1597,7 @@ struct RGWPeriodMap
   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);
 
@@ -1626,7 +1626,7 @@ struct RGWPeriodConfig
     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);
@@ -1658,7 +1658,7 @@ struct RGWRegionMap {
   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);
@@ -1679,7 +1679,7 @@ struct RGWZoneGroupMap {
   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);
@@ -1705,7 +1705,7 @@ struct objexp_hint_entry {
     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);
@@ -1745,7 +1745,7 @@ public:
     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);
@@ -1793,7 +1793,7 @@ struct RGWPeriodLatestEpochInfo {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(epoch, bl);
     DECODE_FINISH(bl);
@@ -1945,7 +1945,7 @@ public:
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(id, bl);
     decode(epoch, bl);
index 8e7d28db4041b8a5a730bd20ca8934da8d7b55a0..3a91e552484aff9d405c1f94bf64368ac2bd9272 100644 (file)
@@ -49,7 +49,7 @@ class RGWRealmReloader::C_Reload : public Context {
 };
 
 void RGWRealmReloader::handle_notify(RGWRealmNotify type,
-                                     bufferlist::iterator& p)
+                                     bufferlist::const_iterator& p)
 {
   if (!store) {
     /* we're in the middle of reload */
index ab9f4e56ec4b1b7c5443c680db64d5dc88e5d85a..aea21d5833820953009f648811fe5b731bc7fc4b 100644 (file)
@@ -37,7 +37,7 @@ class RGWRealmReloader : public RGWRealmWatcher::Watcher {
   ~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
index 7389c3f80b95fcd4670c9a7c63e13f1b35d216a8..ae77128e10a6e6b148779c9ef0c7c40d378a86aa 100644 (file)
@@ -51,7 +51,7 @@ void RGWRealmWatcher::handle_notify(uint64_t notify_id, uint64_t cookie,
   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);
index 7ef40f458a0d6cde06be3f5c3e183579124eb912..9f9bab829efc2f3d3bfc0aeb2af9bf72445c5e1e 100644 (file)
@@ -33,7 +33,7 @@ class RGWRealmWatcher : public librados::WatchCtx2 {
     virtual ~Watcher() = default;
 
     virtual void handle_notify(RGWRealmNotify type,
-                               bufferlist::iterator& p) = 0;
+                               bufferlist::const_iterator& p) = 0;
   };
 
   RGWRealmWatcher(CephContext* cct, RGWRealm& realm);
index 67d0712f1f1b37b6339862fbff96f526ada2a2ce..b60bbeb58e1086fadd596599bef286b5a3b4e3b0 100644 (file)
@@ -158,7 +158,7 @@ int decode_attr_bl_single_value(map<string, bufferlist>& attrs, const char *attr
     *result = def_val;
     return 0;
   }
-  bufferlist::iterator bliter = bl.begin();
+  auto bliter = bl.cbegin();
   try {
     decode(*result, bliter);
   } catch (buffer::error& err) {
@@ -299,7 +299,7 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs,
       } 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;
@@ -375,7 +375,7 @@ void RGWGetObjTags_ObjStore_S3::send_response_data(bufferlist& bl)
   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) {
@@ -2263,7 +2263,7 @@ void RGWGetLC_ObjStore_S3::execute()
     return;
   }
 
-  bufferlist::iterator iter(&aiter->second);
+  bufferlist::const_iterator iter{&aiter->second};
   try {
       config.decode(iter);
     } catch (const buffer::error& e) {
index 8fe173d9cffe4b35520534faa8475545ead82af5..525da75bbb2cce1c5dd1583769ac2386da33fc38 100644 (file)
@@ -303,7 +303,7 @@ int RGWRole::read_id(const string& role_name, const string& tenant, string& role
 
   RGWNameToId nameToId;
   try {
-    bufferlist::iterator iter = bl.begin();
+    auto iter = bl.cbegin();
     using ceph::decode;
     decode(nameToId, iter);
   } catch (buffer::error& err) {
@@ -331,7 +331,7 @@ int RGWRole::read_info()
 
   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 <<
@@ -359,7 +359,7 @@ int RGWRole::read_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 << ": "
index 1aa96ca78b68e91381dd3cf37f05e164351a8248..fa2b382eeeee088f595f634590d047dc8e2f5c39 100644 (file)
@@ -96,7 +96,7 @@ public:
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(id, bl);
     decode(name, bl);
index d73b6d51d9635b985d8a3d5434c148c9fc10c17c..9092f3ebe1a01d17846bdc05892c577fd2e9c125 100644 (file)
@@ -507,7 +507,7 @@ SignedTokenEngine::authenticate(const std::string& token,
   std::string swift_user;
 
   try {
-    /*const*/ auto iter = tok_bl.begin();
+    auto iter = tok_bl.cbegin();
 
     using ceph::decode;
     decode(swift_user, iter);
index bc902e72ca964d151da3dd89560e0862abc87e7d..d43dcb20cf23c5de88e5f9a8be27282141eae0fa 100644 (file)
@@ -43,7 +43,7 @@ struct rgw_mdlog_entry {
     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;
@@ -96,7 +96,7 @@ struct rgw_sync_error_info {
     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);
index 28b5cc99ad084417a0989984bb4ce1e9113bd1d3..87a64e9ef726434405c98bdf1d90434e26d278d4 100644 (file)
@@ -52,7 +52,7 @@ WRITE_RAW_ENCODER(TrimNotifyType);
 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.
@@ -69,7 +69,7 @@ struct TrimCounters {
       : 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>;
 
@@ -78,7 +78,7 @@ struct TrimCounters {
     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
@@ -86,7 +86,7 @@ struct TrimCounters {
     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
@@ -103,7 +103,7 @@ struct TrimCounters {
    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)
@@ -118,7 +118,7 @@ void TrimCounters::BucketCounter::encode(bufferlist& bl) const
   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);
@@ -132,7 +132,7 @@ void TrimCounters::Request::encode(bufferlist& bl) const
   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);
@@ -146,7 +146,7 @@ void TrimCounters::Response::encode(bufferlist& bl) const
   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);
@@ -154,7 +154,7 @@ void TrimCounters::Response::decode(bufferlist::iterator& 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;
@@ -171,11 +171,11 @@ void TrimCounters::Handler::handle(bufferlist::iterator& input,
 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
@@ -187,7 +187,7 @@ struct TrimComplete {
    public:
     explicit Handler(Server *server) : server(server) {}
 
-    void handle(bufferlist::iterator& input, bufferlist& output) override;
+    void handle(bufferlist::const_iterator& input, bufferlist& output) override;
   };
 };
 
@@ -196,7 +196,7 @@ void TrimComplete::Request::encode(bufferlist& bl) const
   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);
@@ -208,14 +208,14 @@ void TrimComplete::Response::encode(bufferlist& bl) const
   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;
@@ -306,7 +306,7 @@ class BucketTrimWatcher : public librados::WatchCtx2 {
     }
     bufferlist reply;
     try {
-      auto p = bl.begin();
+      auto p = bl.cbegin();
       TrimNotifyType type;
       decode(type, p);
 
@@ -545,14 +545,14 @@ int accumulate_peer_counters(bufferlist& bl, BucketChangeCounter& counter)
 
   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) {
index 39823c1a7ee2b81057d36df17842a2e459caa499..3c9023cf72b44a6f7288f3523154f34ef201f05f 100644 (file)
@@ -93,7 +93,7 @@ struct BucketTrimStatus {
     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);
index 50cb113aaae9432bc4b6c0845ec83b34775b4b67..9dac4cbb470ffa9a5ae9b9f15e8cfe950ecbc6fd 100644 (file)
@@ -691,7 +691,7 @@ static int do_decode_rest_obj(CephContext *cct, map<string, bufferlist>& attrs,
   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) {
@@ -1531,7 +1531,7 @@ int decode_attr(map<string, bufferlist>& attrs, const char *attr_name, T *result
     *result = def_val;
     return 0;
   }
-  bufferlist::iterator bliter = bl.begin();
+  auto bliter = bl.cbegin();
   try {
     decode(*result, bliter);
   } catch (buffer::error& err) {
index dca647572540f4055e188bbb1aeaec4aba32d87e..334f466277d61142968f227144bcd22ab4f4c409 100644 (file)
@@ -18,7 +18,7 @@ struct rgw_sync_aws_multipart_part_info {
     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);
@@ -46,7 +46,7 @@ struct rgw_sync_aws_src_obj_properties {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::iterator& bl) {
+  void decode(bufferlist::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(mtime, bl);
     decode(etag, bl);
@@ -83,7 +83,7 @@ struct rgw_sync_aws_multipart_upload_info {
     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);
index 4b85ef9e0257e08570d8bdefbbf4f5825a89a7f5..0528e7049904bbdbc130c9c523ea84ce46b26efd 100644 (file)
@@ -285,7 +285,7 @@ struct es_obj_metadata {
 
       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;
@@ -305,11 +305,11 @@ struct es_obj_metadata {
           }
         }
       } 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 {
index c18254b1840398a9f03b28e1a91b19dcc861a188..6c8467deef02058e96143df61c3d8b93b4c69f09 100644 (file)
@@ -22,7 +22,7 @@ class RGWObjTags
     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);
index 38fc75a14900262e2fd19a4bc5385400459adfac..d0496aedf59896e82166adcb1cfda18fb4ff4583 100644 (file)
@@ -101,7 +101,7 @@ namespace rgw {
       ENCODE_FINISH(bl);
     }
 
-    void decode(bufferlist::iterator& bl) {
+    void decode(bufferlist::const_iterator& bl) {
       string name;
       string typestr;
       uint32_t version;
index 7f694c249b90ffefd755258845b6c7468b39d282..93af4afe621c8b4f83f6799a0f3350cae0b14d9f 100644 (file)
@@ -279,7 +279,7 @@ int rgw_get_user_info_from_index(RGWRados * const store,
 
   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);
@@ -324,7 +324,7 @@ int rgw_get_user_info_by_uid(RGWRados *store,
     return ret;
   }
 
-  bufferlist::iterator iter = bl.begin();
+  auto iter = bl.cbegin();
   try {
     decode(user_id, iter);
     if (user_id.user_id.compare(uid) != 0) {
index c9bca868bd4e00f395bad85e0500af54857dc0a4..dcfad360661ff75e08adca371396326e1e12c51c 100644 (file)
@@ -40,7 +40,7 @@ struct RGWUID
     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);
index c689ef73685f106e0c925e348d40774114059a0a..7695345cb8c818c0fc4d19b84c6f27ca7be39a74 100644 (file)
@@ -35,7 +35,7 @@ struct RGWRedirectInfo
     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);
@@ -62,7 +62,7 @@ struct RGWBWRedirectInfo
     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);
@@ -88,7 +88,7 @@ struct RGWBWRoutingRuleCondition
     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);
@@ -118,7 +118,7 @@ struct RGWBWRoutingRule
     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);
@@ -154,7 +154,7 @@ struct RGWBWRoutingRules
     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);
@@ -197,7 +197,7 @@ struct RGWBucketWebsiteConf
     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);
index 6684dff516e79368679e158f63f9bb7f054eae0f..029dadb6adc0b52a46ce716d2304d3c492a61bdb 100644 (file)
@@ -57,7 +57,7 @@ struct old_rgw_bucket {
     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);
@@ -391,7 +391,7 @@ public:
     }
     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);
index aeb9a879cb3e1f5968e5a438dad49062531278a3..57a7ff323d6696ed59030cd621955fea87dc01db 100644 (file)
@@ -46,7 +46,7 @@ struct OldObjManifestPart {
     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);
@@ -92,7 +92,7 @@ public:
     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);
@@ -362,7 +362,7 @@ TEST(TestRGWManifest, old_obj_manifest) {
   RGWObjManifest manifest;
 
   try {
-    auto iter = bl.begin();
+    auto iter = bl.cbegin();
     decode(manifest, iter);
   } catch (buffer::error& err) {
     ASSERT_TRUE(false);
index 91dfc8dc66b361d2679009f359005eff772c730c..ad8ef6956630228cd9d6541151feb5fb75afd7dc 100644 (file)
@@ -233,7 +233,7 @@ TEST(TestRGWObj, old_to_raw) {
         rgw_raw_obj raw_obj;
 
         try {
-          bufferlist::iterator iter = bl.begin();
+          auto iter = bl.cbegin();
           decode(new_obj, iter);
 
           iter = bl.begin();
@@ -254,7 +254,7 @@ TEST(TestRGWObj, old_to_raw) {
         cout << "raw=" << raw_obj << std::endl;
 
         try {
-          bufferlist::iterator iter = bl.begin();
+          auto iter = bl.cbegin();
           decode(new_obj2, iter);
 
           /*