]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cls: Build ceph-osd without using namespace declarations in headers
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 2 Apr 2020 23:28:22 +0000 (19:28 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 6 Apr 2020 15:15:04 +0000 (11:15 -0400)
This is part of a series of commits to clean up using namespace at top
level in headers.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
77 files changed:
src/cls/2pc_queue/cls_2pc_queue.cc
src/cls/2pc_queue/cls_2pc_queue_ops.h
src/cls/2pc_queue/cls_2pc_queue_types.h
src/cls/cas/cls_cas.cc
src/cls/cas/cls_cas_client.cc
src/cls/cas/cls_cas_client.h
src/cls/cas/cls_cas_ops.h
src/cls/cephfs/cls_cephfs.cc
src/cls/cephfs/cls_cephfs.h
src/cls/cephfs/cls_cephfs_client.cc
src/cls/cephfs/cls_cephfs_client.h
src/cls/hello/cls_hello.cc
src/cls/journal/cls_journal.cc
src/cls/journal/cls_journal_types.cc
src/cls/lock/cls_lock.cc
src/cls/lock/cls_lock_client.cc
src/cls/lock/cls_lock_client.h
src/cls/lock/cls_lock_ops.h
src/cls/lock/cls_lock_types.cc
src/cls/lock/cls_lock_types.h
src/cls/log/cls_log.cc
src/cls/log/cls_log_client.cc
src/cls/log/cls_log_client.h
src/cls/log/cls_log_ops.h
src/cls/log/cls_log_types.h
src/cls/numops/cls_numops.cc
src/cls/otp/cls_otp.cc
src/cls/otp/cls_otp_client.cc
src/cls/otp/cls_otp_client.h
src/cls/otp/cls_otp_ops.h
src/cls/otp/cls_otp_types.cc
src/cls/otp/cls_otp_types.h
src/cls/queue/cls_queue.cc
src/cls/queue/cls_queue_ops.h
src/cls/queue/cls_queue_src.cc
src/cls/queue/cls_queue_types.h
src/cls/rbd/cls_rbd.cc
src/cls/rbd/cls_rbd.h
src/cls/rbd/cls_rbd_client.cc
src/cls/rbd/cls_rbd_client.h
src/cls/rbd/cls_rbd_types.cc
src/cls/rbd/cls_rbd_types.h
src/cls/refcount/cls_refcount.cc
src/cls/refcount/cls_refcount_client.cc
src/cls/refcount/cls_refcount_client.h
src/cls/refcount/cls_refcount_ops.cc
src/cls/refcount/cls_refcount_ops.h
src/cls/rgw/cls_rgw.cc
src/cls/rgw/cls_rgw_client.cc
src/cls/rgw/cls_rgw_client.h
src/cls/rgw/cls_rgw_const.h
src/cls/rgw/cls_rgw_ops.cc
src/cls/rgw/cls_rgw_ops.h
src/cls/rgw/cls_rgw_types.cc
src/cls/rgw/cls_rgw_types.h
src/cls/rgw_gc/cls_rgw_gc.cc
src/cls/rgw_gc/cls_rgw_gc_client.cc
src/cls/rgw_gc/cls_rgw_gc_client.h
src/cls/rgw_gc/cls_rgw_gc_ops.h
src/cls/rgw_gc/cls_rgw_gc_types.h
src/cls/timeindex/cls_timeindex.cc
src/cls/timeindex/cls_timeindex_client.h
src/cls/timeindex/cls_timeindex_ops.h
src/cls/timeindex/cls_timeindex_types.h
src/cls/user/cls_user.cc
src/cls/user/cls_user_client.cc
src/cls/user/cls_user_client.h
src/cls/user/cls_user_ops.cc
src/cls/user/cls_user_ops.h
src/cls/user/cls_user_types.cc
src/cls/user/cls_user_types.h
src/cls/version/cls_version.cc
src/cls/version/cls_version_client.cc
src/cls/version/cls_version_client.h
src/cls/version/cls_version_ops.h
src/cls/version/cls_version_types.cc
src/cls/version/cls_version_types.h

index a28fb648edae1cd6f8bc14046d38336c9d41facc..41e8166cecf10adcd254e11c2e65a427646b6c8d 100644 (file)
 CLS_VER(1,0)
 CLS_NAME(2pc_queue)
 
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
+
 constexpr auto CLS_QUEUE_URGENT_DATA_XATTR_NAME = "cls_queue_urgent_data";
 
 static int cls_2pc_queue_init(cls_method_context_t hctx, bufferlist *in, bufferlist *out) {
@@ -21,7 +25,7 @@ static int cls_2pc_queue_init(cls_method_context_t hctx, bufferlist *in, bufferl
   cls_queue_init_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_2pc_queue_init: failed to decode entry: %s", err.what());
     return -EINVAL;
   }
@@ -44,7 +48,7 @@ static int cls_2pc_queue_reserve(cls_method_context_t hctx, bufferlist *in, buff
   try {
     auto in_iter = in->cbegin();
     decode(res_op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_2pc_queue_reserve: failed to decode entry: %s", err.what());
     return -EINVAL;
   }
@@ -69,7 +73,7 @@ static int cls_2pc_queue_reserve(cls_method_context_t hctx, bufferlist *in, buff
   try {
     auto in_iter = head.bl_urgent_data.cbegin();
     decode(urgent_data, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_2pc_queue_reserve: failed to decode entry: %s", err.what());
     return -EINVAL;
   }
@@ -126,7 +130,7 @@ static int cls_2pc_queue_reserve(cls_method_context_t hctx, bufferlist *in, buff
       auto iter = bl_xattrs.cbegin();
       try {
         decode(xattr_reservations, iter);
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         CLS_LOG(1, "ERROR: cls_2pc_queue_reserve: failed to decode xattrs urgent data map");
         return -EINVAL;
       } //end - catch
@@ -178,7 +182,7 @@ static int cls_2pc_queue_commit(cls_method_context_t hctx, bufferlist *in, buffe
   try {
     auto in_iter = in->cbegin();
     decode(commit_op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_2pc_queue_commit: failed to decode entry: %s", err.what());
     return -EINVAL;
   }
@@ -194,7 +198,7 @@ static int cls_2pc_queue_commit(cls_method_context_t hctx, bufferlist *in, buffe
   try {
     auto in_iter = head.bl_urgent_data.cbegin();
     decode(urgent_data, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_2pc_queue_commit: failed to decode entry: %s", err.what());
     return -EINVAL;
   }
@@ -221,7 +225,7 @@ static int cls_2pc_queue_commit(cls_method_context_t hctx, bufferlist *in, buffe
     auto iter = bl_xattrs.cbegin();
     try {
       decode(xattr_reservations, iter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(1, "ERROR: cls_2pc_queue_commit: failed to decode xattrs urgent data map");
       return -EINVAL;
     } //end - catch
@@ -285,7 +289,7 @@ static int cls_2pc_queue_abort(cls_method_context_t hctx, bufferlist *in, buffer
   try {
     auto in_iter = in->cbegin();
     decode(abort_op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_2pc_queue_abort: failed to decode entry: %s", err.what());
     return -EINVAL;
   }
@@ -301,7 +305,7 @@ static int cls_2pc_queue_abort(cls_method_context_t hctx, bufferlist *in, buffer
   try {
     auto in_iter = head.bl_urgent_data.cbegin();
     decode(urgent_data, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_2pc_queue_abort: failed to decode entry: %s", err.what());
     return -EINVAL;
   }
@@ -329,7 +333,7 @@ static int cls_2pc_queue_abort(cls_method_context_t hctx, bufferlist *in, buffer
     cls_2pc_reservations xattr_reservations;
     try {
       decode(xattr_reservations, iter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(1, "ERROR: cls_2pc_queue_abort: failed to decode xattrs urgent data map");
       return -EINVAL;
     } //end - catch
@@ -375,7 +379,7 @@ static int cls_2pc_queue_list_reservations(cls_method_context_t hctx, bufferlist
   try {
     auto in_iter = head.bl_urgent_data.cbegin();
     decode(urgent_data, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_2pc_queue_list_reservations: failed to decode entry: %s", err.what());
     return -EINVAL;
   }
@@ -396,7 +400,7 @@ static int cls_2pc_queue_list_reservations(cls_method_context_t hctx, bufferlist
       auto iter = bl_xattrs.cbegin();
       try {
         decode(xattr_reservations, iter);
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         CLS_LOG(1, "ERROR: cls_2pc_queue_list_reservations: failed to decode xattrs urgent data map");
         return -EINVAL;
       } //end - catch
index 5a58dc6c4fa3e427458e619ec0e1f269e6961ecc..24b2be992fd0ddf61c6884b26226022fb9404438 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #pragma once
 
 #include "include/types.h"
@@ -7,14 +10,14 @@ struct cls_2pc_queue_reserve_op {
   uint64_t size;
   uint32_t entries;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(size, bl);
     encode(entries, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(size, bl);
     decode(entries, bl);
@@ -26,13 +29,13 @@ WRITE_CLASS_ENCODER(cls_2pc_queue_reserve_op)
 struct cls_2pc_queue_reserve_ret {
   cls_2pc_reservation::id_t id; // allocated reservation id
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(id, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(id, bl);
     DECODE_FINISH(bl);
@@ -42,16 +45,16 @@ WRITE_CLASS_ENCODER(cls_2pc_queue_reserve_ret)
 
 struct cls_2pc_queue_commit_op {
   cls_2pc_reservation::id_t id; // reservation to commit
-  std::vector<bufferlist> bl_data_vec; // the data to enqueue
+  std::vector<ceph::buffer::list> bl_data_vec; // the data to enqueue
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(id, bl);
     encode(bl_data_vec, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(id, bl);
     decode(bl_data_vec, bl);
@@ -64,13 +67,13 @@ WRITE_CLASS_ENCODER(cls_2pc_queue_commit_op)
 struct cls_2pc_queue_abort_op {
   cls_2pc_reservation::id_t id; // reservation to abort
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(id, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(id, bl);
     DECODE_FINISH(bl);
@@ -81,17 +84,16 @@ WRITE_CLASS_ENCODER(cls_2pc_queue_abort_op)
 struct cls_2pc_queue_reservations_ret {
   cls_2pc_reservations reservations; // reservation list (keyed by id)
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(reservations, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(reservations, bl);
     DECODE_FINISH(bl);
   }
 };
 WRITE_CLASS_ENCODER(cls_2pc_queue_reservations_ret)
-
index b0a175cc47210f9201c3bc57b3a952444c7d4430..82dc4e974f984cda46cfc1e4e8e6c509b0543aff 100644 (file)
@@ -1,3 +1,5 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
 #pragma once
 
 #include "include/types.h"
@@ -14,14 +16,14 @@ struct cls_2pc_reservation
 
   cls_2pc_reservation() = default;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(size, bl);
     encode(timestamp, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(size, bl);
     decode(timestamp, bl);
@@ -39,7 +41,7 @@ struct cls_2pc_urgent_data
   cls_2pc_reservations reservations; // reservation list (keyed by id)
   bool has_xattrs{false};
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(reserved_size, bl);
     encode(last_id, bl);
@@ -48,7 +50,7 @@ struct cls_2pc_urgent_data
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(reserved_size, bl);
     decode(last_id, bl);
@@ -58,4 +60,3 @@ struct cls_2pc_urgent_data
   }
 };
 WRITE_CLASS_ENCODER(cls_2pc_urgent_data)
-
index c6a7b9b591ad5896afd30c76ed276115b2b1fd1f..d5e5f0e28b856fccf520e2c36fd2abb753b21608 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include <errno.h>
@@ -9,6 +9,9 @@
 #include "include/compat.h"
 #include "osd/osd_types.h"
 
+using ceph::bufferlist;
+using ceph::decode;
+
 CLS_VER(1,0)
 CLS_NAME(cas)
 
@@ -28,7 +31,7 @@ static int chunk_read_refcount(cls_method_context_t hctx, chunk_obj_refcount *ob
   try {
     auto iter = bl.cbegin();
     decode(*objr, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: chunk_read_refcount(): failed to decode refcount entry\n");
     return -EIO;
   }
@@ -56,7 +59,7 @@ static int cls_rc_chunk_refcount_get(cls_method_context_t hctx, bufferlist *in,
   cls_chunk_refcount_get_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rc_refcount_get(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -84,7 +87,7 @@ static int cls_rc_chunk_refcount_put(cls_method_context_t hctx, bufferlist *in,
   cls_chunk_refcount_put_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rc_chunk_refcount_put(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -134,7 +137,7 @@ static int cls_rc_chunk_refcount_set(cls_method_context_t hctx, bufferlist *in,
   cls_chunk_refcount_set_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_chunk_refcount_set(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -182,7 +185,7 @@ static int cls_rc_write_or_get(cls_method_context_t hctx, bufferlist *in, buffer
     decode(src_obj, in_iter);
     in_iter.copy(op.extent.length, indata);
   }
-  catch (buffer::error& e) {
+  catch (ceph::buffer::error& e) {
     return -EINVAL;
   }
 
@@ -215,12 +218,12 @@ static int cls_rc_write_or_get(cls_method_context_t hctx, bufferlist *in, buffer
 static int cls_rc_has_chunk(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
   auto in_iter = in->cbegin();
-  string fp_oid;
+  std::string fp_oid;
   bufferlist indata, outdata;
   try {
     decode (fp_oid, in_iter);
   }
-  catch (buffer::error& e) {
+  catch (ceph::buffer::error& e) {
     return -EINVAL;
   }
   CLS_LOG(10, " fp_oid: %s \n", fp_oid.c_str());
index b041641f64492a610fa71b924b3c4489faff8ab5..8ccc445aff68b67f8300a8a10d65ca61e5f70522 100644 (file)
@@ -1,10 +1,18 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #include <errno.h>
 
 #include "cls/cas/cls_cas_client.h"
 #include "cls/cas/cls_cas_ops.h"
 #include "include/rados/librados.hpp"
 
-using namespace librados;
+using std::set;
+using std::string;
+
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
 
 void cls_chunk_refcount_get(librados::ObjectWriteOperation& op, const hobject_t& soid)
 {
@@ -44,7 +52,7 @@ int cls_chunk_refcount_read(librados::IoCtx& io_ctx, string& oid, set<hobject_t>
   try {
     auto iter = out.cbegin();
     decode(ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
index 323be9eb98c3fe871ad7890ba57a181465fd62bd..af64f342c015dfdf7eecd509f5f52aa696ebbd6f 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_CAS_CLIENT_H
 #define CEPH_CLS_CAS_CLIENT_H
 
@@ -5,9 +8,9 @@
 #include "include/rados/librados_fwd.hpp"
 #include "common/hobject.h"
 
-void cls_chunk_refcount_get(librados::ObjectWriteOperation& op, const hobject_t& soid);
+void cls_chunk_refcount_get(librados::ObjectWriteOperation& op,const hobject_t& soid);
 void cls_chunk_refcount_put(librados::ObjectWriteOperation& op, const hobject_t& soid);
-void cls_chunk_refcount_set(librados::ObjectWriteOperation& op, set<hobject_t>& refs);
-int cls_chunk_refcount_read(librados::IoCtx& io_ctx, string& oid, set<hobject_t> *refs);
-int cls_chunk_has_chunk(librados::IoCtx& io_ctx, string& oid, string& fp_oid);
+void cls_chunk_refcount_set(librados::ObjectWriteOperation& op, std::set<hobject_t>& refs);
+int cls_chunk_refcount_read(librados::IoCtx& io_ctx, std::string& oid, std::set<hobject_t> *refs);
+int cls_chunk_has_chunk(librados::IoCtx& io_ctx, std::string& oid, std::string& fp_oid);
 #endif
index 35bc90dfa4f83c5b672bc8b614d92008cadf8355..6632a61a01416570e93b56a981ab3f7aeac04362 100644 (file)
@@ -14,19 +14,19 @@ struct cls_chunk_refcount_get_op {
 
   cls_chunk_refcount_get_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(source, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(source, bl);
     DECODE_FINISH(bl);
   }
   void dump(ceph::Formatter *f) const;
-  static void generate_test_instances(list<cls_chunk_refcount_get_op*>& ls);
+  static void generate_test_instances(std::list<cls_chunk_refcount_get_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_chunk_refcount_get_op)
 
@@ -35,79 +35,79 @@ struct cls_chunk_refcount_put_op {
 
   cls_chunk_refcount_put_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(source, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(source, bl);
     DECODE_FINISH(bl);
   }
 
   void dump(ceph::Formatter *f) const;
-  static void generate_test_instances(list<cls_chunk_refcount_put_op*>& ls);
+  static void generate_test_instances(std::list<cls_chunk_refcount_put_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_chunk_refcount_put_op)
 
 struct cls_chunk_refcount_set_op {
-  set<hobject_t> refs;
+  std::set<hobject_t> refs;
 
   cls_chunk_refcount_set_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(refs, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(refs, bl);
     DECODE_FINISH(bl);
   }
 
   void dump(ceph::Formatter *f) const;
-  static void generate_test_instances(list<cls_chunk_refcount_set_op*>& ls);
+  static void generate_test_instances(std::list<cls_chunk_refcount_set_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_chunk_refcount_set_op)
 
 struct cls_chunk_refcount_read_ret {
-  set<hobject_t> refs;
+  std::set<hobject_t> refs;
 
   cls_chunk_refcount_read_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(refs, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(refs, bl);
     DECODE_FINISH(bl);
   }
 
   void dump(ceph::Formatter *f) const;
-  static void generate_test_instances(list<cls_chunk_refcount_read_ret*>& ls);
+  static void generate_test_instances(std::list<cls_chunk_refcount_read_ret*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_chunk_refcount_read_ret)
 
 struct chunk_obj_refcount {
-  set<hobject_t> refs;
+  std::set<hobject_t> refs;
 
   chunk_obj_refcount() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(refs, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(refs, bl);
     DECODE_FINISH(bl);
@@ -116,19 +116,19 @@ struct chunk_obj_refcount {
 WRITE_CLASS_ENCODER(chunk_obj_refcount)
 
 struct obj_refcount {
-  map<string, bool> refs;
-  set<string> retired_refs;
+  std::map<std::string, bool> refs;
+  std::set<std::string> retired_refs;
 
   obj_refcount() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(refs, bl);
     encode(retired_refs, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(refs, bl);
     if (struct_v >= 2) {
index 7207a6b4b849debc5c5b81566ca95d47e17bcb6e..dcd07b4bb5bf37fea6c5ed30bd3098cd60b7a1fd 100644 (file)
@@ -24,6 +24,9 @@
 CLS_VER(1,0)
 CLS_NAME(cephfs)
 
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
 
 std::ostream &operator<<(std::ostream &out, const ObjCeiling &in)
 {
@@ -65,7 +68,7 @@ static int set_if_greater(cls_method_context_t hctx,
         // Valid existing value, do comparison
         set_val = input_val > existing_val;
       }
-    } catch (const buffer::error &err) {
+    } catch (const ceph::buffer::error &err) {
       // Corrupt or empty existing value, overwrite it
       set_val = true;
     }
@@ -96,7 +99,7 @@ static int accumulate_inode_metadata(cls_method_context_t hctx,
   AccumulateArgs args;
   try {
     args.decode(q);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -132,7 +135,7 @@ public:
       InodeTagFilterArgs args;
       args.decode(params);
       scrub_tag = args.scrub_tag;
-    } catch (buffer::error &e) {
+    } catch (ceph::buffer::error &e) {
       return -EINVAL;
     }
 
@@ -173,7 +176,7 @@ bool PGLSCephFSFilter::filter(const hobject_t &obj,
       decode(tag_ondisk, q);
       if (tag_ondisk == scrub_tag)
        return false;
-    } catch (const buffer::error &err) {
+    } catch (const ceph::buffer::error &err) {
     }
   }
 
index 89f4dab45d3ae9b09e8dccd09f70b7adf16b22d0..37d656f113a3d45b7d8feb68d5fe4b0ff5a281e8 100644 (file)
@@ -36,7 +36,7 @@ class ObjCeiling {
       return id > rhs.id;
     }
 
-    void encode(bufferlist &bl) const
+    void encode(ceph::buffer::list &bl) const
     {
       ENCODE_START(1, 1, bl);
       encode(id, bl);
@@ -44,7 +44,7 @@ class ObjCeiling {
       ENCODE_FINISH(bl);
     }
 
-    void decode(bufferlist::const_iterator &p)
+    void decode(ceph::buffer::list::const_iterator &p)
     {
       DECODE_START(1, p);
       decode(id, p);
@@ -83,7 +83,7 @@ public:
     : obj_index(0), obj_size(0), mtime(0)
   {}
 
-  void encode(bufferlist &bl) const
+  void encode(ceph::buffer::list &bl) const
   {
     ENCODE_START(1, 1, bl);
     encode(obj_xattr_name, bl);
@@ -95,7 +95,7 @@ public:
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator &bl)
+  void decode(ceph::buffer::list::const_iterator &bl)
   {
     DECODE_START(1, bl);
     decode(obj_xattr_name, bl);
@@ -113,14 +113,14 @@ class InodeTagFilterArgs
   public:
     std::string scrub_tag;
 
-  void encode(bufferlist &bl) const
+  void encode(ceph::buffer::list &bl) const
   {
     ENCODE_START(1, 1, bl);
     encode(scrub_tag, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator &bl)
+  void decode(ceph::buffer::list::const_iterator &bl)
   {
     DECODE_START(1, bl);
     decode(scrub_tag, bl);
index 988eab41b9a6158545bef12b124d78bed3418007..d776443fe996205b4a7dd6eea2c7a5d86a1214da 100644 (file)
@@ -19,6 +19,9 @@
 
 #include "cls_cephfs_client.h"
 
+using ceph::bufferlist;
+using ceph::decode;
+
 #define XATTR_CEILING "scan_ceiling"
 #define XATTR_MAX_MTIME "scan_max_mtime"
 #define XATTR_MAX_SIZE "scan_max_size"
@@ -114,7 +117,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result(
     ceiling.decode(scan_ceiling_bl_iter);
     result->ceiling_obj_index = ceiling.id;
     result->ceiling_obj_size = ceiling.size;
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     //dout(4) << "Invalid size attr on '" << oid << "'" << dendl;
     return -EINVAL;
   }
@@ -123,7 +126,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result(
   try {
     auto scan_max_size_bl_iter = scan_max_size_bl.cbegin();
     decode(result->max_obj_size, scan_max_size_bl_iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     //dout(4) << "Invalid size attr on '" << oid << "'" << dendl;
     return -EINVAL;
   }
@@ -132,7 +135,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result(
   try {
     auto scan_max_mtime_bl_iter = scan_max_mtime_bl.cbegin();
     decode(result->max_mtime, scan_max_mtime_bl_iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     //dout(4) << "Invalid size attr on '" << oid << "'" << dendl;
     return -EINVAL;
   }
@@ -142,7 +145,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result(
     try {
       auto q = parent_bl.cbegin();
       backtrace->decode(q);
-    } catch (buffer::error &e) {
+    } catch (ceph::buffer::error &e) {
       //dout(4) << "Corrupt backtrace on '" << oid << "': " << e << dendl;
       return -EINVAL;
     }
@@ -153,7 +156,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result(
     try {
       auto q = layout_bl.cbegin();
       decode(*layout, q);
-    } catch (buffer::error &e) {
+    } catch (ceph::buffer::error &e) {
       return -EINVAL;
     }
   }
index 744c0aed0f6ce1c62a4859dc6458e229adf69c40..e2b23b4a6f97e321a41e50ecd25832185c53095d 100644 (file)
@@ -1,3 +1,5 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
 
 #include "include/rados/librados_fwd.hpp"
 #include "mds/mdstypes.h"
@@ -28,6 +30,5 @@ class ClsCephFSClient
 
   static void build_tag_filter(
       const std::string &scrub_tag,
-      bufferlist *out_bl);
+      ceph::buffer::list *out_bl);
 };
-
index 9f152ad6373810f6065e89ebf3320b5e57423331..d7263b431421edd5abdf60d35a88977bd8bb5e27 100644 (file)
 #include "objclass/objclass.h"
 #include "osd/osd_types.h"
 
-using ceph::bufferlist;
 using std::string;
+using std::ostringstream;
+
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
 
 CLS_VER(1,0)
 CLS_NAME(hello)
@@ -278,7 +282,7 @@ public:
     try {
       decode(xattr, params);
       decode(val, params);
-    } catch (buffer::error &e) {
+    } catch (ceph::buffer::error &e) {
       return -EINVAL;
     }
     return 0;
index 5102b3ebf2dbb100523abdc72d1719198e622f86..fb1267fba10fe095cf75d80ae2dc8d75f609d712 100644 (file)
 CLS_VER(1, 0)
 CLS_NAME(journal)
 
+using std::string;
+
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
+
 namespace {
 
 static const uint64_t MAX_KEYS_READ = 64;
@@ -68,7 +74,7 @@ int read_key(cls_method_context_t hctx, const string &key, T *t,
   try {
     auto iter = bl.cbegin();
     decode(*t, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -127,7 +133,7 @@ int expire_tags(cls_method_context_t hctx, const std::string *skip_client_id) {
       auto iter = val.second.cbegin();
       try {
         decode(client, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
         CLS_ERR("error decoding registered client: %s",
                 val.first.c_str());
         return -EIO;
@@ -176,7 +182,7 @@ int expire_tags(cls_method_context_t hctx, const std::string *skip_client_id) {
       auto iter = val.second.cbegin();
       try {
         decode(tag, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
         CLS_ERR("error decoding tag: %s", val.first.c_str());
         return -EIO;
       }
@@ -239,7 +245,7 @@ int get_client_list_range(cls_method_context_t hctx,
       cls::journal::Client client;
       decode(client, iter);
       clients->insert(client);
-    } catch (const buffer::error &err) {
+    } catch (const ceph::buffer::error &err) {
       CLS_ERR("could not decode client '%s': %s", it->first.c_str(),
               err.what());
       return -EIO;
@@ -313,7 +319,7 @@ int journal_create(cls_method_context_t hctx, bufferlist *in, bufferlist *out) {
     decode(order, iter);
     decode(splay_width, iter);
     decode(pool_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -459,7 +465,7 @@ int journal_set_minimum_set(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(object_set, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -530,7 +536,7 @@ int journal_set_active_set(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(object_set, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -582,7 +588,7 @@ int journal_get_client(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -614,7 +620,7 @@ int journal_client_register(cls_method_context_t hctx, bufferlist *in,
     auto iter = in->cbegin();
     decode(id, iter);
     decode(data, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -664,7 +670,7 @@ int journal_client_update_data(cls_method_context_t hctx, bufferlist *in,
     auto iter = in->cbegin();
     decode(id, iter);
     decode(data, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -703,7 +709,7 @@ int journal_client_update_state(cls_method_context_t hctx, bufferlist *in,
     uint8_t state_raw;
     decode(state_raw, iter);
     state = static_cast<cls::journal::ClientState>(state_raw);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -736,7 +742,7 @@ int journal_client_unregister(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -779,7 +785,7 @@ int journal_client_commit(cls_method_context_t hctx, bufferlist *in,
     auto iter = in->cbegin();
     decode(id, iter);
     decode(commit_position, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -830,7 +836,7 @@ int journal_client_list(cls_method_context_t hctx, bufferlist *in,
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -877,7 +883,7 @@ int journal_get_tag(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(tag_tid, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -912,7 +918,7 @@ int journal_tag_create(cls_method_context_t hctx, bufferlist *in,
     decode(tag_tid, iter);
     decode(tag_class, iter);
     decode(data, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -1007,7 +1013,7 @@ int journal_tag_list(cls_method_context_t hctx, bufferlist *in,
     decode(max_return, iter);
     decode(client_id, iter);
     decode(tag_class, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -1048,7 +1054,7 @@ int journal_tag_list(cls_method_context_t hctx, bufferlist *in,
       auto iter = val.second.cbegin();
       try {
         decode(tag, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
         CLS_ERR("error decoding tag: %s", val.first.c_str());
         return -EIO;
       }
@@ -1102,7 +1108,7 @@ int journal_object_guard_append(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(soft_max_size, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
@@ -1142,7 +1148,7 @@ int journal_object_append(cls_method_context_t hctx, bufferlist *in,
     auto iter = in->cbegin();
     decode(soft_max_size, iter);
     decode(data, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode input parameters: %s", err.what());
     return -EINVAL;
   }
index 6976304d0fe2255ba9cb3e2e92628b25f5fee4a5..6e9dfde87818fd55d46233d180fe62821549be12 100644 (file)
@@ -5,6 +5,9 @@
 #include "include/stringify.h"
 #include "common/Formatter.h"
 
+using ceph::bufferlist;
+using ceph::Formatter;
+
 namespace cls {
 namespace journal {
 
index e9aab96936aae68c4a69da47c6571e5e7281fbd0..96d28461db421db16460d87257e4dc35ddd55b7a 100644 (file)
 
 #include "include/compat.h"
 
+using std::map;
+using std::string;
 
+using ceph::bufferlist;
 using namespace rados::cls::lock;
 
-
 CLS_VER(1,0)
 CLS_NAME(lock)
 
@@ -67,7 +69,7 @@ static int read_lock(cls_method_context_t hctx,
   try {
     auto it = bl.cbegin();
     decode(*lock, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("error decoding %s", key.c_str());
     return -EIO;
   }
@@ -76,7 +78,7 @@ static int read_lock(cls_method_context_t hctx,
 
   utime_t now = ceph_clock_now();
 
-  map<locker_id_t, locker_info_t>::iterator iter = lock->lockers.begin();
+  auto iter = lock->lockers.begin();
 
   while (iter != lock->lockers.end()) {
     struct locker_info_t& info = iter->second;
@@ -167,8 +169,7 @@ static int lock_obj(cls_method_context_t hctx,
     return r;
   }
 
-  map<locker_id_t, locker_info_t>& lockers = linfo.lockers;
-  map<locker_id_t, locker_info_t>::iterator iter;
+  auto& lockers = linfo.lockers;
 
   locker_id_t id;
   id.cookie = cookie;
@@ -186,7 +187,7 @@ static int lock_obj(cls_method_context_t hctx,
 
   ClsLockType existing_lock_type = linfo.lock_type;
   CLS_LOG(20, "existing_lock_type=%s", cls_lock_type_str(existing_lock_type));
-  iter = lockers.find(id);
+  auto iter = lockers.find(id);
   if (iter != lockers.end()) {
     if (fail_if_exists && !fail_if_does_not_exist) {
       return -EEXIST;
@@ -259,7 +260,7 @@ static int lock_op(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -291,11 +292,11 @@ static int remove_lock(cls_method_context_t hctx,
     return r;
   }
 
-  map<locker_id_t, locker_info_t>& lockers = linfo.lockers;
+  auto& lockers = linfo.lockers;
   struct locker_id_t id(locker, cookie);
 
   // remove named locker from set
-  map<locker_id_t, locker_info_t>::iterator iter = lockers.find(id);
+  auto iter = lockers.find(id);
   if (iter == lockers.end()) { // no such key
     CLS_LOG(10, "locker %s [name: %s.%ld, cookie: %s] does not exist", name.c_str(), 
             locker.type_str(), locker.num(), cookie.c_str());
@@ -331,7 +332,7 @@ static int unlock_op(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error& err) {
+  } catch (const ceph::buffer::error& err) {
     return -EINVAL;
   }
 
@@ -359,7 +360,7 @@ static int break_lock(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error& err) {
+  } catch (const ceph::buffer::error& err) {
     return -EINVAL;
   }
 
@@ -385,7 +386,7 @@ static int get_info(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error& err) {
+  } catch (const ceph::buffer::error& err) {
     return -EINVAL;
   }
 
@@ -399,8 +400,7 @@ static int get_info(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   struct cls_lock_get_info_reply ret;
 
-  map<locker_id_t, locker_info_t>::iterator iter;
-  for (iter = linfo.lockers.begin(); iter != linfo.lockers.end(); ++iter) {
+  for (auto iter = linfo.lockers.begin(); iter != linfo.lockers.end(); ++iter) {
     ret.lockers[iter->first] = iter->second;
   }
   ret.lock_type = linfo.lock_type;
@@ -435,9 +435,8 @@ static int list_locks(cls_method_context_t hctx, bufferlist *in, bufferlist *out
 
   cls_lock_list_locks_reply ret;
 
-  map<string, bufferlist>::iterator iter;
   size_t pos = sizeof(LOCK_PREFIX) - 1;
-  for (iter = attrs.begin(); iter != attrs.end(); ++iter) {
+  for (auto iter = attrs.begin(); iter != attrs.end(); ++iter) {
     const string& attr = iter->first;
     if (attr.substr(0, pos).compare(LOCK_PREFIX) == 0) {
       ret.locks.push_back(attr.substr(pos));
@@ -468,7 +467,7 @@ int assert_locked(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error& err) {
+  } catch (const ceph::buffer::error& err) {
     return -EINVAL;
   }
 
@@ -513,7 +512,7 @@ int assert_locked(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   id.cookie = op.cookie;
   id.locker = inst.name;
 
-  map<locker_id_t, locker_info_t>::iterator iter = linfo.lockers.find(id);
+  auto iter = linfo.lockers.find(id);
   if (iter == linfo.lockers.end()) {
     CLS_LOG(20, "not locked by assert client");
     return -EBUSY;
@@ -540,7 +539,7 @@ int set_cookie(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error& err) {
+  } catch (const ceph::buffer::error& err) {
     return -EINVAL;
   }
 
index 498d573f20d078d016763506427034b2603818fb..ce979b6cd5372ce8a092e46e285012c8e41b54b2 100644 (file)
 #include "msg/msg_types.h"
 #include "include/rados/librados.hpp"
 #include "include/utime.h"
-using namespace librados;
 
 #include "cls/lock/cls_lock_ops.h"
 #include "cls/lock/cls_lock_client.h"
 
+using std::map;
+
+using namespace librados;
+
+
 namespace rados {
   namespace cls {
     namespace lock {
 
       void lock(ObjectWriteOperation *rados_op,
-                const string& name, ClsLockType type,
-                const string& cookie, const string& tag,
-                const string& description,
+                const std::string& name, ClsLockType type,
+                const std::string& cookie, const std::string& tag,
+                const std::string& description,
                 const utime_t& duration, uint8_t flags)
       {
         cls_lock_lock_op op;
@@ -46,10 +49,10 @@ namespace rados {
       }
 
       int lock(IoCtx *ioctx,
-               const string& oid,
-               const string& name, ClsLockType type,
-               const string& cookie, const string& tag,
-               const string& description, const utime_t& duration,
+               const std::string& oid,
+               const std::string& name, ClsLockType type,
+               const std::string& cookie, const std::string& tag,
+               const std::string& description, const utime_t& duration,
               uint8_t flags)
       {
         ObjectWriteOperation op;
@@ -58,7 +61,7 @@ namespace rados {
       }
 
       void unlock(ObjectWriteOperation *rados_op,
-                  const string& name, const string& cookie)
+                  const std::string& name, const std::string& cookie)
       {
         cls_lock_unlock_op op;
         op.name = name;
@@ -69,16 +72,16 @@ namespace rados {
         rados_op->exec("lock", "unlock", in);
       }
 
-      int unlock(IoCtx *ioctx, const string& oid,
-                 const string& name, const string& cookie)
+      int unlock(IoCtx *ioctx, const std::string& oid,
+                 const std::string& name, const std::string& cookie)
       {
         ObjectWriteOperation op;
         unlock(&op, name, cookie);
         return ioctx->operate(oid, &op);
       }
 
-      int aio_unlock(IoCtx *ioctx, const string& oid,
-                    const string& name, const string& cookie,
+      int aio_unlock(IoCtx *ioctx, const std::string& oid,
+                    const std::string& name, const std::string& cookie,
                     librados::AioCompletion *completion)
       {
         ObjectWriteOperation op;
@@ -87,7 +90,7 @@ namespace rados {
       }
 
       void break_lock(ObjectWriteOperation *rados_op,
-                      const string& name, const string& cookie,
+                      const std::string& name, const std::string& cookie,
                       const entity_name_t& locker)
       {
         cls_lock_break_op op;
@@ -99,8 +102,8 @@ namespace rados {
         rados_op->exec("lock", "break_lock", in);
       }
 
-      int break_lock(IoCtx *ioctx, const string& oid,
-                     const string& name, const string& cookie,
+      int break_lock(IoCtx *ioctx, const std::string& oid,
+                     const std::string& name, const std::string& cookie,
                      const entity_name_t& locker)
       {
         ObjectWriteOperation op;
@@ -108,7 +111,7 @@ namespace rados {
         return ioctx->operate(oid, &op);
       }
 
-      int list_locks(IoCtx *ioctx, const string& oid, list<string> *locks)
+      int list_locks(IoCtx *ioctx, const std::string& oid, std::list<std::string> *locks)
       {
         bufferlist in, out;
         int r = ioctx->exec(oid, "lock", "list_locks", in, out);
@@ -116,10 +119,10 @@ namespace rados {
           return r;
 
         cls_lock_list_locks_reply ret;
-        auto iter = cbegin(out);
+        auto iter = std::cbegin(out);
         try {
           decode(ret, iter);
-        } catch (buffer::error& err) {
+        } catch (ceph::buffer::error& err) {
          return -EBADMSG;
         }
 
@@ -129,7 +132,7 @@ namespace rados {
       }
 
       void get_lock_info_start(ObjectReadOperation *rados_op,
-                              const string& name)
+                              const std::string& name)
       {
         bufferlist in;
         cls_lock_get_info_op op;
@@ -140,12 +143,12 @@ namespace rados {
 
       int get_lock_info_finish(bufferlist::const_iterator *iter,
                               map<locker_id_t, locker_info_t> *lockers,
-                              ClsLockType *type, string *tag)
+                              ClsLockType *type, std::string *tag)
       {
         cls_lock_get_info_reply ret;
         try {
           decode(ret, *iter);
-        } catch (buffer::error& err) {
+        } catch (ceph::buffer::error& err) {
          return -EBADMSG;
         }
 
@@ -164,9 +167,9 @@ namespace rados {
         return 0;
       }
 
-      int get_lock_info(IoCtx *ioctx, const string& oid, const string& name,
+      int get_lock_info(IoCtx *ioctx, const std::string& oid, const std::string& name,
                         map<locker_id_t, locker_info_t> *lockers,
-                        ClsLockType *type, string *tag)
+                        ClsLockType *type, std::string *tag)
       {
         ObjectReadOperation op;
         get_lock_info_start(&op, name);
@@ -229,7 +232,7 @@ namespace rados {
              cookie, tag, description, duration, flags);
       }
 
-      int Lock::lock_shared(IoCtx *ioctx, const string& oid)
+      int Lock::lock_shared(IoCtx *ioctx, const std::string& oid)
       {
         return lock(ioctx, oid, name, LOCK_SHARED,
                     cookie, tag, description, duration, flags);
@@ -241,7 +244,7 @@ namespace rados {
              cookie, tag, description, duration, flags);
       }
 
-      int Lock::lock_exclusive(IoCtx *ioctx, const string& oid)
+      int Lock::lock_exclusive(IoCtx *ioctx, const std::string& oid)
       {
         return lock(ioctx, oid, name, LOCK_EXCLUSIVE,
                     cookie, tag, description, duration, flags);
@@ -253,7 +256,7 @@ namespace rados {
              cookie, tag, description, duration, flags);
       }
 
-      int Lock::lock_exclusive_ephemeral(IoCtx *ioctx, const string& oid)
+      int Lock::lock_exclusive_ephemeral(IoCtx *ioctx, const std::string& oid)
       {
         return lock(ioctx, oid, name, LOCK_EXCLUSIVE_EPHEMERAL,
                     cookie, tag, description, duration, flags);
@@ -264,7 +267,7 @@ namespace rados {
        rados::cls::lock::unlock(op, name, cookie);
       }
 
-      int Lock::unlock(IoCtx *ioctx, const string& oid)
+      int Lock::unlock(IoCtx *ioctx, const std::string& oid)
       {
         return rados::cls::lock::unlock(ioctx, oid, name, cookie);
       }
@@ -274,11 +277,10 @@ namespace rados {
        rados::cls::lock::break_lock(op, name, cookie, locker);
       }
 
-      int Lock::break_lock(IoCtx *ioctx, const string& oid, const entity_name_t& locker)
+      int Lock::break_lock(IoCtx *ioctx, const std::string& oid, const entity_name_t& locker)
       {
           return rados::cls::lock::break_lock(ioctx, oid, name, cookie, locker);
       }
     } // namespace lock
   } // namespace cls
 } // namespace rados
-
index 11c0e6584374ab8bdd2ea731da97b456547d5b4c..92e1396bf9d613efd02279763a2e08d360a05ff0 100644 (file)
@@ -44,16 +44,16 @@ namespace rados {
                            const entity_name_t& locker);
 
       extern int list_locks(librados::IoCtx *ioctx, const std::string& oid,
-                           list<std::string> *locks);
+                           std::list<std::string> *locks);
       extern void get_lock_info_start(librados::ObjectReadOperation *rados_op,
                                      const std::string& name);
       extern int get_lock_info_finish(ceph::bufferlist::const_iterator *out,
-                                     map<locker_id_t, locker_info_t> *lockers,
+                                     std::map<locker_id_t, locker_info_t> *lockers,
                                      ClsLockType *type, std::string *tag);
 
       extern int get_lock_info(librados::IoCtx *ioctx, const std::string& oid,
                               const std::string& name,
-                              map<locker_id_t, locker_info_t> *lockers,
+                              std::map<locker_id_t, locker_info_t> *lockers,
                               ClsLockType *type, std::string *tag);
 
       extern void assert_locked(librados::ObjectOperation *rados_op,
index 5d22452b3b2554d6a7ce02cc188b68aa08fcc2f0..3df75f22ed1ec2037e2b02c541e6569f2e3faf91 100644 (file)
 
 struct cls_lock_lock_op
 {
-  string name;
+  std::string name;
   ClsLockType type;
-  string cookie;
-  string tag;
-  string description;
+  std::string cookie;
+  std::string tag;
+  std::string description;
   utime_t duration;
   uint8_t flags;
 
   cls_lock_lock_op() : type(LOCK_NONE), flags(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(name, bl);
     uint8_t t = (uint8_t)type;
@@ -32,7 +32,7 @@ struct cls_lock_lock_op
     encode(flags, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
     decode(name, bl);
     uint8_t t;
@@ -45,92 +45,92 @@ struct cls_lock_lock_op
     decode(flags, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_lock_lock_op*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_lock_lock_op*>& o);
 };
 WRITE_CLASS_ENCODER(cls_lock_lock_op)
 
 struct cls_lock_unlock_op
 {
-  string name;
-  string cookie;
+  std::string name;
+  std::string cookie;
 
   cls_lock_unlock_op() {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(name, bl);
     encode(cookie, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
     decode(name, bl);
     decode(cookie, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_lock_unlock_op*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_lock_unlock_op*>& o);
 };
 WRITE_CLASS_ENCODER(cls_lock_unlock_op)
 
 struct cls_lock_break_op
 {
-  string name;
+  std::string name;
   entity_name_t locker;
-  string cookie;
+  std::string cookie;
 
   cls_lock_break_op() {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(name, bl);
     encode(locker, bl);
     encode(cookie, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
     decode(name, bl);
     decode(locker, bl);
     decode(cookie, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_lock_break_op*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_lock_break_op*>& o);
 };
 WRITE_CLASS_ENCODER(cls_lock_break_op)
 
 struct cls_lock_get_info_op
 {
-  string name;
+  std::string name;
 
   cls_lock_get_info_op() {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(name, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
     decode(name, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_lock_get_info_op*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_lock_get_info_op*>& o);
 };
 WRITE_CLASS_ENCODER(cls_lock_get_info_op)
 
 struct cls_lock_get_info_reply
 {
-  map<rados::cls::lock::locker_id_t, rados::cls::lock::locker_info_t> lockers;
+  std::map<rados::cls::lock::locker_id_t, rados::cls::lock::locker_info_t> lockers;
   ClsLockType lock_type;
-  string tag;
+  std::string tag;
 
   cls_lock_get_info_reply() : lock_type(LOCK_NONE) {}
 
-  void encode(bufferlist &bl, uint64_t features) const {
+  void encode(ceph::buffer::list &bl, uint64_t features) const {
     ENCODE_START(1, 1, bl);
     encode(lockers, bl, features);
     uint8_t t = (uint8_t)lock_type;
@@ -138,7 +138,7 @@ struct cls_lock_get_info_reply
     encode(tag, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
     decode(lockers, bl);
     uint8_t t;
@@ -147,42 +147,42 @@ struct cls_lock_get_info_reply
     decode(tag, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_lock_get_info_reply*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_lock_get_info_reply*>& o);
 };
 WRITE_CLASS_ENCODER_FEATURES(cls_lock_get_info_reply)
 
 struct cls_lock_list_locks_reply
 {
-  list<string> locks;
+  std::list<std::string> locks;
 
   cls_lock_list_locks_reply() {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(locks, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
     decode(locks, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_lock_list_locks_reply*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_lock_list_locks_reply*>& o);
 };
 WRITE_CLASS_ENCODER(cls_lock_list_locks_reply)
 
 struct cls_lock_assert_op
 {
-  string name;
+  std::string name;
   ClsLockType type;
-  string cookie;
-  string tag;
+  std::string cookie;
+  std::string tag;
 
   cls_lock_assert_op() : type(LOCK_NONE) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(name, bl);
     uint8_t t = (uint8_t)type;
@@ -191,7 +191,7 @@ struct cls_lock_assert_op
     encode(tag, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
     decode(name, bl);
     uint8_t t;
@@ -201,22 +201,22 @@ struct cls_lock_assert_op
     decode(tag, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_lock_assert_op*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_lock_assert_op*>& o);
 };
 WRITE_CLASS_ENCODER(cls_lock_assert_op)
 
 struct cls_lock_set_cookie_op
 {
-  string name;
+  std::string name;
   ClsLockType type;
-  string cookie;
-  string tag;
-  string new_cookie;
+  std::string cookie;
+  std::string tag;
+  std::string new_cookie;
 
   cls_lock_set_cookie_op() : type(LOCK_NONE) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(name, bl);
     uint8_t t = (uint8_t)type;
@@ -226,7 +226,7 @@ struct cls_lock_set_cookie_op
     encode(new_cookie, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl);
     decode(name, bl);
     uint8_t t;
@@ -237,8 +237,8 @@ struct cls_lock_set_cookie_op
     decode(new_cookie, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_lock_set_cookie_op*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_lock_set_cookie_op*>& o);
 };
 WRITE_CLASS_ENCODER(cls_lock_set_cookie_op)
 
index d1aa63342126009efb6672c09a0173b215e9fe1a..9a9a510f3df5bb992cc3f0c4bfe77267920371dc 100644 (file)
@@ -9,7 +9,7 @@
  * modify it under the terms of the GNU Lesser General Public
  * License version 2.1, as published by the Free Software 
  * Foundation.  See file COPYING.
- * 
+ *
  */
 
 #include "common/Formatter.h"
 
 using namespace rados::cls::lock;
 
-static void generate_lock_id(locker_id_t& i, int n, const string& cookie)
+static void generate_lock_id(locker_id_t& i, int n, const std::string& cookie)
 {
   i.locker = entity_name_t::CLIENT(n);
   i.cookie = cookie;
 }
 
-void locker_id_t::dump(Formatter *f) const
+void locker_id_t::dump(ceph::Formatter *f) const
 {
   f->dump_stream("locker") << locker;
   f->dump_string("cookie", cookie);
 }
 
-void locker_id_t::generate_test_instances(list<locker_id_t*>& o)
+void locker_id_t::generate_test_instances(std::list<locker_id_t*>& o)
 {
   locker_id_t *i = new locker_id_t;
   generate_lock_id(*i, 1, "cookie");
@@ -38,7 +38,7 @@ void locker_id_t::generate_test_instances(list<locker_id_t*>& o)
   o.push_back(new locker_id_t);
 }
 
-void locker_info_t::dump(Formatter *f) const
+void locker_info_t::dump(ceph::Formatter *f) const
 {
   f->dump_stream("expiration") << expiration;
   f->dump_string("addr", addr.get_legacy_str());
@@ -57,7 +57,7 @@ static void generate_test_addr(entity_addr_t& a, int nonce, int port)
   a.set_port(port);
 }
 
-void locker_info_t::generate_test_instances(list<locker_info_t*>& o)
+void locker_info_t::generate_test_instances(std::list<locker_info_t*>& o)
 {
   locker_info_t *i = new locker_info_t;
   i->expiration = utime_t(5, 0);
@@ -67,7 +67,7 @@ void locker_info_t::generate_test_instances(list<locker_info_t*>& o)
   o.push_back(new locker_info_t);
 }
 
-void lock_info_t::dump(Formatter *f) const
+void lock_info_t::dump(ceph::Formatter *f) const
 {
   f->dump_int("lock_type", lock_type);
   f->dump_string("tag", tag);
@@ -81,7 +81,7 @@ void lock_info_t::dump(Formatter *f) const
   f->close_section();
 }
 
-void lock_info_t::generate_test_instances(list<lock_info_t *>& o)
+void lock_info_t::generate_test_instances(std::list<lock_info_t *>& o)
 {
   lock_info_t *i = new lock_info_t;
   locker_id_t id;
index e3f15fe628a58964ce1ebbfc3a6d20dfc4611fcf..df05c69c24a14cf032d16251225aed9da0b9853a 100644 (file)
@@ -84,13 +84,13 @@ namespace rados {
             return true;
           return false;
         }
-        void dump(Formatter *f) const;
+        void dump(ceph::Formatter *f) const;
        friend std::ostream& operator<<(std::ostream& out,
                                        const locker_id_t& data) {
          out << data.locker;
          return out;
        }
-        static void generate_test_instances(list<locker_id_t*>& o);
+        static void generate_test_instances(std::list<locker_id_t*>& o);
       };
       WRITE_CLASS_ENCODER(locker_id_t)
 
@@ -118,9 +118,10 @@ namespace rados {
           decode(description, bl);
           DECODE_FINISH(bl);
         }
-        void dump(Formatter *f) const;
+        void dump(ceph::Formatter *f) const;
        friend std::ostream& operator<<(std::ostream& out,
                                        const locker_info_t& data) {
+         using ceph::operator <<;
          out << "{addr:" << data.addr << ", exp:";
 
          const auto& exp = data.expiration;
@@ -132,12 +133,12 @@ namespace rados {
 
          return out;
        }
-        static void generate_test_instances(list<locker_info_t *>& o);
+        static void generate_test_instances(std::list<locker_info_t *>& o);
       };
       WRITE_CLASS_ENCODER_FEATURES(locker_info_t)
 
       struct lock_info_t {
-        map<locker_id_t, locker_info_t> lockers; // map of lockers
+       std::map<locker_id_t, locker_info_t> lockers; // map of lockers
         ClsLockType lock_type;                   // lock type (exclusive / shared)
        std::string tag;                              // tag: operations on lock can only succeed with this tag
                                                  //      as long as set of non expired lockers
@@ -161,8 +162,8 @@ namespace rados {
           DECODE_FINISH(bl);
         }
         lock_info_t() : lock_type(LOCK_NONE) {}
-        void dump(Formatter *f) const;
-        static void generate_test_instances(list<lock_info_t *>& o);
+        void dump(ceph::Formatter *f) const;
+        static void generate_test_instances(std::list<lock_info_t *>& o);
       };
       WRITE_CLASS_ENCODER_FEATURES(lock_info_t);
     }
index ad3de9499fa1b55a9e6bf937f5781dcb7e51cf7a..58a8524da34123b7ed0a2c128afa81e3e985bbfb 100644 (file)
 #include "global/global_context.h"
 #include "include/compat.h"
 
+using std::map;
+using std::string;
+
+using ceph::bufferlist;
+
 CLS_VER(1,0)
 CLS_NAME(log)
 
@@ -53,7 +58,7 @@ static int read_header(cls_method_context_t hctx, cls_log_header& header)
   auto iter = header_bl.cbegin();
   try {
     decode(header, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: read_header(): failed to decode header");
   }
 
@@ -90,7 +95,7 @@ static int cls_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist *ou
   cls_log_add_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_log_add_op(): failed to decode op");
     return -EINVAL;
   }
@@ -101,8 +106,7 @@ static int cls_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist *ou
   if (ret < 0)
     return ret;
 
-  for (list<cls_log_entry>::iterator iter = op.entries.begin();
-       iter != op.entries.end(); ++iter) {
+  for (auto iter = op.entries.begin(); iter != op.entries.end(); ++iter) {
     cls_log_entry& entry = *iter;
 
     string index;
@@ -145,7 +149,7 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o
   cls_log_list_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_log_list_op(): failed to decode op");
     return -EINVAL;
   }
@@ -176,8 +180,8 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o
   if (rc < 0)
     return rc;
 
-  list<cls_log_entry>& entries = ret.entries;
-  map<string, bufferlist>::iterator iter = keys.begin();
+  auto& entries = ret.entries;
+  auto iter = keys.begin();
 
   string marker;
 
@@ -195,7 +199,7 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o
       cls_log_entry e;
       decode(e, biter);
       entries.push_back(e);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(0, "ERROR: cls_log_list: could not decode entry, index=%s", index.c_str());
     }
   }
@@ -215,7 +219,7 @@ static int cls_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlist *o
   cls_log_trim_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: cls_log_trim(): failed to decode entry");
     return -EINVAL;
   }
@@ -280,7 +284,7 @@ static int cls_log_info(cls_method_context_t hctx, bufferlist *in, bufferlist *o
   cls_log_info_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_log_add_op(): failed to decode op");
     return -EINVAL;
   }
index accc9dd14375eee2f436fb2e9c912bb2ca3b85ae..418599c8066e4842cf9880b8817d783aae271b0d 100644 (file)
@@ -1,3 +1,5 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
 #include <errno.h>
 
 #include "cls/log/cls_log_ops.h"
@@ -5,6 +7,11 @@
 #include "include/compat.h"
 
 
+using std::list;
+using std::string;
+
+using ceph::bufferlist;
+
 using namespace librados;
 
 
@@ -99,7 +106,7 @@ public:
           *truncated = ret.truncated;
         if (marker)
           *marker = std::move(ret.marker);
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         // nothing we can do about it atm
       }
     }
@@ -135,7 +142,7 @@ public:
         decode(ret, iter);
         if (header)
          *header = ret.header;
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         // nothing we can do about it atm
       }
     }
@@ -151,4 +158,3 @@ void cls_log_info(librados::ObjectReadOperation& op, cls_log_header *header)
 
   op.exec("log", "info", inbl, new LogInfoCtx(header));
 }
-
index b994206bec6d8e6b315b3c4d1442e32c4429d32c..b049c2cc01bda293940d4990156cc7178a050e2b 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_LOG_CLIENT_H
 #define CEPH_CLS_LOG_CLIENT_H
 
  */
 
 void cls_log_add_prepare_entry(cls_log_entry& entry, const utime_t& timestamp,
-                 const string& section, const string& name, bufferlist& bl);
+                 const std::string& section, const std::string& name, ceph::buffer::list& bl);
 
-void cls_log_add(librados::ObjectWriteOperation& op, list<cls_log_entry>& entries, bool monotonic_inc);
+void cls_log_add(librados::ObjectWriteOperation& op, std::list<cls_log_entry>& entries, bool monotonic_inc);
 void cls_log_add(librados::ObjectWriteOperation& op, cls_log_entry& entry);
 void cls_log_add(librados::ObjectWriteOperation& op, const utime_t& timestamp,
-                 const string& section, const string& name, bufferlist& bl);
+                 const std::string& section, const std::string& name, ceph::buffer::list& bl);
 
 void cls_log_list(librados::ObjectReadOperation& op, utime_t& from, utime_t& to,
-                  const string& in_marker, int max_entries,
-                 list<cls_log_entry>& entries,
-                  string *out_marker, bool *truncated);
+                  const std::string& in_marker, int max_entries,
+                 std::list<cls_log_entry>& entries,
+                  std::string *out_marker, bool *truncated);
 
 void cls_log_trim(librados::ObjectWriteOperation& op, const utime_t& from_time, const utime_t& to_time,
-                  const string& from_marker, const string& to_marker);
+                  const std::string& from_marker, const std::string& to_marker);
 
 // these overloads which call io_ctx.operate() should not be called in the rgw.
 // rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()
 #ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_log_trim(librados::IoCtx& io_ctx, const string& oid, const utime_t& from_time, const utime_t& to_time,
-                 const string& from_marker, const string& to_marker);
+int cls_log_trim(librados::IoCtx& io_ctx, const std::string& oid, const utime_t& from_time, const utime_t& to_time,
+                 const std::string& from_marker, const std::string& to_marker);
 #endif
 
 void cls_log_info(librados::ObjectReadOperation& op, cls_log_header *header);
index 2967da6ea687c8c07429a1bd95cddd1da9c86ade..0cedc8802a5e43f1a0525895e6d3ba54f3ae0492 100644 (file)
@@ -7,19 +7,19 @@
 #include "cls_log_types.h"
 
 struct cls_log_add_op {
-  list<cls_log_entry> entries;
+  std::list<cls_log_entry> entries;
   bool monotonic_inc;
 
   cls_log_add_op() : monotonic_inc(true) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(entries, bl);
     encode(monotonic_inc, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(entries, bl);
     if (struct_v >= 2) {
@@ -32,14 +32,14 @@ WRITE_CLASS_ENCODER(cls_log_add_op)
 
 struct cls_log_list_op {
   utime_t from_time;
-  string marker; /* if not empty, overrides from_time */
+  std::string marker; /* if not empty, overrides from_time */
   utime_t to_time; /* not inclusive */
   int max_entries; /* upperbound to returned num of entries
                       might return less than that and still be truncated */
 
   cls_log_list_op() : max_entries(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(from_time, bl);
     encode(marker, bl);
@@ -48,7 +48,7 @@ struct cls_log_list_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(from_time, bl);
     decode(marker, bl);
@@ -60,13 +60,13 @@ struct cls_log_list_op {
 WRITE_CLASS_ENCODER(cls_log_list_op)
 
 struct cls_log_list_ret {
-  list<cls_log_entry> entries;
-  string marker;
+  std::list<cls_log_entry> entries;
+  std::string marker;
   bool truncated;
 
   cls_log_list_ret() : truncated(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entries, bl);
     encode(marker, bl);
@@ -74,7 +74,7 @@ struct cls_log_list_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     decode(marker, bl);
@@ -92,12 +92,12 @@ WRITE_CLASS_ENCODER(cls_log_list_ret)
 struct cls_log_trim_op {
   utime_t from_time;
   utime_t to_time; /* inclusive */
-  string from_marker;
-  string to_marker;
+  std::string from_marker;
+  std::string to_marker;
 
   cls_log_trim_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(from_time, bl);
     encode(to_time, bl);
@@ -106,7 +106,7 @@ struct cls_log_trim_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(from_time, bl);
     decode(to_time, bl);
@@ -122,13 +122,13 @@ WRITE_CLASS_ENCODER(cls_log_trim_op)
 struct cls_log_info_op {
   cls_log_info_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     // currently empty request
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     // currently empty request
     DECODE_FINISH(bl);
@@ -139,13 +139,13 @@ WRITE_CLASS_ENCODER(cls_log_info_op)
 struct cls_log_info_ret {
   cls_log_header header;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(header, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(header, bl);
     DECODE_FINISH(bl);
index 5ec8628f6ac359cdb91fced82e76b9802fffe6f2..b5ab8f3cb1320d34e3c1ebaa367c5153bf7d3722 100644 (file)
@@ -1,3 +1,5 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
 #ifndef CEPH_CLS_LOG_TYPES_H
 #define CEPH_CLS_LOG_TYPES_H
 
@@ -10,15 +12,15 @@ class JSONObj;
 
 
 struct cls_log_entry {
-  string id;
-  string section;
-  string name;
+  std::string id;
+  std::string section;
+  std::string name;
   utime_t timestamp;
-  bufferlist data;
+  ceph::buffer::list data;
 
   cls_log_entry() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(section, bl);
     encode(name, bl);
@@ -28,7 +30,7 @@ struct cls_log_entry {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(section, bl);
     decode(name, bl);
@@ -42,17 +44,17 @@ struct cls_log_entry {
 WRITE_CLASS_ENCODER(cls_log_entry)
 
 struct cls_log_header {
-  string max_marker;
+  std::string max_marker;
   utime_t max_time;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(max_marker, bl);
     encode(max_time, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(max_marker, bl);
     decode(max_time, bl);
index 30a203ef1e327ba6cb36c47bbaf0f372f75b1627..331eb7dca516c239f225ea23db27177d633764fd 100644 (file)
@@ -1,3 +1,5 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
 /*
  * Ceph - scalable distributed file system
  *
@@ -44,7 +46,7 @@ static int add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     decode(key, iter);
     decode(diff_str, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_LOG(20, "add: invalid decode of input");
     return -EINVAL;
   }
@@ -99,7 +101,7 @@ static int mul(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     decode(key, iter);
     decode(diff_str, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_LOG(20, "mul: invalid decode of input");
     return -EINVAL;
   }
index 355e14dab3e08d9174f3a64fb3450dfc48567eb6..9143f6241b152a8d9c695a33d73bbdf28562720b 100644 (file)
 #include "cls/otp/cls_otp_ops.h"
 #include "cls/otp/cls_otp_types.h"
 
+using std::list;
+using std::string;
+using std::set;
+
+using ceph::bufferlist;
+using ceph::encode;
+using ceph::real_clock;
 
 using namespace rados::cls::otp;
 
@@ -147,7 +154,7 @@ bool otp_instance::verify(const ceph::real_time& timestamp, const string& val)
 
 void otp_instance::find(const string& token, otp_check_t *result)
 {
-  ceph::real_time now = real_clock::now();
+  auto now = real_clock::now();
   trim_expired(now);
 
   for (auto& entry : boost::adaptors::reverse(last_checks)) {
@@ -177,7 +184,7 @@ static int get_otp_instance(cls_method_context_t hctx, const string& id, otp_ins
   try {
     auto it = bl.cbegin();
     decode(*instance, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("ERROR: failed to decode %s", key.c_str());
     return -EIO;
   }
@@ -236,7 +243,7 @@ static int read_header(cls_method_context_t hctx, otp_header *h)
   auto iter = bl.cbegin();
   try {
     decode(*h, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_ERR("failed to decode otp_header");
     return -EIO;
   }
@@ -299,7 +306,7 @@ static int otp_set_op(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -348,7 +355,7 @@ static int otp_remove_op(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -394,7 +401,7 @@ static int otp_get_op(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -445,7 +452,7 @@ static int otp_check_op(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -481,7 +488,7 @@ static int otp_get_result(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -511,7 +518,7 @@ static int otp_get_current_time_op(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(op, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
index dc1efab4132a7a0f3b1e5fb19124e9f474b1929e..0ba55571f8d1dae9dd2fdd8687edfcd8973e4df6 100644 (file)
@@ -16,7 +16,9 @@
 #include "msg/msg_types.h"
 #include "include/rados/librados.hpp"
 #include "include/utime.h"
+
+using std::list;
+using std::string;
 using namespace librados;
 
 #include "cls/otp/cls_otp_ops.h"
@@ -85,7 +87,7 @@ namespace rados {
         cls_otp_get_result_reply ret;
         try {
           decode(ret, iter);
-        } catch (buffer::error& err) {
+        } catch (ceph::buffer::error& err) {
          return -EBADMSG;
         }
 
@@ -123,7 +125,7 @@ namespace rados {
         auto iter = out.cbegin();
         try {
           decode(ret, iter);
-        } catch (buffer::error& err) {
+        } catch (ceph::buffer::error& err) {
          return -EBADMSG;
         }
 
@@ -176,7 +178,7 @@ namespace rados {
         auto iter = out.cbegin();
         try {
           decode(ret, iter);
-        } catch (buffer::error& err) {
+        } catch (ceph::buffer::error& err) {
          return -EBADMSG;
         }
 
@@ -187,4 +189,3 @@ namespace rados {
     } // namespace otp
   } // namespace cls
 } // namespace rados
-
index f1dec9f5681f2b1e9a13cb7e07df6636603f2eb5..a921e4e383f4659b24fd06b148c87e04c582bb8e 100644 (file)
@@ -14,23 +14,23 @@ namespace rados {
       class OTP {
       public:
         static void create(librados::ObjectWriteOperation *op, const otp_info_t& config);
-        static void set(librados::ObjectWriteOperation *op, const list<otp_info_t>& entries);
-        static void remove(librados::ObjectWriteOperation *op, const string& id);
+        static void set(librados::ObjectWriteOperation *op, const std::list<otp_info_t>& entries);
+        static void remove(librados::ObjectWriteOperation *op, const std::string& id);
         static int get(librados::ObjectReadOperation *op,
-                       librados::IoCtx& ioctx, const string& oid,
-                       const string& id, otp_info_t *result);
+                       librados::IoCtx& ioctx, const std::string& oid,
+                       const std::string& id, otp_info_t *result);
         static int get_all(librados::ObjectReadOperation *op,
-                           librados::IoCtx& ioctx, const string& oid,
-                           list<otp_info_t> *result);
+                           librados::IoCtx& ioctx, const std::string& oid,
+                           std::list<otp_info_t> *result);
 // these overloads which call io_ctx.operate() or io_ctx.exec() should not be called in the rgw.
 // rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()/exec()
 #ifndef CLS_CLIENT_HIDE_IOCTX
         static int get(librados::ObjectReadOperation *op,
-                       librados::IoCtx& ioctx, const string& oid,
-                       const list<string> *ids, bool get_all, list<otp_info_t> *result);
-        static int check(CephContext *cct, librados::IoCtx& ioctx, const string& oid,
-                         const string& id, const string& val, otp_check_t *result);
-        static int get_current_time(librados::IoCtx& ioctx, const string& oid,
+                       librados::IoCtx& ioctx, const std::string& oid,
+                       const std::list<std::string> *ids, bool get_all, std::list<otp_info_t> *result);
+        static int check(CephContext *cct, librados::IoCtx& ioctx, const std::string& oid,
+                         const std::string& id, const std::string& val, otp_check_t *result);
+        static int get_current_time(librados::IoCtx& ioctx, const std::string& oid,
                                     ceph::real_time *result);
 #endif
       };
@@ -38,7 +38,7 @@ namespace rados {
       class TOTPConfig {
         otp_info_t config;
         public:
-          TOTPConfig(const string& id, const string& seed) {
+          TOTPConfig(const std::string& id, const std::string& seed) {
             config.type = OTP_TOTP;
             config.id = id;
             config.seed = seed;
index 51cec3eb37bcab0558d20252a81d021599f7c441..970bd3a7809f495aaad1fb0097dae723e4ad0cfe 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_OTP_OPS_H
 #define CEPH_CLS_OTP_OPS_H
 
 
 struct cls_otp_set_otp_op
 {
-  list<rados::cls::otp::otp_info_t> entries;
+  std::list<rados::cls::otp::otp_info_t> entries;
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(entries, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     DECODE_FINISH(bl);
@@ -24,18 +27,18 @@ WRITE_CLASS_ENCODER(cls_otp_set_otp_op)
 
 struct cls_otp_check_otp_op
 {
-  string id;
-  string val;
-  string token;
+  std::string id;
+  std::string val;
+  std::string token;
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(id, bl);
     encode(val, bl);
     encode(token, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(id, bl);
     decode(val, bl);
@@ -47,14 +50,14 @@ WRITE_CLASS_ENCODER(cls_otp_check_otp_op)
 
 struct cls_otp_get_result_op
 {
-  string token;
+  std::string token;
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(token, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(token, bl);
     DECODE_FINISH(bl);
@@ -66,12 +69,12 @@ struct cls_otp_get_result_reply
 {
   rados::cls::otp::otp_check_t result;
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(result, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(result, bl);
     DECODE_FINISH(bl);
@@ -81,14 +84,14 @@ WRITE_CLASS_ENCODER(cls_otp_get_result_reply)
 
 struct cls_otp_remove_otp_op
 {
-  list<string> ids;
+  std::list<std::string> ids;
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(ids, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(ids, bl);
     DECODE_FINISH(bl);
@@ -99,15 +102,15 @@ WRITE_CLASS_ENCODER(cls_otp_remove_otp_op)
 struct cls_otp_get_otp_op
 {
   bool get_all{false};
-  list<string> ids;
+  std::list<std::string> ids;
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(get_all, bl);
     encode(ids, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(get_all, bl);
     decode(ids, bl);
@@ -118,14 +121,14 @@ WRITE_CLASS_ENCODER(cls_otp_get_otp_op)
 
 struct cls_otp_get_otp_reply
 {
-  list<rados::cls::otp::otp_info_t> found_entries;
+  std::list<rados::cls::otp::otp_info_t> found_entries;
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(found_entries, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(found_entries, bl);
     DECODE_FINISH(bl);
@@ -135,11 +138,11 @@ WRITE_CLASS_ENCODER(cls_otp_get_otp_reply)
 
 struct cls_otp_get_current_time_op
 {
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     DECODE_FINISH(bl);
   }
@@ -150,12 +153,12 @@ struct cls_otp_get_current_time_reply
 {
   ceph::real_time time;
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(time, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(time, bl);
     DECODE_FINISH(bl);
index b8a6e0125e4bbfb3d0d5e34092ea0f1d5139c192..1f95749ed1afdf0896b4ed0e680c94ab9ac767ca 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 /*
  * Ceph - scalable distributed file system
@@ -7,9 +7,9 @@
  *
  * This is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software 
+ * License version 2.1, as published by the Free Software
  * Foundation.  See file COPYING.
- * 
+ *
  */
 
 #include "objclass/objclass.h"
 
 #include "cls/otp/cls_otp_types.h"
 
+using std::string;
+
+using ceph::Formatter;
+
 using namespace rados::cls::otp;
 
 void otp_info_t::dump(Formatter *f) const
index b542b5cbd87844c6de10069862a3c6779967de1a..6e431b330c746a4ad69e2ecd2eba19bb9681f385 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_OTP_TYPES_H
 #define CEPH_CLS_OTP_TYPES_H
 
@@ -27,10 +30,10 @@ namespace rados {
 
       struct otp_info_t {
         OTPType type{OTP_TOTP};
-        string id;
-        string seed;
+        std::string id;
+        std::string seed;
         SeedType seed_type{OTP_SEED_UNKNOWN};
-        bufferlist seed_bin; /* parsed seed, built automatically by otp_set_op,
+        ceph::buffer::list seed_bin; /* parsed seed, built automatically by otp_set_op,
                               * not being json encoded/decoded on purpose
                               */
         int32_t time_ofs{0};
@@ -39,7 +42,7 @@ namespace rados {
 
         otp_info_t() {}
 
-        void encode(bufferlist &bl) const {
+        void encode(ceph::buffer::list &bl) const {
           ENCODE_START(1, 1, bl);
           encode((uint8_t)type, bl);
           /* if we ever implement anything other than TOTP
@@ -53,7 +56,7 @@ namespace rados {
           encode(window, bl);
           ENCODE_FINISH(bl);
         }
-        void decode(bufferlist::const_iterator &bl) {
+        void decode(ceph::buffer::list::const_iterator &bl) {
           DECODE_START(1, bl);
           uint8_t t;
           decode(t, bl);
@@ -69,7 +72,7 @@ namespace rados {
           decode(window, bl);
           DECODE_FINISH(bl);
         }
-        void dump(Formatter *f) const;
+        void dump(ceph::Formatter *f) const;
         void decode_json(JSONObj *obj);
       };
       WRITE_CLASS_ENCODER(rados::cls::otp::otp_info_t)
@@ -81,18 +84,18 @@ namespace rados {
       };
 
       struct otp_check_t {
-        string token;
+        std::string token;
         ceph::real_time timestamp;
         OTPCheckResult result{OTP_CHECK_UNKNOWN};
 
-        void encode(bufferlist &bl) const {
+        void encode(ceph::buffer::list &bl) const {
           ENCODE_START(1, 1, bl);
           encode(token, bl);
           encode(timestamp, bl);
           encode((char)result, bl);
           ENCODE_FINISH(bl);
         }
-        void decode(bufferlist::const_iterator &bl) {
+        void decode(ceph::buffer::list::const_iterator &bl) {
           DECODE_START(1, bl);
           decode(token, bl);
           decode(timestamp, bl);
@@ -105,16 +108,16 @@ namespace rados {
       WRITE_CLASS_ENCODER(rados::cls::otp::otp_check_t)
 
       struct otp_repo_t {
-        map<string, otp_info_t> entries;
+        std::map<std::string, otp_info_t> entries;
 
         otp_repo_t() {}
 
-        void encode(bufferlist &bl) const {
+        void encode(ceph::buffer::list &bl) const {
           ENCODE_START(1, 1, bl);
           encode(entries, bl);
           ENCODE_FINISH(bl);
         }
-        void decode(bufferlist::const_iterator &bl) {
+        void decode(ceph::buffer::list::const_iterator &bl) {
           DECODE_START(1, bl);
           decode(entries, bl);
           DECODE_FINISH(bl);
index 54bddb25498fa0e77c87324e1711d7c003f1757b..cf4daaac8b64701649289bdc37bf485482e75c20 100644 (file)
 #include "cls/queue/cls_queue_const.h"
 #include "cls/queue/cls_queue_src.h"
 
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
+
 CLS_VER(1,0)
 CLS_NAME(queue)
 
@@ -20,7 +24,7 @@ static int cls_queue_init(cls_method_context_t hctx, bufferlist *in, bufferlist
   cls_queue_init_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_queue_init_op(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -46,7 +50,7 @@ static int cls_queue_enqueue(cls_method_context_t hctx, bufferlist *in, bufferli
   cls_queue_enqueue_op op;
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_queue_enqueue: failed to decode input data \n");
     return -EINVAL;
   }
@@ -72,7 +76,7 @@ static int cls_queue_list_entries(cls_method_context_t hctx, bufferlist *in, buf
   cls_queue_list_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(5, "ERROR: cls_queue_list_entries(): failed to decode input data\n");
     return -EINVAL;
   }
@@ -99,7 +103,7 @@ static int cls_queue_remove_entries(cls_method_context_t hctx, bufferlist *in, b
   cls_queue_remove_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(5, "ERROR: cls_queue_remove_entries: failed to decode input data\n");
     return -EINVAL;
   }
index e48b03dd20fcfc08f12855539e86efa84443095e..64891cffb390959e4b4c98373c1ae58f6b4f04ce 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_QUEUE_OPS_H
 #define CEPH_CLS_QUEUE_OPS_H
 
@@ -6,11 +9,11 @@
 struct cls_queue_init_op {
   uint64_t queue_size{0};
   uint64_t max_urgent_data_size{0};
-  bufferlist bl_urgent_data;
+  ceph::buffer::list bl_urgent_data;
 
   cls_queue_init_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(queue_size, bl);
     encode(max_urgent_data_size, bl);
@@ -18,7 +21,7 @@ struct cls_queue_init_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(queue_size, bl);
     decode(max_urgent_data_size, bl);
@@ -30,17 +33,17 @@ struct cls_queue_init_op {
 WRITE_CLASS_ENCODER(cls_queue_init_op)
 
 struct cls_queue_enqueue_op {
-  vector<bufferlist> bl_data_vec;
+  std::vector<ceph::buffer::list> bl_data_vec;
 
   cls_queue_enqueue_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(bl_data_vec, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(bl_data_vec, bl);
     DECODE_FINISH(bl);
@@ -50,18 +53,18 @@ WRITE_CLASS_ENCODER(cls_queue_enqueue_op)
 
 struct cls_queue_list_op {
   uint64_t max;
-  string start_marker;
+  std::string start_marker;
 
   cls_queue_list_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(max, bl);
     encode(start_marker, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(max, bl);
     decode(start_marker, bl);
@@ -72,12 +75,12 @@ WRITE_CLASS_ENCODER(cls_queue_list_op)
 
 struct cls_queue_list_ret {
   bool is_truncated;
-  string next_marker;
-  vector<cls_queue_entry> entries;
+  std::string next_marker;
+  std::vector<cls_queue_entry> entries;
 
   cls_queue_list_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(is_truncated, bl);
     encode(next_marker, bl);
@@ -85,7 +88,7 @@ struct cls_queue_list_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(is_truncated, bl);
     decode(next_marker, bl);
@@ -96,17 +99,17 @@ struct cls_queue_list_ret {
 WRITE_CLASS_ENCODER(cls_queue_list_ret)
 
 struct cls_queue_remove_op {
-  string end_marker;
+  std::string end_marker;
 
   cls_queue_remove_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(end_marker, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(end_marker, bl);
     DECODE_FINISH(bl);
@@ -119,13 +122,13 @@ struct cls_queue_get_capacity_ret {
 
   cls_queue_get_capacity_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(queue_capacity, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(queue_capacity, bl);
     DECODE_FINISH(bl);
@@ -133,4 +136,4 @@ struct cls_queue_get_capacity_ret {
 };
 WRITE_CLASS_ENCODER(cls_queue_get_capacity_ret)
 
-#endif /* CEPH_CLS_QUEUE_OPS_H */
\ No newline at end of file
+#endif /* CEPH_CLS_QUEUE_OPS_H */
index ed5fe6df5b286664880beaa79269edbb01e4832b..8900482d2df4b7229bdb2ae5a3ef0866672d22d3 100644 (file)
@@ -9,6 +9,10 @@
 #include "cls/queue/cls_queue_const.h"
 #include "cls/queue/cls_queue_src.h"
 
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
+
 int queue_write_head(cls_method_context_t hctx, cls_queue_head& head)
 {
   bufferlist bl;
@@ -52,7 +56,7 @@ int queue_read_head(cls_method_context_t hctx, cls_queue_head& head)
   uint16_t queue_head_start;
   try {
     decode(queue_head_start, it);
-  } catch (buffer::error& err) {
+  } catch (const ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: queue_read_head: failed to decode queue start: %s", err.what());
     return -EINVAL;
   }
@@ -64,7 +68,7 @@ int queue_read_head(cls_method_context_t hctx, cls_queue_head& head)
   uint64_t encoded_len;
   try {
     decode(encoded_len, it);
-  } catch (buffer::error& err) {
+  } catch (const ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: queue_read_head: failed to decode encoded head size: %s", err.what());
     return -EINVAL;
   }
@@ -83,7 +87,7 @@ int queue_read_head(cls_method_context_t hctx, cls_queue_head& head)
 
   try {
     decode(head, it);
-  } catch (buffer::error& err) {
+  } catch (const ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: queue_read_head: failed to decode head: %s", err.what());
     return -EINVAL;
   }
@@ -345,7 +349,7 @@ int queue_list_entries(cls_method_context_t hctx, const cls_queue_list_op& op, c
           // Decode magic number at start
           try {
             decode(entry_start, it);
-          } catch (buffer::error& err) {
+          } catch (const ceph::buffer::error& err) {
             CLS_LOG(10, "ERROR: queue_list_entries: failed to decode entry start: %s", err.what());
             return -EINVAL;
           }
@@ -358,7 +362,7 @@ int queue_list_entries(cls_method_context_t hctx, const cls_queue_list_op& op, c
           // Decode data size
           try {
             decode(data_size, it);
-          } catch (buffer::error& err) {
+          } catch (const ceph::buffer::error& err) {
             CLS_LOG(10, "ERROR: queue_list_entries: failed to decode data size: %s", err.what());
             return -EINVAL;
           }
index 0a253bdfefb8ed19fc263e7b9b1fdb585704c8ab..cc46df405052061a7dff7041d38bdfeb778465cb 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_QUEUE_TYPES_H
 #define CEPH_CLS_QUEUE_TYPES_H
 
@@ -15,17 +18,17 @@ constexpr unsigned int QUEUE_ENTRY_OVERHEAD = sizeof(uint16_t) + sizeof(uint64_t
 
 struct cls_queue_entry
 {
-  bufferlist data;
+  ceph::buffer::list data;
   std::string marker;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(data, bl);
     encode(marker, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(data, bl);
     decode(marker, bl);
@@ -39,23 +42,22 @@ struct cls_queue_marker
   uint64_t offset{0};
   uint64_t gen{0};
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(gen, bl);
     encode(offset, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(gen, bl);
     decode(offset, bl);
     DECODE_FINISH(bl);
   }
 
-  string to_str() {
-    string marker = std::to_string(gen) + '/' + std::to_string(offset);
-    return marker;
+  std::string to_str() {
+    return std::to_string(gen) + '/' + std::to_string(offset);
   }
 
   int from_str(const char* str) {
@@ -89,9 +91,9 @@ struct cls_queue_head
   cls_queue_marker tail{QUEUE_START_OFFSET_1K, 0};
   uint64_t queue_size{0}; // size of queue requested by user, with head size added to it
   uint64_t max_urgent_data_size{0};
-  bufferlist bl_urgent_data;  // special data known to application using queue
+  ceph::buffer::list bl_urgent_data;  // special data known to application using queue
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(max_head_size, bl);
     encode(front, bl);
@@ -102,7 +104,7 @@ struct cls_queue_head
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(max_head_size, bl);
     decode(front, bl);
index 6c8dfc61a3d3756f55d5bc5e14bc231a1ae5e2c9..33910b7df518282f603cb1ad5ff7e65c90e0a3df 100644 (file)
 
 #include <boost/algorithm/string/predicate.hpp>
 
+using std::istringstream;
+using std::ostringstream;
+using std::map;
+using std::set;
+using std::string;
+using std::vector;
+
+using ceph::BitVector;
+using ceph::bufferlist;
+using ceph::bufferptr;
+using ceph::encode;
+using ceph::decode;
+
 /*
  * Object keys:
  *
@@ -173,7 +186,7 @@ static int read_key(cls_method_context_t hctx, const string &key, T *out)
   try {
     auto it = bl.cbegin();
     decode(*out, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("error decoding %s", key.c_str());
     return -EIO;
   }
@@ -528,7 +541,7 @@ int iterate(cls_method_context_t hctx, L& lambda) {
       auto iter = val.second.cbegin();
       try {
        decode(snap_meta, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
        CLS_ERR("error decoding snapshot metadata for snap : %s",
                val.first.c_str());
        return -EIO;
@@ -767,7 +780,7 @@ int create(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     if (!iter.end()) {
       decode(data_pool_id, iter);
     }
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -862,7 +875,7 @@ int get_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     if (!iter.end()) {
       decode(read_only, iter);
     }
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -902,7 +915,7 @@ int set_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     decode(features, iter);
     decode(mask, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -971,7 +984,7 @@ int get_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   auto iter = in->cbegin();
   try {
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -1020,7 +1033,7 @@ int set_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   auto iter = in->cbegin();
   try {
     decode(size, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -1086,7 +1099,7 @@ int get_protection_status(cls_method_context_t hctx, bufferlist *in,
   auto iter = in->cbegin();
   try {
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_LOG(20, "get_protection_status: invalid decode");
     return -EINVAL;
   }
@@ -1141,7 +1154,7 @@ int set_protection_status(cls_method_context_t hctx, bufferlist *in,
   try {
     decode(snap_id, iter);
     decode(status, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_LOG(20, "set_protection_status: invalid decode");
     return -EINVAL;
   }
@@ -1255,7 +1268,7 @@ int set_stripe_unit_count(cls_method_context_t hctx, bufferlist *in, bufferlist
   try {
     decode(stripe_unit, iter);
     decode(stripe_count, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_LOG(20, "set_stripe_unit_count: invalid decode");
     return -EINVAL;
   }
@@ -1319,7 +1332,7 @@ int get_create_timestamp(cls_method_context_t hctx, bufferlist *in, bufferlist *
     try {
       auto it = bl.cbegin();
       decode(timestamp, it);
-    } catch (const buffer::error &err) {
+    } catch (const ceph::buffer::error &err) {
       CLS_ERR("could not decode create_timestamp");
       return -EIO;
     }
@@ -1356,7 +1369,7 @@ int get_access_timestamp(cls_method_context_t hctx, bufferlist *in, bufferlist *
     try {
       auto it = bl.cbegin();
       decode(timestamp, it);
-    } catch (const buffer::error &err) {
+    } catch (const ceph::buffer::error &err) {
       CLS_ERR("could not decode access_timestamp");
       return -EIO;
     }
@@ -1393,7 +1406,7 @@ int get_modify_timestamp(cls_method_context_t hctx, bufferlist *in, bufferlist *
     try {
       auto it = bl.cbegin();
       decode(timestamp, it);
-    } catch (const buffer::error &err) {
+    } catch (const ceph::buffer::error &err) {
       CLS_ERR("could not decode modify_timestamp");
       return -EIO;
     }
@@ -1421,7 +1434,7 @@ int get_flags(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   auto iter = in->cbegin();
   try {
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -1474,7 +1487,7 @@ int set_flags(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     if (!iter.end()) {
       decode(snap_id, iter);
     }
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -1564,7 +1577,7 @@ int op_features_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     decode(op_features, iter);
     decode(mask, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -1598,7 +1611,7 @@ int get_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   auto iter = in->cbegin();
   try {
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -1677,7 +1690,7 @@ int set_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     uint64_t overlap;
     decode(overlap, iter);
     parent.head_overlap = overlap;
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_LOG(20, "cls_rbd::set_parent: invalid decode");
     return -EINVAL;
   }
@@ -1767,7 +1780,7 @@ int parent_overlap_get(cls_method_context_t hctx, bufferlist *in,
   auto iter = in->cbegin();
   try {
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -1828,7 +1841,7 @@ int parent_attach(cls_method_context_t hctx, bufferlist *in, bufferlist *out) {
     if (!iter.end()) {
       decode(reattach, iter);
     }
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_LOG(20, "cls_rbd::parent_attach: invalid decode");
     return -EINVAL;
   }
@@ -1870,7 +1883,7 @@ static int decode_parent_common(bufferlist::const_iterator& it, uint64_t *pool_i
     decode(*pool_id, it);
     decode(*image_id, it);
     decode(*snap_id, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("error decoding parent spec");
     return -EINVAL;
   }
@@ -1894,7 +1907,7 @@ static int decode_parent_and_child(bufferlist *in, uint64_t *pool_id,
     return r;
   try {
     decode(*c_image_id, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("error decoding child image id");
     return -EINVAL;
   }
@@ -2096,8 +2109,7 @@ int get_snapcontext(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     if (r < 0)
       return r;
 
-    for (set<string>::const_iterator it = keys.begin();
-        it != keys.end(); ++it) {
+    for (auto it = keys.begin(); it != keys.end(); ++it) {
       if ((*it).find(RBD_SNAP_KEY_PREFIX) != 0)
        break;
       snapid_t snap_id = snap_id_from_key(*it);
@@ -2185,7 +2197,7 @@ int get_snapshot_name(cls_method_context_t hctx, bufferlist *in, bufferlist *out
   auto iter = in->cbegin();
   try {
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -2223,7 +2235,7 @@ int get_snapshot_timestamp(cls_method_context_t hctx, bufferlist *in, bufferlist
   auto iter = in->cbegin();
   try {
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -2260,7 +2272,7 @@ int snapshot_get(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   auto iter = in->cbegin();
   try {
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -2310,7 +2322,7 @@ int snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     if (!iter.end()) {
       decode(snap_meta.snapshot_namespace, iter);
     }
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -2443,7 +2455,7 @@ int snapshot_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(src_snap_id, iter);
     decode(dst_snap_name, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -2505,7 +2517,7 @@ int snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -2614,7 +2626,7 @@ int snapshot_trash_add(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -2714,7 +2726,7 @@ int sparse_copyup(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(extent_map, iter);
     decode(data, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_LOG(20, "sparse_copyup: invalid decode");
     return -EINVAL;
   }
@@ -2738,7 +2750,7 @@ int sparse_copyup(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     bufferlist tmpbl;
     try {
       tmpbl.substr_of(data, data_offset, len);
-    } catch (const buffer::error &err) {
+    } catch (const ceph::buffer::error &err) {
       CLS_LOG(20, "sparse_copyup: invalid data");
       return -EINVAL;
     }
@@ -2788,7 +2800,7 @@ int get_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = read_bl.cbegin();
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EIO;
   }
 
@@ -2816,7 +2828,7 @@ int set_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3011,7 +3023,7 @@ int dir_rename_image(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     decode(src, iter);
     decode(dest, iter);
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3040,7 +3052,7 @@ int dir_get_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(name, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3074,7 +3086,7 @@ int dir_get_name(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3115,7 +3127,7 @@ int dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3136,13 +3148,12 @@ int dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       return r;
     }
 
-    for (map<string, bufferlist>::iterator it = vals.begin();
-        it != vals.end(); ++it) {
+    for (auto it = vals.begin(); it != vals.end(); ++it) {
       string id;
       auto iter = it->second.cbegin();
       try {
        decode(id, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
        CLS_ERR("could not decode id of image '%s'", it->first.c_str());
        return -EIO;
       }
@@ -3187,7 +3198,7 @@ int dir_add_image(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(name, iter);
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3212,7 +3223,7 @@ int dir_remove_image(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(name, iter);
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3235,7 +3246,7 @@ int dir_state_assert(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(directory_state, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3267,7 +3278,7 @@ int dir_state_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(directory_state, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3329,7 +3340,7 @@ int object_map_read(cls_method_context_t hctx, BitVector<2> &object_map)
   try {
     auto iter = bl.cbegin();
     decode(object_map, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode object map: %s", err.what());
     return -EINVAL;
   }
@@ -3374,7 +3385,7 @@ int object_map_save(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(object_map, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3405,7 +3416,7 @@ int object_map_resize(cls_method_context_t hctx, bufferlist *in, bufferlist *out
     auto iter = in->cbegin();
     decode(object_count, iter);
     decode(default_state, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3473,7 +3484,7 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out
     decode(end_object_no, iter);
     decode(new_object_state, iter);
     decode(current_object_state, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode message");
     return -EINVAL;
   }
@@ -3496,7 +3507,7 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out
   try {
     auto it = header_bl.cbegin();
     object_map.decode_header(it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode object map header: %s", err.what());
     return -EINVAL;
   }
@@ -3516,7 +3527,7 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out
   try {
     auto it = footer_bl.cbegin();
     object_map.decode_header_crc(it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode object map header CRC: %s", err.what());
   }
 
@@ -3540,7 +3551,7 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out
   try {
     auto it = footer_bl.cbegin();
     object_map.decode_data_crcs(it, start_object_no);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode object map data CRCs: %s", err.what());
   }
 
@@ -3560,7 +3571,7 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out
   try {
     auto it = data_bl.cbegin();
     object_map.decode_data(it, data_byte_offset);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("failed to decode data chunk [%" PRIu64 "]: %s",
            data_byte_offset, err.what());
     return -EINVAL;
@@ -3661,7 +3672,7 @@ int object_map_snap_remove(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(src_object_map, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3724,7 +3735,7 @@ int metadata_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3777,12 +3788,11 @@ int metadata_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   auto iter = in->cbegin();
   try {
     decode(data, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
-  for (map<string, bufferlist>::iterator it = data.begin();
-       it != data.end(); ++it) {
+  for (auto it = data.begin(); it != data.end(); ++it) {
     CLS_LOG(20, "metadata_set key=%s value=%.*s", it->first.c_str(),
            it->second.length(), it->second.c_str());
     raw_data[metadata_key_for_name(it->first)].swap(it->second);
@@ -3810,7 +3820,7 @@ int metadata_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   auto iter = in->cbegin();
   try {
     decode(key, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3841,7 +3851,7 @@ int metadata_get(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   auto iter = in->cbegin();
   try {
     decode(key, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3887,7 +3897,7 @@ int snapshot_set_limit(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(new_limit, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -3961,7 +3971,7 @@ int child_attach(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto it = in->cbegin();
     decode(snap_id, it);
     decode(child_image, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -4034,7 +4044,7 @@ int child_detach(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto it = in->cbegin();
     decode(snap_id, it);
     decode(child_image, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -4124,7 +4134,7 @@ int children_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto it = in->cbegin();
     decode(snap_id, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -4167,7 +4177,7 @@ int migration_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out) {
   try {
     auto it = in->cbegin();
     decode(migration_spec, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -4198,7 +4208,7 @@ int migration_set_state(cls_method_context_t hctx, bufferlist *in,
     auto it = in->cbegin();
     decode(state, it);
     decode(description, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -4280,7 +4290,7 @@ int assert_snapc_seq(cls_method_context_t hctx, bufferlist *in,
     auto it = in->cbegin();
     decode(snapc_seq, it);
     decode(state, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -4362,7 +4372,7 @@ int old_snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     decode(s, iter);
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
   snap_name = s.c_str();
@@ -4450,7 +4460,7 @@ int old_snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *o
 
   try {
     decode(s, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
   snap_name = s.c_str();
@@ -4544,7 +4554,7 @@ int old_snapshot_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *o
   try {
     decode(src_snap_id, iter);
     decode(dst, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
   dst_snap_name = dst.c_str();
@@ -4704,7 +4714,7 @@ int read_peers(cls_method_context_t hctx,
         cls::rbd::MirrorPeer peer;
        decode(peer, bl_it);
         peers->push_back(peer);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
        CLS_ERR("could not decode peer '%s'", it.first.c_str());
        return -EIO;
       }
@@ -4730,7 +4740,7 @@ int read_peer(cls_method_context_t hctx, const std::string &id,
   try {
     auto bl_it = bl.cbegin();
     decode(*peer, bl_it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("could not decode peer '%s'", id.c_str());
     return -EIO;
   }
@@ -4939,7 +4949,7 @@ int image_get(cls_method_context_t hctx, const string &image_id,
   try {
     auto it = bl.cbegin();
     decode(*mirror_image, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("could not decode mirrored image '%s'", image_id.c_str());
     return -EIO;
   }
@@ -5133,7 +5143,7 @@ int image_status_get(cls_method_context_t hctx, const string &global_image_id,
   try {
     auto it = bl.cbegin();
     decode(ondisk_status, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("could not decode status for mirrored image, global id '%s', "
             "site '%s'",
             global_image_id.c_str(), mirror_uuid.c_str());
@@ -5269,7 +5279,7 @@ int image_status_list(cls_method_context_t hctx,
       auto iter = it->second.cbegin();
       try {
        decode(mirror_image, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
        CLS_ERR("could not decode mirror image payload of image '%s'",
                 image_id.c_str());
        return -EIO;
@@ -5390,7 +5400,7 @@ int image_status_get_summary(
       auto iter = list_it.second.cbegin();
       try {
        decode(mirror_image, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
        CLS_ERR("could not decode mirror image payload for key '%s'",
                 key.c_str());
        return -EIO;
@@ -5450,7 +5460,7 @@ int image_status_remove_down(cls_method_context_t hctx) {
         try {
           auto it = list_it.second.cbegin();
           status.decode_meta(it);
-        } catch (const buffer::error &err) {
+        } catch (const ceph::buffer::error &err) {
           CLS_ERR("could not decode status metadata for mirrored image '%s'",
                   key.c_str());
           return -EIO;
@@ -5499,7 +5509,7 @@ int image_instance_get(cls_method_context_t hctx,
   try {
     auto it = bl.cbegin();
     decode(ondisk_status, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("could not decode status for mirrored image, global id '%s'",
             global_image_id.c_str());
     return -EIO;
@@ -5547,7 +5557,7 @@ int image_instance_list(cls_method_context_t hctx,
       auto iter = it->second.cbegin();
       try {
         decode(mirror_image, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
         CLS_ERR("could not decode mirror image payload of image '%s'",
                 image_id.c_str());
         return -EIO;
@@ -5651,7 +5661,7 @@ int mirror_image_map_list(cls_method_context_t hctx,
       auto iter = it->second.cbegin();
       try {
         decode(mirror_image_map, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
         CLS_ERR("could not decode image map payload: %s",
                 cpp_strerror(r).c_str());
         return -EINVAL;
@@ -5795,7 +5805,7 @@ int mirror_uuid_set(cls_method_context_t hctx, bufferlist *in,
   try {
     auto bl_it = in->cbegin();
     decode(mirror_uuid, bl_it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -5856,7 +5866,7 @@ int mirror_mode_set(cls_method_context_t hctx, bufferlist *in,
   try {
     auto bl_it = in->cbegin();
     decode(mirror_mode_decode, bl_it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -5940,7 +5950,7 @@ int mirror_peer_ping(cls_method_context_t hctx, bufferlist *in,
     decode(direction, it);
     mirror_peer_direction = static_cast<cls::rbd::MirrorPeerDirection>(
       direction);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -5989,7 +5999,7 @@ int mirror_peer_add(cls_method_context_t hctx, bufferlist *in,
   try {
     auto it = in->cbegin();
     decode(mirror_peer, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6014,7 +6024,7 @@ int mirror_peer_remove(cls_method_context_t hctx, bufferlist *in,
   try {
     auto it = in->cbegin();
     decode(uuid, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6041,7 +6051,7 @@ int mirror_peer_set_client(cls_method_context_t hctx, bufferlist *in,
     auto it = in->cbegin();
     decode(uuid, it);
     decode(client_name, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6075,7 +6085,7 @@ int mirror_peer_set_cluster(cls_method_context_t hctx, bufferlist *in,
     auto it = in->cbegin();
     decode(uuid, it);
     decode(site_name, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6125,7 +6135,7 @@ int mirror_peer_set_direction(cls_method_context_t hctx, bufferlist *in,
     decode(direction, it);
     mirror_peer_direction = static_cast<cls::rbd::MirrorPeerDirection>(
       direction);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6161,7 +6171,7 @@ int mirror_image_list(cls_method_context_t hctx, bufferlist *in,
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6190,7 +6200,7 @@ int mirror_image_list(cls_method_context_t hctx, bufferlist *in,
       auto iter = it->second.cbegin();
       try {
        decode(mirror_image, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
        CLS_ERR("could not decode mirror image payload of image '%s'",
                 image_id.c_str());
        return -EIO;
@@ -6224,7 +6234,7 @@ int mirror_image_get_image_id(cls_method_context_t hctx, bufferlist *in,
   try {
     auto it = in->cbegin();
     decode(global_id, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6256,7 +6266,7 @@ int mirror_image_get(cls_method_context_t hctx, bufferlist *in,
   try {
     auto it = in->cbegin();
     decode(image_id, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6287,7 +6297,7 @@ int mirror_image_set(cls_method_context_t hctx, bufferlist *in,
     auto it = in->cbegin();
     decode(image_id, it);
     decode(mirror_image, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6311,7 +6321,7 @@ int mirror_image_remove(cls_method_context_t hctx, bufferlist *in,
   try {
     auto it = in->cbegin();
     decode(image_id, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6338,7 +6348,7 @@ int mirror_image_status_set(cls_method_context_t hctx, bufferlist *in,
     auto it = in->cbegin();
     decode(global_image_id, it);
     decode(status, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6364,7 +6374,7 @@ int mirror_image_status_remove(cls_method_context_t hctx, bufferlist *in,
   try {
     auto it = in->cbegin();
     decode(global_image_id, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6389,7 +6399,7 @@ int mirror_image_status_get(cls_method_context_t hctx, bufferlist *in,
   try {
     auto it = in->cbegin();
     decode(global_image_id, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6428,7 +6438,7 @@ int mirror_image_status_list(cls_method_context_t hctx, bufferlist *in,
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6461,7 +6471,7 @@ int mirror_image_status_get_summary(cls_method_context_t hctx, bufferlist *in,
     if (!iter.end()) {
       decode(peers, iter);
     }
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6524,7 +6534,7 @@ int mirror_image_instance_get(cls_method_context_t hctx, bufferlist *in,
   try {
     auto it = in->cbegin();
     decode(global_image_id, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6562,7 +6572,7 @@ int mirror_image_instance_list(cls_method_context_t hctx, bufferlist *in,
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6611,7 +6621,7 @@ int mirror_instances_add(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(instance_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6635,7 +6645,7 @@ int mirror_instances_remove(cls_method_context_t hctx, bufferlist *in,
   try {
     auto iter = in->cbegin();
     decode(instance_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6663,7 +6673,7 @@ int mirror_image_map_list(cls_method_context_t hctx, bufferlist *in,
     auto it = in->cbegin();
     decode(start_after, it);
     decode(max_return, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6694,7 +6704,7 @@ int mirror_image_map_update(cls_method_context_t hctx, bufferlist *in,
     auto it = in->cbegin();
     decode(global_image_id, it);
     decode(image_map, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6726,7 +6736,7 @@ int mirror_image_map_remove(cls_method_context_t hctx, bufferlist *in,
   try {
     auto it = in->cbegin();
     decode(global_image_id, it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6758,7 +6768,7 @@ int mirror_image_snapshot_unlink_peer(cls_method_context_t hctx, bufferlist *in,
     auto iter = in->cbegin();
     decode(snap_id, iter);
     decode(mirror_peer_uuid, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6793,7 +6803,7 @@ int mirror_image_snapshot_set_copy_progress(cls_method_context_t hctx,
     decode(snap_id, iter);
     decode(complete, iter);
     decode(last_copied_object_number, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -6917,14 +6927,13 @@ int snap_list(cls_method_context_t hctx, cls::rbd::GroupSnapshot start_after,
     if (r < 0)
       return r;
 
-    for (map<string, bufferlist>::iterator it = vals.begin();
-        it != vals.end() && group_snaps->size() < max_return; ++it) {
+    for (auto it = vals.begin(); it != vals.end() && group_snaps->size() < max_return; ++it) {
 
       auto iter = it->second.cbegin();
       cls::rbd::GroupSnapshot snap;
       try {
        decode(snap, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
        CLS_ERR("error decoding snapshot: %s", it->first.c_str());
        return -EIO;
       }
@@ -6990,7 +6999,7 @@ int group_dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7011,12 +7020,12 @@ int group_dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       return r;
     }
 
-    for (pair<string, bufferlist> val: vals) {
+    for (auto val : vals) {
       string id;
       auto iter = val.second.cbegin();
       try {
        decode(id, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
        CLS_ERR("could not decode id of group '%s'", val.first.c_str());
        return -EIO;
       }
@@ -7060,7 +7069,7 @@ int group_dir_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(name, iter);
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7086,7 +7095,7 @@ int group_dir_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     decode(src, iter);
     decode(dest, iter);
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7114,7 +7123,7 @@ int group_dir_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(name, iter);
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7138,7 +7147,7 @@ int group_image_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(st, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7171,7 +7180,7 @@ int group_image_remove(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(spec, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7208,7 +7217,7 @@ int group_image_list(cls_method_context_t hctx,
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7224,14 +7233,13 @@ int group_image_list(cls_method_context_t hctx,
     if (r < 0)
       return r;
 
-    for (map<string, bufferlist>::iterator it = vals.begin();
-        it != vals.end() && res.size() < max_return; ++it) {
+    for (auto it = vals.begin(); it != vals.end() && res.size() < max_return; ++it) {
 
       auto iter = it->second.cbegin();
       cls::rbd::GroupImageLinkState state;
       try {
        decode(state, iter);
-      } catch (const buffer::error &err) {
+      } catch (const ceph::buffer::error &err) {
        CLS_ERR("error decoding state for image: %s", it->first.c_str());
        return -EIO;
       }
@@ -7273,7 +7281,7 @@ int image_group_add(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(new_group, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7287,7 +7295,7 @@ int image_group_add(cls_method_context_t hctx,
     try {
       auto iter = existing_refbl.cbegin();
       decode(old_group, iter);
-    } catch (const buffer::error &err) {
+    } catch (const ceph::buffer::error &err) {
       return -EINVAL;
     }
 
@@ -7337,7 +7345,7 @@ int image_group_remove(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(spec, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7351,7 +7359,7 @@ int image_group_remove(cls_method_context_t hctx,
   auto iter = refbl.cbegin();
   try {
     decode(ref_spec, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7398,7 +7406,7 @@ int image_group_get(cls_method_context_t hctx,
     auto iter = refbl.cbegin();
     try {
       decode(spec, iter);
-    } catch (const buffer::error &err) {
+    } catch (const ceph::buffer::error &err) {
       return -EINVAL;
     }
   }
@@ -7424,7 +7432,7 @@ int group_snap_set(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(group_snap, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7477,7 +7485,7 @@ int group_snap_remove(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7507,7 +7515,7 @@ int group_snap_get_by_id(cls_method_context_t hctx,
   try {
     auto iter = in->cbegin();
     decode(snap_id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7522,7 +7530,7 @@ int group_snap_get_by_id(cls_method_context_t hctx,
   auto iter = snapbl.cbegin();
   try {
     decode(group_snap, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     CLS_ERR("error decoding snapshot: %s", snap_id.c_str());
     return -EIO;
   }
@@ -7555,7 +7563,7 @@ int group_snap_list(cls_method_context_t hctx,
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
   std::vector<cls::rbd::GroupSnapshot> group_snaps;
@@ -7606,7 +7614,7 @@ int trash_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(id, iter);
     decode(trash_spec, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7651,7 +7659,7 @@ int trash_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7699,7 +7707,7 @@ int trash_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7725,8 +7733,7 @@ int trash_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       break;
     }
 
-    map<string, bufferlist>::iterator it = raw_data.begin();
-    for (; it != raw_data.end(); ++it) {
+    for (auto it = raw_data.begin(); it != raw_data.end(); ++it) {
       decode(data[trash::image_id_from_key(it->first)], it->second);
     }
 
@@ -7759,7 +7766,7 @@ int trash_get(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(id, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7793,11 +7800,11 @@ int trash_state_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   cls::rbd::TrashImageState trash_state;
   cls::rbd::TrashImageState expect_state;
   try {
-    bufferlist::const_iterator iter = in->begin();
+    auto iter = in->cbegin();
     decode(id, iter);
     decode(trash_state, iter);
     decode(expect_state, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7862,7 +7869,7 @@ int namespace_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(name, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7899,7 +7906,7 @@ int namespace_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     auto iter = in->cbegin();
     decode(name, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7938,7 +7945,7 @@ int namespace_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(start_after, iter);
     decode(max_return, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -7995,7 +8002,7 @@ int sparsify(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     auto iter = in->cbegin();
     decode(sparse_size, iter);
     decode(remove_empty, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EINVAL;
   }
 
@@ -8033,7 +8040,7 @@ int sparsify(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     return 0;
   }
 
-  bl.rebuild(buffer::ptr_node::create(bl.length()));
+  bl.rebuild(ceph::buffer::ptr_node::create(bl.length()));
   size_t write_offset = 0;
   size_t write_length = 0;
   size_t offset = 0;
@@ -8050,10 +8057,10 @@ int sparsify(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       CLS_LOG(20, "write%s %" PRIu64 "~%" PRIu64, (replace ? "(replace)" : ""),
               write_offset, write_length);
       bufferlist write_bl;
-      write_bl.push_back(buffer::ptr_node::create(ptr, write_offset,
-                                                  write_length));
+      write_bl.push_back(ceph::buffer::ptr_node::create(ptr, write_offset,
+                                                       write_length));
       if (replace) {
-        r = cls_cxx_replace(hctx, write_offset, write_length, &write_bl);
+       r = cls_cxx_replace(hctx, write_offset, write_length, &write_bl);
         replace = false;
       } else {
         r = cls_cxx_write(hctx, write_offset, write_length, &write_bl);
index 0dc0a9b94f153bfb8012fd5e619126c850429857..566bcdf6ca0d1d563ce641f08621bfa2a561f155 100644 (file)
@@ -42,7 +42,7 @@ struct cls_rbd_parent {
     return !(*this == rhs);
   }
 
-  void encode(bufferlist& bl, uint64_t features) const {
+  void encode(ceph::buffer::list& bl, uint64_t features) const {
     // NOTE: remove support for version 1 after Nautilus EOLed
     uint8_t version = 1;
     if ((features & CEPH_FEATURE_SERVER_NAUTILUS) != 0ULL) {
@@ -65,7 +65,7 @@ struct cls_rbd_parent {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(pool_id, bl);
     if (struct_v >= 2) {
@@ -83,7 +83,7 @@ struct cls_rbd_parent {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const {
+  void dump(ceph::Formatter *f) const {
     f->dump_int("pool_id", pool_id);
     f->dump_string("pool_namespace", pool_namespace);
     f->dump_string("image_id", image_id);
@@ -93,7 +93,7 @@ struct cls_rbd_parent {
     }
   }
 
-  static void generate_test_instances(list<cls_rbd_parent*>& o) {
+  static void generate_test_instances(std::list<cls_rbd_parent*>& o) {
     o.push_back(new cls_rbd_parent{});
     o.push_back(new cls_rbd_parent{{1, "", "image id", 234}, {}});
     o.push_back(new cls_rbd_parent{{1, "", "image id", 234}, {123}});
@@ -134,7 +134,7 @@ struct cls_rbd_snap {
             (parent.exists()));
   }
 
-  void encode(bufferlist& bl, uint64_t features) const {
+  void encode(ceph::buffer::list& bl, uint64_t features) const {
     // NOTE: remove support for versions < 8 after Nautilus EOLed
     uint8_t min_version = 1;
     if ((features & CEPH_FEATURE_SERVER_NAUTILUS) != 0ULL) {
@@ -160,7 +160,7 @@ struct cls_rbd_snap {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& p) {
+  void decode(ceph::buffer::list::const_iterator& p) {
     DECODE_START(8, p);
     decode(id, p);
     decode(name, p);
@@ -193,7 +193,7 @@ struct cls_rbd_snap {
     DECODE_FINISH(p);
   }
 
-  void dump(Formatter *f) const {
+  void dump(ceph::Formatter *f) const {
     f->dump_unsigned("id", id);
     f->dump_string("name", name);
     f->dump_unsigned("image_size", image_size);
@@ -221,7 +221,7 @@ struct cls_rbd_snap {
     }
   }
 
-  static void generate_test_instances(list<cls_rbd_snap*>& o) {
+  static void generate_test_instances(std::list<cls_rbd_snap*>& o) {
     o.push_back(new cls_rbd_snap{});
     o.push_back(new cls_rbd_snap{1, "snap", 123456,
                                  RBD_PROTECTION_STATUS_PROTECTED,
index 1de9306a682ce5618b5012a86ee0d6a7a4619d22..f9ba2419a6809b20eba4c0fdd5bcec72ee130b36 100644 (file)
 namespace librbd {
 namespace cls_client {
 
+using std::map;
+using std::set;
+using std::string;
+
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
+
 void create_image(librados::ObjectWriteOperation *op, uint64_t size,
                   uint8_t order, uint64_t features,
                   const std::string &object_prefix, int64_t data_pool_id)
@@ -52,7 +60,7 @@ int get_features_finish(bufferlist::const_iterator *it, uint64_t *features,
   try {
     decode(*features, *it);
     decode(*incompatible_features, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
 
@@ -106,7 +114,7 @@ int get_object_prefix_finish(bufferlist::const_iterator *it,
 {
   try {
     decode(*object_prefix, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -136,7 +144,7 @@ void get_data_pool_start(librados::ObjectReadOperation *op) {
 int get_data_pool_finish(bufferlist::const_iterator *it, int64_t *data_pool_id) {
   try {
     decode(*data_pool_id, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -170,7 +178,7 @@ int get_size_finish(bufferlist::const_iterator *it, uint64_t *size,
   try {
     decode(*order, *it);
     decode(*size, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -216,7 +224,7 @@ void get_flags_start(librados::ObjectReadOperation *op, snapid_t snap_id) {
 int get_flags_finish(bufferlist::const_iterator *it, uint64_t *flags) {
   try {
     decode(*flags, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -258,7 +266,7 @@ int op_features_get_finish(bufferlist::const_iterator *it, uint64_t *op_features
 {
   try {
     decode(*op_features, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -315,7 +323,7 @@ int get_parent_finish(bufferlist::const_iterator *it,
     decode(pspec->image_id, *it);
     decode(pspec->snap_id, *it);
     decode(*parent_overlap, *it);
-  } catch (const buffer::error &) {
+  } catch (const ceph::buffer::error &) {
     return -EBADMSG;
   }
   return 0;
@@ -382,7 +390,7 @@ int parent_get_finish(bufferlist::const_iterator* it,
                       cls::rbd::ParentImageSpec* parent_image_spec) {
   try {
     decode(*parent_image_spec, *it);
-  } catch (const buffer::error &) {
+  } catch (const ceph::buffer::error &) {
     return -EBADMSG;
   }
   return 0;
@@ -418,7 +426,7 @@ int parent_overlap_get_finish(bufferlist::const_iterator* it,
                               std::optional<uint64_t>* parent_overlap) {
   try {
     decode(*parent_overlap, *it);
-  } catch (const buffer::error &) {
+  } catch (const ceph::buffer::error &) {
     return -EBADMSG;
   }
   return 0;
@@ -533,7 +541,7 @@ int get_children_finish(bufferlist::const_iterator *it,
                         std::set<std::string>* children) {
   try {
     decode(*children, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -567,7 +575,7 @@ int snapshot_get_finish(bufferlist::const_iterator* it,
 {
   try {
     decode(*snap_info, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -636,7 +644,7 @@ int get_snapcontext_finish(bufferlist::const_iterator *it,
 {
   try {
     decode(*snapc, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   if (!snapc->is_valid()) {
@@ -674,7 +682,7 @@ int get_snapshot_name_finish(bufferlist::const_iterator *it,
 {
   try {
     decode(*name, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -709,7 +717,7 @@ int get_snapshot_timestamp_finish(bufferlist::const_iterator *it,
 {
   try {
     decode(*timestamp, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -779,7 +787,7 @@ int old_snapshot_list_finish(bufferlist::const_iterator *it,
       decode((*sizes)[i], *it);
       decode((*names)[i], *it);
     }
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -812,7 +820,7 @@ int get_all_features_finish(bufferlist::const_iterator *it,
                             uint64_t *all_features) {
   try {
     decode(*all_features, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -876,7 +884,7 @@ int get_protection_status_finish(bufferlist::const_iterator *it,
 {
   try {
     decode(*protection_status, *it);
-  } catch (const buffer::error &) {
+  } catch (const ceph::buffer::error &) {
     return -EBADMSG;
   }
   return 0;
@@ -926,7 +934,7 @@ int snapshot_get_limit_finish(bufferlist::const_iterator *it, uint64_t *limit)
 {
   try {
     decode(*limit, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -969,7 +977,7 @@ int get_stripe_unit_count_finish(bufferlist::const_iterator *it,
   try {
     decode(*stripe_unit, *it);
     decode(*stripe_count, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1021,7 +1029,7 @@ int get_create_timestamp_finish(bufferlist::const_iterator *it,
 
   try {
     decode(*timestamp, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1054,7 +1062,7 @@ int get_access_timestamp_finish(bufferlist::const_iterator *it,
 
   try {
     decode(*timestamp, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1100,7 +1108,7 @@ int get_modify_timestamp_finish(bufferlist::const_iterator *it,
 
   try {
     decode(*timestamp, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1146,7 +1154,7 @@ void get_id_start(librados::ObjectReadOperation *op) {
 int get_id_finish(bufferlist::const_iterator *it, std::string *id) {
   try {
     decode(*id, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1195,7 +1203,7 @@ void dir_get_id_start(librados::ObjectReadOperation *op,
 int dir_get_id_finish(bufferlist::const_iterator *iter, std::string *image_id) {
   try {
     decode(*image_id, *iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
 
@@ -1227,7 +1235,7 @@ void dir_get_name_start(librados::ObjectReadOperation *op,
 int dir_get_name_finish(bufferlist::const_iterator *it, std::string *name) {
   try {
     decode(*name, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1262,7 +1270,7 @@ int dir_list_finish(bufferlist::const_iterator *it, map<string, string> *images)
 {
   try {
     decode(*images, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1376,7 +1384,7 @@ int object_map_load_finish(bufferlist::const_iterator *it,
                            ceph::BitVector<2> *object_map) {
   try {
     decode(*object_map, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1516,7 +1524,7 @@ int metadata_list_finish(bufferlist::const_iterator *it,
   ceph_assert(pairs);
   try {
     decode(*pairs, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1534,7 +1542,7 @@ int metadata_get_finish(bufferlist::const_iterator *it,
                          std::string* value) {
   try {
     decode(*value, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1621,7 +1629,7 @@ int children_list_finish(bufferlist::const_iterator *it,
   child_images->clear();
   try {
     decode(*child_images, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1688,7 +1696,7 @@ int migration_get_finish(bufferlist::const_iterator *it,
                          cls::rbd::MigrationSpec *migration_spec) {
   try {
     decode(*migration_spec, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1750,7 +1758,7 @@ int mirror_uuid_get_finish(bufferlist::const_iterator *it,
                            std::string *uuid) {
   try {
     decode(*uuid, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1798,7 +1806,7 @@ int mirror_mode_get_finish(bufferlist::const_iterator *it,
     uint32_t mirror_mode_decode;
     decode(mirror_mode_decode, *it);
     *mirror_mode = static_cast<cls::rbd::MirrorMode>(mirror_mode_decode);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
 
@@ -1851,7 +1859,7 @@ int mirror_peer_list_finish(bufferlist::const_iterator *it,
   peers->clear();
   try {
     decode(*peers, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -1998,7 +2006,7 @@ int mirror_image_list_finish(bufferlist::const_iterator *it,
 {
   try {
     decode(*mirror_image_ids, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2031,7 +2039,7 @@ int mirror_image_get_image_id_finish(bufferlist::const_iterator *it,
                                      std::string *image_id) {
   try {
     decode(*image_id, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2084,7 +2092,7 @@ int mirror_image_get_finish(bufferlist::const_iterator *iter,
                             cls::rbd::MirrorImage *mirror_image) {
   try {
     decode(*mirror_image, *iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2179,7 +2187,7 @@ int mirror_image_status_get_finish(bufferlist::const_iterator *iter,
                                    cls::rbd::MirrorImageStatus *status) {
   try {
     decode(*status, *iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2223,7 +2231,7 @@ int mirror_image_status_list_finish(bufferlist::const_iterator *iter,
   try {
     decode(*images, *iter);
     decode(*statuses, *iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2263,7 +2271,7 @@ int mirror_image_status_get_summary_finish(
     std::map<cls::rbd::MirrorImageStatusState, int32_t> *states) {
   try {
     decode(*states, *iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2311,7 +2319,7 @@ int mirror_image_instance_get_finish(bufferlist::const_iterator *iter,
                                      entity_inst_t *instance) {
   try {
     decode(*instance, *iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2352,7 +2360,7 @@ int mirror_image_instance_list_finish(
   instances->clear();
   try {
     decode(*instances, *iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2368,7 +2376,7 @@ int mirror_instances_list_finish(bufferlist::const_iterator *iter,
   instance_ids->clear();
   try {
     decode(*instance_ids, *iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2435,7 +2443,7 @@ int mirror_image_map_list_finish(bufferlist::const_iterator *iter,
                                  std::map<std::string, cls::rbd::MirrorImageMap> *image_mapping) {
   try {
     decode(*image_mapping, *iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2531,7 +2539,7 @@ int group_dir_list(librados::IoCtx *ioctx, const std::string &oid,
   auto iter = out.cbegin();
   try {
     decode(*cgs, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
 
@@ -2593,7 +2601,7 @@ int group_image_list(librados::IoCtx *ioctx,
   auto iter = bl2.cbegin();
   try {
     decode(*images, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
 
@@ -2638,7 +2646,7 @@ int image_group_get_finish(bufferlist::const_iterator *iter,
 {
   try {
     decode(*group_spec, *iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
   return 0;
@@ -2696,7 +2704,7 @@ int group_snap_get_by_id(librados::IoCtx *ioctx, const std::string &oid,
   auto iter = outbl.cbegin();
   try {
     decode(*snapshot, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
 
@@ -2720,7 +2728,7 @@ int group_snap_list(librados::IoCtx *ioctx, const std::string &oid,
   auto iter = outbl.cbegin();
   try {
     decode(*snapshots, iter);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
 
@@ -2779,7 +2787,7 @@ int trash_list_finish(bufferlist::const_iterator *it,
 
   try {
     decode(*entries, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
 
@@ -2816,7 +2824,7 @@ int trash_get_finish(bufferlist::const_iterator *it,
   ceph_assert(trash_spec);
   try {
     decode(*trash_spec, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
 
@@ -2909,7 +2917,7 @@ int namespace_list_finish(bufferlist::const_iterator *it,
 
   try {
     decode(*entries, *it);
-  } catch (const buffer::error &err) {
+  } catch (const ceph::buffer::error &err) {
     return -EBADMSG;
   }
 
index 23917b91b33c6627eb7d530bfad224e0c45c2c02..aa9bb2b09e09608fa8fcc8e740ffcef55bc6c41c 100644 (file)
@@ -25,7 +25,7 @@ int create_image(librados::IoCtx *ioctx, const std::string &oid,
                  const std::string &object_prefix, int64_t data_pool_id);
 
 void get_features_start(librados::ObjectReadOperation *op, bool read_only);
-int get_features_finish(bufferlist::const_iterator *it, uint64_t *features,
+int get_features_finish(ceph::buffer::list::const_iterator *it, uint64_t *features,
                         uint64_t *incompatible_features);
 int get_features(librados::IoCtx *ioctx, const std::string &oid,
                  bool read_only, uint64_t *features,
@@ -36,18 +36,18 @@ int set_features(librados::IoCtx *ioctx, const std::string &oid,
                  uint64_t features, uint64_t mask);
 
 void get_object_prefix_start(librados::ObjectReadOperation *op);
-int get_object_prefix_finish(bufferlist::const_iterator *it,
+int get_object_prefix_finish(ceph::buffer::list::const_iterator *it,
                              std::string *object_prefix);
 int get_object_prefix(librados::IoCtx *ioctx, const std::string &oid,
                       std::string *object_prefix);
 
 void get_data_pool_start(librados::ObjectReadOperation *op);
-int get_data_pool_finish(bufferlist::const_iterator *it, int64_t *data_pool_id);
+int get_data_pool_finish(ceph::buffer::list::const_iterator *it, int64_t *data_pool_id);
 int get_data_pool(librados::IoCtx *ioctx, const std::string &oid,
                   int64_t *data_pool_id);
 
 void get_size_start(librados::ObjectReadOperation *op, snapid_t snap_id);
-int get_size_finish(bufferlist::const_iterator *it, uint64_t *size,
+int get_size_finish(ceph::buffer::list::const_iterator *it, uint64_t *size,
                     uint8_t *order);
 int get_size(librados::IoCtx *ioctx, const std::string &oid,
              snapid_t snap_id, uint64_t *size, uint8_t *order);
@@ -56,7 +56,7 @@ int set_size(librados::IoCtx *ioctx, const std::string &oid,
 void set_size(librados::ObjectWriteOperation *op, uint64_t size);
 
 void get_flags_start(librados::ObjectReadOperation *op, snapid_t snap_id);
-int get_flags_finish(bufferlist::const_iterator *it, uint64_t *flags);
+int get_flags_finish(ceph::buffer::list::const_iterator *it, uint64_t *flags);
 int get_flags(librados::IoCtx *ioctx, const std::string &oid,
               snapid_t snap_id, uint64_t *flags);
 
@@ -64,7 +64,7 @@ void set_flags(librados::ObjectWriteOperation *op, snapid_t snap_id,
                uint64_t flags, uint64_t mask);
 
 void op_features_get_start(librados::ObjectReadOperation *op);
-int op_features_get_finish(bufferlist::const_iterator *it,
+int op_features_get_finish(ceph::buffer::list::const_iterator *it,
                            uint64_t *op_features);
 int op_features_get(librados::IoCtx *ioctx, const std::string &oid,
                     uint64_t *op_features);
@@ -75,7 +75,7 @@ int op_features_set(librados::IoCtx *ioctx, const std::string &oid,
 
 // NOTE: deprecate v1 parent APIs after mimic EOLed
 void get_parent_start(librados::ObjectReadOperation *op, snapid_t snap_id);
-int get_parent_finish(bufferlist::const_iterator *it,
+int get_parent_finish(ceph::buffer::list::const_iterator *it,
                       cls::rbd::ParentImageSpec *pspec,
                       uint64_t *parent_overlap);
 int get_parent(librados::IoCtx *ioctx, const std::string &oid,
@@ -91,14 +91,14 @@ void remove_parent(librados::ObjectWriteOperation *op);
 
 // v2 parent APIs
 void parent_get_start(librados::ObjectReadOperation* op);
-int parent_get_finish(bufferlist::const_iterator* it,
+int parent_get_finish(ceph::buffer::list::const_iterator* it,
                       cls::rbd::ParentImageSpec* parent_image_spec);
 int parent_get(librados::IoCtx* ioctx, const std::string &oid,
                cls::rbd::ParentImageSpec* parent_image_spec);
 
 void parent_overlap_get_start(librados::ObjectReadOperation* op,
                               snapid_t snap_id);
-int parent_overlap_get_finish(bufferlist::const_iterator* it,
+int parent_overlap_get_finish(ceph::buffer::list::const_iterator* it,
                               std::optional<uint64_t>* parent_overlap);
 int parent_overlap_get(librados::IoCtx* ioctx, const std::string &oid,
                        snapid_t snap_id,
@@ -128,14 +128,14 @@ int remove_child(librados::IoCtx *ioctx, const std::string &oid,
                  const std::string &c_imageid);
 void get_children_start(librados::ObjectReadOperation *op,
                         const cls::rbd::ParentImageSpec &pspec);
-int get_children_finish(bufferlist::const_iterator *it,
-                        std::set<string> *children);
+int get_children_finish(ceph::buffer::list::const_iterator *it,
+                        std::set<std::string> *children);
 int get_children(librados::IoCtx *ioctx, const std::string &oid,
-                 const cls::rbd::ParentImageSpec& pspec, set<string>& children);
+                 const cls::rbd::ParentImageSpec& pspec, std::set<std::string>& children);
 
 void snapshot_get_start(librados::ObjectReadOperation* op,
                         snapid_t snap_id);
-int snapshot_get_finish(bufferlist::const_iterator* it,
+int snapshot_get_finish(ceph::buffer::list::const_iterator* it,
                         cls::rbd::SnapshotInfo* snap_info);
 int snapshot_get(librados::IoCtx *ioctx, const std::string &oid,
                  snapid_t snap_id, cls::rbd::SnapshotInfo* snap_info);
@@ -151,7 +151,7 @@ void snapshot_trash_add(librados::ObjectWriteOperation *op,
                         snapid_t snap_id);
 
 void get_snapcontext_start(librados::ObjectReadOperation *op);
-int get_snapcontext_finish(bufferlist::const_iterator *it,
+int get_snapcontext_finish(ceph::buffer::list::const_iterator *it,
                            ::SnapContext *snapc);
 int get_snapcontext(librados::IoCtx *ioctx, const std::string &oid,
                     ::SnapContext *snapc);
@@ -159,7 +159,7 @@ int get_snapcontext(librados::IoCtx *ioctx, const std::string &oid,
 /// NOTE: remove after Luminous is retired
 void get_snapshot_name_start(librados::ObjectReadOperation *op,
                              snapid_t snap_id);
-int get_snapshot_name_finish(bufferlist::const_iterator *it,
+int get_snapshot_name_finish(ceph::buffer::list::const_iterator *it,
                              std::string *name);
 int get_snapshot_name(librados::IoCtx *ioctx, const std::string &oid,
                       snapid_t snap_id, std::string *name);
@@ -167,13 +167,13 @@ int get_snapshot_name(librados::IoCtx *ioctx, const std::string &oid,
 /// NOTE: remove after Luminous is retired
 void get_snapshot_timestamp_start(librados::ObjectReadOperation *op,
                                   snapid_t snap_id);
-int get_snapshot_timestamp_finish(bufferlist::const_iterator *it,
+int get_snapshot_timestamp_finish(ceph::buffer::list::const_iterator *it,
                                   utime_t *timestamp);
 int get_snapshot_timestamp(librados::IoCtx *ioctx, const std::string &oid,
                            snapid_t snap_id, utime_t *timestamp);
 
 void get_all_features_start(librados::ObjectReadOperation *op);
-int get_all_features_finish(bufferlist::const_iterator *it,
+int get_all_features_finish(ceph::buffer::list::const_iterator *it,
                             uint64_t *all_features);
 int get_all_features(librados::IoCtx *ioctx, const std::string &oid,
                      uint64_t *all_features);
@@ -181,7 +181,7 @@ int get_all_features(librados::IoCtx *ioctx, const std::string &oid,
 /// NOTE: remove protection after clone v1 is retired
 void get_protection_status_start(librados::ObjectReadOperation *op,
                                  snapid_t snap_id);
-int get_protection_status_finish(bufferlist::const_iterator *it,
+int get_protection_status_finish(ceph::buffer::list::const_iterator *it,
                                  uint8_t *protection_status);
 int get_protection_status(librados::IoCtx *ioctx, const std::string &oid,
                           snapid_t snap_id, uint8_t *protection_status);
@@ -192,14 +192,14 @@ void set_protection_status(librados::ObjectWriteOperation *op,
                            snapid_t snap_id, uint8_t protection_status);
 
 void snapshot_get_limit_start(librados::ObjectReadOperation *op);
-int snapshot_get_limit_finish(bufferlist::const_iterator *it, uint64_t *limit);
+int snapshot_get_limit_finish(ceph::buffer::list::const_iterator *it, uint64_t *limit);
 int snapshot_get_limit(librados::IoCtx *ioctx, const std::string &oid,
                        uint64_t *limit);
 void snapshot_set_limit(librados::ObjectWriteOperation *op,
                         uint64_t limit);
 
 void get_stripe_unit_count_start(librados::ObjectReadOperation *op);
-int get_stripe_unit_count_finish(bufferlist::const_iterator *it,
+int get_stripe_unit_count_finish(ceph::buffer::list::const_iterator *it,
                                  uint64_t *stripe_unit,
                                  uint64_t *stripe_count);
 int get_stripe_unit_count(librados::IoCtx *ioctx, const std::string &oid,
@@ -211,13 +211,13 @@ int set_stripe_unit_count(librados::IoCtx *ioctx, const std::string &oid,
                           uint64_t stripe_unit, uint64_t stripe_count);
 
 void get_create_timestamp_start(librados::ObjectReadOperation *op);
-int get_create_timestamp_finish(bufferlist::const_iterator *it,
+int get_create_timestamp_finish(ceph::buffer::list::const_iterator *it,
                                 utime_t *timestamp);
 int get_create_timestamp(librados::IoCtx *ioctx, const std::string &oid,
                          utime_t *timestamp);
 
 void get_access_timestamp_start(librados::ObjectReadOperation *op);
-int get_access_timestamp_finish(bufferlist::const_iterator *it,
+int get_access_timestamp_finish(ceph::buffer::list::const_iterator *it,
                                 utime_t *timestamp);
 int get_access_timestamp(librados::IoCtx *ioctx, const std::string &oid,
                          utime_t *timestamp);
@@ -226,7 +226,7 @@ void set_access_timestamp(librados::ObjectWriteOperation *op);
 int set_access_timestamp(librados::IoCtx *ioctx, const std::string &oid);
 
 void get_modify_timestamp_start(librados::ObjectReadOperation *op);
-int get_modify_timestamp_finish(bufferlist::const_iterator *it,
+int get_modify_timestamp_finish(ceph::buffer::list::const_iterator *it,
                                 utime_t *timestamp);
 int get_modify_timestamp(librados::IoCtx *ioctx, const std::string &oid,
                          utime_t *timestamp);
@@ -236,25 +236,25 @@ int set_modify_timestamp(librados::IoCtx *ioctx, const std::string &oid);
 
 int metadata_list(librados::IoCtx *ioctx, const std::string &oid,
                   const std::string &start, uint64_t max_return,
-                  map<string, bufferlist> *pairs);
+                  std::map<std::string, ceph::buffer::list> *pairs);
 void metadata_list_start(librados::ObjectReadOperation *op,
                          const std::string &start, uint64_t max_return);
-int metadata_list_finish(bufferlist::const_iterator *it,
-                         std::map<std::string, bufferlist> *pairs);
+int metadata_list_finish(ceph::buffer::list::const_iterator *it,
+                         std::map<std::string, ceph::buffer::list> *pairs);
 void metadata_set(librados::ObjectWriteOperation *op,
-                  const map<std::string, bufferlist> &data);
+                  const std::map<std::string, ceph::buffer::list> &data);
 int metadata_set(librados::IoCtx *ioctx, const std::string &oid,
-                 const map<std::string, bufferlist> &data);
+                 const std::map<std::string, ceph::buffer::list> &data);
 void metadata_remove(librados::ObjectWriteOperation *op,
                      const std::string &key);
 int metadata_remove(librados::IoCtx *ioctx, const std::string &oid,
                     const std::string &key);
 void metadata_get_start(librados::ObjectReadOperation* op,
                  const std::string &key);
-int metadata_get_finish(bufferlist::const_iterator *it,
+int metadata_get_finish(ceph::buffer::list::const_iterator *it,
                         std::string* value);
 int metadata_get(librados::IoCtx *ioctx, const std::string &oid,
-                 const std::string &key, string *v);
+                 const std::string &key, std::string *v);
 
 void child_attach(librados::ObjectWriteOperation *op, snapid_t snap_id,
                   const cls::rbd::ChildImageSpec& child_image);
@@ -268,7 +268,7 @@ int child_detach(librados::IoCtx *ioctx, const std::string &oid,
                  const cls::rbd::ChildImageSpec& child_image);
 void children_list_start(librados::ObjectReadOperation *op,
                          snapid_t snap_id);
-int children_list_finish(bufferlist::const_iterator *it,
+int children_list_finish(ceph::buffer::list::const_iterator *it,
                          cls::rbd::ChildImageSpecs *child_images);
 int children_list(librados::IoCtx *ioctx, const std::string &oid,
                   snapid_t snap_id,
@@ -284,7 +284,7 @@ void migration_set_state(librados::ObjectWriteOperation *op,
                          cls::rbd::MigrationState state,
                          const std::string &description);
 void migration_get_start(librados::ObjectReadOperation *op);
-int migration_get_finish(bufferlist::const_iterator *it,
+int migration_get_finish(ceph::buffer::list::const_iterator *it,
                          cls::rbd::MigrationSpec *migration_spec);
 int migration_get(librados::IoCtx *ioctx, const std::string &oid,
                   cls::rbd::MigrationSpec *migration_spec);
@@ -293,7 +293,7 @@ void migration_remove(librados::ObjectWriteOperation *op);
 
 // operations on rbd_id objects
 void get_id_start(librados::ObjectReadOperation *op);
-int get_id_finish(bufferlist::const_iterator *it, std::string *id);
+int get_id_finish(ceph::buffer::list::const_iterator *it, std::string *id);
 int get_id(librados::IoCtx *ioctx, const std::string &oid, std::string *id);
 
 void set_id(librados::ObjectWriteOperation *op, const std::string &id);
@@ -304,18 +304,18 @@ int dir_get_id(librados::IoCtx *ioctx, const std::string &oid,
                const std::string &name, std::string *id);
 void dir_get_id_start(librados::ObjectReadOperation *op,
                       const std::string &image_name);
-int dir_get_id_finish(bufferlist::const_iterator *iter, std::string *image_id);
+int dir_get_id_finish(ceph::buffer::list::const_iterator *iter, std::string *image_id);
 void dir_get_name_start(librados::ObjectReadOperation *op,
                         const std::string &id);
-int dir_get_name_finish(bufferlist::const_iterator *it, std::string *name);
+int dir_get_name_finish(ceph::buffer::list::const_iterator *it, std::string *name);
 int dir_get_name(librados::IoCtx *ioctx, const std::string &oid,
                  const std::string &id, std::string *name);
 void dir_list_start(librados::ObjectReadOperation *op,
                     const std::string &start, uint64_t max_return);
-int dir_list_finish(bufferlist::const_iterator *it, map<string, string> *images);
+int dir_list_finish(ceph::buffer::list::const_iterator *it, std::map<std::string, std::string> *images);
 int dir_list(librados::IoCtx *ioctx, const std::string &oid,
              const std::string &start, uint64_t max_return,
-             map<string, string> *images);
+             std::map<std::string, std::string> *images);
 void dir_add_image(librados::ObjectWriteOperation *op,
                    const std::string &name, const std::string &id);
 int dir_add_image(librados::IoCtx *ioctx, const std::string &oid,
@@ -339,7 +339,7 @@ int dir_state_set(librados::IoCtx *ioctx, const std::string &oid,
 
 // operations on the rbd_object_map.$image_id object
 void object_map_load_start(librados::ObjectReadOperation *op);
-int object_map_load_finish(bufferlist::const_iterator *it,
+int object_map_load_finish(ceph::buffer::list::const_iterator *it,
                            ceph::BitVector<2> *object_map);
 int object_map_load(librados::IoCtx *ioctx, const std::string &oid,
                     ceph::BitVector<2> *object_map);
@@ -365,23 +365,23 @@ void old_snapshot_rename(librados::ObjectWriteOperation *rados_op,
                          snapid_t src_snap_id, const std::string &dst_name);
 
 void old_snapshot_list_start(librados::ObjectReadOperation *op);
-int old_snapshot_list_finish(bufferlist::const_iterator *it,
-                             std::vector<string> *names,
+int old_snapshot_list_finish(ceph::buffer::list::const_iterator *it,
+                             std::vector<std::string> *names,
                              std::vector<uint64_t> *sizes,
                              ::SnapContext *snapc);
 int old_snapshot_list(librados::IoCtx *ioctx, const std::string &oid,
-                      std::vector<string> *names,
+                      std::vector<std::string> *names,
                       std::vector<uint64_t> *sizes,
                       ::SnapContext *snapc);
 
 // operations on the rbd_mirroring object
 void mirror_uuid_get_start(librados::ObjectReadOperation *op);
-int mirror_uuid_get_finish(bufferlist::const_iterator *it,
+int mirror_uuid_get_finish(ceph::buffer::list::const_iterator *it,
                            std::string *uuid);
 int mirror_uuid_get(librados::IoCtx *ioctx, std::string *uuid);
 int mirror_uuid_set(librados::IoCtx *ioctx, const std::string &uuid);
 void mirror_mode_get_start(librados::ObjectReadOperation *op);
-int mirror_mode_get_finish(bufferlist::const_iterator *it,
+int mirror_mode_get_finish(ceph::buffer::list::const_iterator *it,
                            cls::rbd::MirrorMode *mirror_mode);
 int mirror_mode_get(librados::IoCtx *ioctx,
                     cls::rbd::MirrorMode *mirror_mode);
@@ -395,7 +395,7 @@ void mirror_peer_ping(librados::ObjectWriteOperation *op,
                       const std::string& site_name,
                       const std::string& fsid);
 void mirror_peer_list_start(librados::ObjectReadOperation *op);
-int mirror_peer_list_finish(bufferlist::const_iterator *it,
+int mirror_peer_list_finish(ceph::buffer::list::const_iterator *it,
                             std::vector<cls::rbd::MirrorPeer> *peers);
 int mirror_peer_list(librados::IoCtx *ioctx,
                      std::vector<cls::rbd::MirrorPeer> *peers);
@@ -417,14 +417,14 @@ int mirror_peer_set_direction(
 
 void mirror_image_list_start(librados::ObjectReadOperation *op,
                              const std::string &start, uint64_t max_return);
-int mirror_image_list_finish(bufferlist::const_iterator *it,
-                             std::map<string, string> *mirror_image_ids);
+int mirror_image_list_finish(ceph::buffer::list::const_iterator *it,
+                             std::map<std::string, std::string> *mirror_image_ids);
 int mirror_image_list(librados::IoCtx *ioctx,
                       const std::string &start, uint64_t max_return,
                       std::map<std::string, std::string> *mirror_image_ids);
 void mirror_image_get_image_id_start(librados::ObjectReadOperation *op,
                                      const std::string &global_image_id);
-int mirror_image_get_image_id_finish(bufferlist::const_iterator *it,
+int mirror_image_get_image_id_finish(ceph::buffer::list::const_iterator *it,
                                      std::string *image_id);
 int mirror_image_get_image_id(librados::IoCtx *ioctx,
                               const std::string &global_image_id,
@@ -433,7 +433,7 @@ int mirror_image_get(librados::IoCtx *ioctx, const std::string &image_id,
                      cls::rbd::MirrorImage *mirror_image);
 void mirror_image_get_start(librados::ObjectReadOperation *op,
                             const std::string &image_id);
-int mirror_image_get_finish(bufferlist::const_iterator *iter,
+int mirror_image_get_finish(ceph::buffer::list::const_iterator *iter,
                             cls::rbd::MirrorImage *mirror_image);
 void mirror_image_set(librados::ObjectWriteOperation *op,
                       const std::string &image_id,
@@ -455,7 +455,7 @@ int mirror_image_status_get(librados::IoCtx *ioctx,
                             cls::rbd::MirrorImageStatus *status);
 void mirror_image_status_get_start(librados::ObjectReadOperation *op,
                                    const std::string &global_image_id);
-int mirror_image_status_get_finish(bufferlist::const_iterator *iter,
+int mirror_image_status_get_finish(ceph::buffer::list::const_iterator *iter,
                                    cls::rbd::MirrorImageStatus *status);
 int mirror_image_status_list(librados::IoCtx *ioctx,
                              const std::string &start, uint64_t max_return,
@@ -464,7 +464,7 @@ int mirror_image_status_list(librados::IoCtx *ioctx,
 void mirror_image_status_list_start(librados::ObjectReadOperation *op,
                                     const std::string &start,
                                     uint64_t max_return);
-int mirror_image_status_list_finish(bufferlist::const_iterator *iter,
+int mirror_image_status_list_finish(ceph::buffer::list::const_iterator *iter,
                                     std::map<std::string, cls::rbd::MirrorImage> *images,
                                     std::map<std::string, cls::rbd::MirrorImageStatus> *statuses);
 int mirror_image_status_get_summary(
@@ -475,7 +475,7 @@ void mirror_image_status_get_summary_start(
     librados::ObjectReadOperation *op,
     const std::vector<cls::rbd::MirrorPeer>& mirror_peer_sites);
 int mirror_image_status_get_summary_finish(
-    bufferlist::const_iterator *iter,
+    ceph::buffer::list::const_iterator *iter,
     std::map<cls::rbd::MirrorImageStatusState, int32_t> *states);
 int mirror_image_status_remove_down(librados::IoCtx *ioctx);
 void mirror_image_status_remove_down(librados::ObjectWriteOperation *op);
@@ -485,7 +485,7 @@ int mirror_image_instance_get(librados::IoCtx *ioctx,
                               entity_inst_t *instance);
 void mirror_image_instance_get_start(librados::ObjectReadOperation *op,
                                      const std::string &global_image_id);
-int mirror_image_instance_get_finish(bufferlist::const_iterator *iter,
+int mirror_image_instance_get_finish(ceph::buffer::list::const_iterator *iter,
                                      entity_inst_t *instance);
 int mirror_image_instance_list(librados::IoCtx *ioctx,
                                const std::string &start, uint64_t max_return,
@@ -493,11 +493,11 @@ int mirror_image_instance_list(librados::IoCtx *ioctx,
 void mirror_image_instance_list_start(librados::ObjectReadOperation *op,
                                       const std::string &start,
                                       uint64_t max_return);
-int mirror_image_instance_list_finish(bufferlist::const_iterator *iter,
+int mirror_image_instance_list_finish(ceph::buffer::list::const_iterator *iter,
                                       std::map<std::string, entity_inst_t> *instances);
 
 void mirror_instances_list_start(librados::ObjectReadOperation *op);
-int mirror_instances_list_finish(bufferlist::const_iterator *iter,
+int mirror_instances_list_finish(ceph::buffer::list::const_iterator *iter,
                                  std::vector<std::string> *instance_ids);
 int mirror_instances_list(librados::IoCtx *ioctx,
                           std::vector<std::string> *instance_ids);
@@ -514,7 +514,7 @@ int mirror_instances_remove(librados::IoCtx *ioctx,
 void mirror_image_map_list_start(librados::ObjectReadOperation *op,
                                  const std::string &start_after,
                                  uint64_t max_read);
-int mirror_image_map_list_finish(bufferlist::const_iterator *iter,
+int mirror_image_map_list_finish(ceph::buffer::list::const_iterator *iter,
                                  std::map<std::string, cls::rbd::MirrorImageMap> *image_mapping);
 int mirror_image_map_list(librados::IoCtx *ioctx,
                           const std::string &start_after, uint64_t max_read,
@@ -543,7 +543,7 @@ int mirror_image_snapshot_set_copy_progress(librados::IoCtx *ioctx,
 // Groups functions
 int group_dir_list(librados::IoCtx *ioctx, const std::string &oid,
                    const std::string &start, uint64_t max_return,
-                   map<string, string> *groups);
+                   std::map<std::string, std::string> *groups);
 int group_dir_add(librados::IoCtx *ioctx, const std::string &oid,
                   const std::string &name, const std::string &id);
 int group_dir_rename(librados::IoCtx *ioctx, const std::string &oid,
@@ -564,7 +564,7 @@ int image_group_add(librados::IoCtx *ioctx, const std::string &oid,
 int image_group_remove(librados::IoCtx *ioctx, const std::string &oid,
                        const cls::rbd::GroupSpec &group_spec);
 void image_group_get_start(librados::ObjectReadOperation *op);
-int image_group_get_finish(bufferlist::const_iterator *iter,
+int image_group_get_finish(ceph::buffer::list::const_iterator *iter,
                            cls::rbd::GroupSpec *group_spec);
 int image_group_get(librados::IoCtx *ioctx, const std::string &oid,
                     cls::rbd::GroupSpec *group_spec);
@@ -591,14 +591,14 @@ void trash_remove(librados::ObjectWriteOperation *op,
 int trash_remove(librados::IoCtx *ioctx, const std::string &id);
 void trash_list_start(librados::ObjectReadOperation *op,
                       const std::string &start, uint64_t max_return);
-int trash_list_finish(bufferlist::const_iterator *it,
-                      map<string, cls::rbd::TrashImageSpec> *entries);
+int trash_list_finish(ceph::buffer::list::const_iterator *it,
+                      std::map<std::string, cls::rbd::TrashImageSpec> *entries);
 int trash_list(librados::IoCtx *ioctx,
                const std::string &start, uint64_t max_return,
-               map<string, cls::rbd::TrashImageSpec> *entries);
+               std::map<std::string, cls::rbd::TrashImageSpec> *entries);
 void trash_get_start(librados::ObjectReadOperation *op,
                      const std::string &id);
-int trash_get_finish(bufferlist::const_iterator *it,
+int trash_get_finish(ceph::buffer::list::const_iterator *it,
                      cls::rbd::TrashImageSpec *trash_spec);
 int trash_get(librados::IoCtx *ioctx, const std::string &id,
               cls::rbd::TrashImageSpec *trash_spec);
@@ -619,7 +619,7 @@ void namespace_remove(librados::ObjectWriteOperation *op,
 int namespace_remove(librados::IoCtx *ioctx, const std::string &name);
 void namespace_list_start(librados::ObjectReadOperation *op,
                           const std::string &start, uint64_t max_return);
-int namespace_list_finish(bufferlist::const_iterator *it,
+int namespace_list_finish(ceph::buffer::list::const_iterator *it,
                           std::list<std::string> *entries);
 int namespace_list(librados::IoCtx *ioctx,
                    const std::string &start, uint64_t max_return,
@@ -633,16 +633,16 @@ void assert_snapc_seq(librados::ObjectWriteOperation *op,
                       uint64_t snapc_seq,
                       cls::rbd::AssertSnapcSeqState state);
 
-void copyup(librados::ObjectWriteOperation *op, bufferlist data);
+void copyup(librados::ObjectWriteOperation *op, ceph::buffer::list data);
 int copyup(librados::IoCtx *ioctx, const std::string &oid,
-           bufferlist data);
+           ceph::buffer::list data);
 
 void sparse_copyup(librados::ObjectWriteOperation *op,
                    const std::map<uint64_t, uint64_t> &extent_map,
-                   bufferlist data);
+                   ceph::buffer::list data);
 int sparse_copyup(librados::IoCtx *ioctx, const std::string &oid,
                   const std::map<uint64_t, uint64_t> &extent_map,
-                  bufferlist data);
+                  ceph::buffer::list data);
 
 void sparsify(librados::ObjectWriteOperation *op, size_t sparse_size,
               bool remove_empty);
index 9071f3457fe5d8d6d1a6ad262a07624f0e3895b7..4da8a28246a2519c1e39fc79851e8d49970a6937 100644 (file)
@@ -8,6 +8,13 @@
 namespace cls {
 namespace rbd {
 
+using std::istringstream;
+using std::ostringstream;
+using std::string;
+
+using ceph::bufferlist;
+using ceph::Formatter;
+
 std::ostream& operator<<(std::ostream& os,
                          MirrorPeerDirection mirror_peer_direction) {
   switch (mirror_peer_direction) {
index b2c155eb864a2378101b2e27addd94c742efce73..f5abbc9eb669c16695c9ef52371b90b3c957934c 100644 (file)
@@ -23,20 +23,20 @@ namespace cls {
 namespace rbd {
 
 static const uint32_t MAX_OBJECT_MAP_OBJECT_COUNT = 256000000;
-static const string RBD_GROUP_IMAGE_KEY_PREFIX = "image_";
+static const std::string RBD_GROUP_IMAGE_KEY_PREFIX = "image_";
 
 enum DirectoryState {
   DIRECTORY_STATE_READY         = 0,
   DIRECTORY_STATE_ADD_DISABLED  = 1
 };
 
-inline void encode(DirectoryState state, bufferlist& bl,
+inline void encode(DirectoryState state, ceph::buffer::list& bl,
                   uint64_t features=0)
 {
   ceph::encode(static_cast<uint8_t>(state), bl);
 }
 
-inline void decode(DirectoryState &state, bufferlist::const_iterator& it)
+inline void decode(DirectoryState &state, ceph::buffer::list::const_iterator& it)
 {
   uint8_t int_state;
   ceph::decode(int_state, it);
@@ -54,14 +54,14 @@ enum GroupImageLinkState {
   GROUP_IMAGE_LINK_STATE_INCOMPLETE
 };
 
-inline void encode(const GroupImageLinkState &state, bufferlist& bl,
+inline void encode(const GroupImageLinkState &state, ceph::buffer::list& bl,
                   uint64_t features=0)
 {
   using ceph::encode;
   encode(static_cast<uint8_t>(state), bl);
 }
 
-inline void decode(GroupImageLinkState &state, bufferlist::const_iterator& it)
+inline void decode(GroupImageLinkState &state, ceph::buffer::list::const_iterator& it)
 {
   uint8_t int_state;
   using ceph::decode;
@@ -115,9 +115,9 @@ struct MirrorPeer {
     return (!uuid.empty() && !site_name.empty());
   }
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<MirrorPeer*> &o);
 
@@ -156,9 +156,9 @@ struct MirrorImage {
   std::string global_image_id;
   MirrorImageState state = MIRROR_IMAGE_STATE_DISABLING;
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<MirrorImage*> &o);
 
@@ -182,7 +182,7 @@ enum MirrorImageStatusState {
   MIRROR_IMAGE_STATUS_STATE_STOPPED         = 6,
 };
 
-inline void encode(const MirrorImageStatusState &state, bufferlist& bl,
+inline void encode(const MirrorImageStatusState &state, ceph::buffer::list& bl,
                   uint64_t features=0)
 {
   using ceph::encode;
@@ -190,7 +190,7 @@ inline void encode(const MirrorImageStatusState &state, bufferlist& bl,
 }
 
 inline void decode(MirrorImageStatusState &state,
-                   bufferlist::const_iterator& it)
+                   ceph::buffer::list::const_iterator& it)
 {
   uint8_t int_state;
   using ceph::decode;
@@ -216,12 +216,12 @@ struct MirrorImageSiteStatus {
   utime_t last_update;
   bool up = false;
 
-  void encode_meta(uint8_t version, bufferlist &bl) const;
-  void decode_meta(uint8_t version, bufferlist::const_iterator &it);
+  void encode_meta(uint8_t version, ceph::buffer::list &bl) const;
+  void decode_meta(uint8_t version, ceph::buffer::list::const_iterator &it);
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &it);
+  void dump(ceph::Formatter *f) const;
 
   std::string state_to_string() const;
 
@@ -242,11 +242,11 @@ struct MirrorImageSiteStatusOnDisk : cls::rbd::MirrorImageSiteStatus {
     cls::rbd::MirrorImageSiteStatus(status) {
   }
 
-  void encode_meta(bufferlist &bl, uint64_t features) const;
-  void decode_meta(bufferlist::const_iterator &it);
+  void encode_meta(ceph::buffer::list &bl, uint64_t features) const;
+  void decode_meta(ceph::buffer::list::const_iterator &it);
 
-  void encode(bufferlist &bl, uint64_t features) const;
-  void decode(bufferlist::const_iterator &it);
+  void encode(ceph::buffer::list &bl, uint64_t features) const;
+  void decode(ceph::buffer::list::const_iterator &it);
 
   static void generate_test_instances(
       std::list<MirrorImageSiteStatusOnDisk*> &o);
@@ -265,9 +265,9 @@ struct MirrorImageStatus {
 
   int get_local_mirror_image_site_status(MirrorImageSiteStatus* status) const;
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &it);
+  void dump(ceph::Formatter *f) const;
 
   bool operator==(const MirrorImageStatus& rhs) const;
 
@@ -306,9 +306,9 @@ struct ParentImageSpec {
     return !(*this == rhs);
   }
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<ParentImageSpec*> &o);
 };
@@ -328,9 +328,9 @@ struct ChildImageSpec {
     : pool_id(pool_id), pool_namespace(pool_namespace), image_id(image_id) {
   }
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<ChildImageSpec*> &o);
 
@@ -366,9 +366,9 @@ struct GroupImageSpec {
   std::string image_id;
   int64_t pool_id = -1;
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<GroupImageSpec*> &o);
 
@@ -391,9 +391,9 @@ struct GroupImageStatus {
   GroupImageSpec spec;
   GroupImageLinkState state = GROUP_IMAGE_LINK_STATE_INCOMPLETE;
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<GroupImageStatus*> &o);
 
@@ -410,9 +410,9 @@ struct GroupSpec {
   std::string group_id;
   int64_t pool_id = -1;
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &it);
+  void dump(ceph::Formatter *f) const;
   bool is_valid() const;
 
   static void generate_test_instances(std::list<GroupSpec *> &o);
@@ -433,10 +433,10 @@ struct UserSnapshotNamespace {
 
   UserSnapshotNamespace() {}
 
-  void encode(bufferlist& bl) const {}
-  void decode(bufferlist::const_iterator& it) {}
+  void encode(ceph::buffer::list& bl) const {}
+  void decode(ceph::buffer::list::const_iterator& it) {}
 
-  void dump(Formatter *f) const {}
+  void dump(ceph::Formatter *f) const {}
 
   inline bool operator==(const UserSnapshotNamespace& usn) const {
     return true;
@@ -454,19 +454,19 @@ struct GroupSnapshotNamespace {
   GroupSnapshotNamespace() {}
 
   GroupSnapshotNamespace(int64_t _group_pool,
-                        const string &_group_id,
-                        const string &_group_snapshot_id)
+                        const std::string &_group_id,
+                        const std::string &_group_snapshot_id)
     : group_id(_group_id), group_pool(_group_pool),
       group_snapshot_id(_group_snapshot_id) {}
 
-  string group_id;
+  std::string group_id;
   int64_t group_pool = 0;
-  string group_snapshot_id;
+  std::string group_snapshot_id;
 
-  void encode(bufferlist& bl) const;
-  void decode(bufferlist::const_iterator& it);
+  void encode(ceph::buffer::list& bl) const;
+  void decode(ceph::buffer::list::const_iterator& it);
 
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
 
   inline bool operator==(const GroupSnapshotNamespace& gsn) const {
     return group_pool == gsn.group_pool &&
@@ -500,9 +500,9 @@ struct TrashSnapshotNamespace {
     : original_name(original_name),
       original_snapshot_namespace_type(original_snapshot_namespace_type) {}
 
-  void encode(bufferlist& bl) const;
-  void decode(bufferlist::const_iterator& it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list& bl) const;
+  void decode(ceph::buffer::list::const_iterator& it);
+  void dump(ceph::Formatter *f) const;
 
   inline bool operator==(const TrashSnapshotNamespace& usn) const {
     return true;
@@ -519,13 +519,13 @@ enum MirrorSnapshotState {
   MIRROR_SNAPSHOT_STATE_NON_PRIMARY_DEMOTED = 3,
 };
 
-inline void encode(const MirrorSnapshotState &state, bufferlist& bl,
+inline void encode(const MirrorSnapshotState &state, ceph::buffer::list& bl,
                    uint64_t features=0) {
   using ceph::encode;
   encode(static_cast<uint8_t>(state), bl);
 }
 
-inline void decode(MirrorSnapshotState &state, bufferlist::const_iterator& it) {
+inline void decode(MirrorSnapshotState &state, ceph::buffer::list::const_iterator& it) {
   using ceph::decode;
   uint8_t int_state;
   decode(int_state, it);
@@ -594,10 +594,10 @@ struct MirrorSnapshotNamespace {
             primary_snap_id == CEPH_NOSNAP);
   }
 
-  void encode(bufferlist& bl) const;
-  void decode(bufferlist::const_iterator& it);
+  void encode(ceph::buffer::list& bl) const;
+  void decode(ceph::buffer::list::const_iterator& it);
 
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
 
   inline bool operator==(const MirrorSnapshotNamespace& rhs) const {
     return state == rhs.state &&
@@ -634,9 +634,9 @@ struct UnknownSnapshotNamespace {
 
   UnknownSnapshotNamespace() {}
 
-  void encode(bufferlist& bl) const {}
-  void decode(bufferlist::const_iterator& it) {}
-  void dump(Formatter *f) const {}
+  void encode(ceph::buffer::list& bl) const {}
+  void decode(ceph::buffer::list::const_iterator& it) {}
+  void dump(ceph::Formatter *f) const {}
 
   inline bool operator==(const UnknownSnapshotNamespace& gsn) const {
     return true;
@@ -668,9 +668,9 @@ struct SnapshotNamespace : public SnapshotNamespaceVariant {
   SnapshotNamespace(T&& t) : SnapshotNamespaceVariant(std::forward<T>(t)) {
   }
 
-  void encode(bufferlist& bl) const;
-  void decode(bufferlist::const_iterator& it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list& bl) const;
+  void decode(ceph::buffer::list::const_iterator& it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<SnapshotNamespace*> &o);
 
@@ -708,9 +708,9 @@ struct SnapshotInfo {
       child_count(child_count) {
   }
 
-  void encode(bufferlist& bl) const;
-  void decode(bufferlist::const_iterator& it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list& bl) const;
+  void decode(ceph::buffer::list::const_iterator& it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<SnapshotInfo*> &o);
 };
@@ -721,13 +721,13 @@ enum GroupSnapshotState {
   GROUP_SNAPSHOT_STATE_COMPLETE = 1,
 };
 
-inline void encode(const GroupSnapshotState &state, bufferlist& bl, uint64_t features=0)
+inline void encode(const GroupSnapshotState &state, ceph::buffer::list& bl, uint64_t features=0)
 {
   using ceph::encode;
   encode(static_cast<uint8_t>(state), bl);
 }
 
-inline void decode(GroupSnapshotState &state, bufferlist::const_iterator& it)
+inline void decode(GroupSnapshotState &state, ceph::buffer::list::const_iterator& it)
 {
   using ceph::decode;
   uint8_t int_state;
@@ -737,20 +737,20 @@ inline void decode(GroupSnapshotState &state, bufferlist::const_iterator& it)
 
 struct ImageSnapshotSpec {
   int64_t pool;
-  string image_id;
+  std::string image_id;
   snapid_t snap_id;
 
   ImageSnapshotSpec() {}
   ImageSnapshotSpec(int64_t _pool,
-                   string _image_id,
+                   std::string _image_id,
                    snapid_t _snap_id) : pool(_pool),
                                         image_id(_image_id),
                                         snap_id(_snap_id) {}
 
-  void encode(bufferlist& bl) const;
-  void decode(bufferlist::const_iterator& it);
+  void encode(ceph::buffer::list& bl) const;
+  void decode(ceph::buffer::list::const_iterator& it);
 
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<ImageSnapshotSpec *> &o);
 };
@@ -768,11 +768,11 @@ struct GroupSnapshot {
                                             name(_name),
                                             state(_state) {}
 
-  vector<ImageSnapshotSpec> snaps;
+  std::vector<ImageSnapshotSpec> snaps;
 
-  void encode(bufferlist& bl) const;
-  void decode(bufferlist::const_iterator& it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list& bl) const;
+  void decode(ceph::buffer::list::const_iterator& it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<GroupSnapshot *> &o);
 };
@@ -807,14 +807,14 @@ inline std::ostream& operator<<(std::ostream& os,
   return os;
 }
 
-inline void encode(const TrashImageSource &source, bufferlist& bl,
+inline void encode(const TrashImageSource &source, ceph::buffer::list& bl,
                   uint64_t features=0)
 {
   using ceph::encode;
   encode(static_cast<uint8_t>(source), bl);
 }
 
-inline void decode(TrashImageSource &source, bufferlist::const_iterator& it)
+inline void decode(TrashImageSource &source, ceph::buffer::list::const_iterator& it)
 {
   uint8_t int_source;
   using ceph::decode;
@@ -829,13 +829,13 @@ enum TrashImageState {
   TRASH_IMAGE_STATE_RESTORING = 3
 };
 
-inline void encode(const TrashImageState &state, bufferlist &bl)
+inline void encode(const TrashImageState &state, ceph::buffer::list &bl)
 {
   using ceph::encode;
   encode(static_cast<uint8_t>(state), bl);
 }
 
-inline void decode(TrashImageState &state, bufferlist::const_iterator &it)
+inline void decode(TrashImageState &state, ceph::buffer::list::const_iterator &it)
 {
   uint8_t int_state;
   using ceph::decode;
@@ -858,9 +858,9 @@ struct TrashImageSpec {
       deferment_end_time(deferment_end_time) {
   }
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator& it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator& it);
+  void dump(ceph::Formatter *f) const;
 
   inline bool operator==(const TrashImageSpec& rhs) const {
     return (source == rhs.source &&
@@ -876,7 +876,7 @@ struct MirrorImageMap {
   }
 
   MirrorImageMap(const std::string &instance_id, utime_t mapped_time,
-                 const bufferlist &data)
+                 const ceph::buffer::list &data)
     : instance_id(instance_id),
       mapped_time(mapped_time),
       data(data) {
@@ -884,11 +884,11 @@ struct MirrorImageMap {
 
   std::string instance_id;
   utime_t mapped_time;
-  bufferlist data;
+  ceph::buffer::list data;
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<MirrorImageMap*> &o);
 
@@ -905,12 +905,12 @@ enum MigrationHeaderType {
   MIGRATION_HEADER_TYPE_DST = 2,
 };
 
-inline void encode(const MigrationHeaderType &type, bufferlist& bl) {
+inline void encode(const MigrationHeaderType &type, ceph::buffer::list& bl) {
   using ceph::encode;
   encode(static_cast<uint8_t>(type), bl);
 }
 
-inline void decode(MigrationHeaderType &type, bufferlist::const_iterator& it) {
+inline void decode(MigrationHeaderType &type, ceph::buffer::list::const_iterator& it) {
   uint8_t int_type;
   using ceph::decode;
   decode(int_type, it);
@@ -925,12 +925,12 @@ enum MigrationState {
   MIGRATION_STATE_EXECUTED = 4,
 };
 
-inline void encode(const MigrationState &state, bufferlist& bl) {
+inline void encode(const MigrationState &state, ceph::buffer::list& bl) {
   using ceph::encode;
   encode(static_cast<uint8_t>(state), bl);
 }
 
-inline void decode(MigrationState &state, bufferlist::const_iterator& it) {
+inline void decode(MigrationState &state, ceph::buffer::list::const_iterator& it) {
   uint8_t int_state;
   using ceph::decode;
   decode(int_state, it);
@@ -970,9 +970,9 @@ struct MigrationSpec {
       state_description(state_description) {
   }
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator& it);
-  void dump(Formatter *f) const;
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator& it);
+  void dump(ceph::Formatter *f) const;
 
   static void generate_test_instances(std::list<MigrationSpec*> &o);
 
@@ -995,12 +995,12 @@ enum AssertSnapcSeqState {
   ASSERT_SNAPC_SEQ_LE_SNAPSET_SEQ = 1,
 };
 
-inline void encode(const AssertSnapcSeqState &state, bufferlist& bl) {
+inline void encode(const AssertSnapcSeqState &state, ceph::buffer::list& bl) {
   using ceph::encode;
   encode(static_cast<uint8_t>(state), bl);
 }
 
-inline void decode(AssertSnapcSeqState &state, bufferlist::const_iterator& it) {
+inline void decode(AssertSnapcSeqState &state, ceph::buffer::list::const_iterator& it) {
   uint8_t int_state;
   using ceph::decode;
   decode(int_state, it);
index 73cc3b852fddc994d59c288e036f6659b3e6d530..781d967f979b7916962ed071a8627fe8c25b9553 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include <errno.h>
@@ -8,10 +8,13 @@
 
 #include "include/compat.h"
 
+using std::string;
+
+using ceph::bufferlist;
+
 CLS_VER(1,0)
 CLS_NAME(refcount)
 
-
 #define REFCOUNT_ATTR "refcount"
 
 static string wildcard_tag;
@@ -33,7 +36,7 @@ static int read_refcount(cls_method_context_t hctx, bool implicit_ref, obj_refco
   try {
     auto iter = bl.cbegin();
     decode(*objr, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: read_refcount(): failed to decode refcount entry\n");
     return -EIO;
   }
@@ -61,7 +64,7 @@ static int cls_rc_refcount_get(cls_method_context_t hctx, bufferlist *in, buffer
   cls_refcount_get_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rc_refcount_get(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -89,7 +92,7 @@ static int cls_rc_refcount_put(cls_method_context_t hctx, bufferlist *in, buffer
   cls_refcount_put_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rc_refcount_put(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -107,7 +110,7 @@ static int cls_rc_refcount_put(cls_method_context_t hctx, bufferlist *in, buffer
   CLS_LOG(10, "cls_rc_refcount_put() tag=%s\n", op.tag.c_str());
 
   bool found = false;
-  map<string, bool>::iterator iter = objr.refs.find(op.tag);
+  auto iter = objr.refs.find(op.tag);
   if (iter != objr.refs.end()) {
     found = true;
   } else if (op.implicit_ref) {
@@ -142,7 +145,7 @@ static int cls_rc_refcount_set(cls_method_context_t hctx, bufferlist *in, buffer
   cls_refcount_set_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_refcount_set(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -152,8 +155,7 @@ static int cls_rc_refcount_set(cls_method_context_t hctx, bufferlist *in, buffer
   }
 
   obj_refcount objr;
-  list<string>::iterator iter;
-  for (iter = op.refs.begin(); iter != op.refs.end(); ++iter) {
+  for (auto iter = op.refs.begin(); iter != op.refs.end(); ++iter) {
     objr.refs[*iter] = true;
   }
 
@@ -171,7 +173,7 @@ static int cls_rc_refcount_read(cls_method_context_t hctx, bufferlist *in, buffe
   cls_refcount_read_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rc_refcount_read(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -183,8 +185,7 @@ static int cls_rc_refcount_read(cls_method_context_t hctx, bufferlist *in, buffe
   if (ret < 0)
     return ret;
 
-  map<string, bool>::iterator iter;
-  for (iter = objr.refs.begin(); iter != objr.refs.end(); ++iter) {
+  for (auto iter = objr.refs.begin(); iter != objr.refs.end(); ++iter) {
     read_ret.refs.push_back(iter->first);
   }
 
index 9d5210c8abc85dac6e18c1ceedfc2f20c4d46397..f65a0fe32d0fc0f8c98d9a3bf010f3ce76d0136c 100644 (file)
@@ -1,11 +1,16 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #include <errno.h>
 
 #include "cls/refcount/cls_refcount_client.h"
 #include "cls/refcount/cls_refcount_ops.h"
 #include "include/rados/librados.hpp"
 
-using namespace librados;
+using std::list;
+using std::string;
 
+using ceph::bufferlist;
 
 void cls_refcount_get(librados::ObjectWriteOperation& op, const string& tag, bool implicit_ref)
 {
@@ -50,7 +55,7 @@ int cls_refcount_read(librados::IoCtx& io_ctx, string& oid, list<string> *refs,
   try {
     auto iter = out.cbegin();
     decode(ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
@@ -58,4 +63,3 @@ int cls_refcount_read(librados::IoCtx& io_ctx, string& oid, list<string> *refs,
 
   return r;
 }
-
index 756a971a328c29b03250af5d8b09bc51aafef3ec..73a23a7ee28db48cda086745fcd180e137fc1aa1 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_REFCOUNT_CLIENT_H
 #define CEPH_CLS_REFCOUNT_CLIENT_H
 
  * as the relevant tag, and the refcount will be decreased.
  */
 
-void cls_refcount_get(librados::ObjectWriteOperation& op, const string& tag, bool implicit_ref = false);
-void cls_refcount_put(librados::ObjectWriteOperation& op, const string& tag, bool implicit_ref = false);
-void cls_refcount_set(librados::ObjectWriteOperation& op, list<string>& refs);
+void cls_refcount_get(librados::ObjectWriteOperation& op, const std::string& tag, bool implicit_ref = false);
+void cls_refcount_put(librados::ObjectWriteOperation& op, const std::string& tag, bool implicit_ref = false);
+void cls_refcount_set(librados::ObjectWriteOperation& op, std::list<std::string>& refs);
 // these overloads which call io_ctx.operate() or io_ctx.exec() should not be called in the rgw.
 // rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()/exec()
 #ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_refcount_read(librados::IoCtx& io_ctx, string& oid, list<string> *refs, bool implicit_ref = false);
+int cls_refcount_read(librados::IoCtx& io_ctx, std::string& oid, std::list<std::string> *refs, bool implicit_ref = false);
 #endif
 
 #endif
index ca7f93ed8089c7b91d69386611db9dc54e150075..3731269a9be11e75dccc76e61641abb48688c02a 100644 (file)
@@ -5,6 +5,8 @@
 #include "common/Formatter.h"
 #include "common/ceph_json.h"
 
+using std::list;
+
 void cls_refcount_get_op::dump(ceph::Formatter *f) const
 {
   f->dump_string("tag", tag);
@@ -66,7 +68,7 @@ void cls_refcount_read_op::generate_test_instances(list<cls_refcount_read_op*>&
 void cls_refcount_read_ret::dump(ceph::Formatter *f) const
 {
   f->open_array_section("refs");
-  for (list<string>::const_iterator p = refs.begin(); p != refs.end(); ++p)
+  for (auto p = refs.begin(); p != refs.end(); ++p)
     f->dump_string("ref", *p);
   f->close_section();
 }
index 946c11aa30bb18ac8987c4f1b99b7f6652e31dcb..5d60b161fd5ab1b1a4e87281dc0b02e7c3a68200 100644 (file)
@@ -8,44 +8,44 @@
 #include "common/hobject.h"
 
 struct cls_refcount_get_op {
-  string tag;
+  std::string tag;
   bool implicit_ref;
 
   cls_refcount_get_op() : implicit_ref(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(tag, bl);
     encode(implicit_ref, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(tag, bl);
     decode(implicit_ref, bl);
     DECODE_FINISH(bl);
   }
   void dump(ceph::Formatter *f) const;
-  static void generate_test_instances(list<cls_refcount_get_op*>& ls);
+  static void generate_test_instances(std::list<cls_refcount_get_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_refcount_get_op)
 
 struct cls_refcount_put_op {
-  string tag;
+  std::string tag;
   bool implicit_ref; // assume wildcard reference for
-                          // objects without a set ref
+                          // objects without a std::set ref
 
   cls_refcount_put_op() : implicit_ref(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(tag, bl);
     encode(implicit_ref, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(tag, bl);
     decode(implicit_ref, bl);
@@ -53,91 +53,91 @@ struct cls_refcount_put_op {
   }
 
   void dump(ceph::Formatter *f) const;
-  static void generate_test_instances(list<cls_refcount_put_op*>& ls);
+  static void generate_test_instances(std::list<cls_refcount_put_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_refcount_put_op)
 
 struct cls_refcount_set_op {
-  list<string> refs;
+  std::list<std::string> refs;
 
   cls_refcount_set_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(refs, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(refs, bl);
     DECODE_FINISH(bl);
   }
 
   void dump(ceph::Formatter *f) const;
-  static void generate_test_instances(list<cls_refcount_set_op*>& ls);
+  static void generate_test_instances(std::list<cls_refcount_set_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_refcount_set_op)
 
 struct cls_refcount_read_op {
   bool implicit_ref; // assume wildcard reference for
-                          // objects without a set ref
+                          // objects without a std::set ref
 
   cls_refcount_read_op() : implicit_ref(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(implicit_ref, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(implicit_ref, bl);
     DECODE_FINISH(bl);
   }
 
   void dump(ceph::Formatter *f) const;
-  static void generate_test_instances(list<cls_refcount_read_op*>& ls);
+  static void generate_test_instances(std::list<cls_refcount_read_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_refcount_read_op)
 
 struct cls_refcount_read_ret {
-  list<string> refs;
+  std::list<std::string> refs;
 
   cls_refcount_read_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(refs, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(refs, bl);
     DECODE_FINISH(bl);
   }
 
   void dump(ceph::Formatter *f) const;
-  static void generate_test_instances(list<cls_refcount_read_ret*>& ls);
+  static void generate_test_instances(std::list<cls_refcount_read_ret*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_refcount_read_ret)
 
 struct obj_refcount {
-  map<string, bool> refs;
-  set<string> retired_refs;
+  std::map<std::string, bool> refs;
+  std::set<std::string> retired_refs;
 
   obj_refcount() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(refs, bl);
     encode(retired_refs, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(refs, bl);
     if (struct_v >= 2) {
@@ -147,7 +147,7 @@ struct obj_refcount {
   }
 
   void dump(ceph::Formatter *f) const;
-  static void generate_test_instances(list<obj_refcount*>& ls);
+  static void generate_test_instances(std::list<obj_refcount*>& ls);
 };
 WRITE_CLASS_ENCODER(obj_refcount)
 
index bdc3f78433246eae219a412123b64e4cf216699b..98f4cc31aa53ebacfc4f47f9b5ffaac04b550866 100644 (file)
 #include "include/compat.h"
 #include <boost/lexical_cast.hpp>
 
+using std::pair;
+using std::list;
+using std::map;
+using std::string;
+using std::vector;
+
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
+using ceph::make_timespan;
+using ceph::real_clock;
+using ceph::real_time;
+using ceph::timespan;
+
 CLS_VER(1,0)
 CLS_NAME(rgw)
 
@@ -389,7 +403,7 @@ static int decode_list_index_key(const string& index_key, cls_rgw_obj_key *key,
     return -EIO;
   }
 
-  list<string>::iterator iter = vals.begin();
+  auto iter = vals.begin();
   key->name = *iter;
   ++iter;
 
@@ -431,7 +445,7 @@ static int read_bucket_header(cls_method_context_t hctx,
   auto iter = bl.cbegin();
   try {
     decode(*header, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: read_bucket_header(): failed to decode header\n");
     return -EIO;
   }
@@ -451,7 +465,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   rgw_cls_list_op op;
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: %s: failed to decode request\n", __func__);
     return -EINVAL;
   }
@@ -519,7 +533,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
        const bufferlist& entrybl = kiter->second;
        auto eiter = entrybl.cbegin();
         decode(entry, eiter);
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         CLS_LOG(1, "ERROR: %s: failed to decode entry, key=%s\n",
                __func__, kiter->first.c_str());
         return -EINVAL;
@@ -637,8 +651,7 @@ static int check_index(cls_method_context_t hctx,
     if (rc < 0)
       return rc;
 
-    std::map<string, bufferlist>::iterator kiter = keys.begin();
-    for (; kiter != keys.end(); ++kiter) {
+    for (auto kiter = keys.begin(); kiter != keys.end(); ++kiter) {
       if (!bi_is_objs_index(kiter->first)) {
         done = true;
         break;
@@ -648,7 +661,7 @@ static int check_index(cls_method_context_t hctx,
       auto eiter = kiter->second.cbegin();
       try {
         decode(entry, eiter);
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode entry, key=%s\n", kiter->first.c_str());
         return -EIO;
       }
@@ -706,7 +719,7 @@ int rgw_bucket_update_stats(cls_method_context_t hctx, bufferlist *in, bufferlis
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: %s(): failed to decode request\n", __func__);
     return -EINVAL;
   }
@@ -764,7 +777,7 @@ int rgw_bucket_set_tag_timeout(cls_method_context_t hctx, bufferlist *in, buffer
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bucket_set_tag_timeout(): failed to decode request\n");
     return -EINVAL;
   }
@@ -792,7 +805,7 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bucket_prepare_op(): failed to decode request\n");
     return -EINVAL;
   }
@@ -874,7 +887,7 @@ static int read_omap_entry(cls_method_context_t hctx, const std::string& name,
   auto cur_iter = current_entry.cbegin();
   try {
     decode(*entry, cur_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: %s(): failed to decode entry\n", __func__);
     return -EIO;
   }
@@ -934,7 +947,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bucket_complete_op(): failed to decode request\n");
     return -EINVAL;
   }
@@ -973,7 +986,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
                 rgw_bucket_dir_entry::FLAG_VER);
 
   if (op.tag.size()) {
-    map<string, rgw_bucket_pending_info>::iterator pinter = entry.pending_map.find(op.tag);
+    auto pinter = entry.pending_map.find(op.tag);
     if (pinter == entry.pending_map.end()) {
       CLS_LOG(1, "ERROR: couldn't find tag for pending operation\n");
       return -EINVAL;
@@ -1056,9 +1069,8 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
       return rc;
   }
 
-  list<cls_rgw_obj_key>::iterator remove_iter;
   CLS_LOG(20, "rgw_bucket_complete_op(): remove_objs.size()=%d\n", (int)op.remove_objs.size());
-  for (remove_iter = op.remove_objs.begin(); remove_iter != op.remove_objs.end(); ++remove_iter) {
+  for (auto remove_iter = op.remove_objs.begin(); remove_iter != op.remove_objs.end(); ++remove_iter) {
     cls_rgw_obj_key& remove_key = *remove_iter;
     CLS_LOG(1, "rgw_bucket_complete_op(): removing entries, read_index_entry name=%s instance=%s\n",
             remove_key.name.c_str(), remove_key.instance.c_str());
@@ -1309,11 +1321,11 @@ public:
 
     rgw_bucket_dir_entry next_entry;
 
-    map<string, bufferlist>::reverse_iterator last = keys.rbegin();
+    auto last = keys.rbegin();
     try {
       auto iter = last->second.cbegin();
       decode(next_entry, iter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(0, "ERROR; failed to decode entry: %s", last->first.c_str());
       return -EIO;
     }
@@ -1513,7 +1525,7 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_bucket_link_olh_op(): failed to decode request\n");
     return -EINVAL;
   }
@@ -1710,7 +1722,7 @@ static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in,
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_bucket_rm_obj_instance_op(): failed to decode request\n");
     return -EINVAL;
   }
@@ -1857,7 +1869,7 @@ static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bu
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_bucket_read_olh_log(): failed to decode request\n");
     return -EINVAL;
   }
@@ -1890,7 +1902,7 @@ static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bu
     op_ret.log = log;
     op_ret.is_truncated = false;
   } else {
-    map<uint64_t, vector<rgw_bucket_olh_log_entry> >::iterator iter = log.upper_bound(op.ver_marker);
+    auto iter = log.upper_bound(op.ver_marker);
 
     for (int i = 0; i < MAX_OLH_LOG_ENTRIES && iter != log.end(); ++i, ++iter) {
       op_ret.log[iter->first] = iter->second;
@@ -1910,7 +1922,7 @@ static int rgw_bucket_trim_olh_log(cls_method_context_t hctx, bufferlist *in, bu
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_bucket_trim_olh_log(): failed to decode request\n");
     return -EINVAL;
   }
@@ -1936,10 +1948,10 @@ static int rgw_bucket_trim_olh_log(cls_method_context_t hctx, bufferlist *in, bu
   }
 
   /* remove all versions up to and including ver from the pending map */
-  map<uint64_t, vector<rgw_bucket_olh_log_entry> >& log = olh_data_entry.pending_log;
-  map<uint64_t, vector<rgw_bucket_olh_log_entry> >::iterator liter = log.begin();
+  auto& log = olh_data_entry.pending_log;
+  auto liter = log.begin();
   while (liter != log.end() && liter->first <= op.ver) {
-    map<uint64_t, vector<rgw_bucket_olh_log_entry> >::iterator rm_iter = liter;
+    auto rm_iter = liter;
     ++liter;
     log.erase(rm_iter);
   }
@@ -1961,7 +1973,7 @@ static int rgw_bucket_clear_olh(cls_method_context_t hctx, bufferlist *in, buffe
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: rgw_bucket_clear_olh(): failed to decode request\n");
     return -EINVAL;
   }
@@ -2047,7 +2059,7 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
     try {
       decode(op, in_iter);
       decode(cur_change, in_iter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(1, "ERROR: rgw_dir_suggest_changes(): failed to decode request\n");
       return -EINVAL;
     }
@@ -2067,16 +2079,15 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
       auto cur_disk_iter = cur_disk_bl.cbegin();
       try {
         decode(cur_disk, cur_disk_iter);
-      } catch (buffer::error& error) {
+      } catch (ceph::buffer::error& error) {
         CLS_LOG(1, "ERROR: rgw_dir_suggest_changes(): failed to decode cur_disk\n");
         return -EINVAL;
       }
 
       real_time cur_time = real_clock::now();
-      map<string, rgw_bucket_pending_info>::iterator iter =
-                cur_disk.pending_map.begin();
+      auto iter = cur_disk.pending_map.begin();
       while(iter != cur_disk.pending_map.end()) {
-        map<string, rgw_bucket_pending_info>::iterator cur_iter=iter++;
+        auto cur_iter = iter++;
         if (cur_time > (cur_iter->second.timestamp + timespan(tag_timeout))) {
           cur_disk.pending_map.erase(cur_iter);
         }
@@ -2156,7 +2167,7 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -2173,11 +2184,11 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist
   }
 
   map<string, bufferlist> new_attrs;
-  for (list<string>::iterator iter = op.keep_attr_prefixes.begin();
+  for (auto iter = op.keep_attr_prefixes.begin();
        iter != op.keep_attr_prefixes.end(); ++iter) {
-    string& check_prefix = *iter;
+    auto& check_prefix = *iter;
 
-    for (map<string, bufferlist>::iterator aiter = attrset.lower_bound(check_prefix);
+    for (auto aiter = attrset.lower_bound(check_prefix);
          aiter != attrset.end(); ++aiter) {
       const string& attr = aiter->first;
 
@@ -2207,9 +2218,9 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist
     return ret;
   }
 
-  for (map<string, bufferlist>::iterator aiter = new_attrs.begin();
+  for (auto aiter = new_attrs.begin();
        aiter != new_attrs.end(); ++aiter) {
-    const string& attr = aiter->first;
+    const auto& attr = aiter->first;
 
     ret = cls_cxx_setxattr(hctx, attr.c_str(), &aiter->second);
     CLS_LOG(20, "%s(): setting attr: %s", __func__, attr.c_str());
@@ -2229,7 +2240,7 @@ static int rgw_obj_store_pg_ver(cls_method_context_t hctx, bufferlist *in, buffe
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -2253,7 +2264,7 @@ static int rgw_obj_check_attrs_prefix(cls_method_context_t hctx, bufferlist *in,
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -2271,9 +2282,9 @@ static int rgw_obj_check_attrs_prefix(cls_method_context_t hctx, bufferlist *in,
 
   bool exist = false;
 
-  for (map<string, bufferlist>::iterator aiter = attrset.lower_bound(op.check_prefix);
+  for (auto aiter = attrset.lower_bound(op.check_prefix);
        aiter != attrset.end(); ++aiter) {
-    const string& attr = aiter->first;
+    const auto& attr = aiter->first;
 
     if (attr.substr(0, op.check_prefix.size()) > op.check_prefix) {
       break;
@@ -2296,7 +2307,7 @@ static int rgw_obj_check_mtime(cls_method_context_t hctx, bufferlist *in, buffer
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -2359,7 +2370,7 @@ static int rgw_bi_get_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -2407,7 +2418,7 @@ static int rgw_bi_put_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -2443,8 +2454,7 @@ static int list_plain_entries(cls_method_context_t hctx,
     return ret;
   }
 
-  map<string, bufferlist>::iterator iter;
-  for (iter = keys.begin(); iter != keys.end(); ++iter) {
+  for (auto iter = keys.begin(); iter != keys.end(); ++iter) {
     if (iter->first >= end_key) {
       /* past the end of plain namespace */
       if (pmore) {
@@ -2463,7 +2473,7 @@ static int list_plain_entries(cls_method_context_t hctx,
     rgw_bucket_dir_entry e;
     try {
       decode(e, biter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(0, "ERROR: %s(): failed to decode buffer", __func__);
       return -EIO;
     }
@@ -2536,8 +2546,7 @@ static int list_instance_entries(cls_method_context_t hctx,
     keys[start_after_key].claim(k);
   }
 
-  map<string, bufferlist>::iterator iter;
-  for (iter = keys.begin(); iter != keys.end(); ++iter) {
+  for (auto iter = keys.begin(); iter != keys.end(); ++iter) {
     rgw_cls_bi_entry entry;
     entry.type = BIIndexType::Instance;
     entry.idx = iter->first;
@@ -2558,7 +2567,7 @@ static int list_instance_entries(cls_method_context_t hctx,
     rgw_bucket_dir_entry e;
     try {
       decode(e, biter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(0, "ERROR: %s(): failed to decode buffer (size=%d)", __func__, entry.data.length());
       return -EIO;
     }
@@ -2628,8 +2637,7 @@ static int list_olh_entries(cls_method_context_t hctx,
     keys[start_after_key].claim(k);
   }
 
-  map<string, bufferlist>::iterator iter;
-  for (iter = keys.begin(); iter != keys.end(); ++iter) {
+  for (auto iter = keys.begin(); iter != keys.end(); ++iter) {
     rgw_cls_bi_entry entry;
     entry.type = BIIndexType::OLH;
     entry.idx = iter->first;
@@ -2650,7 +2658,7 @@ static int list_olh_entries(cls_method_context_t hctx,
     rgw_bucket_olh_entry e;
     try {
       decode(e, biter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(0, "ERROR: %s(): failed to decode buffer (size=%d)", __func__, entry.data.length());
       return -EIO;
     }
@@ -2680,7 +2688,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx,
   auto iter = in->cbegin();
   try {
     decode(op, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
   }
@@ -2737,7 +2745,7 @@ int bi_log_record_decode(bufferlist& bl, rgw_bi_log_entry& e)
   auto iter = bl.cbegin();
   try {
     decode(e, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: failed to decode rgw_bi_log_entry");
     return -EIO;
   }
@@ -2793,7 +2801,7 @@ static int bi_log_iterate_entries(cls_method_context_t hctx,
   if (ret < 0)
     return ret;
 
-  map<string, bufferlist>::iterator iter = keys.begin();
+  auto iter = keys.begin();
   if (iter == keys.end())
     return 0;
 
@@ -2854,7 +2862,7 @@ static int rgw_bi_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist
   cls_rgw_bi_log_list_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bi_log_list(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -2876,7 +2884,7 @@ static int rgw_bi_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlist
   cls_rgw_bi_log_trim_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_bi_log_list(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -3031,7 +3039,7 @@ static int usage_record_decode(bufferlist& record_bl, rgw_usage_log_entry& e)
   auto kiter = record_bl.cbegin();
   try {
     decode(e, kiter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: usage_record_decode(): failed to decode record_bl\n");
     return -EINVAL;
   }
@@ -3048,15 +3056,14 @@ int rgw_user_usage_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_user_usage_log_add(): failed to decode request\n");
     return -EINVAL;
   }
 
   rgw_usage_log_info& info = op.info;
-  vector<rgw_usage_log_entry>::iterator iter;
 
-  for (iter = info.entries.begin(); iter != info.entries.end(); ++iter) {
+  for (auto iter = info.entries.begin(); iter != info.entries.end(); ++iter) {
     rgw_usage_log_entry& entry = *iter;
     string key_by_time;
 
@@ -3136,8 +3143,8 @@ static int usage_iterate_range(cls_method_context_t hctx, uint64_t start, uint64
     return ret;
 
   *truncated = truncated_status;
-      
-  map<string, bufferlist>::iterator iter = keys.begin();
+
+  auto iter = keys.begin();
   if (iter == keys.end())
     return 0;
 
@@ -3208,7 +3215,7 @@ int rgw_user_usage_log_read(cls_method_context_t hctx, bufferlist *in, bufferlis
 
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_user_usage_log_read(): failed to decode request\n");
     return -EINVAL;
   }
@@ -3263,7 +3270,7 @@ int rgw_user_usage_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlis
 
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_user_log_usage_log_trim(): failed to decode request\n");
     return -EINVAL;
   }
@@ -3434,7 +3441,7 @@ int gc_record_decode(bufferlist& bl, cls_rgw_gc_obj_info& e)
   auto iter = bl.cbegin();
   try {
     decode(e, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: failed to decode cls_rgw_gc_obj_info");
     return -EIO;
   }
@@ -3448,7 +3455,7 @@ static int rgw_cls_gc_set_entry(cls_method_context_t hctx, bufferlist *in, buffe
   cls_rgw_gc_set_entry_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_gc_set_entry(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -3463,7 +3470,7 @@ static int rgw_cls_gc_defer_entry(cls_method_context_t hctx, bufferlist *in, buf
   cls_rgw_gc_defer_entry_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_gc_defer_entry(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -3515,7 +3522,7 @@ static int gc_iterate_entries(cls_method_context_t hctx,
   if (ret < 0)
     return ret;
 
-  map<string, bufferlist>::iterator iter = keys.begin();
+  auto iter = keys.begin();
   if (iter == keys.end()) {
     // if keys empty must not come back as truncated
     ceph_assert(!truncated || !(*truncated));
@@ -3585,7 +3592,7 @@ static int rgw_cls_gc_list(cls_method_context_t hctx, bufferlist *in, bufferlist
   cls_rgw_gc_list_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_gc_list(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -3640,7 +3647,7 @@ static int rgw_cls_gc_remove(cls_method_context_t hctx, bufferlist *in, bufferli
   cls_rgw_gc_remove_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_gc_remove(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -3655,7 +3662,7 @@ static int rgw_cls_lc_get_entry(cls_method_context_t hctx, bufferlist *in, buffe
   cls_rgw_lc_get_entry_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_set_entry(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -3678,7 +3685,7 @@ static int rgw_cls_lc_set_entry(cls_method_context_t hctx, bufferlist *in, buffe
   cls_rgw_lc_set_entry_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_set_entry(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -3697,7 +3704,7 @@ static int rgw_cls_lc_rm_entry(cls_method_context_t hctx, bufferlist *in, buffer
   cls_rgw_lc_rm_entry_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_rm_entry(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -3713,7 +3720,7 @@ static int rgw_cls_lc_get_next_entry(cls_method_context_t hctx, bufferlist *in,
   cls_rgw_lc_get_next_entry_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_get_next_entry: failed to decode op\n");
     return -EINVAL;
   }
@@ -3724,14 +3731,13 @@ static int rgw_cls_lc_get_next_entry(cls_method_context_t hctx, bufferlist *in,
   int ret = cls_cxx_map_get_vals(hctx, op.marker, filter_prefix, 1, &vals, &more);
   if (ret < 0)
     return ret;
-  map<string, bufferlist>::iterator it;
   pair<string, int> entry;
   if (!vals.empty()) {
-    it=vals.begin();
+    auto it = vals.begin();
     in_iter = it->second.begin();
     try {
       decode(entry, in_iter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(1, "ERROR: rgw_cls_lc_get_next_entry(): failed to decode entry\n");
       return -EIO;
     }
@@ -3747,25 +3753,23 @@ static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in, bu
   auto in_iter = in->cbegin();
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_list_entries(): failed to decode op\n");
     return -EINVAL;
   }
 
   cls_rgw_lc_list_entries_ret op_ret;
-  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);
   if (ret < 0)
     return ret;
-  map<string, bufferlist>::iterator it;
   pair<string, int> entry;
-  for (it = vals.begin(); it != vals.end(); ++it) {
-    iter = it->second.cbegin();
+  for (auto it = vals.begin(); it != vals.end(); ++it) {
+    auto iter = it->second.cbegin();
     try {
-    decode(entry, iter);
-    } catch (buffer::error& err) {
+      decode(entry, iter);
+    } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_list_entries(): failed to decode entry\n");
     return -EIO;
    }
@@ -3782,7 +3786,7 @@ static int rgw_cls_lc_put_head(cls_method_context_t hctx, bufferlist *in, buffer
   cls_rgw_lc_put_head_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_lc_put_head(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -3804,7 +3808,7 @@ static int rgw_cls_lc_get_head(cls_method_context_t hctx, bufferlist *in,  buffe
     auto iter = bl.cbegin();
     try {
       decode(head, iter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(0, "ERROR: rgw_cls_lc_get_head(): failed to decode entry %s\n",err.what());
       return -EINVAL;
     }
@@ -3825,7 +3829,7 @@ static int rgw_reshard_add(cls_method_context_t hctx, bufferlist *in, bufferlist
   cls_rgw_reshard_add_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_reshard_add: failed to decode entry\n");
     return -EINVAL;
   }
@@ -3851,12 +3855,11 @@ static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlis
   auto in_iter = in->cbegin();
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_rehard_list(): failed to decode entry\n");
     return -EINVAL;
   }
   cls_rgw_reshard_list_ret op_ret;
-  bufferlist::const_iterator iter;
   map<string, bufferlist> vals;
   string filter_prefix;
 #define MAX_RESHARD_LIST_ENTRIES 1000
@@ -3865,14 +3868,13 @@ static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlis
   int ret = cls_cxx_map_get_vals(hctx, op.marker, filter_prefix, max, &vals, &op_ret.is_truncated);
   if (ret < 0)
     return ret;
-  map<string, bufferlist>::iterator it;
   cls_rgw_reshard_entry entry;
   int i = 0;
-  for (it = vals.begin(); i < (int)op.max && it != vals.end(); ++it, ++i) {
-    iter = it->second.cbegin();
+  for (auto it = vals.begin(); i < (int)op.max && it != vals.end(); ++it, ++i) {
+    auto iter = it->second.cbegin();
     try {
       decode(entry, iter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(1, "ERROR: rgw_cls_rehard_list(): failed to decode entry\n");
       return -EIO;
    }
@@ -3889,7 +3891,7 @@ static int rgw_reshard_get(cls_method_context_t hctx, bufferlist *in,  bufferlis
   cls_rgw_reshard_get_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_reshard_get: failed to decode entry\n");
     return -EINVAL;
   }
@@ -3915,7 +3917,7 @@ static int rgw_reshard_remove(cls_method_context_t hctx, bufferlist *in, bufferl
   cls_rgw_reshard_remove_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: rgw_cls_rehard_remove: failed to decode entry\n");
     return -EINVAL;
   }
@@ -3948,7 +3950,7 @@ static int rgw_set_bucket_resharding(cls_method_context_t hctx, bufferlist *in,
   auto in_iter = in->cbegin();
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rgw_set_bucket_resharding: failed to decode entry\n");
     return -EINVAL;
   }
@@ -3972,7 +3974,7 @@ static int rgw_clear_bucket_resharding(cls_method_context_t hctx, bufferlist *in
   auto in_iter = in->cbegin();
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rgw_clear_bucket_resharding: failed to decode entry\n");
     return -EINVAL;
   }
@@ -3995,7 +3997,7 @@ static int rgw_guard_bucket_resharding(cls_method_context_t hctx, bufferlist *in
   auto in_iter = in->cbegin();
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: %s(): failed to decode entry\n", __func__);
     return -EINVAL;
   }
@@ -4022,7 +4024,7 @@ static int rgw_get_bucket_resharding(cls_method_context_t hctx,
   auto in_iter = in->cbegin();
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: %s(): failed to decode entry\n", __func__);
     return -EINVAL;
   }
index 65e59047ebada1547a95de8a50061080f6af42e0..09ce9749a00a8218b00264d7b643ece46c73c240 100644 (file)
@@ -8,6 +8,14 @@
 
 #include "common/debug.h"
 
+using std::list;
+using std::map;
+using std::pair;
+using std::string;
+using std::vector;
+
+using ceph::real_time;
+
 using namespace librados;
 
 const string BucketIndexShardsManager::KEY_VALUE_SEPARATOR = "#";
@@ -29,7 +37,7 @@ public:
       try {
         auto iter = outbl.cbegin();
         decode((*data), iter);
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         r = -EIO;
       }
     }
@@ -42,14 +50,14 @@ public:
 void BucketIndexAioManager::do_completion(int id) {
   std::lock_guard l{lock};
 
-  map<int, librados::AioCompletion*>::iterator iter = pendings.find(id);
+  auto iter = pendings.find(id);
   ceph_assert(iter != pendings.end());
   completions[id] = iter->second;
   pendings.erase(iter);
 
   // If the caller needs a list of finished objects, store them
   // for further processing
-  map<int, string>::iterator miter = pending_objs.find(id);
+  auto miter = pending_objs.find(id);
   if (miter != pending_objs.end()) {
     completion_objs[id] = miter->second;
     pending_objs.erase(miter);
@@ -71,11 +79,11 @@ bool BucketIndexAioManager::wait_for_completions(int valid_ret_code,
   }
 
   // Clear the completed AIOs
-  map<int, librados::AioCompletion*>::iterator iter = completions.begin();
+  auto iter = completions.begin();
   for (; iter != completions.end(); ++iter) {
     int r = iter->second->get_return_value();
     if (objs && r == 0) { /* update list of successfully completed objs */
-      map<int, string>::iterator liter = completion_objs.find(iter->first);
+      auto liter = completion_objs.find(iter->first);
       if (liter != completion_objs.end()) {
         (*objs)[liter->first] = liter->second;
       }
@@ -309,7 +317,7 @@ int cls_rgw_bi_get(librados::IoCtx& io_ctx, const string oid,
   auto iter = out.cbegin();
   try {
     decode(op_ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
@@ -358,7 +366,7 @@ int cls_rgw_bi_list(librados::IoCtx& io_ctx, const string oid,
   auto iter = out.cbegin();
   try {
     decode(op_ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
@@ -634,7 +642,7 @@ public:
     try {
       auto iter = outbl.cbegin();
       decode(ret, iter);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       r = -EIO;
     }
 
@@ -690,7 +698,7 @@ int cls_rgw_usage_log_read(IoCtx& io_ctx, const string& oid, const string& user,
       *is_truncated = result.truncated;
 
     usage = result.usage;
-  } catch (buffer::error& e) {
+  } catch (ceph::buffer::error& e) {
     return -EINVAL;
   }
 
@@ -789,7 +797,7 @@ int cls_rgw_gc_list(IoCtx& io_ctx, string& oid, string& marker, uint32_t max, bo
   try {
     auto iter = out.cbegin();
     decode(ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
@@ -821,7 +829,7 @@ int cls_rgw_lc_get_head(IoCtx& io_ctx, const string& oid, cls_rgw_lc_obj_head& h
   try {
     auto iter = out.cbegin();
     decode(ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
   head = ret.head;
@@ -853,7 +861,7 @@ int cls_rgw_lc_get_next_entry(IoCtx& io_ctx, const string& oid, string& marker,
   try {
     auto iter = out.cbegin();
     decode(ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
   entry = ret.entry;
@@ -896,7 +904,7 @@ int cls_rgw_lc_get_entry(IoCtx& io_ctx, const string& oid, const std::string& ma
   try {
     auto iter = out.cbegin();
     decode(ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
@@ -927,7 +935,7 @@ int cls_rgw_lc_list(IoCtx& io_ctx, const string& oid,
   try {
     auto iter = out.cbegin();
     decode(ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
   entries.insert(ret.entries.begin(),ret.entries.end());
@@ -960,7 +968,7 @@ int cls_rgw_reshard_list(librados::IoCtx& io_ctx, const string& oid, string& mar
   auto iter = out.cbegin();
   try {
     decode(op_ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
@@ -984,7 +992,7 @@ int cls_rgw_reshard_get(librados::IoCtx& io_ctx, const string& oid, cls_rgw_resh
   auto iter = out.cbegin();
   try {
     decode(op_ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
@@ -1036,7 +1044,7 @@ int cls_rgw_get_bucket_resharding(librados::IoCtx& io_ctx, const string& oid,
   auto iter = out.cbegin();
   try {
     decode(op_ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
index bd13710e86686b29484ae64d4e55533f279d38df..a8fd6dd51bbc0b9ded6f1ae4f0b36b0e6c35e5b6 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #ifndef CEPH_CLS_RGW_CLIENT_H
@@ -34,10 +34,10 @@ struct BucketIndexAioArg : public RefCountedObject {
  */
 class BucketIndexAioManager {
 private:
-  map<int, librados::AioCompletion*> pendings;
-  map<int, librados::AioCompletion*> completions;
-  map<int, string> pending_objs;
-  map<int, string> completion_objs;
+  std::map<int, librados::AioCompletion*> pendings;
+  std::map<int, librados::AioCompletion*> completions;
+  std::map<int, std::string> pending_objs;
+  std::map<int, std::string> completion_objs;
   int next = 0;
   ceph::mutex lock = ceph::make_mutex("BucketIndexAioManager::lock");
   ceph::condition_variable cond;
@@ -65,7 +65,7 @@ private:
    * @param oid        - the object id associated with the object, if it is NULL, we don't
    *                     track the object id per callback.
    */
-  void add_pending(int id, librados::AioCompletion* completion, const string& oid) {
+  void add_pending(int id, librados::AioCompletion* completion, const std::string& oid) {
     pendings[id] = completion;
     pending_objs[id] = oid;
   }
@@ -86,17 +86,17 @@ public:
    * valid_ret_code  - valid AIO return code.
    * num_completions - number of completions.
    * ret_code        - return code of failed AIO.
-   * objs            - a list of objects that has been finished the AIO.
+   * objs            - a std::list of objects that has been finished the AIO.
    *
    * Return false if there is no pending AIO, true otherwise.
    */
   bool wait_for_completions(int valid_ret_code, int *num_completions, int *ret_code,
-      map<int, string> *objs);
+      std::map<int, std::string> *objs);
 
   /**
    * Do aio read operation.
    */
-  bool aio_operate(librados::IoCtx& io_ctx, const string& oid, librados::ObjectReadOperation *op) {
+  bool aio_operate(librados::IoCtx& io_ctx, const std::string& oid, librados::ObjectReadOperation *op) {
     std::lock_guard l{lock};
     BucketIndexAioArg *arg = new BucketIndexAioArg(get_next(), this);
     librados::AioCompletion *c = librados::Rados::aio_create_completion((void*)arg, bucket_index_op_completion_cb);
@@ -113,7 +113,7 @@ public:
   /**
    * Do aio write operation.
    */
-  bool aio_operate(librados::IoCtx& io_ctx, const string& oid, librados::ObjectWriteOperation *op) {
+  bool aio_operate(librados::IoCtx& io_ctx, const std::string& oid, librados::ObjectWriteOperation *op) {
     std::lock_guard l{lock};
     BucketIndexAioArg *arg = new BucketIndexAioArg(get_next(), this);
     librados::AioCompletion *c = librados::Rados::aio_create_completion((void*)arg, bucket_index_op_completion_cb);
@@ -137,21 +137,21 @@ public:
 class BucketIndexShardsManager {
 private:
   // Per shard setting manager, for example, marker.
-  map<int, string> value_by_shards;
+  std::map<int, std::string> value_by_shards;
 public:
-  const static string KEY_VALUE_SEPARATOR;
-  const static string SHARDS_SEPARATOR;
+  const static std::string KEY_VALUE_SEPARATOR;
+  const static std::string SHARDS_SEPARATOR;
 
-  void add(int shard, const string& value) {
+  void add(int shard, const std::string& value) {
     value_by_shards[shard] = value;
   }
 
-  const string& get(int shard, const string& default_value) {
-    map<int, string>::iterator iter = value_by_shards.find(shard);
+  const std::string& get(int shard, const std::string& default_value) {
+    auto iter = value_by_shards.find(shard);
     return (iter == value_by_shards.end() ? default_value : iter->second);
   }
 
-  map<int, string>& get() {
+  std::map<int, std::string>& get() {
     return value_by_shards;
   }
 
@@ -159,13 +159,13 @@ public:
     return value_by_shards.empty();
   }
 
-  void to_string(string *out) const {
+  void to_string(std::string *out) const {
     if (!out) {
       return;
     }
     out->clear();
-    map<int, string>::const_iterator iter = value_by_shards.begin();
-    for (; iter != value_by_shards.end(); ++iter) {
+    for (auto iter = value_by_shards.begin();
+        iter != value_by_shards.end(); ++iter) {
       if (out->length()) {
         // Not the first item, append a separator first
         out->append(SHARDS_SEPARATOR);
@@ -178,12 +178,12 @@ public:
     }
   }
 
-  static bool is_shards_marker(const string& marker) {
-    return marker.find(KEY_VALUE_SEPARATOR) != string::npos;
+  static bool is_shards_marker(const std::string& marker) {
+    return marker.find(KEY_VALUE_SEPARATOR) != std::string::npos;
   }
 
   /*
-   * convert from string. There are two options of how the string looks like:
+   * convert from std::string. There are two options of how the std::string looks like:
    *
    * 1. Single shard, no shard id specified, e.g. 000001.23.1
    *
@@ -193,17 +193,16 @@ public:
    * 2. One or more shards, shard id specified for each shard, e.g., 0#00002.12,1#00003.23.2
    *
    */
-  int from_string(const string& composed_marker, int shard_id) {
+  int from_string(const std::string& composed_marker, int shard_id) {
     value_by_shards.clear();
-    vector<string> shards;
+    std::vector<std::string> shards;
     get_str_vec(composed_marker, SHARDS_SEPARATOR.c_str(), shards);
     if (shards.size() > 1 && shard_id >= 0) {
       return -EINVAL;
     }
-    vector<string>::const_iterator iter = shards.begin();
-    for (; iter != shards.end(); ++iter) {
+    for (auto iter = shards.begin(); iter != shards.end(); ++iter) {
       size_t pos = iter->find(KEY_VALUE_SEPARATOR);
-      if (pos == string::npos) {
+      if (pos == std::string::npos) {
         if (!value_by_shards.empty()) {
           return -EINVAL;
         }
@@ -214,8 +213,8 @@ public:
         }
         return 0;
       }
-      string shard_str = iter->substr(0, pos);
-      string err;
+      std::string shard_str = iter->substr(0, pos);
+      std::string err;
       int shard = (int)strict_strtol(shard_str.c_str(), 10, &err);
       if (!err.empty()) {
         return -EINVAL;
@@ -241,12 +240,12 @@ void cls_rgw_bucket_init_index(librados::ObjectWriteOperation& o);
 class CLSRGWConcurrentIO {
 protected:
   librados::IoCtx& io_ctx;
-  map<int, string>& objs_container;
-  map<int, string>::iterator iter;
+  std::map<int, std::string>& objs_container;
+  std::map<int, std::string>::iterator iter;
   uint32_t max_aio;
   BucketIndexAioManager manager;
 
-  virtual int issue_op(int shard_id, const string& oid) = 0;
+  virtual int issue_op(int shard_id, const std::string& oid) = 0;
 
   virtual void cleanup() {}
   virtual int valid_ret_code() { return 0; }
@@ -254,13 +253,13 @@ protected:
   // OP needs to be re-send until a certain code is returned.
   virtual bool need_multiple_rounds() { return false; }
   // Add a new object to the end of the container.
-  virtual void add_object(int shard, const string& oid) {}
-  virtual void reset_container(map<int, string>& objs) {}
+  virtual void add_object(int shard, const std::string& oid) {}
+  virtual void reset_container(std::map<int, std::string>& objs) {}
 
 public:
 
   CLSRGWConcurrentIO(librados::IoCtx& ioc,
-                    map<int, string>& _objs_container,
+                    std::map<int, std::string>& _objs_container,
                     uint32_t _max_aio) :
   io_ctx(ioc), objs_container(_objs_container), max_aio(_max_aio)
   {}
@@ -278,8 +277,8 @@ public:
     }
 
     int num_completions = 0, r = 0;
-    map<int, string> objs;
-    map<int, string> *pobjs = (need_multiple_rounds() ? &objs : NULL);
+    std::map<int, std::string> objs;
+    std::map<int, std::string> *pobjs = (need_multiple_rounds() ? &objs : NULL);
     while (manager.wait_for_completions(valid_ret_code(), &num_completions, &r, pobjs)) {
       if (r >= 0 && ret >= 0) {
         for (; num_completions && iter != objs_container.end(); --num_completions, ++iter) {
@@ -316,11 +315,11 @@ public:
 
 class CLSRGWIssueBucketIndexInit : public CLSRGWConcurrentIO {
 protected:
-  int issue_op(int shard_id, const string& oid) override;
+  int issue_op(int shard_id, const std::string& oid) override;
   int valid_ret_code() override { return -EEXIST; }
   void cleanup() override;
 public:
-  CLSRGWIssueBucketIndexInit(librados::IoCtx& ioc, map<int, string>& _bucket_objs,
+  CLSRGWIssueBucketIndexInit(librados::IoCtx& ioc, std::map<int, std::string>& _bucket_objs,
                      uint32_t _max_aio) :
     CLSRGWConcurrentIO(ioc, _bucket_objs, _max_aio) {}
 };
@@ -328,14 +327,14 @@ public:
 
 class CLSRGWIssueBucketIndexClean : public CLSRGWConcurrentIO {
 protected:
-  int issue_op(int shard_id, const string& oid) override;
+  int issue_op(int shard_id, const std::string& oid) override;
   int valid_ret_code() override {
     return -ENOENT;
   }
 
 public:
   CLSRGWIssueBucketIndexClean(librados::IoCtx& ioc,
-                             map<int, string>& _bucket_objs,
+                             std::map<int, std::string>& _bucket_objs,
                              uint32_t _max_aio) :
   CLSRGWConcurrentIO(ioc, _bucket_objs, _max_aio)
   {}
@@ -345,76 +344,76 @@ public:
 class CLSRGWIssueSetTagTimeout : public CLSRGWConcurrentIO {
   uint64_t tag_timeout;
 protected:
-  int issue_op(int shard_id, const string& oid) override;
+  int issue_op(int shard_id, const std::string& oid) override;
 public:
-  CLSRGWIssueSetTagTimeout(librados::IoCtx& ioc, map<int, string>& _bucket_objs,
+  CLSRGWIssueSetTagTimeout(librados::IoCtx& ioc, std::map<int, std::string>& _bucket_objs,
                      uint32_t _max_aio, uint64_t _tag_timeout) :
     CLSRGWConcurrentIO(ioc, _bucket_objs, _max_aio), tag_timeout(_tag_timeout) {}
 };
 
 void cls_rgw_bucket_update_stats(librados::ObjectWriteOperation& o,
                                  bool absolute,
-                                 const map<RGWObjCategory, rgw_bucket_category_stats>& stats);
+                                 const std::map<RGWObjCategory, rgw_bucket_category_stats>& stats);
 
-void cls_rgw_bucket_prepare_op(librados::ObjectWriteOperation& o, RGWModifyOp op, string& tag,
-                               const cls_rgw_obj_key& key, const string& locator, bool log_op,
+void cls_rgw_bucket_prepare_op(librados::ObjectWriteOperation& o, RGWModifyOp op, std::string& tag,
+                               const cls_rgw_obj_key& key, const std::string& locator, bool log_op,
                                uint16_t bilog_op, rgw_zone_set& zones_trace);
 
-void cls_rgw_bucket_complete_op(librados::ObjectWriteOperation& o, RGWModifyOp op, string& tag,
+void cls_rgw_bucket_complete_op(librados::ObjectWriteOperation& o, RGWModifyOp op, std::string& tag,
                                 rgw_bucket_entry_ver& ver,
                                 const cls_rgw_obj_key& key,
                                 rgw_bucket_dir_entry_meta& dir_meta,
-                               list<cls_rgw_obj_key> *remove_objs, bool log_op,
+                               std::list<cls_rgw_obj_key> *remove_objs, bool log_op,
                                 uint16_t bilog_op, rgw_zone_set *zones_trace);
 
-void cls_rgw_remove_obj(librados::ObjectWriteOperation& o, list<string>& keep_attr_prefixes);
-void cls_rgw_obj_store_pg_ver(librados::ObjectWriteOperation& o, const string& attr);
-void cls_rgw_obj_check_attrs_prefix(librados::ObjectOperation& o, const string& prefix, bool fail_if_exist);
+void cls_rgw_remove_obj(librados::ObjectWriteOperation& o, std::list<std::string>& keep_attr_prefixes);
+void cls_rgw_obj_store_pg_ver(librados::ObjectWriteOperation& o, const std::string& attr);
+void cls_rgw_obj_check_attrs_prefix(librados::ObjectOperation& o, const std::string& prefix, bool fail_if_exist);
 void cls_rgw_obj_check_mtime(librados::ObjectOperation& o, const ceph::real_time& mtime, bool high_precision_time, RGWCheckMTimeType type);
 
-int cls_rgw_bi_get(librados::IoCtx& io_ctx, const string oid,
+int cls_rgw_bi_get(librados::IoCtx& io_ctx, const std::string oid,
                    BIIndexType index_type, cls_rgw_obj_key& key,
                    rgw_cls_bi_entry *entry);
-int cls_rgw_bi_put(librados::IoCtx& io_ctx, const string oid, rgw_cls_bi_entry& entry);
-void cls_rgw_bi_put(librados::ObjectWriteOperation& op, const string oid, rgw_cls_bi_entry& entry);
-int cls_rgw_bi_list(librados::IoCtx& io_ctx, const string oid,
-                   const string& name, const string& marker, uint32_t max,
-                   list<rgw_cls_bi_entry> *entries, bool *is_truncated);
+int cls_rgw_bi_put(librados::IoCtx& io_ctx, const std::string oid, rgw_cls_bi_entry& entry);
+void cls_rgw_bi_put(librados::ObjectWriteOperation& op, const std::string oid, rgw_cls_bi_entry& entry);
+int cls_rgw_bi_list(librados::IoCtx& io_ctx, const std::string oid,
+                   const std::string& name, const std::string& marker, uint32_t max,
+                   std::list<rgw_cls_bi_entry> *entries, bool *is_truncated);
 
 
 void cls_rgw_bucket_link_olh(librados::ObjectWriteOperation& op,
-                            const cls_rgw_obj_key& key, bufferlist& olh_tag,
-                            bool delete_marker, const string& op_tag, rgw_bucket_dir_entry_meta *meta,
+                            const cls_rgw_obj_key& key, ceph::buffer::list& olh_tag,
+                            bool delete_marker, const std::string& op_tag, rgw_bucket_dir_entry_meta *meta,
                             uint64_t olh_epoch, ceph::real_time unmod_since, bool high_precision_time, bool log_op, rgw_zone_set& zones_trace);
 void cls_rgw_bucket_unlink_instance(librados::ObjectWriteOperation& op,
-                                   const cls_rgw_obj_key& key, const string& op_tag,
-                                   const string& olh_tag, uint64_t olh_epoch, bool log_op, rgw_zone_set& zones_trace);
-void cls_rgw_get_olh_log(librados::ObjectReadOperation& op, const cls_rgw_obj_key& olh, uint64_t ver_marker, const string& olh_tag, rgw_cls_read_olh_log_ret& log_ret, int& op_ret);
-void cls_rgw_trim_olh_log(librados::ObjectWriteOperation& op, const cls_rgw_obj_key& olh, uint64_t ver, const string& olh_tag);
-void cls_rgw_clear_olh(librados::ObjectWriteOperation& op, const cls_rgw_obj_key& olh, const string& olh_tag);
+                                   const cls_rgw_obj_key& key, const std::string& op_tag,
+                                   const std::string& olh_tag, uint64_t olh_epoch, bool log_op, rgw_zone_set& zones_trace);
+void cls_rgw_get_olh_log(librados::ObjectReadOperation& op, const cls_rgw_obj_key& olh, uint64_t ver_marker, const std::string& olh_tag, rgw_cls_read_olh_log_ret& log_ret, int& op_ret);
+void cls_rgw_trim_olh_log(librados::ObjectWriteOperation& op, const cls_rgw_obj_key& olh, uint64_t ver, const std::string& olh_tag);
+void cls_rgw_clear_olh(librados::ObjectWriteOperation& op, const cls_rgw_obj_key& olh, const std::string& olh_tag);
 
 // these overloads which call io_ctx.operate() should not be called in the rgw.
 // rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()
 #ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_rgw_bucket_link_olh(librados::IoCtx& io_ctx, const string& oid,
-                            const cls_rgw_obj_key& key, bufferlist& olh_tag,
-                            bool delete_marker, const string& op_tag, rgw_bucket_dir_entry_meta *meta,
+int cls_rgw_bucket_link_olh(librados::IoCtx& io_ctx, const std::string& oid,
+                            const cls_rgw_obj_key& key, ceph::buffer::list& olh_tag,
+                            bool delete_marker, const std::string& op_tag, rgw_bucket_dir_entry_meta *meta,
                             uint64_t olh_epoch, ceph::real_time unmod_since, bool high_precision_time, bool log_op, rgw_zone_set& zones_trace);
-int cls_rgw_bucket_unlink_instance(librados::IoCtx& io_ctx, const string& oid,
-                                   const cls_rgw_obj_key& key, const string& op_tag,
-                                   const string& olh_tag, uint64_t olh_epoch, bool log_op, rgw_zone_set& zones_trace);
-int cls_rgw_get_olh_log(librados::IoCtx& io_ctx, string& oid, const cls_rgw_obj_key& olh, uint64_t ver_marker,
-                        const string& olh_tag, rgw_cls_read_olh_log_ret& log_ret);
-int cls_rgw_clear_olh(librados::IoCtx& io_ctx, string& oid, const cls_rgw_obj_key& olh, const string& olh_tag);
-int cls_rgw_usage_log_trim(librados::IoCtx& io_ctx, const string& oid, const string& user, const string& bucket,
+int cls_rgw_bucket_unlink_instance(librados::IoCtx& io_ctx, const std::string& oid,
+                                   const cls_rgw_obj_key& key, const std::string& op_tag,
+                                   const std::string& olh_tag, uint64_t olh_epoch, bool log_op, rgw_zone_set& zones_trace);
+int cls_rgw_get_olh_log(librados::IoCtx& io_ctx, std::string& oid, const cls_rgw_obj_key& olh, uint64_t ver_marker,
+                        const std::string& olh_tag, rgw_cls_read_olh_log_ret& log_ret);
+int cls_rgw_clear_olh(librados::IoCtx& io_ctx, std::string& oid, const cls_rgw_obj_key& olh, const std::string& olh_tag);
+int cls_rgw_usage_log_trim(librados::IoCtx& io_ctx, const std::string& oid, const std::string& user, const std::string& bucket,
                            uint64_t start_epoch, uint64_t end_epoch);
 #endif
 
 
 /**
- * List the bucket with the starting object and filter prefix.
+ * Std::list the bucket with the starting object and filter prefix.
  * NOTE: this method do listing requests for each bucket index shards identified by
- *       the keys of the *list_results* map, which means the map should be popludated
+ *       the keys of the *list_results* std::map, which means the std::map should be popludated
  *       by the caller to fill with each bucket index object id.
  *
  * io_ctx        - IO context for rados.
@@ -422,7 +421,7 @@ int cls_rgw_usage_log_trim(librados::IoCtx& io_ctx, const string& oid, const str
  * filter_prefix - filter prefix.
  * num_entries   - number of entries to request for each object (note the total
  *                 amount of entries returned depends on the number of shardings).
- * list_results  - the list results keyed by bucket index object id.
+ * list_results  - the std::list results keyed by bucket index object id.
  * max_aio       - the maximum number of AIO (for throttling).
  *
  * Return 0 on success, a failure code otherwise.
@@ -430,22 +429,22 @@ int cls_rgw_usage_log_trim(librados::IoCtx& io_ctx, const string& oid, const str
 
 class CLSRGWIssueBucketList : public CLSRGWConcurrentIO {
   cls_rgw_obj_key start_obj;
-  string filter_prefix;
-  string delimiter;
+  std::string filter_prefix;
+  std::string delimiter;
   uint32_t num_entries;
   bool list_versions;
-  map<int, rgw_cls_list_ret>& result;
+  std::map<int, rgw_cls_list_ret>& result;
 protected:
-  int issue_op(int shard_id, const string& oid) override;
+  int issue_op(int shard_id, const std::string& oid) override;
 public:
   CLSRGWIssueBucketList(librados::IoCtx& io_ctx,
                        const cls_rgw_obj_key& _start_obj,
-                        const string& _filter_prefix,
-                       const string& _delimiter,
+                        const std::string& _filter_prefix,
+                       const std::string& _delimiter,
                        uint32_t _num_entries,
                         bool _list_versions,
-                        map<int, string>& oids,
-                        map<int, rgw_cls_list_ret>& list_results,
+                        std::map<int, std::string>& oids,
+                        std::map<int, rgw_cls_list_ret>& list_results,
                         uint32_t max_aio) :
   CLSRGWConcurrentIO(io_ctx, oids, max_aio),
     start_obj(_start_obj), filter_prefix(_filter_prefix), delimiter(_delimiter),
@@ -467,15 +466,15 @@ void cls_rgw_bilog_list(librados::ObjectReadOperation& op,
                         cls_rgw_bi_log_list_ret *pdata, int *ret = nullptr);
 
 class CLSRGWIssueBILogList : public CLSRGWConcurrentIO {
-  map<int, cls_rgw_bi_log_list_ret>& result;
+  std::map<int, cls_rgw_bi_log_list_ret>& result;
   BucketIndexShardsManager& marker_mgr;
   uint32_t max;
 protected:
-  int issue_op(int shard_id, const string& oid) override;
+  int issue_op(int shard_id, const std::string& oid) override;
 public:
   CLSRGWIssueBILogList(librados::IoCtx& io_ctx, BucketIndexShardsManager& _marker_mgr, uint32_t _max,
-                       map<int, string>& oids,
-                       map<int, cls_rgw_bi_log_list_ret>& bi_log_lists, uint32_t max_aio) :
+                       std::map<int, std::string>& oids,
+                       std::map<int, cls_rgw_bi_log_list_ret>& bi_log_lists, uint32_t max_aio) :
     CLSRGWConcurrentIO(io_ctx, oids, max_aio), result(bi_log_lists),
     marker_mgr(_marker_mgr), max(_max) {}
 };
@@ -488,19 +487,19 @@ class CLSRGWIssueBILogTrim : public CLSRGWConcurrentIO {
   BucketIndexShardsManager& start_marker_mgr;
   BucketIndexShardsManager& end_marker_mgr;
 protected:
-  int issue_op(int shard_id, const string& oid) override;
+  int issue_op(int shard_id, const std::string& oid) override;
   // Trim until -ENODATA is returned.
   int valid_ret_code() override { return -ENODATA; }
   bool need_multiple_rounds() override { return true; }
-  void add_object(int shard, const string& oid) override { objs_container[shard] = oid; }
-  void reset_container(map<int, string>& objs) override {
+  void add_object(int shard, const std::string& oid) override { objs_container[shard] = oid; }
+  void reset_container(std::map<int, std::string>& objs) override {
     objs_container.swap(objs);
     iter = objs_container.begin();
     objs.clear();
   }
 public:
   CLSRGWIssueBILogTrim(librados::IoCtx& io_ctx, BucketIndexShardsManager& _start_marker_mgr,
-      BucketIndexShardsManager& _end_marker_mgr, map<int, string>& _bucket_objs, uint32_t max_aio) :
+      BucketIndexShardsManager& _end_marker_mgr, std::map<int, std::string>& _bucket_objs, uint32_t max_aio) :
     CLSRGWConcurrentIO(io_ctx, _bucket_objs, max_aio),
     start_marker_mgr(_start_marker_mgr), end_marker_mgr(_end_marker_mgr) {}
 };
@@ -514,31 +513,31 @@ public:
  *
  * Return 0 on success, a failure code otherwise.
  */
-class CLSRGWIssueBucketCheck : public CLSRGWConcurrentIO /*<map<string, rgw_cls_check_index_ret> >*/ {
-  map<int, rgw_cls_check_index_ret>& result;
+class CLSRGWIssueBucketCheck : public CLSRGWConcurrentIO /*<std::map<std::string, rgw_cls_check_index_ret> >*/ {
+  std::map<int, rgw_cls_check_index_ret>& result;
 protected:
-  int issue_op(int shard_id, const string& oid) override;
+  int issue_op(int shard_id, const std::string& oid) override;
 public:
-  CLSRGWIssueBucketCheck(librados::IoCtx& ioc, map<int, string>& oids,
-                        map<int, rgw_cls_check_index_ret>& bucket_objs_ret,
+  CLSRGWIssueBucketCheck(librados::IoCtx& ioc, std::map<int, std::string>& oids,
+                        std::map<int, rgw_cls_check_index_ret>& bucket_objs_ret,
                         uint32_t _max_aio) :
     CLSRGWConcurrentIO(ioc, oids, _max_aio), result(bucket_objs_ret) {}
 };
 
 class CLSRGWIssueBucketRebuild : public CLSRGWConcurrentIO {
 protected:
-  int issue_op(int shard_id, const string& oid) override;
+  int issue_op(int shard_id, const std::string& oid) override;
 public:
-  CLSRGWIssueBucketRebuild(librados::IoCtx& io_ctx, map<int, string>& bucket_objs,
+  CLSRGWIssueBucketRebuild(librados::IoCtx& io_ctx, std::map<int, std::string>& bucket_objs,
                            uint32_t max_aio) : CLSRGWConcurrentIO(io_ctx, bucket_objs, max_aio) {}
 };
 
 class CLSRGWIssueGetDirHeader : public CLSRGWConcurrentIO {
-  map<int, rgw_cls_list_ret>& result;
+  std::map<int, rgw_cls_list_ret>& result;
 protected:
-  int issue_op(int shard_id, const string& oid) override;
+  int issue_op(int shard_id, const std::string& oid) override;
 public:
-  CLSRGWIssueGetDirHeader(librados::IoCtx& io_ctx, map<int, string>& oids, map<int, rgw_cls_list_ret>& dir_headers,
+  CLSRGWIssueGetDirHeader(librados::IoCtx& io_ctx, std::map<int, std::string>& oids, std::map<int, rgw_cls_list_ret>& dir_headers,
                           uint32_t max_aio) :
     CLSRGWConcurrentIO(io_ctx, oids, max_aio), result(dir_headers) {}
 };
@@ -546,75 +545,75 @@ public:
 class CLSRGWIssueSetBucketResharding : public CLSRGWConcurrentIO {
   cls_rgw_bucket_instance_entry entry;
 protected:
-  int issue_op(int shard_id, const string& oid) override;
+  int issue_op(int shard_id, const std::string& oid) override;
 public:
-  CLSRGWIssueSetBucketResharding(librados::IoCtx& ioc, map<int, string>& _bucket_objs,
+  CLSRGWIssueSetBucketResharding(librados::IoCtx& ioc, std::map<int, std::string>& _bucket_objs,
                                  const cls_rgw_bucket_instance_entry& _entry,
                                  uint32_t _max_aio) : CLSRGWConcurrentIO(ioc, _bucket_objs, _max_aio), entry(_entry) {}
 };
 
 class CLSRGWIssueResyncBucketBILog : public CLSRGWConcurrentIO {
 protected:
-  int issue_op(int shard_id, const string& oid);
+  int issue_op(int shard_id, const std::string& oid);
 public:
-  CLSRGWIssueResyncBucketBILog(librados::IoCtx& io_ctx, map<int, string>& _bucket_objs, uint32_t max_aio) :
+  CLSRGWIssueResyncBucketBILog(librados::IoCtx& io_ctx, std::map<int, std::string>& _bucket_objs, uint32_t max_aio) :
     CLSRGWConcurrentIO(io_ctx, _bucket_objs, max_aio) {}
 };
 
 class CLSRGWIssueBucketBILogStop : public CLSRGWConcurrentIO {
 protected:
-  int issue_op(int shard_id, const string& oid);
+  int issue_op(int shard_id, const std::string& oid);
 public:
-  CLSRGWIssueBucketBILogStop(librados::IoCtx& io_ctx, map<int, string>& _bucket_objs, uint32_t max_aio) :
+  CLSRGWIssueBucketBILogStop(librados::IoCtx& io_ctx, std::map<int, std::string>& _bucket_objs, uint32_t max_aio) :
     CLSRGWConcurrentIO(io_ctx, _bucket_objs, max_aio) {}
 };
 
-int cls_rgw_get_dir_header_async(librados::IoCtx& io_ctx, string& oid, RGWGetDirHeader_CB *ctx);
+int cls_rgw_get_dir_header_async(librados::IoCtx& io_ctx, std::string& oid, RGWGetDirHeader_CB *ctx);
 
-void cls_rgw_encode_suggestion(char op, rgw_bucket_dir_entry& dirent, bufferlist& updates);
+void cls_rgw_encode_suggestion(char op, rgw_bucket_dir_entry& dirent, ceph::buffer::list& updates);
 
-void cls_rgw_suggest_changes(librados::ObjectWriteOperation& o, bufferlist& updates);
+void cls_rgw_suggest_changes(librados::ObjectWriteOperation& o, ceph::buffer::list& updates);
 
 /* usage logging */
 // these overloads which call io_ctx.operate() should not be called in the rgw.
 // rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()
 #ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_rgw_usage_log_read(librados::IoCtx& io_ctx, const string& oid, const string& user, const string& bucket,
-                           uint64_t start_epoch, uint64_t end_epoch, uint32_t max_entries, string& read_iter,
-                          map<rgw_user_bucket, rgw_usage_log_entry>& usage, bool *is_truncated);
+int cls_rgw_usage_log_read(librados::IoCtx& io_ctx, const std::string& oid, const std::string& user, const std::string& bucket,
+                           uint64_t start_epoch, uint64_t end_epoch, uint32_t max_entries, std::string& read_iter,
+                          std::map<rgw_user_bucket, rgw_usage_log_entry>& usage, bool *is_truncated);
 #endif
 
-void cls_rgw_usage_log_trim(librados::ObjectWriteOperation& op, const string& user, const string& bucket, uint64_t start_epoch, uint64_t end_epoch);
+void cls_rgw_usage_log_trim(librados::ObjectWriteOperation& op, const std::string& user, const std::string& bucket, uint64_t start_epoch, uint64_t end_epoch);
 
 void cls_rgw_usage_log_clear(librados::ObjectWriteOperation& op);
 void cls_rgw_usage_log_add(librados::ObjectWriteOperation& op, rgw_usage_log_info& info);
 
 /* garbage collection */
 void cls_rgw_gc_set_entry(librados::ObjectWriteOperation& op, uint32_t expiration_secs, cls_rgw_gc_obj_info& info);
-void cls_rgw_gc_defer_entry(librados::ObjectWriteOperation& op, uint32_t expiration_secs, const string& tag);
-void cls_rgw_gc_remove(librados::ObjectWriteOperation& op, const vector<string>& tags);
+void cls_rgw_gc_defer_entry(librados::ObjectWriteOperation& op, uint32_t expiration_secs, const std::string& tag);
+void cls_rgw_gc_remove(librados::ObjectWriteOperation& op, const std::vector<std::string>& tags);
 
 // these overloads which call io_ctx.operate() should not be called in the rgw.
 // rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()
 #ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_rgw_gc_list(librados::IoCtx& io_ctx, string& oid, string& marker, uint32_t max, bool expired_only,
-                    list<cls_rgw_gc_obj_info>& entries, bool *truncated, string& next_marker);
+int cls_rgw_gc_list(librados::IoCtx& io_ctx, std::string& oid, std::string& marker, uint32_t max, bool expired_only,
+                    std::list<cls_rgw_gc_obj_info>& entries, bool *truncated, std::string& next_marker);
 #endif
 
 /* lifecycle */
 // these overloads which call io_ctx.operate() should not be called in the rgw.
 // rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()
 #ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_rgw_lc_get_head(librados::IoCtx& io_ctx, const string& oid, cls_rgw_lc_obj_head& head);
-int cls_rgw_lc_put_head(librados::IoCtx& io_ctx, const string& oid, cls_rgw_lc_obj_head& head);
-int cls_rgw_lc_get_next_entry(librados::IoCtx& io_ctx, const string& oid, string& marker, pair<string, int>& entry);
-int cls_rgw_lc_rm_entry(librados::IoCtx& io_ctx, const string& oid, const pair<string, int>& entry);
-int cls_rgw_lc_set_entry(librados::IoCtx& io_ctx, const string& oid, const pair<string, int>& entry);
-int cls_rgw_lc_get_entry(librados::IoCtx& io_ctx, const string& oid, const std::string& marker, rgw_lc_entry_t& entry);
-int cls_rgw_lc_list(librados::IoCtx& io_ctx, const string& oid,
-                    const string& marker,
+int cls_rgw_lc_get_head(librados::IoCtx& io_ctx, const std::string& oid, cls_rgw_lc_obj_head& head);
+int cls_rgw_lc_put_head(librados::IoCtx& io_ctx, const std::string& oid, cls_rgw_lc_obj_head& head);
+int cls_rgw_lc_get_next_entry(librados::IoCtx& io_ctx, const std::string& oid, std::string& marker, std::pair<std::string, int>& entry);
+int cls_rgw_lc_rm_entry(librados::IoCtx& io_ctx, const std::string& oid, const std::pair<std::string, int>& entry);
+int cls_rgw_lc_set_entry(librados::IoCtx& io_ctx, const std::string& oid, const std::pair<std::string, int>& entry);
+int cls_rgw_lc_get_entry(librados::IoCtx& io_ctx, const std::string& oid, const std::string& marker, rgw_lc_entry_t& entry);
+int cls_rgw_lc_list(librados::IoCtx& io_ctx, const std::string& oid,
+                    const std::string& marker,
                     uint32_t max_entries,
-                    map<string, int>& entries);
+                    std::map<std::string, int>& entries);
 #endif
 
 /* resharding */
@@ -623,9 +622,9 @@ void cls_rgw_reshard_remove(librados::ObjectWriteOperation& op, const cls_rgw_re
 // these overloads which call io_ctx.operate() should not be called in the rgw.
 // rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()
 #ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_rgw_reshard_list(librados::IoCtx& io_ctx, const string& oid, string& marker, uint32_t max,
-                         list<cls_rgw_reshard_entry>& entries, bool* is_truncated);
-int cls_rgw_reshard_get(librados::IoCtx& io_ctx, const string& oid, cls_rgw_reshard_entry& entry);
+int cls_rgw_reshard_list(librados::IoCtx& io_ctx, const std::string& oid, std::string& marker, uint32_t max,
+                         std::list<cls_rgw_reshard_entry>& entries, bool* is_truncated);
+int cls_rgw_reshard_get(librados::IoCtx& io_ctx, const std::string& oid, cls_rgw_reshard_entry& entry);
 #endif
 
 /* resharding attribute on bucket index shard headers */
@@ -633,10 +632,10 @@ void cls_rgw_guard_bucket_resharding(librados::ObjectOperation& op, int ret_err)
 // these overloads which call io_ctx.operate() should not be called in the rgw.
 // rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()
 #ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_rgw_set_bucket_resharding(librados::IoCtx& io_ctx, const string& oid,
+int cls_rgw_set_bucket_resharding(librados::IoCtx& io_ctx, const std::string& oid,
                                   const cls_rgw_bucket_instance_entry& entry);
-int cls_rgw_clear_bucket_resharding(librados::IoCtx& io_ctx, const string& oid);
-int cls_rgw_get_bucket_resharding(librados::IoCtx& io_ctx, const string& oid,
+int cls_rgw_clear_bucket_resharding(librados::IoCtx& io_ctx, const std::string& oid);
+int cls_rgw_get_bucket_resharding(librados::IoCtx& io_ctx, const std::string& oid,
                                   cls_rgw_bucket_instance_entry *entry);
 #endif
 
index 5957d2ffbfd7c8a55f3efdd6241b4e1d2c588c08..f39919d24b60b3fc5b4f8fa073a3560eb9ae0c26 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #ifndef CEPH_CLS_RGW_CONST_H
index afca9a281696f478367942ed07c573c3872ac8a6..d779ea567e179c7cbdca7e4c81fc5c108083d5ff 100644 (file)
@@ -7,6 +7,11 @@
 #include "common/ceph_json.h"
 #include "include/utime.h"
 
+using std::list;
+using std::map;
+
+using ceph::Formatter;
+
 void rgw_cls_tag_timeout_op::dump(Formatter *f) const
 {
   f->dump_int("tag_timeout", tag_timeout);
@@ -111,7 +116,7 @@ void rgw_cls_obj_prepare_op::dump(Formatter *f) const
   f->dump_string("locator", locator);
   f->dump_bool("log_op", log_op);
   f->dump_int("bilog_flags", bilog_flags);
-  ::encode_json("zones_trace", zones_trace, f);
+  encode_json("zones_trace", zones_trace, f);
 }
 
 void rgw_cls_obj_complete_op::generate_test_instances(list<rgw_cls_obj_complete_op*>& o)
@@ -126,7 +131,7 @@ void rgw_cls_obj_complete_op::generate_test_instances(list<rgw_cls_obj_complete_
 
   list<rgw_bucket_dir_entry_meta *> l;
   rgw_bucket_dir_entry_meta::generate_test_instances(l);
-  list<rgw_bucket_dir_entry_meta *>::iterator iter = l.begin();
+  auto iter = l.begin();
   op->meta = *(*iter);
 
   o.push_back(op);
@@ -149,7 +154,7 @@ void rgw_cls_obj_complete_op::dump(Formatter *f) const
   f->dump_string("tag", tag);
   f->dump_bool("log_op", log_op);
   f->dump_int("bilog_flags", bilog_flags);
-  ::encode_json("zones_trace", zones_trace, f);
+  encode_json("zones_trace", zones_trace, f);
 }
 
 void rgw_cls_link_olh_op::generate_test_instances(list<rgw_cls_link_olh_op*>& o)
@@ -162,7 +167,7 @@ void rgw_cls_link_olh_op::generate_test_instances(list<rgw_cls_link_olh_op*>& o)
   op->olh_epoch = 123;
   list<rgw_bucket_dir_entry_meta *> l;
   rgw_bucket_dir_entry_meta::generate_test_instances(l);
-  list<rgw_bucket_dir_entry_meta *>::iterator iter = l.begin();
+  auto iter = l.begin();
   op->meta = *(*iter);
   op->log_op = true;
 
@@ -173,18 +178,18 @@ void rgw_cls_link_olh_op::generate_test_instances(list<rgw_cls_link_olh_op*>& o)
 
 void rgw_cls_link_olh_op::dump(Formatter *f) const
 {
-  ::encode_json("key", key, f);
-  ::encode_json("olh_tag", olh_tag, f);
-  ::encode_json("delete_marker", delete_marker, f);
-  ::encode_json("op_tag", op_tag, f);
-  ::encode_json("meta", meta, f);
-  ::encode_json("olh_epoch", olh_epoch, f);
-  ::encode_json("log_op", log_op, f);
-  ::encode_json("bilog_flags", (uint32_t)bilog_flags, f);
+  encode_json("key", key, f);
+  encode_json("olh_tag", olh_tag, f);
+  encode_json("delete_marker", delete_marker, f);
+  encode_json("op_tag", op_tag, f);
+  encode_json("meta", meta, f);
+  encode_json("olh_epoch", olh_epoch, f);
+  encode_json("log_op", log_op, f);
+  encode_json("bilog_flags", (uint32_t)bilog_flags, f);
   utime_t ut(unmod_since);
-  ::encode_json("unmod_since", ut, f);
-  ::encode_json("high_precision_time", high_precision_time, f);
-  ::encode_json("zones_trace", zones_trace, f);
+  encode_json("unmod_since", ut, f);
+  encode_json("high_precision_time", high_precision_time, f);
+  encode_json("zones_trace", zones_trace, f);
 }
 
 void rgw_cls_unlink_instance_op::generate_test_instances(list<rgw_cls_unlink_instance_op*>& o)
@@ -202,12 +207,12 @@ void rgw_cls_unlink_instance_op::generate_test_instances(list<rgw_cls_unlink_ins
 
 void rgw_cls_unlink_instance_op::dump(Formatter *f) const
 {
-  ::encode_json("key", key, f);
-  ::encode_json("op_tag", op_tag, f);
-  ::encode_json("olh_epoch", olh_epoch, f);
-  ::encode_json("log_op", log_op, f);
-  ::encode_json("bilog_flags", (uint32_t)bilog_flags, f);
-  ::encode_json("zones_trace", zones_trace, f);
+  encode_json("key", key, f);
+  encode_json("op_tag", op_tag, f);
+  encode_json("olh_epoch", olh_epoch, f);
+  encode_json("log_op", log_op, f);
+  encode_json("bilog_flags", (uint32_t)bilog_flags, f);
+  encode_json("zones_trace", zones_trace, f);
 }
 
 void rgw_cls_read_olh_log_op::generate_test_instances(list<rgw_cls_read_olh_log_op*>& o)
@@ -224,9 +229,9 @@ void rgw_cls_read_olh_log_op::generate_test_instances(list<rgw_cls_read_olh_log_
 
 void rgw_cls_read_olh_log_op::dump(Formatter *f) const
 {
-  ::encode_json("olh", olh, f);
-  ::encode_json("ver_marker", ver_marker, f);
-  ::encode_json("olh_tag", olh_tag, f);
+  encode_json("olh", olh, f);
+  encode_json("ver_marker", ver_marker, f);
+  encode_json("olh_tag", olh_tag, f);
 }
 
 void rgw_cls_read_olh_log_ret::generate_test_instances(list<rgw_cls_read_olh_log_ret*>& o)
@@ -235,7 +240,7 @@ void rgw_cls_read_olh_log_ret::generate_test_instances(list<rgw_cls_read_olh_log
   r->is_truncated = true;
   list<rgw_bucket_olh_log_entry *> l;
   rgw_bucket_olh_log_entry::generate_test_instances(l);
-  list<rgw_bucket_olh_log_entry *>::iterator iter = l.begin();
+  auto iter = l.begin();
   r->log[1].push_back(*(*iter));
 
   o.push_back(r);
@@ -245,8 +250,8 @@ void rgw_cls_read_olh_log_ret::generate_test_instances(list<rgw_cls_read_olh_log
 
 void rgw_cls_read_olh_log_ret::dump(Formatter *f) const
 {
-  ::encode_json("log", log, f);
-  ::encode_json("is_truncated", is_truncated, f);
+  encode_json("log", log, f);
+  encode_json("is_truncated", is_truncated, f);
 }
 
 void rgw_cls_trim_olh_log_op::generate_test_instances(list<rgw_cls_trim_olh_log_op*>& o)
@@ -263,9 +268,9 @@ void rgw_cls_trim_olh_log_op::generate_test_instances(list<rgw_cls_trim_olh_log_
 
 void rgw_cls_trim_olh_log_op::dump(Formatter *f) const
 {
-  ::encode_json("olh", olh, f);
-  ::encode_json("ver", ver, f);
-  ::encode_json("olh_tag", olh_tag, f);
+  encode_json("olh", olh, f);
+  encode_json("ver", ver, f);
+  encode_json("olh_tag", olh_tag, f);
 }
 
 void rgw_cls_bucket_clear_olh_op::generate_test_instances(list<rgw_cls_bucket_clear_olh_op *>& o)
@@ -281,8 +286,8 @@ void rgw_cls_bucket_clear_olh_op::generate_test_instances(list<rgw_cls_bucket_cl
 
 void rgw_cls_bucket_clear_olh_op::dump(Formatter *f) const
 {
-  ::encode_json("key", key, f);
-  ::encode_json("olh_tag", olh_tag, f);
+  encode_json("key", key, f);
+  encode_json("olh_tag", olh_tag, f);
 }
 
 void rgw_cls_list_op::generate_test_instances(list<rgw_cls_list_op*>& o)
@@ -305,8 +310,7 @@ void rgw_cls_list_ret::generate_test_instances(list<rgw_cls_list_ret*>& o)
 {
  list<rgw_bucket_dir *> l;
   rgw_bucket_dir::generate_test_instances(l);
-  list<rgw_bucket_dir *>::iterator iter;
-  for (iter = l.begin(); iter != l.end(); ++iter) {
+  for (auto iter = l.begin(); iter != l.end(); ++iter) {
     rgw_bucket_dir *d = *iter;
 
     rgw_cls_list_ret *ret = new rgw_cls_list_ret;
@@ -338,7 +342,7 @@ void rgw_cls_check_index_ret::generate_test_instances(list<rgw_cls_check_index_r
   r->calculated_header = *(h.front());
   o.push_back(r);
 
-  for (list<rgw_bucket_dir_header *>::iterator iter = h.begin(); iter != h.end(); ++iter) {
+  for (auto iter = h.begin(); iter != h.end(); ++iter) {
     delete *iter;
   }
   o.push_back(new rgw_cls_check_index_ret);
@@ -346,8 +350,8 @@ void rgw_cls_check_index_ret::generate_test_instances(list<rgw_cls_check_index_r
 
 void rgw_cls_check_index_ret::dump(Formatter *f) const
 {
-  ::encode_json("existing_header", existing_header, f);
-  ::encode_json("calculated_header", calculated_header, f);
+  encode_json("existing_header", existing_header, f);
+  encode_json("calculated_header", calculated_header, f);
 }
 
 void rgw_cls_bucket_update_stats_op::generate_test_instances(list<rgw_cls_bucket_update_stats_op*>& o)
@@ -365,12 +369,12 @@ void rgw_cls_bucket_update_stats_op::generate_test_instances(list<rgw_cls_bucket
 
 void rgw_cls_bucket_update_stats_op::dump(Formatter *f) const
 {
-  ::encode_json("absolute", absolute, f);
+  encode_json("absolute", absolute, f);
   map<int, rgw_bucket_category_stats> s;
   for (auto& entry : stats) {
     s[(int)entry.first] = entry.second;
   }
-  ::encode_json("stats", s, f);
+  encode_json("stats", s, f);
 }
 
 void cls_rgw_bi_log_list_op::dump(Formatter *f) const
@@ -421,13 +425,13 @@ void cls_rgw_reshard_add_op::generate_test_instances(list<cls_rgw_reshard_add_op
   ls.push_back(new cls_rgw_reshard_add_op);
   list<cls_rgw_reshard_entry *> l;
   cls_rgw_reshard_entry::generate_test_instances(l);
-  list<cls_rgw_reshard_entry *>::iterator iter = l.begin();
+  auto iter = l.begin();
   ls.back()->entry = *(*iter);
 }
 
 void cls_rgw_reshard_add_op::dump(Formatter *f) const
 {
-  ::encode_json("entry", entry, f);
+  encode_json("entry", entry, f);
 }
 
 void cls_rgw_reshard_list_op::generate_test_instances(list<cls_rgw_reshard_list_op*>& ls)
@@ -440,8 +444,8 @@ void cls_rgw_reshard_list_op::generate_test_instances(list<cls_rgw_reshard_list_
 
 void cls_rgw_reshard_list_op::dump(Formatter *f) const
 {
-  ::encode_json("max", max, f);
-  ::encode_json("marker", marker, f);
+  encode_json("max", max, f);
+  encode_json("marker", marker, f);
 }
 
 void cls_rgw_reshard_list_ret::generate_test_instances(list<cls_rgw_reshard_list_ret*>& ls)
@@ -454,8 +458,8 @@ void cls_rgw_reshard_list_ret::generate_test_instances(list<cls_rgw_reshard_list
 
 void cls_rgw_reshard_list_ret::dump(Formatter *f) const
 {
-  ::encode_json("entries", entries, f);
-  ::encode_json("is_truncated", is_truncated, f);
+  encode_json("entries", entries, f);
+  encode_json("is_truncated", is_truncated, f);
 }
 
 void cls_rgw_reshard_get_op::generate_test_instances(list<cls_rgw_reshard_get_op*>& ls)
@@ -466,7 +470,7 @@ void cls_rgw_reshard_get_op::generate_test_instances(list<cls_rgw_reshard_get_op
 
 void cls_rgw_reshard_get_op::dump(Formatter *f) const
 {
-  ::encode_json("entry", entry, f);
+  encode_json("entry", entry, f);
 }
 
 void cls_rgw_reshard_get_ret::generate_test_instances(list<cls_rgw_reshard_get_ret*>& ls)
@@ -477,7 +481,7 @@ void cls_rgw_reshard_get_ret::generate_test_instances(list<cls_rgw_reshard_get_r
 
 void cls_rgw_reshard_get_ret::dump(Formatter *f) const
 {
-  ::encode_json("entry", entry, f);
+  encode_json("entry", entry, f);
 }
 
 void cls_rgw_reshard_remove_op::generate_test_instances(list<cls_rgw_reshard_remove_op*>& ls)
@@ -490,8 +494,8 @@ void cls_rgw_reshard_remove_op::generate_test_instances(list<cls_rgw_reshard_rem
 
 void cls_rgw_reshard_remove_op::dump(Formatter *f) const
 {
-  ::encode_json("bucket_name", bucket_name, f);
-  ::encode_json("bucket_id", bucket_name, f);
+  encode_json("bucket_name", bucket_name, f);
+  encode_json("bucket_id", bucket_name, f);
 }
 
 
@@ -504,7 +508,7 @@ void cls_rgw_set_bucket_resharding_op::generate_test_instances(
 
 void cls_rgw_set_bucket_resharding_op::dump(Formatter *f) const
 {
-  ::encode_json("entry", entry, f);
+  encode_json("entry", entry, f);
 }
 
 void cls_rgw_clear_bucket_resharding_op::generate_test_instances(
@@ -527,7 +531,7 @@ void cls_rgw_guard_bucket_resharding_op::generate_test_instances(
 
 void cls_rgw_guard_bucket_resharding_op::dump(Formatter *f) const
 {
-  ::encode_json("ret_err", ret_err, f);
+  encode_json("ret_err", ret_err, f);
 }
 
 
index d752118b2fb19d0cd7b2f130298356d1d3bf8082..253529b4aea505066e1308ee923904b712d9a78f 100644 (file)
@@ -12,18 +12,18 @@ struct rgw_cls_tag_timeout_op
 
   rgw_cls_tag_timeout_op() : tag_timeout(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(tag_timeout, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(tag_timeout, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<rgw_cls_tag_timeout_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_tag_timeout_op*>& ls);
 };
 WRITE_CLASS_ENCODER(rgw_cls_tag_timeout_op)
 
@@ -31,15 +31,15 @@ struct rgw_cls_obj_prepare_op
 {
   RGWModifyOp op;
   cls_rgw_obj_key key;
-  string tag;
-  string locator;
+  std::string tag;
+  std::string locator;
   bool log_op;
   uint16_t bilog_flags;
   rgw_zone_set zones_trace;
 
   rgw_cls_obj_prepare_op() : op(CLS_RGW_OP_UNKNOWN), log_op(false), bilog_flags(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(7, 5, bl);
     uint8_t c = (uint8_t)op;
     encode(c, bl);
@@ -51,7 +51,7 @@ struct rgw_cls_obj_prepare_op
     encode(zones_trace, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(7, 3, 3, bl);
     uint8_t c;
     decode(c, bl);
@@ -77,8 +77,8 @@ struct rgw_cls_obj_prepare_op
     }
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<rgw_cls_obj_prepare_op*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_obj_prepare_op*>& o);
 };
 WRITE_CLASS_ENCODER(rgw_cls_obj_prepare_op)
 
@@ -86,19 +86,19 @@ struct rgw_cls_obj_complete_op
 {
   RGWModifyOp op;
   cls_rgw_obj_key key;
-  string locator;
+  std::string locator;
   rgw_bucket_entry_ver ver;
   rgw_bucket_dir_entry_meta meta;
-  string tag;
+  std::string tag;
   bool log_op;
   uint16_t bilog_flags;
 
-  list<cls_rgw_obj_key> remove_objs;
+  std::list<cls_rgw_obj_key> remove_objs;
   rgw_zone_set zones_trace;
 
   rgw_cls_obj_complete_op() : op(CLS_RGW_OP_ADD), log_op(false), bilog_flags(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(9, 7, bl);
     uint8_t c = (uint8_t)op;
     encode(c, bl);
@@ -114,7 +114,7 @@ struct rgw_cls_obj_complete_op
     encode(zones_trace, bl);
     ENCODE_FINISH(bl);
  }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(9, 3, 3, bl);
     uint8_t c;
     decode(c, bl);
@@ -129,10 +129,10 @@ struct rgw_cls_obj_complete_op
       decode(locator, bl);
     }
     if (struct_v >= 4 && struct_v < 7) {
-      list<string> old_remove_objs;
+      std::list<std::string> old_remove_objs;
       decode(old_remove_objs, bl);
 
-      for (list<string>::iterator iter = old_remove_objs.begin();
+      for (auto  iter = old_remove_objs.begin();
            iter != old_remove_objs.end(); ++iter) {
         cls_rgw_obj_key k;
         k.name = *iter;
@@ -160,27 +160,27 @@ struct rgw_cls_obj_complete_op
     }
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<rgw_cls_obj_complete_op*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_obj_complete_op*>& o);
 };
 WRITE_CLASS_ENCODER(rgw_cls_obj_complete_op)
 
 struct rgw_cls_link_olh_op {
   cls_rgw_obj_key key;
-  string olh_tag;
+  std::string olh_tag;
   bool delete_marker;
-  string op_tag;
+  std::string op_tag;
   rgw_bucket_dir_entry_meta meta;
   uint64_t olh_epoch;
   bool log_op;
   uint16_t bilog_flags;
-  real_time unmod_since; /* only create delete marker if newer then this */
+  ceph::real_time unmod_since; /* only create delete marker if newer then this */
   bool high_precision_time;
   rgw_zone_set zones_trace;
 
   rgw_cls_link_olh_op() : delete_marker(false), olh_epoch(0), log_op(false), bilog_flags(0), high_precision_time(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(5, 1, bl);
     encode(key, bl);
     encode(olh_tag, bl);
@@ -198,7 +198,7 @@ struct rgw_cls_link_olh_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(5, bl);
     decode(key, bl);
     decode(olh_tag, bl);
@@ -227,23 +227,23 @@ struct rgw_cls_link_olh_op {
     DECODE_FINISH(bl);
   }
 
-  static void generate_test_instances(list<rgw_cls_link_olh_op *>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_link_olh_op *>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(rgw_cls_link_olh_op)
 
 struct rgw_cls_unlink_instance_op {
   cls_rgw_obj_key key;
-  string op_tag;
+  std::string op_tag;
   uint64_t olh_epoch;
   bool log_op;
   uint16_t bilog_flags;
-  string olh_tag;
+  std::string olh_tag;
   rgw_zone_set zones_trace;
 
   rgw_cls_unlink_instance_op() : olh_epoch(0), log_op(false), bilog_flags(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(3, 1, bl);
     encode(key, bl);
     encode(op_tag, bl);
@@ -255,7 +255,7 @@ struct rgw_cls_unlink_instance_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(3, bl);
     decode(key, bl);
     decode(op_tag, bl);
@@ -271,8 +271,8 @@ struct rgw_cls_unlink_instance_op {
     DECODE_FINISH(bl);
   }
 
-  static void generate_test_instances(list<rgw_cls_unlink_instance_op *>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_unlink_instance_op *>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(rgw_cls_unlink_instance_op)
 
@@ -280,51 +280,51 @@ struct rgw_cls_read_olh_log_op
 {
   cls_rgw_obj_key olh;
   uint64_t ver_marker;
-  string olh_tag;
+  std::string olh_tag;
 
   rgw_cls_read_olh_log_op() : ver_marker(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(olh, bl);
     encode(ver_marker, bl);
     encode(olh_tag, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(olh, bl);
     decode(ver_marker, bl);
     decode(olh_tag, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<rgw_cls_read_olh_log_op *>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_read_olh_log_op *>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(rgw_cls_read_olh_log_op)
 
 
 struct rgw_cls_read_olh_log_ret
 {
-  map<uint64_t, vector<rgw_bucket_olh_log_entry> > log;
+  std::map<uint64_t, std::vector<rgw_bucket_olh_log_entry> > log;
   bool is_truncated;
 
   rgw_cls_read_olh_log_ret() : is_truncated(false) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(log, bl);
     encode(is_truncated, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(log, bl);
     decode(is_truncated, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<rgw_cls_read_olh_log_ret *>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_read_olh_log_ret *>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(rgw_cls_read_olh_log_ret)
 
@@ -332,51 +332,51 @@ struct rgw_cls_trim_olh_log_op
 {
   cls_rgw_obj_key olh;
   uint64_t ver;
-  string olh_tag;
+  std::string olh_tag;
 
   rgw_cls_trim_olh_log_op() : ver(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(olh, bl);
     encode(ver, bl);
     encode(olh_tag, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(olh, bl);
     decode(ver, bl);
     decode(olh_tag, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<rgw_cls_trim_olh_log_op *>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_trim_olh_log_op *>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(rgw_cls_trim_olh_log_op)
 
 struct rgw_cls_bucket_clear_olh_op {
   cls_rgw_obj_key key;
-  string olh_tag;
+  std::string olh_tag;
 
   rgw_cls_bucket_clear_olh_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(key, bl);
     encode(olh_tag, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(key, bl);
     decode(olh_tag, bl);
     DECODE_FINISH(bl);
   }
 
-  static void generate_test_instances(list<rgw_cls_bucket_clear_olh_op *>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_bucket_clear_olh_op *>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(rgw_cls_bucket_clear_olh_op)
 
@@ -384,13 +384,13 @@ struct rgw_cls_list_op
 {
   cls_rgw_obj_key start_obj;
   uint32_t num_entries;
-  string filter_prefix;
+  std::string filter_prefix;
   bool list_versions;
-  string delimiter;
+  std::string delimiter;
 
   rgw_cls_list_op() : num_entries(0), list_versions(false) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(6, 4, bl);
     encode(num_entries, bl);
     encode(filter_prefix, bl);
@@ -399,7 +399,7 @@ struct rgw_cls_list_op
     encode(delimiter, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(6, 2, 2, bl);
     if (struct_v < 4) {
       decode(start_obj.name, bl);
@@ -419,8 +419,8 @@ struct rgw_cls_list_op
     }
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<rgw_cls_list_op*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_list_op*>& o);
 };
 WRITE_CLASS_ENCODER(rgw_cls_list_op)
 
@@ -438,21 +438,21 @@ struct rgw_cls_list_ret {
     cls_filtered(true)
   {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(3, 2, bl);
     encode(dir, bl);
     encode(is_truncated, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
     decode(dir, bl);
     decode(is_truncated, bl);
     cls_filtered = struct_v >= 3;
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<rgw_cls_list_ret*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_list_ret*>& o);
 };
 WRITE_CLASS_ENCODER(rgw_cls_list_ret)
 
@@ -463,57 +463,57 @@ struct rgw_cls_check_index_ret
 
   rgw_cls_check_index_ret() {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(existing_header, bl);
     encode(calculated_header, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(existing_header, bl);
     decode(calculated_header, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<rgw_cls_check_index_ret *>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_check_index_ret *>& o);
 };
 WRITE_CLASS_ENCODER(rgw_cls_check_index_ret)
 
 struct rgw_cls_bucket_update_stats_op
 {
   bool absolute{false};
-  map<RGWObjCategory, rgw_bucket_category_stats> stats;
+  std::map<RGWObjCategory, rgw_bucket_category_stats> stats;
 
   rgw_cls_bucket_update_stats_op() {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(absolute, bl);
     encode(stats, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(absolute, bl);
     decode(stats, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<rgw_cls_bucket_update_stats_op *>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_cls_bucket_update_stats_op *>& o);
 };
 WRITE_CLASS_ENCODER(rgw_cls_bucket_update_stats_op)
 
 struct rgw_cls_obj_remove_op {
-  list<string> keep_attr_prefixes;
+  std::list<std::string> keep_attr_prefixes;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(keep_attr_prefixes, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(keep_attr_prefixes, bl);
     DECODE_FINISH(bl);
@@ -522,15 +522,15 @@ struct rgw_cls_obj_remove_op {
 WRITE_CLASS_ENCODER(rgw_cls_obj_remove_op)
 
 struct rgw_cls_obj_store_pg_ver_op {
-  string attr;
+  std::string attr;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(attr, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(attr, bl);
     DECODE_FINISH(bl);
@@ -539,19 +539,19 @@ struct rgw_cls_obj_store_pg_ver_op {
 WRITE_CLASS_ENCODER(rgw_cls_obj_store_pg_ver_op)
 
 struct rgw_cls_obj_check_attrs_prefix {
-  string check_prefix;
+  std::string check_prefix;
   bool fail_if_exist;
 
   rgw_cls_obj_check_attrs_prefix() : fail_if_exist(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(check_prefix, bl);
     encode(fail_if_exist, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(check_prefix, bl);
     decode(fail_if_exist, bl);
@@ -567,7 +567,7 @@ struct rgw_cls_obj_check_mtime {
 
   rgw_cls_obj_check_mtime() : type(CLS_RGW_CHECK_TIME_MTIME_EQ), high_precision_time(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(mtime, bl);
     encode((uint8_t)type, bl);
@@ -575,7 +575,7 @@ struct rgw_cls_obj_check_mtime {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(mtime, bl);
     uint8_t c;
@@ -593,18 +593,18 @@ struct rgw_cls_usage_log_add_op {
   rgw_usage_log_info info;
   rgw_user user;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(info, bl);
     encode(user.to_str(), bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(info, bl);
     if (struct_v >= 2) {
-      string s;
+      std::string s;
       decode(s, bl);
       user.from_str(s);
     }
@@ -619,14 +619,14 @@ struct rgw_cls_bi_get_op {
 
   rgw_cls_bi_get_op() : type(BIIndexType::Plain) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(key, bl);
     encode((uint8_t)type, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(key, bl);
     uint8_t c;
@@ -642,13 +642,13 @@ struct rgw_cls_bi_get_ret {
 
   rgw_cls_bi_get_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entry, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -661,13 +661,13 @@ struct rgw_cls_bi_put_op {
 
   rgw_cls_bi_put_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entry, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -677,12 +677,12 @@ WRITE_CLASS_ENCODER(rgw_cls_bi_put_op)
 
 struct rgw_cls_bi_list_op {
   uint32_t max;
-  string name;
-  string marker;
+  std::string name;
+  std::string marker;
 
   rgw_cls_bi_list_op() : max(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(max, bl);
     encode(name, bl);
@@ -690,7 +690,7 @@ struct rgw_cls_bi_list_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(max, bl);
     decode(name, bl);
@@ -701,19 +701,19 @@ struct rgw_cls_bi_list_op {
 WRITE_CLASS_ENCODER(rgw_cls_bi_list_op)
 
 struct rgw_cls_bi_list_ret {
-  list<rgw_cls_bi_entry> entries;
+  std::list<rgw_cls_bi_entry> entries;
   bool is_truncated;
 
   rgw_cls_bi_list_ret() : is_truncated(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entries, bl);
     encode(is_truncated, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     decode(is_truncated, bl);
@@ -725,13 +725,13 @@ WRITE_CLASS_ENCODER(rgw_cls_bi_list_ret)
 struct rgw_cls_usage_log_read_op {
   uint64_t start_epoch;
   uint64_t end_epoch;
-  string owner;
-  string bucket;
+  std::string owner;
+  std::string bucket;
 
-  string iter;  // should be empty for the first call, non empty for subsequent calls
+  std::string iter;  // should be empty for the first call, non empty for subsequent calls
   uint32_t max_entries;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(start_epoch, bl);
     encode(end_epoch, bl);
@@ -742,7 +742,7 @@ struct rgw_cls_usage_log_read_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(start_epoch, bl);
     decode(end_epoch, bl);
@@ -758,11 +758,11 @@ struct rgw_cls_usage_log_read_op {
 WRITE_CLASS_ENCODER(rgw_cls_usage_log_read_op)
 
 struct rgw_cls_usage_log_read_ret {
-  map<rgw_user_bucket, rgw_usage_log_entry> usage;
+  std::map<rgw_user_bucket, rgw_usage_log_entry> usage;
   bool truncated;
-  string next_iter;
+  std::string next_iter;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(usage, bl);
     encode(truncated, bl);
@@ -770,7 +770,7 @@ struct rgw_cls_usage_log_read_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(usage, bl);
     decode(truncated, bl);
@@ -783,10 +783,10 @@ WRITE_CLASS_ENCODER(rgw_cls_usage_log_read_ret)
 struct rgw_cls_usage_log_trim_op {
   uint64_t start_epoch;
   uint64_t end_epoch;
-  string user;
-  string bucket;
+  std::string user;
+  std::string bucket;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(3, 2, bl);
     encode(start_epoch, bl);
     encode(end_epoch, bl);
@@ -795,7 +795,7 @@ struct rgw_cls_usage_log_trim_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(3, bl);
     decode(start_epoch, bl);
     decode(end_epoch, bl);
@@ -813,57 +813,57 @@ struct cls_rgw_gc_set_entry_op {
   cls_rgw_gc_obj_info info;
   cls_rgw_gc_set_entry_op() : expiration_secs(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(expiration_secs, bl);
     encode(info, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(expiration_secs, bl);
     decode(info, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_gc_set_entry_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_gc_set_entry_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_rgw_gc_set_entry_op)
 
 struct cls_rgw_gc_defer_entry_op {
   uint32_t expiration_secs;
-  string tag;
+  std::string tag;
   cls_rgw_gc_defer_entry_op() : expiration_secs(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(expiration_secs, bl);
     encode(tag, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(expiration_secs, bl);
     decode(tag, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_gc_defer_entry_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_gc_defer_entry_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_rgw_gc_defer_entry_op)
 
 struct cls_rgw_gc_list_op {
-  string marker;
+  std::string marker;
   uint32_t max;
   bool expired_only;
 
   cls_rgw_gc_list_op() : max(0), expired_only(true) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(marker, bl);
     encode(max, bl);
@@ -871,7 +871,7 @@ struct cls_rgw_gc_list_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(marker, bl);
     decode(max, bl);
@@ -881,19 +881,19 @@ struct cls_rgw_gc_list_op {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_gc_list_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_gc_list_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_rgw_gc_list_op)
 
 struct cls_rgw_gc_list_ret {
-  list<cls_rgw_gc_obj_info> entries;
-  string next_marker;
+  std::list<cls_rgw_gc_obj_info> entries;
+  std::string next_marker;
   bool truncated;
 
   cls_rgw_gc_list_ret() : truncated(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(entries, bl);
     encode(next_marker, bl);
@@ -901,7 +901,7 @@ struct cls_rgw_gc_list_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(entries, bl);
     if (struct_v >= 2)
@@ -910,119 +910,119 @@ struct cls_rgw_gc_list_ret {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_gc_list_ret*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_gc_list_ret*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_rgw_gc_list_ret)
 
 struct cls_rgw_gc_remove_op {
-  vector<string> tags;
+  std::vector<std::string> tags;
 
   cls_rgw_gc_remove_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(tags, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(tags, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_gc_remove_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_gc_remove_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_rgw_gc_remove_op)
 
 struct cls_rgw_bi_log_list_op {
-  string marker;
+  std::string marker;
   uint32_t max;
 
   cls_rgw_bi_log_list_op() : max(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(marker, bl);
     encode(max, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(marker, bl);
     decode(max, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_bi_log_list_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_bi_log_list_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_rgw_bi_log_list_op)
 
 struct cls_rgw_bi_log_trim_op {
-  string start_marker;
-  string end_marker;
+  std::string start_marker;
+  std::string end_marker;
 
   cls_rgw_bi_log_trim_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(start_marker, bl);
     encode(end_marker, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(start_marker, bl);
     decode(end_marker, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_bi_log_trim_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_bi_log_trim_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_rgw_bi_log_trim_op)
 
 struct cls_rgw_bi_log_list_ret {
-  list<rgw_bi_log_entry> entries;
+  std::list<rgw_bi_log_entry> entries;
   bool truncated;
 
   cls_rgw_bi_log_list_ret() : truncated(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entries, bl);
     encode(truncated, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     decode(truncated, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_bi_log_list_ret*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_bi_log_list_ret*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_rgw_bi_log_list_ret)
 
 struct cls_rgw_lc_get_next_entry_op {
-  string marker;
+  std::string marker;
   cls_rgw_lc_get_next_entry_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(marker, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(marker, bl);
     DECODE_FINISH(bl);
@@ -1036,13 +1036,13 @@ struct cls_rgw_lc_get_next_entry_ret {
   rgw_lc_entry_t entry;
   cls_rgw_lc_get_next_entry_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entry, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1052,17 +1052,17 @@ struct cls_rgw_lc_get_next_entry_ret {
 WRITE_CLASS_ENCODER(cls_rgw_lc_get_next_entry_ret)
 
 struct cls_rgw_lc_get_entry_op {
-  string marker;
+  std::string marker;
   cls_rgw_lc_get_entry_op() {}
   cls_rgw_lc_get_entry_op(const std::string& _marker) : marker(_marker) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(marker, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(marker, bl);
     DECODE_FINISH(bl);
@@ -1075,13 +1075,13 @@ struct cls_rgw_lc_get_entry_ret {
   cls_rgw_lc_get_entry_ret() {}
   cls_rgw_lc_get_entry_ret(rgw_lc_entry_t&& _entry) : entry(std::move(_entry)) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entry, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1095,13 +1095,13 @@ struct cls_rgw_lc_rm_entry_op {
   rgw_lc_entry_t entry;
   cls_rgw_lc_rm_entry_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entry, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1113,13 +1113,13 @@ struct cls_rgw_lc_set_entry_op {
   rgw_lc_entry_t entry;
   cls_rgw_lc_set_entry_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entry, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
@@ -1133,13 +1133,13 @@ struct cls_rgw_lc_put_head_op {
 
   cls_rgw_lc_put_head_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(head, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(head, bl);
     DECODE_FINISH(bl);
@@ -1153,13 +1153,13 @@ struct cls_rgw_lc_get_head_ret {
 
   cls_rgw_lc_get_head_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(head, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(head, bl);
     DECODE_FINISH(bl);
@@ -1169,19 +1169,19 @@ struct cls_rgw_lc_get_head_ret {
 WRITE_CLASS_ENCODER(cls_rgw_lc_get_head_ret)
 
 struct cls_rgw_lc_list_entries_op {
-  string marker;
+  std::string marker;
   uint32_t max_entries = 0;
 
   cls_rgw_lc_list_entries_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(marker, bl);
     encode(max_entries, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(marker, bl);
     decode(max_entries, bl);
@@ -1192,19 +1192,19 @@ struct cls_rgw_lc_list_entries_op {
 WRITE_CLASS_ENCODER(cls_rgw_lc_list_entries_op)
 
 struct cls_rgw_lc_list_entries_ret {
-  map<string, int> entries;
+  std::map<std::string, int> entries;
   bool is_truncated{false};
 
   cls_rgw_lc_list_entries_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(entries, bl);
     encode(is_truncated, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(entries, bl);
     if (struct_v >= 2) {
@@ -1221,68 +1221,68 @@ struct cls_rgw_reshard_add_op {
 
   cls_rgw_reshard_add_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entry, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<cls_rgw_reshard_add_op*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_reshard_add_op*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_reshard_add_op)
 
 struct cls_rgw_reshard_list_op {
   uint32_t max{0};
-  string marker;
+  std::string marker;
 
   cls_rgw_reshard_list_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(max, bl);
     encode(marker, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(max, bl);
     decode(marker, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<cls_rgw_reshard_list_op*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_reshard_list_op*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_reshard_list_op)
 
 
 struct cls_rgw_reshard_list_ret {
-  list<cls_rgw_reshard_entry> entries;
+  std::list<cls_rgw_reshard_entry> entries;
   bool is_truncated{false};
 
   cls_rgw_reshard_list_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entries, bl);
     encode(is_truncated, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     decode(is_truncated, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<cls_rgw_reshard_list_ret*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_reshard_list_ret*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_reshard_list_ret)
 
@@ -1291,19 +1291,19 @@ struct cls_rgw_reshard_get_op {
 
   cls_rgw_reshard_get_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entry, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<cls_rgw_reshard_get_op*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_reshard_get_op*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_reshard_get_op)
 
@@ -1312,30 +1312,30 @@ struct cls_rgw_reshard_get_ret {
 
   cls_rgw_reshard_get_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entry, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<cls_rgw_reshard_get_ret*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_reshard_get_ret*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_reshard_get_ret)
 
 struct cls_rgw_reshard_remove_op {
-  string tenant;
-  string bucket_name;
-  string bucket_id;
+  std::string tenant;
+  std::string bucket_name;
+  std::string bucket_id;
 
   cls_rgw_reshard_remove_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(tenant, bl);
     encode(bucket_name, bl);
@@ -1343,106 +1343,106 @@ struct cls_rgw_reshard_remove_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(tenant, bl);
     decode(bucket_name, bl);
     decode(bucket_id, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<cls_rgw_reshard_remove_op*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_reshard_remove_op*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_reshard_remove_op)
 
 struct cls_rgw_set_bucket_resharding_op  {
   cls_rgw_bucket_instance_entry entry;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entry, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entry, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<cls_rgw_set_bucket_resharding_op*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_set_bucket_resharding_op*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_set_bucket_resharding_op)
 
 struct cls_rgw_clear_bucket_resharding_op {
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<cls_rgw_clear_bucket_resharding_op*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_clear_bucket_resharding_op*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_clear_bucket_resharding_op)
 
 struct cls_rgw_guard_bucket_resharding_op  {
   int ret_err{0};
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(ret_err, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(ret_err, bl);
     DECODE_FINISH(bl);
   }
 
-  static void generate_test_instances(list<cls_rgw_guard_bucket_resharding_op*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_guard_bucket_resharding_op*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_guard_bucket_resharding_op)
 
 struct cls_rgw_get_bucket_resharding_op  {
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     DECODE_FINISH(bl);
   }
 
-  static void generate_test_instances(list<cls_rgw_get_bucket_resharding_op*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_get_bucket_resharding_op*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_op)
 
 struct cls_rgw_get_bucket_resharding_ret  {
   cls_rgw_bucket_instance_entry new_instance;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(new_instance, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(new_instance, bl);
     DECODE_FINISH(bl);
   }
 
-  static void generate_test_instances(list<cls_rgw_get_bucket_resharding_ret*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_get_bucket_resharding_ret*>& o);
+  void dump(ceph::Formatter *f) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_ret)
 
index f820003a2ff512f98fe2d10fb5191190d2ba67b5..c175d3ba1d4a43d9390d7f3db474f76b553330bd 100644 (file)
@@ -5,6 +5,11 @@
 #include "common/ceph_json.h"
 #include "include/utime.h"
 
+using std::list;
+using std::string;
+
+using ceph::bufferlist;
+using ceph::Formatter;
 
 void rgw_zone_set_entry::from_str(const string& s)
 {
@@ -30,7 +35,7 @@ string rgw_zone_set_entry::to_str() const
 void rgw_zone_set_entry::encode(bufferlist &bl) const
 {
   /* no ENCODE_START, ENCODE_END for backward compatibility */
-  ceph::encode(to_str(), bl);  
+  ceph::encode(to_str(), bl);
 }
 
 void rgw_zone_set_entry::decode(bufferlist::const_iterator &bl)
@@ -156,8 +161,7 @@ void rgw_bucket_dir_entry::generate_test_instances(list<rgw_bucket_dir_entry*>&
   list<rgw_bucket_dir_entry_meta *> l;
   rgw_bucket_dir_entry_meta::generate_test_instances(l);
 
-  list<rgw_bucket_dir_entry_meta *>::iterator iter;
-  for (iter = l.begin(); iter != l.end(); ++iter) {
+  for (auto iter = l.begin(); iter != l.end(); ++iter) {
     rgw_bucket_dir_entry_meta *m = *iter;
     rgw_bucket_dir_entry *e = new rgw_bucket_dir_entry;
     e->key.name = "name";
@@ -576,11 +580,10 @@ void rgw_bucket_category_stats::dump(Formatter *f) const
 void rgw_bucket_dir_header::generate_test_instances(list<rgw_bucket_dir_header*>& o)
 {
   list<rgw_bucket_category_stats *> l;
-  list<rgw_bucket_category_stats *>::iterator iter;
   rgw_bucket_category_stats::generate_test_instances(l);
 
-  uint8_t i;
-  for (i = 0, iter = l.begin(); iter != l.end(); ++iter, ++i) {
+  uint8_t i = 0;
+  for (auto iter = l.begin(); iter != l.end(); ++iter, ++i) {
     RGWObjCategory c = static_cast<RGWObjCategory>(i);
     rgw_bucket_dir_header *h = new rgw_bucket_dir_header;
     rgw_bucket_category_stats *s = *iter;
@@ -612,18 +615,16 @@ void rgw_bucket_dir_header::dump(Formatter *f) const
 void rgw_bucket_dir::generate_test_instances(list<rgw_bucket_dir*>& o)
 {
   list<rgw_bucket_dir_header *> l;
-  list<rgw_bucket_dir_header *>::iterator iter;
   rgw_bucket_dir_header::generate_test_instances(l);
 
-  uint8_t i;
-  for (i = 0, iter = l.begin(); iter != l.end(); ++iter, ++i) {
+  uint8_t i = 0;
+  for (auto iter = l.begin(); iter != l.end(); ++iter, ++i) {
     rgw_bucket_dir *d = new rgw_bucket_dir;
     rgw_bucket_dir_header *h = *iter;
     d->header = *h;
 
     list<rgw_bucket_dir_entry *> el;
-    list<rgw_bucket_dir_entry *>::iterator eiter;
-    for (eiter = el.begin(); eiter != el.end(); ++eiter) {
+    for (auto eiter = el.begin(); eiter != el.end(); ++eiter) {
       rgw_bucket_dir_entry *e = *eiter;
       d->m[e->key.name] = *e;
 
@@ -670,8 +671,7 @@ void rgw_usage_log_entry::dump(Formatter *f) const
 
   f->open_array_section("categories");
   if (usage_map.size() > 0) {
-    map<string, rgw_usage_data>::const_iterator it;
-    for (it = usage_map.begin(); it != usage_map.end(); it++) {
+    for (auto it = usage_map.begin(); it != usage_map.end(); it++) {
       const rgw_usage_data& total_usage = it->second;
       f->open_object_section("entry");
       f->dump_string("category", it->first.c_str());
index 0bd197ae856ad61c0d6c4c832e19a6e7dc400292..2187603f26cdc4ac48b56a9fa94adff0519c7aea 100644 (file)
 
 class JSONObj;
 
-namespace ceph {
-  class Formatter;
-}
 using ceph::operator <<;
 
 struct rgw_zone_set_entry {
-  string zone;
+  std::string zone;
   std::optional<std::string> location_key;
 
   bool operator<(const rgw_zone_set_entry& e) const {
@@ -38,20 +35,20 @@ struct rgw_zone_set_entry {
   }
 
   rgw_zone_set_entry() {}
-  rgw_zone_set_entry(const string& _zone,
+  rgw_zone_set_entry(const std::string& _zone,
                      std::optional<std::string> _location_key) : zone(_zone),
                                                                 location_key(_location_key) {}
-  rgw_zone_set_entry(const string& s) {
+  rgw_zone_set_entry(const std::string& s) {
     from_str(s);
   }
 
-  void from_str(const string& s);
-  string to_str() const;
+  void from_str(const std::string& s);
+  std::string to_str() const;
 
-  void encode(bufferlist &bl) const;
-  void decode(bufferlist::const_iterator &bl);
+  void encode(ceph::buffer::list &bl) const;
+  void decode(ceph::buffer::list::const_iterator &bl);
 
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
   void decode_json(JSONObj *obj);
 };
 WRITE_CLASS_ENCODER(rgw_zone_set_entry)
@@ -59,17 +56,17 @@ WRITE_CLASS_ENCODER(rgw_zone_set_entry)
 struct rgw_zone_set {
   std::set<rgw_zone_set_entry> entries;
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     /* no ENCODE_START, ENCODE_END for backward compatibility */
     ceph::encode(entries, bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     /* no DECODE_START, DECODE_END for backward compatibility */
     ceph::decode(entries, bl);
   }
 
-  void insert(const string& zone, std::optional<string> location_key);
-  bool exists(const string& zone, std::optional<string> location_key) const;
+  void insert(const std::string& zone, std::optional<std::string> location_key);
+  bool exists(const std::string& zone, std::optional<std::string> location_key) const;
 };
 WRITE_CLASS_ENCODER(rgw_zone_set)
 
@@ -110,19 +107,19 @@ enum RGWCheckMTimeType {
 
 #define ROUND_BLOCK_SIZE 4096
 
-static inline uint64_t cls_rgw_get_rounded_size(uint64_t size) {
+inline uint64_t cls_rgw_get_rounded_size(uint64_t size) {
   return (size + ROUND_BLOCK_SIZE - 1) & ~(ROUND_BLOCK_SIZE - 1);
 }
 
 /*
- * This takes a string that either wholly contains a delimiter or is a
+ * This takes a std::string that either wholly contains a delimiter or is a
  * path that ends with a delimiter and appends a new character to the
  * end such that when a we request bucket-index entries *after* this,
  * we'll get the next object after the "subdirectory". This works
  * because we append a '\xFF' charater, and no valid UTF-8 character
  * can contain that byte, so no valid entries can be skipped.
  */
-static inline std::string cls_rgw_after_delim(const std::string& path) {
+inline std::string cls_rgw_after_delim(const std::string& path) {
   // assert: ! path.empty()
   return path + '\xFF';
 }
@@ -134,7 +131,7 @@ struct rgw_bucket_pending_info {
 
   rgw_bucket_pending_info() : state(CLS_RGW_STATE_PENDING_MODIFY), op(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(2, 2, bl);
     uint8_t s = (uint8_t)state;
     encode(s, bl);
@@ -142,7 +139,7 @@ struct rgw_bucket_pending_info {
     encode(op, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
     uint8_t s;
     decode(s, bl);
@@ -151,9 +148,9 @@ struct rgw_bucket_pending_info {
     decode(op, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
   void decode_json(JSONObj *obj);
-  static void generate_test_instances(list<rgw_bucket_pending_info*>& o);
+  static void generate_test_instances(std::list<rgw_bucket_pending_info*>& o);
 };
 WRITE_CLASS_ENCODER(rgw_bucket_pending_info)
 
@@ -179,19 +176,19 @@ struct rgw_bucket_dir_entry_meta {
   RGWObjCategory category;
   uint64_t size;
   ceph::real_time mtime;
-  string etag;
-  string owner;
-  string owner_display_name;
-  string content_type;
+  std::string etag;
+  std::string owner;
+  std::string owner_display_name;
+  std::string content_type;
   uint64_t accounted_size;
-  string user_data;
-  string storage_class;
+  std::string user_data;
+  std::string storage_class;
   bool appendable;
 
   rgw_bucket_dir_entry_meta() :
     category(RGWObjCategory::None), size(0), accounted_size(0), appendable(false) { }
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(7, 3, bl);
     encode(category, bl);
     encode(size, bl);
@@ -207,7 +204,7 @@ struct rgw_bucket_dir_entry_meta {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(6, 3, 3, bl);
     decode(category, bl);
     decode(size, bl);
@@ -229,14 +226,14 @@ struct rgw_bucket_dir_entry_meta {
       decode(appendable, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
   void decode_json(JSONObj *obj);
-  static void generate_test_instances(list<rgw_bucket_dir_entry_meta*>& o);
+  static void generate_test_instances(std::list<rgw_bucket_dir_entry_meta*>& o);
 };
 WRITE_CLASS_ENCODER(rgw_bucket_dir_entry_meta)
 
 template<class T>
-void encode_packed_val(T val, bufferlist& bl)
+void encode_packed_val(T val, ceph::buffer::list& bl)
 {
   using ceph::encode;
   if ((uint64_t)val < 0x80) {
@@ -265,7 +262,7 @@ void encode_packed_val(T val, bufferlist& bl)
 }
 
 template<class T>
-void decode_packed_val(T& val, bufferlist::const_iterator& bl)
+void decode_packed_val(T& val, ceph::buffer::list::const_iterator& bl)
 {
   using ceph::decode;
   unsigned char c;
@@ -307,7 +304,7 @@ void decode_packed_val(T& val, bufferlist::const_iterator& bl)
       }
       break;
     default:
-      throw buffer::error();
+      throw ceph::buffer::error();
   }
 }
 
@@ -317,33 +314,33 @@ struct rgw_bucket_entry_ver {
 
   rgw_bucket_entry_ver() : pool(-1), epoch(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode_packed_val(pool, bl);
     encode_packed_val(epoch, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode_packed_val(pool, bl);
     decode_packed_val(epoch, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
   void decode_json(JSONObj *obj);
-  static void generate_test_instances(list<rgw_bucket_entry_ver*>& o);
+  static void generate_test_instances(std::list<rgw_bucket_entry_ver*>& o);
 };
 WRITE_CLASS_ENCODER(rgw_bucket_entry_ver)
 
 struct cls_rgw_obj_key {
-  string name;
-  string instance;
+  std::string name;
+  std::string instance;
 
   cls_rgw_obj_key() {}
-  cls_rgw_obj_key(const string &_name) : name(_name) {}
-  cls_rgw_obj_key(const string& n, const string& i) : name(n), instance(i) {}
+  cls_rgw_obj_key(const std::string &_name) : name(_name) {}
+  cls_rgw_obj_key(const std::string& n, const std::string& i) : name(n), instance(i) {}
 
-  void set(const string& _name) {
+  void set(const std::string& _name) {
     name = _name;
   }
 
@@ -364,24 +361,24 @@ struct cls_rgw_obj_key {
   bool empty() const {
     return name.empty();
   }
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(name, bl);
     encode(instance, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(name, bl);
     decode(instance, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const {
+  void dump(ceph::Formatter *f) const {
     f->dump_string("name", name);
     f->dump_string("instance", instance);
   }
   void decode_json(JSONObj *obj);
-  static void generate_test_instances(list<cls_rgw_obj_key*>& ls) {
+  static void generate_test_instances(std::list<cls_rgw_obj_key*>& ls) {
     ls.push_back(new cls_rgw_obj_key);
     ls.push_back(new cls_rgw_obj_key);
     ls.back()->name = "name";
@@ -412,16 +409,16 @@ struct rgw_bucket_dir_entry {
   std::string locator;
   bool exists;
   rgw_bucket_dir_entry_meta meta;
-  multimap<string, rgw_bucket_pending_info> pending_map;
+  std::multimap<std::string, rgw_bucket_pending_info> pending_map;
   uint64_t index_ver;
-  string tag;
+  std::string tag;
   uint16_t flags;
   uint64_t versioned_epoch;
 
   rgw_bucket_dir_entry() :
     exists(false), index_ver(0), flags(0), versioned_epoch(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(8, 3, bl);
     encode(key.name, bl);
     encode(ver.epoch, bl);
@@ -437,7 +434,7 @@ struct rgw_bucket_dir_entry {
     encode(versioned_epoch, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(8, 3, 3, bl);
     decode(key.name, bl);
     decode(ver.epoch, bl);
@@ -487,9 +484,9 @@ struct rgw_bucket_dir_entry {
     return flags & rgw_bucket_dir_entry::FLAG_COMMON_PREFIX;
   }
 
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
   void decode_json(JSONObj *obj);
-  static void generate_test_instances(list<rgw_bucket_dir_entry*>& o);
+  static void generate_test_instances(std::list<rgw_bucket_dir_entry*>& o);
 };
 WRITE_CLASS_ENCODER(rgw_bucket_dir_entry)
 
@@ -504,12 +501,12 @@ struct rgw_bucket_category_stats;
 
 struct rgw_cls_bi_entry {
   BIIndexType type;
-  string idx;
-  bufferlist data;
+  std::string idx;
+  ceph::buffer::list data;
 
   rgw_cls_bi_entry() : type(BIIndexType::Invalid) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(type, bl);
     encode(idx, bl);
@@ -517,7 +514,7 @@ struct rgw_cls_bi_entry {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     uint8_t c;
     decode(c, bl);
@@ -527,7 +524,7 @@ struct rgw_cls_bi_entry {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
   void decode_json(JSONObj *obj, cls_rgw_obj_key *effective_key = NULL);
 
   bool get_info(cls_rgw_obj_key *key, RGWObjCategory *category,
@@ -545,14 +542,14 @@ enum OLHLogOp {
 struct rgw_bucket_olh_log_entry {
   uint64_t epoch;
   OLHLogOp op;
-  string op_tag;
+  std::string op_tag;
   cls_rgw_obj_key key;
   bool delete_marker;
 
   rgw_bucket_olh_log_entry() : epoch(0), op(CLS_RGW_OLH_OP_UNKNOWN), delete_marker(false) {}
 
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(epoch, bl);
     encode((__u8)op, bl);
@@ -561,7 +558,7 @@ struct rgw_bucket_olh_log_entry {
     encode(delete_marker, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(epoch, bl);
     uint8_t c;
@@ -572,8 +569,8 @@ struct rgw_bucket_olh_log_entry {
     decode(delete_marker, bl);
     DECODE_FINISH(bl);
   }
-  static void generate_test_instances(list<rgw_bucket_olh_log_entry*>& o);
-  void dump(Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_bucket_olh_log_entry*>& o);
+  void dump(ceph::Formatter *f) const;
   void decode_json(JSONObj *obj);
 };
 WRITE_CLASS_ENCODER(rgw_bucket_olh_log_entry)
@@ -582,14 +579,14 @@ struct rgw_bucket_olh_entry {
   cls_rgw_obj_key key;
   bool delete_marker;
   uint64_t epoch;
-  map<uint64_t, vector<struct rgw_bucket_olh_log_entry> > pending_log;
-  string tag;
+  std::map<uint64_t, std::vector<struct rgw_bucket_olh_log_entry> > pending_log;
+  std::string tag;
   bool exists;
   bool pending_removal;
 
   rgw_bucket_olh_entry() : delete_marker(false), epoch(0), exists(false), pending_removal(false) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(1, 1, bl);
     encode(key, bl);
     encode(delete_marker, bl);
@@ -600,7 +597,7 @@ struct rgw_bucket_olh_entry {
     encode(pending_removal, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(1, bl);
     decode(key, bl);
     decode(delete_marker, bl);
@@ -611,29 +608,29 @@ struct rgw_bucket_olh_entry {
     decode(pending_removal, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
   void decode_json(JSONObj *obj);
 };
 WRITE_CLASS_ENCODER(rgw_bucket_olh_entry)
 
 struct rgw_bi_log_entry {
-  string id;
-  string object;
-  string instance;
+  std::string id;
+  std::string object;
+  std::string instance;
   ceph::real_time timestamp;
   rgw_bucket_entry_ver ver;
   RGWModifyOp op;
   RGWPendingState state;
   uint64_t index_ver;
-  string tag;
+  std::string tag;
   uint16_t bilog_flags;
-  string owner; /* only being set if it's a delete marker */
-  string owner_display_name; /* only being set if it's a delete marker */
+  std::string owner; /* only being set if it's a delete marker */
+  std::string owner_display_name; /* only being set if it's a delete marker */
   rgw_zone_set zones_trace;
 
   rgw_bi_log_entry() : op(CLS_RGW_OP_UNKNOWN), state(CLS_RGW_STATE_PENDING_MODIFY), index_ver(0), bilog_flags(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(4, 1, bl);
     encode(id, bl);
     encode(object, bl);
@@ -652,7 +649,7 @@ struct rgw_bi_log_entry {
     encode(zones_trace, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START(4, bl);
     decode(id, bl);
     decode(object, bl);
@@ -678,9 +675,9 @@ struct rgw_bi_log_entry {
     }
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
   void decode_json(JSONObj *obj);
-  static void generate_test_instances(list<rgw_bi_log_entry*>& o);
+  static void generate_test_instances(std::list<rgw_bi_log_entry*>& o);
 
   bool is_versioned() {
     return ((bilog_flags & RGW_BILOG_FLAG_VERSIONED_OP) != 0);
@@ -696,7 +693,7 @@ struct rgw_bucket_category_stats {
 
   rgw_bucket_category_stats() : total_size(0), total_size_rounded(0), num_entries(0) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(3, 2, bl);
     encode(total_size, bl);
     encode(total_size_rounded, bl);
@@ -704,7 +701,7 @@ struct rgw_bucket_category_stats {
     encode(actual_size, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
     decode(total_size, bl);
     decode(total_size_rounded, bl);
@@ -716,8 +713,8 @@ struct rgw_bucket_category_stats {
     }
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<rgw_bucket_category_stats*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_bucket_category_stats*>& o);
 };
 WRITE_CLASS_ENCODER(rgw_bucket_category_stats)
 
@@ -727,7 +724,7 @@ enum class cls_rgw_reshard_status : uint8_t {
   DONE            = 2
 };
 
-static inline std::string to_string(const cls_rgw_reshard_status status)
+inline std::string to_string(const cls_rgw_reshard_status status)
 {
   switch (status) {
   case cls_rgw_reshard_status::NOT_RESHARDING:
@@ -747,10 +744,10 @@ struct cls_rgw_bucket_instance_entry {
   using RESHARD_STATUS = cls_rgw_reshard_status;
   
   cls_rgw_reshard_status reshard_status{RESHARD_STATUS::NOT_RESHARDING};
-  string new_bucket_instance_id;
+  std::string new_bucket_instance_id;
   int32_t num_shards{-1};
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode((uint8_t)reshard_status, bl);
     encode(new_bucket_instance_id, bl);
@@ -758,7 +755,7 @@ struct cls_rgw_bucket_instance_entry {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     uint8_t s;
     decode(s, bl);
@@ -768,15 +765,15 @@ struct cls_rgw_bucket_instance_entry {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_bucket_instance_entry*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_bucket_instance_entry*>& o);
 
   void clear() {
     reshard_status = RESHARD_STATUS::NOT_RESHARDING;
     new_bucket_instance_id.clear();
   }
 
-  void set_status(const string& new_instance_id,
+  void set_status(const std::string& new_instance_id,
                  int32_t new_num_shards,
                  cls_rgw_reshard_status s) {
     reshard_status = s;
@@ -794,17 +791,17 @@ struct cls_rgw_bucket_instance_entry {
 WRITE_CLASS_ENCODER(cls_rgw_bucket_instance_entry)
 
 struct rgw_bucket_dir_header {
-  map<RGWObjCategory, rgw_bucket_category_stats> stats;
+  std::map<RGWObjCategory, rgw_bucket_category_stats> stats;
   uint64_t tag_timeout;
   uint64_t ver;
   uint64_t master_ver;
-  string max_marker;
+  std::string max_marker;
   cls_rgw_bucket_instance_entry new_instance;
   bool syncstopped;
 
   rgw_bucket_dir_header() : tag_timeout(0), ver(0), master_ver(0), syncstopped(false) {}
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(7, 2, bl);
     encode(stats, bl);
     encode(tag_timeout, bl);
@@ -815,7 +812,7 @@ struct rgw_bucket_dir_header {
     encode(syncstopped,bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(6, 2, 2, bl);
     decode(stats, bl);
     if (struct_v > 2) {
@@ -842,8 +839,8 @@ struct rgw_bucket_dir_header {
     }
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<rgw_bucket_dir_header*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_bucket_dir_header*>& o);
 
   bool resharding() const {
     return new_instance.resharding();
@@ -856,22 +853,22 @@ WRITE_CLASS_ENCODER(rgw_bucket_dir_header)
 
 struct rgw_bucket_dir {
   rgw_bucket_dir_header header;
-  boost::container::flat_map<string, rgw_bucket_dir_entry> m;
+  boost::container::flat_map<std::string, rgw_bucket_dir_entry> m;
 
-  void encode(bufferlist &bl) const {
+  void encode(ceph::buffer::list &bl) const {
     ENCODE_START(2, 2, bl);
     encode(header, bl);
     encode(m, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator &bl) {
+  void decode(ceph::buffer::list::const_iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
     decode(header, bl);
     decode(m, bl);
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<rgw_bucket_dir*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<rgw_bucket_dir*>& o);
 };
 WRITE_CLASS_ENCODER(rgw_bucket_dir)
 
@@ -884,7 +881,7 @@ struct rgw_usage_data {
   rgw_usage_data() : bytes_sent(0), bytes_received(0), ops(0), successful_ops(0) {}
   rgw_usage_data(uint64_t sent, uint64_t received) : bytes_sent(sent), bytes_received(received), ops(0), successful_ops(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(bytes_sent, bl);
     encode(bytes_received, bl);
@@ -893,7 +890,7 @@ struct rgw_usage_data {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(bytes_sent, bl);
     decode(bytes_received, bl);
@@ -915,16 +912,16 @@ WRITE_CLASS_ENCODER(rgw_usage_data)
 struct rgw_usage_log_entry {
   rgw_user owner;
   rgw_user payer; /* if empty, same as owner */
-  string bucket;
+  std::string bucket;
   uint64_t epoch;
   rgw_usage_data total_usage; /* this one is kept for backwards compatibility */
-  map<string, rgw_usage_data> usage_map;
+  std::map<std::string, rgw_usage_data> usage_map;
 
   rgw_usage_log_entry() : epoch(0) {}
-  rgw_usage_log_entry(string& o, string& b) : owner(o), bucket(b), epoch(0) {}
-  rgw_usage_log_entry(string& o, string& p, string& b) : owner(o), payer(p), bucket(b), epoch(0) {}
+  rgw_usage_log_entry(std::string& o, std::string& b) : owner(o), bucket(b), epoch(0) {}
+  rgw_usage_log_entry(std::string& o, std::string& p, std::string& b) : owner(o), payer(p), bucket(b), epoch(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(3, 1, bl);
     encode(owner.to_str(), bl);
     encode(bucket, bl);
@@ -939,9 +936,9 @@ struct rgw_usage_log_entry {
   }
 
 
-   void decode(bufferlist::const_iterator& bl) {
+   void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(3, bl);
-    string s;
+    std::string s;
     decode(s, bl);
     owner.from_str(s);
     decode(bucket, bl);
@@ -956,14 +953,15 @@ struct rgw_usage_log_entry {
       decode(usage_map, bl);
     }
     if (struct_v >= 3) {
-      string p;
+      std::string p;
       decode(p, bl);
       payer.from_str(p);
     }
     DECODE_FINISH(bl);
   }
 
-  void aggregate(const rgw_usage_log_entry& e, map<string, bool> *categories = NULL) {
+  void aggregate(const rgw_usage_log_entry& e,
+                std::map<std::string, bool> *categories = NULL) {
     if (owner.empty()) {
       owner = e.owner;
       bucket = e.bucket;
@@ -971,44 +969,44 @@ struct rgw_usage_log_entry {
       payer = e.payer;
     }
 
-    map<string, rgw_usage_data>::const_iterator iter;
-    for (iter = e.usage_map.begin(); iter != e.usage_map.end(); ++iter) {
+    for (auto iter = e.usage_map.begin(); iter != e.usage_map.end(); ++iter) {
       if (!categories || !categories->size() || categories->count(iter->first)) {
         add(iter->first, iter->second);
       }
     }
   }
 
-  void sum(rgw_usage_data& usage, map<string, bool>& categories) const {
+  void sum(rgw_usage_data& usage,
+          std::map<std::string, bool>& categories) const {
     usage = rgw_usage_data();
-    for (map<string, rgw_usage_data>::const_iterator iter = usage_map.begin(); iter != usage_map.end(); ++iter) {
+    for (auto iter = usage_map.begin(); iter != usage_map.end(); ++iter) {
       if (!categories.size() || categories.count(iter->first)) {
         usage.aggregate(iter->second);
       }
     }
   }
 
-  void add(const string& category, const rgw_usage_data& data) {
+  void add(const std::string& category, const rgw_usage_data& data) {
     usage_map[category].aggregate(data);
     total_usage.aggregate(data);
   }
 
-  void dump(Formatter* f) const;
-  static void generate_test_instances(list<rgw_usage_log_entry*>& o);
+  void dump(ceph::Formatter* f) const;
+  static void generate_test_instances(std::list<rgw_usage_log_entry*>& o);
 
 };
 WRITE_CLASS_ENCODER(rgw_usage_log_entry)
 
 struct rgw_usage_log_info {
-  vector<rgw_usage_log_entry> entries;
+  std::vector<rgw_usage_log_entry> entries;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entries, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     DECODE_FINISH(bl);
@@ -1019,20 +1017,20 @@ struct rgw_usage_log_info {
 WRITE_CLASS_ENCODER(rgw_usage_log_info)
 
 struct rgw_user_bucket {
-  string user;
-  string bucket;
+  std::string user;
+  std::string bucket;
 
   rgw_user_bucket() {}
-  rgw_user_bucket(const string& u, const string& b) : user(u), bucket(b) {}
+  rgw_user_bucket(const std::string& u, const std::string& b) : user(u), bucket(b) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(user, bl);
     encode(bucket, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(user, bl);
     decode(bucket, bl);
@@ -1057,14 +1055,14 @@ enum cls_rgw_gc_op {
 };
 
 struct cls_rgw_obj {
-  string pool;
+  std::string pool;
   cls_rgw_obj_key key;
-  string loc;
+  std::string loc;
 
   cls_rgw_obj() {}
-  cls_rgw_obj(string& _p, cls_rgw_obj_key& _k) : pool(_p), key(_k) {}
+  cls_rgw_obj(std::string& _p, cls_rgw_obj_key& _k) : pool(_p), key(_k) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(pool, bl);
     encode(key.name, bl);
@@ -1073,7 +1071,7 @@ struct cls_rgw_obj {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(pool, bl);
     decode(key.name, bl);
@@ -1084,13 +1082,13 @@ struct cls_rgw_obj {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const {
+  void dump(ceph::Formatter *f) const {
     f->dump_string("pool", pool);
     f->dump_string("oid", key.name);
     f->dump_string("key", loc);
     f->dump_string("instance", key.instance);
   }
-  static void generate_test_instances(list<cls_rgw_obj*>& ls) {
+  static void generate_test_instances(std::list<cls_rgw_obj*>& ls) {
     ls.push_back(new cls_rgw_obj);
     ls.push_back(new cls_rgw_obj);
     ls.back()->pool = "mypool";
@@ -1101,11 +1099,11 @@ struct cls_rgw_obj {
 WRITE_CLASS_ENCODER(cls_rgw_obj)
 
 struct cls_rgw_obj_chain {
-  list<cls_rgw_obj> objs;
+  std::list<cls_rgw_obj> objs;
 
   cls_rgw_obj_chain() {}
 
-  void push_obj(const string& pool, const cls_rgw_obj_key& key, const string& loc) {
+  void push_obj(const std::string& pool, const cls_rgw_obj_key& key, const std::string& loc) {
     cls_rgw_obj obj;
     obj.pool = pool;
     obj.key = key;
@@ -1113,28 +1111,28 @@ struct cls_rgw_obj_chain {
     objs.push_back(obj);
   }
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(objs, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(objs, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const {
+  void dump(ceph::Formatter *f) const {
     f->open_array_section("objs");
-    for (list<cls_rgw_obj>::const_iterator p = objs.begin(); p != objs.end(); ++p) {
+    for (std::list<cls_rgw_obj>::const_iterator p = objs.begin(); p != objs.end(); ++p) {
       f->open_object_section("obj");
       p->dump(f);
       f->close_section();
     }
     f->close_section();
   }
-  static void generate_test_instances(list<cls_rgw_obj_chain*>& ls) {
+  static void generate_test_instances(std::list<cls_rgw_obj_chain*>& ls) {
     ls.push_back(new cls_rgw_obj_chain);
   }
 
@@ -1146,13 +1144,13 @@ WRITE_CLASS_ENCODER(cls_rgw_obj_chain)
 
 struct cls_rgw_gc_obj_info
 {
-  string tag;
+  std::string tag;
   cls_rgw_obj_chain chain;
   ceph::real_time time;
 
   cls_rgw_gc_obj_info() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(tag, bl);
     encode(chain, bl);
@@ -1160,7 +1158,7 @@ struct cls_rgw_gc_obj_info
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(tag, bl);
     decode(chain, bl);
@@ -1168,14 +1166,14 @@ struct cls_rgw_gc_obj_info
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const {
+  void dump(ceph::Formatter *f) const {
     f->dump_string("tag", tag);
     f->open_object_section("chain");
     chain.dump(f);
     f->close_section();
     f->dump_stream("time") << time;
   }
-  static void generate_test_instances(list<cls_rgw_gc_obj_info*>& ls) {
+  static void generate_test_instances(std::list<cls_rgw_gc_obj_info*>& ls) {
     ls.push_back(new cls_rgw_gc_obj_info);
     ls.push_back(new cls_rgw_gc_obj_info);
     ls.back()->tag = "footag";
@@ -1188,11 +1186,11 @@ WRITE_CLASS_ENCODER(cls_rgw_gc_obj_info)
 struct cls_rgw_lc_obj_head
 {
   time_t start_date = 0;
-  string marker;
+  std::string marker;
 
   cls_rgw_lc_obj_head() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     uint64_t t = start_date;
     encode(t, bl);
@@ -1200,7 +1198,7 @@ struct cls_rgw_lc_obj_head
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     uint64_t t;
     decode(t, bl);
@@ -1209,24 +1207,24 @@ struct cls_rgw_lc_obj_head
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_lc_obj_head*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_lc_obj_head*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_rgw_lc_obj_head)
 
 struct cls_rgw_reshard_entry
 {
   ceph::real_time time;
-  string tenant;
-  string bucket_name;
-  string bucket_id;
-  string new_instance_id;
+  std::string tenant;
+  std::string bucket_name;
+  std::string bucket_id;
+  std::string new_instance_id;
   uint32_t old_num_shards{0};
   uint32_t new_num_shards{0};
 
   cls_rgw_reshard_entry() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(time, bl);
     encode(tenant, bl);
@@ -1238,7 +1236,7 @@ struct cls_rgw_reshard_entry
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(time, bl);
     decode(tenant, bl);
@@ -1250,11 +1248,11 @@ struct cls_rgw_reshard_entry
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_rgw_reshard_entry*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_rgw_reshard_entry*>& o);
 
-  static void generate_key(const string& tenant, const string& bucket_name, string *key);
-  void get_key(string *key) const;
+  static void generate_key(const std::string& tenant, const std::string& bucket_name, std::string *key);
+  void get_key(std::string *key) const;
 };
 WRITE_CLASS_ENCODER(cls_rgw_reshard_entry)
 
index 976e49ea52e114d5050ccb048b09a0c2535ea0ad..7970e9e07a2f9ec60137672248c5e9cf03d14901 100644 (file)
 
 #define GC_LIST_DEFAULT_MAX 128
 
+using std::string;
+
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
+using ceph::make_timespan;
+using ceph::real_time;
+
 CLS_VER(1,0)
 CLS_NAME(rgw_gc)
 
@@ -32,7 +40,7 @@ static int cls_rgw_gc_queue_init(cls_method_context_t hctx, bufferlist *in, buff
   cls_rgw_gc_queue_init_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(5, "ERROR: cls_rgw_gc_queue_init: failed to decode entry\n");
     return -EINVAL;
   }
@@ -57,7 +65,7 @@ static int cls_rgw_gc_queue_enqueue(cls_method_context_t hctx, bufferlist *in, b
   cls_rgw_gc_set_entry_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_rgw_gc_queue_enqueue: failed to decode entry\n");
     return -EINVAL;
   }
@@ -94,7 +102,7 @@ static int cls_rgw_gc_queue_list_entries(cls_method_context_t hctx, bufferlist *
   cls_rgw_gc_list_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(5, "ERROR: cls_rgw_gc_queue_list_entries(): failed to decode input\n");
     return -EINVAL;
   }
@@ -110,7 +118,7 @@ static int cls_rgw_gc_queue_list_entries(cls_method_context_t hctx, bufferlist *
     auto iter_urgent_data = head.bl_urgent_data.cbegin();
     try {
       decode(urgent_data, iter_urgent_data);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(5, "ERROR: cls_rgw_gc_queue_list_entries(): failed to decode urgent data\n");
       return -EINVAL;
     }
@@ -143,7 +151,7 @@ static int cls_rgw_gc_queue_list_entries(cls_method_context_t hctx, bufferlist *
         cls_rgw_gc_obj_info info;
         try {
           decode(info, it.data);
-        } catch (buffer::error& err) {
+        } catch (ceph::buffer::error& err) {
           CLS_LOG(5, "ERROR: cls_rgw_gc_queue_list_entries(): failed to decode gc info\n");
           return -EINVAL;
         }
@@ -170,7 +178,7 @@ static int cls_rgw_gc_queue_list_entries(cls_method_context_t hctx, bufferlist *
             auto iter = bl_xattrs.cbegin();
             try {
               decode(xattr_urgent_data_map, iter);
-            } catch (buffer::error& err) {
+            } catch (ceph::buffer::error& err) {
               CLS_LOG(1, "ERROR: cls_rgw_gc_queue_list_entries(): failed to decode xattrs urgent data map\n");
               return -EINVAL;
             } //end - catch
@@ -225,7 +233,7 @@ static int cls_rgw_gc_queue_remove_entries(cls_method_context_t hctx, bufferlist
   cls_rgw_gc_queue_remove_entries_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(5, "ERROR: cls_rgw_gc_queue_remove_entries(): failed to decode input\n");
     return -EINVAL;
   }
@@ -241,7 +249,7 @@ static int cls_rgw_gc_queue_remove_entries(cls_method_context_t hctx, bufferlist
     auto iter_urgent_data = head.bl_urgent_data.cbegin();
     try {
       decode(urgent_data, iter_urgent_data);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(5, "ERROR: cls_rgw_gc_queue_remove_entries(): failed to decode urgent data\n");
       return -EINVAL;
     }
@@ -272,7 +280,7 @@ static int cls_rgw_gc_queue_remove_entries(cls_method_context_t hctx, bufferlist
         cls_rgw_gc_obj_info info;
         try {
           decode(info, it.data);
-        } catch (buffer::error& err) {
+        } catch (ceph::buffer::error& err) {
           CLS_LOG(5, "ERROR: cls_rgw_gc_queue_remove_entries(): failed to decode gc info\n");
           return -EINVAL;
         }
@@ -306,7 +314,7 @@ static int cls_rgw_gc_queue_remove_entries(cls_method_context_t hctx, bufferlist
             auto iter = bl_xattrs.cbegin();
             try {
               decode(xattr_urgent_data_map, iter);
-            } catch (buffer::error& err) {
+            } catch (ceph::buffer::error& err) {
               CLS_LOG(5, "ERROR: cls_rgw_gc_queue_remove_entries(): failed to decode xattrs urgent data map\n");
               return -EINVAL;
             } //end - catch
@@ -374,7 +382,7 @@ static int cls_rgw_gc_queue_update_entry(cls_method_context_t hctx, bufferlist *
   cls_rgw_gc_queue_defer_entry_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(5, "ERROR: cls_rgw_gc_queue_update_entry(): failed to decode input\n");
     return -EINVAL;
   }
@@ -393,7 +401,7 @@ static int cls_rgw_gc_queue_update_entry(cls_method_context_t hctx, bufferlist *
   cls_rgw_gc_urgent_data urgent_data;
   try {
     decode(urgent_data, bl_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(5, "ERROR: cls_rgw_gc_queue_update_entry(): failed to decode urgent data\n");
     return -EINVAL;
   }
@@ -418,7 +426,7 @@ static int cls_rgw_gc_queue_update_entry(cls_method_context_t hctx, bufferlist *
       auto iter = bl_xattrs.cbegin();
       try {
         decode(xattr_urgent_data_map, iter);
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         CLS_LOG(1, "ERROR: cls_rgw_gc_queue_update_entry(): failed to decode xattrs urgent data map\n");
         return -EINVAL;
       } //end - catch
@@ -465,7 +473,7 @@ static int cls_rgw_gc_queue_update_entry(cls_method_context_t hctx, bufferlist *
         auto iter = bl_xattrs.cbegin();
         try {
           decode(xattr_urgent_data_map, iter);
-        } catch (buffer::error& err) {
+        } catch (ceph::buffer::error& err) {
           CLS_LOG(1, "ERROR: cls_rgw_gc_queue_remove_entries(): failed to decode xattrs urgent data map\n");
           return -EINVAL;
         } //end - catch
index 907a58d237708c1b8a52a2a5f9c31de1500ed2ab..415ce8b751aad34dd353f5dbbc172f536a73425a 100644 (file)
@@ -9,6 +9,12 @@
 #include "cls/queue/cls_queue_const.h"
 #include "cls/rgw_gc/cls_rgw_gc_client.h"
 
+using std::list;
+using std::string;
+
+using ceph::decode;
+using ceph::encode;
+
 using namespace librados;
 
 void cls_rgw_gc_queue_init(ObjectWriteOperation& op, uint64_t size, uint64_t num_deferred_entries)
@@ -32,7 +38,7 @@ int cls_rgw_gc_queue_get_capacity(IoCtx& io_ctx, const string& oid, uint64_t& si
   auto iter = out.cbegin();
   try {
     decode(op_ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
@@ -69,7 +75,7 @@ int cls_rgw_gc_queue_list_entries(IoCtx& io_ctx, const string& oid, const string
   auto iter = out.cbegin();
   try {
     decode(ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
index 35654e76c035e6909f082aa13ef42260f9d7a515..88a042fc945bc7afbd58374f7b6df023d2ebd76b 100644 (file)
@@ -1,16 +1,22 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_RGW_GC_CLIENT_H
 #define CEPH_CLS_RGW_GC_CLIENT_H
 
 #include "include/rados/librados.hpp"
-#include "cls/rgw_gc/cls_rgw_gc_types.h"
-#include "cls/queue/cls_queue_ops.h"
+
 #include "common/ceph_time.h"
 
+#include "cls/queue/cls_queue_ops.h"
+#include "cls/rgw/cls_rgw_types.h"
+#include "cls/rgw_gc/cls_rgw_gc_types.h"
+
 void cls_rgw_gc_queue_init(librados::ObjectWriteOperation& op, uint64_t size, uint64_t num_deferred_entries);
-int cls_rgw_gc_queue_get_capacity(librados::IoCtx& io_ctx, const string& oid, uint64_t& size);
+int cls_rgw_gc_queue_get_capacity(librados::IoCtx& io_ctx, const std::string& oid, uint64_t& size);
 void cls_rgw_gc_queue_enqueue(librados::ObjectWriteOperation& op, uint32_t expiration_secs, const cls_rgw_gc_obj_info& info);
-int cls_rgw_gc_queue_list_entries(librados::IoCtx& io_ctx, const string& oid, const string& marker, uint32_t max, bool expired_only,
-                    list<cls_rgw_gc_obj_info>& entries, bool *truncated, string& next_marker);
+int cls_rgw_gc_queue_list_entries(librados::IoCtx& io_ctx, const std::string& oid, const std::string& marker, uint32_t max, bool expired_only,
+                                 std::list<cls_rgw_gc_obj_info>& entries, bool *truncated, std::string& next_marker);
 void cls_rgw_gc_queue_remove_entries(librados::ObjectWriteOperation& op, uint32_t num_entries);
 void cls_rgw_gc_queue_defer_entry(librados::ObjectWriteOperation& op, uint32_t expiration_secs, const cls_rgw_gc_obj_info& info);
 
index e2f55fb7593685e80e0a2dbda4911c846170357d..95f791c09b942be46ba9e8beb8f3c104afdd5203 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_RGW_GC_OPS_H
 #define CEPH_CLS_RGW_GC_OPS_H
 
@@ -9,14 +12,14 @@ struct cls_rgw_gc_queue_init_op {
 
   cls_rgw_gc_queue_init_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(size, bl);
     encode(num_deferred_entries, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(size, bl);
     decode(num_deferred_entries, bl);
@@ -31,13 +34,13 @@ struct cls_rgw_gc_queue_remove_entries_op {
 
   cls_rgw_gc_queue_remove_entries_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(num_entries, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(num_entries, bl);
     DECODE_FINISH(bl);
@@ -50,14 +53,14 @@ struct cls_rgw_gc_queue_defer_entry_op {
   cls_rgw_gc_obj_info info;
   cls_rgw_gc_queue_defer_entry_op() : expiration_secs(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(expiration_secs, bl);
     encode(info, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(expiration_secs, bl);
     decode(info, bl);
@@ -65,4 +68,4 @@ struct cls_rgw_gc_queue_defer_entry_op {
   }
 };
 WRITE_CLASS_ENCODER(cls_rgw_gc_queue_defer_entry_op)
-#endif /* CEPH_CLS_RGW_GC_OPS_H */
\ No newline at end of file
+#endif /* CEPH_CLS_RGW_GC_OPS_H */
index cfcac55f5beab53832958816e6395897214f75b0..da9d08036e6b651f4c20ddcfa0653c8faba43068 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_RGW_GC_TYPES_H
 #define CEPH_CLS_RGW_GC_TYPES_H
 
@@ -6,12 +9,12 @@
 
 struct cls_rgw_gc_urgent_data
 {
-  std::unordered_map<string,ceph::real_time> urgent_data_map;
+  std::unordered_map<std::string, ceph::real_time> urgent_data_map;
   uint32_t num_urgent_data_entries{0}; // requested by user
   uint32_t num_head_urgent_entries{0}; // actual number of entries in queue head
   uint32_t num_xattr_urgent_entries{0}; // actual number of entries in xattr in case of spill over
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(urgent_data_map, bl);
     encode(num_urgent_data_entries, bl);
@@ -20,7 +23,7 @@ struct cls_rgw_gc_urgent_data
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(urgent_data_map, bl);
     decode(num_urgent_data_entries, bl);
@@ -31,4 +34,4 @@ struct cls_rgw_gc_urgent_data
 };
 WRITE_CLASS_ENCODER(cls_rgw_gc_urgent_data)
 
-#endif
\ No newline at end of file
+#endif
index 92ea15be5f820993146ec1024852e4aa729b418c..5ad8883d84cb3cd5d1d5c6ee29ced5b66531b25d 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include <errno.h>
@@ -9,6 +9,11 @@
 
 #include "include/compat.h"
 
+using std::map;
+using std::string;
+
+using ceph::bufferlist;
+
 CLS_VER(1,0)
 CLS_NAME(timeindex)
 
@@ -61,12 +66,12 @@ static int cls_timeindex_add(cls_method_context_t hctx,
   cls_timeindex_add_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_timeindex_add_op(): failed to decode op");
     return -EINVAL;
   }
 
-  for (list<cls_timeindex_entry>::iterator iter = op.entries.begin();
+  for (auto iter = op.entries.begin();
        iter != op.entries.end();
        ++iter) {
     cls_timeindex_entry& entry = *iter;
@@ -94,7 +99,7 @@ static int cls_timeindex_list(cls_method_context_t hctx,
   cls_timeindex_list_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_timeindex_list_op(): failed to decode op");
     return -EINVAL;
   }
@@ -128,8 +133,8 @@ static int cls_timeindex_list(cls_method_context_t hctx,
     return rc;
   }
 
-  list<cls_timeindex_entry>& entries = ret.entries;
-  map<string, bufferlist>::iterator iter = keys.begin();
+  auto& entries = ret.entries;
+  auto iter = keys.begin();
 
   string marker;
 
@@ -175,7 +180,7 @@ static int cls_timeindex_trim(cls_method_context_t hctx,
   cls_timeindex_trim_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_timeindex_trim: failed to decode entry");
     return -EINVAL;
   }
@@ -205,7 +210,7 @@ static int cls_timeindex_trim(cls_method_context_t hctx,
     return rc;
   }
 
-  map<string, bufferlist>::iterator iter = keys.begin();
+  auto iter = keys.begin();
 
   bool removed = false;
   for (; iter != keys.end(); ++iter) {
index ce6392f6d1395dc873d3429d72340bae745c1301..818d4b0c467154835e184b655b5df37c156eb37a 100644 (file)
@@ -27,7 +27,7 @@ public:
   ///* dtor
   ~TimeindexListCtx() {}
 
-  void handle_completion(int r, bufferlist& bl) override {
+  void handle_completion(int r, ceph::buffer::list& bl) override {
     if (r >= 0) {
       cls_timeindex_list_ret ret;
       try {
@@ -39,7 +39,7 @@ public:
           *truncated = ret.truncated;
         if (marker)
           *marker = ret.marker;
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         // nothing we can do about it atm
       }
     }
@@ -50,7 +50,7 @@ void cls_timeindex_add_prepare_entry(
   cls_timeindex_entry& entry,
   const utime_t& key_timestamp,
   const std::string& key_ext,
-  bufferlist& bl);
+  ceph::buffer::list& bl);
 
 void cls_timeindex_add(
   librados::ObjectWriteOperation& op,
@@ -64,7 +64,7 @@ void cls_timeindex_add(
   librados::ObjectWriteOperation& op,
   const utime_t& timestamp,
   const std::string& name,
-  const bufferlist& bl);
+  const ceph::buffer::list& bl);
 
 void cls_timeindex_list(
   librados::ObjectReadOperation& op,
index 05aa8b19ba881bbf60a689308b11c5fa3e608ed6..f40058954dcef4c28f2985e5a4d695aff06deea2 100644 (file)
@@ -7,17 +7,17 @@
 #include "cls_timeindex_types.h"
 
 struct cls_timeindex_add_op {
-  list<cls_timeindex_entry> entries;
+  std::list<cls_timeindex_entry> entries;
 
   cls_timeindex_add_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entries, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     DECODE_FINISH(bl);
@@ -27,14 +27,14 @@ WRITE_CLASS_ENCODER(cls_timeindex_add_op)
 
 struct cls_timeindex_list_op {
   utime_t from_time;
-  string marker; /* if not empty, overrides from_time */
+  std::string marker; /* if not empty, overrides from_time */
   utime_t to_time; /* not inclusive */
   int max_entries; /* upperbound to returned num of entries
                       might return less than that and still be truncated */
 
   cls_timeindex_list_op() : max_entries(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(from_time, bl);
     encode(marker, bl);
@@ -43,7 +43,7 @@ struct cls_timeindex_list_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(from_time, bl);
     decode(marker, bl);
@@ -55,13 +55,13 @@ struct cls_timeindex_list_op {
 WRITE_CLASS_ENCODER(cls_timeindex_list_op)
 
 struct cls_timeindex_list_ret {
-  list<cls_timeindex_entry> entries;
-  string marker;
+  std::list<cls_timeindex_entry> entries;
+  std::string marker;
   bool truncated;
 
   cls_timeindex_list_ret() : truncated(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entries, bl);
     encode(marker, bl);
@@ -69,7 +69,7 @@ struct cls_timeindex_list_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     decode(marker, bl);
@@ -87,12 +87,12 @@ WRITE_CLASS_ENCODER(cls_timeindex_list_ret)
 struct cls_timeindex_trim_op {
   utime_t from_time;
   utime_t to_time; /* inclusive */
-  string from_marker;
-  string to_marker;
+  std::string from_marker;
+  std::string to_marker;
 
   cls_timeindex_trim_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(from_time, bl);
     encode(to_time, bl);
@@ -101,7 +101,7 @@ struct cls_timeindex_trim_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(from_time, bl);
     decode(to_time, bl);
index 90ac3b8e55d0bf5f658ecce1a2414142b3e935c8..d33886881be523e28c5c631e8e751369b1d76bc4 100644 (file)
@@ -16,13 +16,13 @@ struct cls_timeindex_entry {
   utime_t key_ts;
   /* Not mandatory. The name_ext field, if not empty, will form second
    * part of the key. */
-  string key_ext;
+  std::string key_ext;
   /* Become value of OMAP-based mapping. */
-  bufferlist value;
+  ceph::buffer::list value;
 
   cls_timeindex_entry() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(key_ts, bl);
     encode(key_ext, bl);
@@ -30,7 +30,7 @@ struct cls_timeindex_entry {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(key_ts, bl);
     decode(key_ext, bl);
@@ -38,8 +38,8 @@ struct cls_timeindex_entry {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_timeindex_entry*>& o);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_timeindex_entry*>& o);
 };
 WRITE_CLASS_ENCODER(cls_timeindex_entry)
 
index e80e6e231c27046608cd863cec413aa540c5b728..20809daf0bc0f8ade6b3c22ca5f7afe92240cf42 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include <errno.h>
@@ -8,6 +8,13 @@
 
 #include "cls_user_ops.h"
 
+using std::map;
+using std::string;
+
+using ceph::bufferlist;
+using ceph::decode;
+using ceph::encode;
+
 CLS_VER(1,0)
 CLS_NAME(user)
 
@@ -56,7 +63,7 @@ static int get_existing_bucket_entry(cls_method_context_t hctx, const string& bu
   try {
     auto iter = bl.cbegin();
     decode(entry, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: failed to decode entry %s", key.c_str());
     return -EIO;
   }
@@ -79,7 +86,7 @@ static int read_header(cls_method_context_t hctx, cls_user_header *header)
 
   try {
     decode(*header, bl);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: failed to decode user header");
     return -EIO;
   }
@@ -115,7 +122,7 @@ static int cls_user_set_buckets_info(cls_method_context_t hctx, bufferlist *in,
   cls_user_set_buckets_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_user_add_op(): failed to decode op");
     return -EINVAL;
   }
@@ -127,8 +134,7 @@ static int cls_user_set_buckets_info(cls_method_context_t hctx, bufferlist *in,
     return ret;
   }
 
-  for (list<cls_user_bucket_entry>::iterator iter = op.entries.begin();
-       iter != op.entries.end(); ++iter) {
+  for (auto iter = op.entries.begin(); iter != op.entries.end(); ++iter) {
     cls_user_bucket_entry& update_entry = *iter;
 
     string key;
@@ -200,7 +206,7 @@ static int cls_user_complete_stats_sync(cls_method_context_t hctx, bufferlist *i
   cls_user_complete_stats_sync_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_user_add_op(): failed to decode op");
     return -EINVAL;
   }
@@ -233,7 +239,7 @@ static int cls_user_remove_bucket(cls_method_context_t hctx, bufferlist *in, buf
   cls_user_remove_bucket_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_user_add_op(): failed to decode op");
     return -EINVAL;
   }
@@ -285,7 +291,7 @@ static int cls_user_list_buckets(cls_method_context_t hctx, bufferlist *in, buff
   cls_user_list_buckets_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_user_list_op(): failed to decode op");
     return -EINVAL;
   }
@@ -313,8 +319,8 @@ static int cls_user_list_buckets(cls_method_context_t hctx, bufferlist *in, buff
           to_index.c_str(),
           match_prefix.c_str());
 
-  list<cls_user_bucket_entry>& entries = ret.entries;
-  map<string, bufferlist>::iterator iter = keys.begin();
+  auto& entries = ret.entries;
+  auto iter = keys.begin();
 
   string marker;
 
@@ -333,7 +339,7 @@ static int cls_user_list_buckets(cls_method_context_t hctx, bufferlist *in, buff
       cls_user_bucket_entry e;
       decode(e, biter);
       entries.push_back(e);
-    } catch (buffer::error& err) {
+    } catch (ceph::buffer::error& err) {
       CLS_LOG(0, "ERROR: cls_user_list: could not decode entry, index=%s", index.c_str());
     }
   }
@@ -354,7 +360,7 @@ static int cls_user_get_header(cls_method_context_t hctx, bufferlist *in, buffer
   cls_user_get_header_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_user_get_header_op(): failed to decode op");
     return -EINVAL;
   }
@@ -382,7 +388,7 @@ static int cls_user_reset_stats(cls_method_context_t hctx,
   try {
     auto bliter = in->cbegin();
     decode(op, bliter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: %s failed to decode op", __func__);
     return -EINVAL;
   }
@@ -407,7 +413,7 @@ static int cls_user_reset_stats(cls_method_context_t hctx,
        auto bl = kv.second;
        auto bliter = bl.cbegin();
        decode(e, bliter);
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
        CLS_LOG(0, "ERROR: %s failed to decode bucket entry for %s",
                __func__, kv.first.c_str());
        return -EIO;
@@ -449,4 +455,3 @@ CLS_INIT(user)
   cls_register_cxx_method(h_class, "reset_user_stats", CLS_METHOD_RD | CLS_METHOD_WR, cls_user_reset_stats, &h_user_reset_stats);
   return;
 }
-
index f68348627350e9af1738026b4763894ff7cd0605..b74f55b48b2fd493795b71920a154dbfc40956a2 100644 (file)
@@ -6,9 +6,15 @@
 #include "cls/user/cls_user_client.h"
 #include "include/rados/librados.hpp"
 
+using std::list;
+using std::string;
 
-using namespace librados;
+using ceph::bufferlist;
+using ceph::real_clock;
 
+using librados::IoCtx;
+using librados::ObjectOperationCompletion;
+using librados::ObjectReadOperation;
 
 void cls_user_set_buckets(librados::ObjectWriteOperation& op, list<cls_user_bucket_entry>& entries, bool add)
 {
@@ -59,7 +65,7 @@ public:
           *truncated = ret.truncated;
         if (marker)
           *marker = ret.marker;
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         r = -EIO;
       }
     }
@@ -108,7 +114,7 @@ public:
         decode(ret, iter);
         if (header)
          *header = ret.header;
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         r = -EIO;
       }
       if (ret_ctx) {
@@ -148,7 +154,7 @@ int cls_user_get_header_async(IoCtx& io_ctx, string& oid, RGWGetUserHeader_CB *c
   encode(call, in);
   ObjectReadOperation op;
   op.exec("user", "get_header", in, new ClsUserGetHeaderCtx(NULL, ctx, NULL)); /* no need to pass pret, as we'll call ctx->handle_response() with correct error */
-  AioCompletion *c = librados::Rados::aio_create_completion(nullptr, nullptr);
+  auto c = librados::Rados::aio_create_completion(nullptr, nullptr);
   int r = io_ctx.aio_operate(oid, c, &op, NULL);
   c->release();
   if (r < 0)
index 077c15dced7702b0c867a8dc1f8ad65ffcc6c722..03d975c59cb5107202d53e3ca5978b739307bf6a 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #ifndef CEPH_CLS_USER_CLIENT_H
@@ -18,19 +18,19 @@ public:
  * user objclass
  */
 
-void cls_user_set_buckets(librados::ObjectWriteOperation& op, list<cls_user_bucket_entry>& entries, bool add);
+void cls_user_set_buckets(librados::ObjectWriteOperation& op, std::list<cls_user_bucket_entry>& entries, bool add);
 void cls_user_complete_stats_sync(librados::ObjectWriteOperation& op);
 void cls_user_remove_bucket(librados::ObjectWriteOperation& op,  const cls_user_bucket& bucket);
 void cls_user_bucket_list(librados::ObjectReadOperation& op,
-                       const string& in_marker,
-                       const string& end_marker,
-                       int max_entries,
-                       list<cls_user_bucket_entry>& entries,
-                       string *out_marker,
-                       bool *truncated,
-                       int *pret);
+                         const std::string& in_marker,
+                         const std::string& end_marker,
+                         int max_entries,
+                         std::list<cls_user_bucket_entry>& entries,
+                         std::string *out_marker,
+                         bool *truncated,
+                         int *pret);
 void cls_user_get_header(librados::ObjectReadOperation& op, cls_user_header *header, int *pret);
-int cls_user_get_header_async(librados::IoCtx& io_ctx, string& oid, RGWGetUserHeader_CB *ctx);
+int cls_user_get_header_async(librados::IoCtx& io_ctx, std::string& oid, RGWGetUserHeader_CB *ctx);
 void cls_user_reset_stats(librados::ObjectWriteOperation& op);
 
 #endif
index 65d889bbc5c28093eb90f6da845d3a7303575714..5ae9d2c93b82063fed652843a7be3e914fb37fb9 100644 (file)
@@ -1,10 +1,14 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include "cls/user/cls_user_ops.h"
 #include "common/Formatter.h"
 #include "common/ceph_json.h"
 
+using std::list;
+
+using ceph::Formatter;
+
 void cls_user_set_buckets_op::dump(Formatter *f) const
 {
   encode_json("entries", entries, f);
index fa4b1f31b67b848d2e100aad25f32b9de28c2df8..8b957a79f93d573362c7214ebbbdf17a138c1dd6 100644 (file)
@@ -7,13 +7,13 @@
 #include "cls_user_types.h"
 
 struct cls_user_set_buckets_op {
-  list<cls_user_bucket_entry> entries;
+  std::list<cls_user_bucket_entry> entries;
   bool add;
-  real_time time; /* op time */
+  ceph::real_time time; /* op time */
 
   cls_user_set_buckets_op() : add(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entries, bl);
     encode(add, bl);
@@ -21,7 +21,7 @@ struct cls_user_set_buckets_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     decode(add, bl);
@@ -29,8 +29,8 @@ struct cls_user_set_buckets_op {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_set_buckets_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_set_buckets_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_set_buckets_op)
 
@@ -39,33 +39,33 @@ struct cls_user_remove_bucket_op {
 
   cls_user_remove_bucket_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(bucket, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(bucket, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_remove_bucket_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_remove_bucket_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_remove_bucket_op)
 
 struct cls_user_list_buckets_op {
-  string marker;
-  string end_marker;
+  std::string marker;
+  std::string end_marker;
   int max_entries; /* upperbound to returned num of entries
                       might return less than that and still be truncated */
 
   cls_user_list_buckets_op()
     : max_entries(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(2, 1, bl);
     encode(marker, bl);
     encode(max_entries, bl);
@@ -73,7 +73,7 @@ struct cls_user_list_buckets_op {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(2, bl);
     decode(marker, bl);
     decode(max_entries, bl);
@@ -83,19 +83,19 @@ struct cls_user_list_buckets_op {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_list_buckets_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_list_buckets_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_list_buckets_op)
 
 struct cls_user_list_buckets_ret {
-  list<cls_user_bucket_entry> entries;
-  string marker;
+  std::list<cls_user_bucket_entry> entries;
+  std::string marker;
   bool truncated;
 
   cls_user_list_buckets_ret() : truncated(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(entries, bl);
     encode(marker, bl);
@@ -103,7 +103,7 @@ struct cls_user_list_buckets_ret {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(entries, bl);
     decode(marker, bl);
@@ -111,8 +111,8 @@ struct cls_user_list_buckets_ret {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_list_buckets_ret*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_list_buckets_ret*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_list_buckets_ret)
 
@@ -120,39 +120,39 @@ WRITE_CLASS_ENCODER(cls_user_list_buckets_ret)
 struct cls_user_get_header_op {
   cls_user_get_header_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_get_header_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_get_header_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_get_header_op)
 
 struct cls_user_reset_stats_op {
-  real_time time;
+  ceph::real_time time;
   cls_user_reset_stats_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(time, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(time, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_reset_stats_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_reset_stats_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_reset_stats_op);
 
@@ -161,42 +161,42 @@ struct cls_user_get_header_ret {
 
   cls_user_get_header_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(header, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(header, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_get_header_ret*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_get_header_ret*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_get_header_ret)
 
 struct cls_user_complete_stats_sync_op {
-  real_time time;
+  ceph::real_time time;
 
   cls_user_complete_stats_sync_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(time, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(time, bl);
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_complete_stats_sync_op*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_complete_stats_sync_op*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_complete_stats_sync_op)
 
index be3280ca2bd9116bb877d90bb7b041e91b3ce3fb..0d823f0bea20f5a8011c892db9254ee881e85a07 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #include "cls/user/cls_user_types.h"
@@ -6,6 +6,13 @@
 #include "common/ceph_json.h"
 #include "include/utime.h"
 
+using std::list;
+using std::string;
+
+using ceph::Formatter;
+using ceph::bufferlist;
+using ceph::real_clock;
+
 void cls_user_gen_test_bucket(cls_user_bucket *bucket, int i)
 {
   char buf[16];
index 8efd8bc5f6fe1cf8cf058401f68985212f31c759..a139449d3c3ea44be3e350e4e321dee1e65af3ef 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
 #ifndef CEPH_CLS_USER_TYPES_H
@@ -23,7 +23,7 @@ struct cls_user_bucket {
     std::string data_extra_pool;
   } explicit_placement;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     /* since new version of this structure is not backward compatible,
      * we have older rgw running against newer osd if we encode it
      * in the new way. Only encode newer version if placement_id is
@@ -47,7 +47,7 @@ struct cls_user_bucket {
       ENCODE_FINISH(bl);
     }
   }
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(8, 3, 3, bl);
     decode(name, bl);
     if (struct_v < 8) {
@@ -89,8 +89,8 @@ struct cls_user_bucket {
     return name.compare(b.name) < 0;
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_bucket*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_bucket*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_bucket)
 
@@ -107,11 +107,11 @@ struct cls_user_bucket_entry {
 
   cls_user_bucket_entry() : size(0), size_rounded(0), count(0), user_stats_sync(false) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(9, 5, bl);
     uint64_t s = size;
     __u32 mt = ceph::real_clock::to_time_t(creation_time);
-    string empty_str;  // originally had the bucket name here, but we encode bucket later
+    std::string empty_str;  // originally had the bucket name here, but we encode bucket later
     encode(empty_str, bl);
     encode(s, bl);
     encode(mt, bl);
@@ -124,11 +124,11 @@ struct cls_user_bucket_entry {
     //::encode(placement_rule, bl); removed in v9
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START_LEGACY_COMPAT_LEN(9, 5, 5, bl);
     __u32 mt;
     uint64_t s;
-    string empty_str;  // backward compatibility
+    std::string empty_str;  // backward compatibility
     decode(empty_str, bl);
     decode(s, bl);
     decode(mt, bl);
@@ -153,8 +153,8 @@ struct cls_user_bucket_entry {
     }
     DECODE_FINISH(bl);
   }
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_bucket_entry*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_bucket_entry*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_bucket_entry)
 
@@ -168,14 +168,14 @@ struct cls_user_stats {
       total_bytes(0),
       total_bytes_rounded(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
      ENCODE_START(1, 1, bl);
     encode(total_entries, bl);
     encode(total_bytes, bl);
     encode(total_bytes_rounded, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(total_entries, bl);
     decode(total_bytes, bl);
@@ -183,8 +183,8 @@ struct cls_user_stats {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_stats*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_stats*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_stats)
 
@@ -196,14 +196,14 @@ struct cls_user_header {
   ceph::real_time last_stats_sync;     /* last time a full stats sync completed */
   ceph::real_time last_stats_update;   /* last time a stats update was done */
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
      ENCODE_START(1, 1, bl);
     encode(stats, bl);
     encode(last_stats_sync, bl);
     encode(last_stats_update, bl);
     ENCODE_FINISH(bl);
   }
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(stats, bl);
     decode(last_stats_sync, bl);
@@ -211,8 +211,8 @@ struct cls_user_header {
     DECODE_FINISH(bl);
   }
 
-  void dump(Formatter *f) const;
-  static void generate_test_instances(list<cls_user_header*>& ls);
+  void dump(ceph::Formatter *f) const;
+  static void generate_test_instances(std::list<cls_user_header*>& ls);
 };
 WRITE_CLASS_ENCODER(cls_user_header)
 
@@ -222,5 +222,3 @@ void cls_user_gen_test_stats(cls_user_stats *stats);
 void cls_user_gen_test_header(cls_user_header *h);
 
 #endif
-
-
index 61f9fec022b06d4f4a5ef45ad295a46521ebe8ae..2e8ec91edd3ae57b2c5c54b6a580deea92dc34ea 100644 (file)
@@ -9,6 +9,10 @@
 
 #include "include/compat.h"
 
+using std::list;
+
+using ceph::bufferlist;
+
 CLS_VER(1,0)
 CLS_NAME(version)
 
@@ -66,7 +70,7 @@ static int read_version(cls_method_context_t hctx, obj_version *objv, bool impli
   try {
     auto iter = bl.cbegin();
     decode(*objv, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(0, "ERROR: read_version(): failed to decode version entry\n");
     return -EIO;
   }
@@ -82,7 +86,7 @@ static int cls_version_set(cls_method_context_t hctx, bufferlist *in, bufferlist
   cls_version_set_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_version_get(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -148,7 +152,7 @@ static int cls_version_inc(cls_method_context_t hctx, bufferlist *in, bufferlist
   cls_version_inc_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_version_get(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -177,7 +181,7 @@ static int cls_version_check(cls_method_context_t hctx, bufferlist *in, bufferli
   cls_version_check_op op;
   try {
     decode(op, in_iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_version_get(): failed to decode entry\n");
     return -EINVAL;
   }
@@ -186,7 +190,7 @@ static int cls_version_check(cls_method_context_t hctx, bufferlist *in, bufferli
   int ret = read_version(hctx, &objv, false);
   if (ret < 0)
     return ret;
-  
+
   if (!check_conds(op.conds, objv)) {
     CLS_LOG(20, "cls_version: failed condition check");
     return -ECANCELED;
index 3c1792aaa8a578e558f91d5ef0c3d293f15af2c4..769a7b77b6357ca8f2cd957232b9cc70d7d9c44e 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #include <errno.h>
 
 #include "cls/version/cls_version_client.h"
@@ -29,7 +32,7 @@ void cls_version_inc(librados::ObjectWriteOperation& op, obj_version& objv, Vers
   bufferlist in;
   cls_version_inc_op call;
   call.objv = objv;
-  
+
   obj_version_cond c;
   c.cond = cond;
   c.ver = objv;
@@ -67,7 +70,7 @@ public:
         auto iter = outbl.cbegin();
         decode(ret, iter);
        *objv = ret.objv;
-      } catch (buffer::error& err) {
+      } catch (ceph::buffer::error& err) {
         // nothing we can do about it atm
       }
     }
@@ -80,7 +83,7 @@ void cls_version_read(librados::ObjectReadOperation& op, obj_version *objv)
   op.exec("version", "read", inbl, new VersionReadCtx(objv));
 }
 
-int cls_version_read(librados::IoCtx& io_ctx, string& oid, obj_version *ver)
+int cls_version_read(librados::IoCtx& io_ctx, std::string& oid, obj_version *ver)
 {
   bufferlist in, out;
   int r = io_ctx.exec(oid, "version", "read", in, out);
@@ -91,7 +94,7 @@ int cls_version_read(librados::IoCtx& io_ctx, string& oid, obj_version *ver)
   try {
     auto iter = out.cbegin();
     decode(ret, iter);
-  } catch (buffer::error& err) {
+  } catch (ceph::buffer::error& err) {
     return -EIO;
   }
 
index 5dc039bcbe1e57f49ccb180f5fb58d515082d30e..19457855a02d6435f335249fefcc2ac944323fe5 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_VERSION_CLIENT_H
 #define CEPH_CLS_VERSION_CLIENT_H
 
@@ -21,7 +24,7 @@ void cls_version_read(librados::ObjectReadOperation& op, obj_version *objv);
 // these overloads which call io_ctx.operate() or io_ctx.exec() should not be called in the rgw.
 // rgw_rados_operate() should be called after the overloads w/o calls to io_ctx.operate()/exec()
 #ifndef CLS_CLIENT_HIDE_IOCTX
-int cls_version_read(librados::IoCtx& io_ctx, string& oid, obj_version *ver);
+int cls_version_read(librados::IoCtx& io_ctx, std::string& oid, obj_version *ver);
 #endif
 
 void cls_version_check(librados::ObjectOperation& op, obj_version& ver, VersionCond cond);
index 36592fa6ad001c6e3b67768dec34861881a5f96d..62cd1172982a6f8e69dda092e59cd653a84a7a77 100644 (file)
@@ -11,13 +11,13 @@ struct cls_version_set_op {
 
   cls_version_set_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(objv, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(objv, bl);
     DECODE_FINISH(bl);
@@ -27,18 +27,18 @@ WRITE_CLASS_ENCODER(cls_version_set_op)
 
 struct cls_version_inc_op {
   obj_version objv;
-  list<obj_version_cond> conds;
+  std::list<obj_version_cond> conds;
 
   cls_version_inc_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(objv, bl);
     encode(conds, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(objv, bl);
     decode(conds, bl);
@@ -49,18 +49,18 @@ WRITE_CLASS_ENCODER(cls_version_inc_op)
 
 struct cls_version_check_op {
   obj_version objv;
-  list<obj_version_cond> conds;
+  std::list<obj_version_cond> conds;
 
   cls_version_check_op() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(objv, bl);
     encode(conds, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(objv, bl);
     decode(conds, bl);
@@ -74,13 +74,13 @@ struct cls_version_read_ret {
 
   cls_version_read_ret() {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(objv, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(objv, bl);
     DECODE_FINISH(bl);
index 4ec678675d88138eb58e15be76e8448031b2697b..b82f6aa8a5dd9871dd679ffa4e4330ebe84ec8ca 100644 (file)
@@ -1,10 +1,12 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
 
 #include "cls/version/cls_version_types.h"
 #include "common/Formatter.h"
 #include "common/ceph_json.h"
 
 
-void obj_version::dump(Formatter *f) const
+void obj_version::dump(ceph::Formatter *f) const
 {
   f->dump_int("ver", ver);
   f->dump_string("tag", tag);
@@ -15,4 +17,3 @@ void obj_version::decode_json(JSONObj *obj)
   JSONDecoder::decode_json("ver", ver, obj);
   JSONDecoder::decode_json("tag", tag, obj);
 }
-
index ffcb73fa1154405ff7fd2994fd443af492af5a2d..62cc16e33d520b486f3c4748ac9fb6da09d35d68 100644 (file)
@@ -1,3 +1,6 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
 #ifndef CEPH_CLS_VERSION_TYPES_H
 #define CEPH_CLS_VERSION_TYPES_H
 
@@ -9,18 +12,18 @@ class JSONObj;
 
 struct obj_version {
   uint64_t ver;
-  string tag;
+  std::string tag;
 
   obj_version() : ver(0) {}
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(ver, bl);
     encode(tag, bl);
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(ver, bl);
     decode(tag, bl);
@@ -50,9 +53,9 @@ struct obj_version {
             tag.compare(v.tag) == 0);
   }
 
-  void dump(Formatter *f) const;
+  void dump(ceph::Formatter *f) const;
   void decode_json(JSONObj *obj);
-  static void generate_test_instances(list<obj_version*>& o);
+  static void generate_test_instances(std::list<obj_version*>& o);
 };
 WRITE_CLASS_ENCODER(obj_version)
 
@@ -71,7 +74,7 @@ struct obj_version_cond {
   struct obj_version ver;
   VersionCond cond;
 
-  void encode(bufferlist& bl) const {
+  void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode(ver, bl);
     uint32_t c = (uint32_t)cond;
@@ -79,7 +82,7 @@ struct obj_version_cond {
     ENCODE_FINISH(bl);
   }
 
-  void decode(bufferlist::const_iterator& bl) {
+  void decode(ceph::buffer::list::const_iterator& bl) {
     DECODE_START(1, bl);
     decode(ver, bl);
     uint32_t c;