]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/cls/log/cls_log.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / cls / log / cls_log.cc
index c7ed1f5bfa0b0e563a50d44449e73450d28daf26..3de35484cb7c4f77ebaec01e9440456eea816fd7 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 "include/types.h"
@@ -20,7 +20,7 @@ static string log_index_prefix = "1_";
 static int write_log_entry(cls_method_context_t hctx, string& index, cls_log_entry& entry)
 {
   bufferlist bl;
-  ::encode(entry, bl);
+  encode(entry, bl);
 
   int ret = cls_cxx_map_set_val(hctx, index, &bl);
   if (ret < 0)
@@ -50,9 +50,9 @@ static int read_header(cls_method_context_t hctx, cls_log_header& header)
     return 0;
   }
 
-  bufferlist::iterator iter = header_bl.begin();
+  auto iter = header_bl.cbegin();
   try {
-    ::decode(header, iter);
+    decode(header, iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: read_header(): failed to decode header");
   }
@@ -63,7 +63,7 @@ static int read_header(cls_method_context_t hctx, cls_log_header& header)
 static int write_header(cls_method_context_t hctx, cls_log_header& header)
 {
   bufferlist header_bl;
-  ::encode(header, header_bl);
+  encode(header, header_bl);
 
   int ret = cls_cxx_map_write_header(hctx, &header_bl);
   if (ret < 0)
@@ -85,11 +85,11 @@ static void get_index(cls_method_context_t hctx, utime_t& ts, string& index)
 
 static int cls_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  bufferlist::iterator in_iter = in->begin();
+  auto in_iter = in->cbegin();
 
   cls_log_add_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_log_add_op(): failed to decode op");
     return -EINVAL;
@@ -140,11 +140,11 @@ static int cls_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist *ou
 
 static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  bufferlist::iterator in_iter = in->begin();
+  auto in_iter = in->cbegin();
 
   cls_log_list_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_log_list_op(): failed to decode op");
     return -EINVAL;
@@ -190,10 +190,10 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o
     }
 
     bufferlist& bl = iter->second;
-    bufferlist::iterator biter = bl.begin();
+    auto biter = bl.cbegin();
     try {
       cls_log_entry e;
-      ::decode(e, biter);
+      decode(e, biter);
       entries.push_back(e);
     } catch (buffer::error& err) {
       CLS_LOG(0, "ERROR: cls_log_list: could not decode entry, index=%s", index.c_str());
@@ -202,7 +202,7 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o
 
   ret.marker = marker;
 
-  ::encode(ret, *out);
+  encode(ret, *out);
 
   return 0;
 }
@@ -210,11 +210,11 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o
 
 static int cls_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  bufferlist::iterator in_iter = in->begin();
+  auto in_iter = in->cbegin();
 
   cls_log_trim_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(0, "ERROR: cls_log_list_op(): failed to decode entry");
     return -EINVAL;
@@ -273,11 +273,11 @@ static int cls_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlist *o
 
 static int cls_log_info(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  bufferlist::iterator in_iter = in->begin();
+  auto in_iter = in->cbegin();
 
   cls_log_info_op op;
   try {
-    ::decode(op, in_iter);
+    decode(op, in_iter);
   } catch (buffer::error& err) {
     CLS_LOG(1, "ERROR: cls_log_add_op(): failed to decode op");
     return -EINVAL;
@@ -289,7 +289,7 @@ static int cls_log_info(cls_method_context_t hctx, bufferlist *in, bufferlist *o
   if (rc < 0)
     return rc;
 
-  ::encode(ret, *out);
+  encode(ret, *out);
 
   return 0;
 }