]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fixes following rebase
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 14 Feb 2018 23:18:03 +0000 (15:18 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 9 Apr 2018 14:02:17 +0000 (07:02 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/cls/otp/cls_otp.cc
src/cls/otp/cls_otp_client.cc
src/cls/otp/cls_otp_ops.h
src/cls/otp/cls_otp_types.h
src/rgw/rgw_op.cc
src/rgw/rgw_otp.cc

index d2380828a907f6b86abe4d1b0365d1b37024c86d..76e25522b8ba1dc6a6c8e25f924837349271e6a6 100644 (file)
@@ -45,12 +45,12 @@ struct otp_header {
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(ids, bl);
+    encode(ids, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(ids, bl);
+    decode(ids, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -66,16 +66,16 @@ struct otp_instance {
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(otp, bl);
-    ::encode(last_checks, bl);
-    ::encode(last_success, bl);
+    encode(otp, bl);
+    encode(last_checks, bl);
+    encode(last_success, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(otp, bl);
-    ::decode(last_checks, bl);
-    ::decode(last_success, bl);
+    decode(otp, bl);
+    decode(last_checks, bl);
+    decode(last_success, bl);
     DECODE_FINISH(bl);
   }
 
@@ -176,7 +176,7 @@ static int get_otp_instance(cls_method_context_t hctx, const string& id, otp_ins
 
   try {
     bufferlist::iterator it = bl.begin();
-    ::decode(*instance, it);
+    decode(*instance, it);
   } catch (const buffer::error &err) {
     CLS_ERR("ERROR: failed to decode %s", key.c_str());
     return -EIO;
@@ -190,7 +190,7 @@ static int write_otp_instance(cls_method_context_t hctx, const otp_instance& ins
   string key = otp_key_prefix + instance.otp.id;
 
   bufferlist bl;
-  ::encode(instance, bl);
+  encode(instance, bl);
 
   int r = cls_cxx_map_set_val(hctx, key, &bl);
   if (r < 0) {
@@ -217,7 +217,7 @@ static int remove_otp_instance(cls_method_context_t hctx, const string& id)
 static int read_header(cls_method_context_t hctx, otp_header *h)
 {
   bufferlist bl;
-  ::encode(h, bl);
+  encode(h, bl);
   int r = cls_cxx_map_get_val(hctx, otp_header_key, &bl);
   if (r == -ENOENT || r == -ENODATA) {
     *h = otp_header();
@@ -235,7 +235,7 @@ static int read_header(cls_method_context_t hctx, otp_header *h)
 
   auto iter = bl.begin();
   try {
-    ::decode(*h, iter);
+    decode(*h, iter);
   } catch (buffer::error& err) {
     CLS_ERR("failed to decode otp_header");
     return -EIO;
@@ -247,7 +247,7 @@ static int read_header(cls_method_context_t hctx, otp_header *h)
 static int write_header(cls_method_context_t hctx, const otp_header& h)
 {
   bufferlist bl;
-  ::encode(h, bl);
+  encode(h, bl);
 
   int r = cls_cxx_map_set_val(hctx, otp_header_key, &bl);
   if (r < 0) {
@@ -298,7 +298,7 @@ static int otp_set_op(cls_method_context_t hctx,
   cls_otp_set_otp_op op;
   try {
     auto iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -347,7 +347,7 @@ static int otp_remove_op(cls_method_context_t hctx,
   cls_otp_remove_otp_op op;
   try {
     auto iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -393,7 +393,7 @@ static int otp_get_op(cls_method_context_t hctx,
   cls_otp_get_otp_op op;
   try {
     auto iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -432,7 +432,7 @@ static int otp_get_op(cls_method_context_t hctx,
     result.found_entries.push_back(instance.otp);
   }
 
-  ::encode(result, *out);
+  encode(result, *out);
 
   return 0;
 }
@@ -444,7 +444,7 @@ static int otp_check_op(cls_method_context_t hctx,
   cls_otp_check_otp_op op;
   try {
     auto iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -480,7 +480,7 @@ static int otp_get_result(cls_method_context_t hctx,
   cls_otp_check_otp_op op;
   try {
     auto iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -498,7 +498,7 @@ static int otp_get_result(cls_method_context_t hctx,
 
   cls_otp_get_result_reply reply;
   instance.find(op.token, &reply.result);
-  ::encode(reply, *out);
+  encode(reply, *out);
 
   return 0;
 }
@@ -510,7 +510,7 @@ static int otp_get_current_time_op(cls_method_context_t hctx,
   cls_otp_get_current_time_op op;
   try {
     auto iter = in->begin();
-    ::decode(op, iter);
+    decode(op, iter);
   } catch (const buffer::error &err) {
     CLS_ERR("ERROR: %s(): failed to decode request", __func__);
     return -EINVAL;
@@ -518,7 +518,7 @@ static int otp_get_current_time_op(cls_method_context_t hctx,
 
   cls_otp_get_current_time_reply reply;
   reply.time = real_clock::now();
-  ::encode(reply, *out);
+  encode(reply, *out);
 
   return 0;
 }
index 126e46d5eeb25ff308f7d3fbd0f66bc41322a391..31f18a4991c83b29061d4c1ab5bd86f3563a04c0 100644 (file)
@@ -33,7 +33,7 @@ namespace rados {
         cls_otp_set_otp_op op;
         op.entries.push_back(config);
         bufferlist in;
-        ::encode(op, in);
+        encode(op, in);
         rados_op->exec("otp", "otp_set", in);
       }
 
@@ -42,7 +42,7 @@ namespace rados {
         cls_otp_set_otp_op op;
         op.entries = entries;
         bufferlist in;
-        ::encode(op, in);
+        encode(op, in);
         rados_op->exec("otp", "otp_set", in);
       }
 
@@ -51,7 +51,7 @@ namespace rados {
         cls_otp_remove_otp_op op;
         op.ids.push_back(id);
         bufferlist in;
-        ::encode(op, in);
+        encode(op, in);
         rados_op->exec("otp", "otp_remove", in);
       }
 
@@ -67,7 +67,7 @@ namespace rados {
         
         bufferlist in;
         bufferlist out;
-        ::encode(op, in);
+        encode(op, in);
         int r = ioctx.exec(oid, "otp", "otp_check", in, out);
         if (r < 0) {
           return r;
@@ -77,7 +77,7 @@ namespace rados {
         op2.token = buf;
         bufferlist in2;
         bufferlist out2;
-        ::encode(op2, in2);
+        encode(op2, in2);
         r = ioctx.exec(oid, "otp", "otp_get_result", in, out);
         if (r < 0) {
           return r;
@@ -86,7 +86,7 @@ namespace rados {
         auto iter = out.begin();
         cls_otp_get_result_reply ret;
         try {
-          ::decode(ret, iter);
+          decode(ret, iter);
         } catch (buffer::error& err) {
          return -EBADMSG;
         }
@@ -111,7 +111,7 @@ namespace rados {
         bufferlist in;
         bufferlist out;
         int op_ret;
-        ::encode(op, in);
+        encode(op, in);
         rop->exec("otp", "otp_get", in, &out, &op_ret);
         int r = ioctx.operate(oid, rop, nullptr);
         if (r < 0) {
@@ -124,7 +124,7 @@ namespace rados {
         cls_otp_get_otp_reply ret;
         auto iter = out.begin();
         try {
-          ::decode(ret, iter);
+          decode(ret, iter);
         } catch (buffer::error& err) {
          return -EBADMSG;
         }
@@ -163,7 +163,7 @@ namespace rados {
         bufferlist in;
         bufferlist out;
         int op_ret;
-        ::encode(op, in);
+        encode(op, in);
         ObjectReadOperation rop;
         rop.exec("otp", "get_current_time", in, &out, &op_ret);
         int r = ioctx.operate(oid, &rop, nullptr);
@@ -177,7 +177,7 @@ namespace rados {
         cls_otp_get_current_time_reply ret;
         auto iter = out.begin();
         try {
-          ::decode(ret, iter);
+          decode(ret, iter);
         } catch (buffer::error& err) {
          return -EBADMSG;
         }
index 2ec1897569a53b14b464e659963b5aa481262f12..b5c931a48bcf780a9ec3cdccd6ef39d66af483df 100644 (file)
@@ -11,12 +11,12 @@ struct cls_otp_set_otp_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(entries, bl);
+    encode(entries, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(entries, bl);
+    decode(entries, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -30,16 +30,16 @@ struct cls_otp_check_otp_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(id, bl);
-    ::encode(val, bl);
-    ::encode(token, bl);
+    encode(id, bl);
+    encode(val, bl);
+    encode(token, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(id, bl);
-    ::decode(val, bl);
-    ::decode(token, bl);
+    decode(id, bl);
+    decode(val, bl);
+    decode(token, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -51,12 +51,12 @@ struct cls_otp_get_result_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(token, bl);
+    encode(token, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(token, bl);
+    decode(token, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -68,12 +68,12 @@ struct cls_otp_get_result_reply
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(result, bl);
+    encode(result, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(result, bl);
+    decode(result, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -85,12 +85,12 @@ struct cls_otp_remove_otp_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(ids, bl);
+    encode(ids, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(ids, bl);
+    decode(ids, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -103,14 +103,14 @@ struct cls_otp_get_otp_op
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(get_all, bl);
-    ::encode(ids, bl);
+    encode(get_all, bl);
+    encode(ids, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(get_all, bl);
-    ::decode(ids, bl);
+    decode(get_all, bl);
+    decode(ids, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -122,12 +122,12 @@ struct cls_otp_get_otp_reply
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(found_entries, bl);
+    encode(found_entries, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(found_entries, bl);
+    decode(found_entries, bl);
     DECODE_FINISH(bl);
   }
 };
@@ -152,12 +152,12 @@ struct cls_otp_get_current_time_reply
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(time, bl);
+    encode(time, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
-    ::decode(time, bl);
+    decode(time, bl);
     DECODE_FINISH(bl);
   }
 };
index 24f1f20948d154881440602c2695132a8565ce0e..cc752d3e7fed9cbd3bfb862c4e00de1d4b2319cb 100644 (file)
@@ -41,32 +41,32 @@ namespace rados {
 
         void encode(bufferlist &bl) const {
           ENCODE_START(1, 1, bl);
-          ::encode((uint8_t)type, bl);
+          encode((uint8_t)type, bl);
           /* if we ever implement anything other than TOTP
            * then we'll need to branch here */
-          ::encode(id, bl);
-          ::encode(seed, bl);
-          ::encode((uint8_t)seed_type, bl);
-          ::encode(seed_bin, bl);
-          ::encode(time_ofs, bl);
-          ::encode(step_size, bl);
-          ::encode(window, bl);
+          encode(id, bl);
+          encode(seed, bl);
+          encode((uint8_t)seed_type, bl);
+          encode(seed_bin, bl);
+          encode(time_ofs, bl);
+          encode(step_size, bl);
+          encode(window, bl);
           ENCODE_FINISH(bl);
         }
         void decode(bufferlist::iterator &bl) {
           DECODE_START(1, bl);
           uint8_t t;
-          ::decode(t, bl);
+          decode(t, bl);
           type = (OTPType)t;
-          ::decode(id, bl);
-          ::decode(seed, bl);
+          decode(id, bl);
+          decode(seed, bl);
           uint8_t st;
-          ::decode(st, bl);
+          decode(st, bl);
           seed_type = (SeedType)st;
-          ::decode(seed_bin, bl);
-          ::decode(time_ofs, bl);
-          ::decode(step_size, bl);
-          ::decode(window, bl);
+          decode(seed_bin, bl);
+          decode(time_ofs, bl);
+          decode(step_size, bl);
+          decode(window, bl);
           DECODE_FINISH(bl);
         }
         void dump(Formatter *f) const;
@@ -87,17 +87,17 @@ namespace rados {
 
         void encode(bufferlist &bl) const {
           ENCODE_START(1, 1, bl);
-          ::encode(token, bl);
-          ::encode(timestamp, bl);
-          ::encode((char)result, bl);
+          encode(token, bl);
+          encode(timestamp, bl);
+          encode((char)result, bl);
           ENCODE_FINISH(bl);
         }
         void decode(bufferlist::iterator &bl) {
           DECODE_START(1, bl);
-          ::decode(token, bl);
-          ::decode(timestamp, bl);
+          decode(token, bl);
+          decode(timestamp, bl);
           uint8_t t;
-          ::decode(t, bl);
+          decode(t, bl);
           result = (OTPCheckResult)t;
           DECODE_FINISH(bl);
         }
@@ -111,12 +111,12 @@ namespace rados {
 
         void encode(bufferlist &bl) const {
           ENCODE_START(1, 1, bl);
-          ::encode(entries, bl);
+          encode(entries, bl);
           ENCODE_FINISH(bl);
         }
         void decode(bufferlist::iterator &bl) {
           DECODE_START(1, bl);
-          ::decode(entries, bl);
+          decode(entries, bl);
           DECODE_FINISH(bl);
         }
       };
index 8193d77b14e323cffcfaf2a9d0808f64bed97472..12eb7116d0d88443b708ca40e748a15beef42595 100644 (file)
@@ -2187,7 +2187,7 @@ void RGWSetBucketVersioning::execute()
 
   bool modified = mfa_set_status;
 
-  op_ret = retry_raced_bucket_write(store, s, [this] {
+  op_ret = retry_raced_bucket_write(store, s, [&] {
       if (mfa_set_status) {
         if (mfa_status) {
           s->bucket_info.flags |= BUCKET_MFA_ENABLED;
index 263293ffea457a6c7c6af0d845a3e00d6ecbc183..73f10af71fc9ec260edc244720a8605fecac8420 100644 (file)
@@ -10,7 +10,6 @@
 #include "common/errno.h"
 #include "common/Formatter.h"
 #include "common/ceph_json.h"
-#include "common/backport14.h"
 #include "rgw_rados.h"
 
 #include "include/types.h"
@@ -96,7 +95,7 @@ public:
 
   int list_keys_init(RGWRados *store, const string& marker, void **phandle) override
   {
-    auto info = ceph::make_unique<list_keys_info>();
+    auto info = std::make_unique<list_keys_info>();
 
     info->store = store;