]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objclass: Use unqualified encode/decode
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 26 Dec 2017 06:51:12 +0000 (01:51 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 10 Jan 2018 19:02:09 +0000 (14:02 -0500)
This is a portion of Part 1 of the namespace project: using ADL
properly in encode and decode so we can use namespaces easily in Ceph.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/objclass/class_api.cc

index e480b8be0573505635483c40b924c3a7bc50f4d1..496f80d384b7d028cf45d1ea2c56baf832fae252 100644 (file)
@@ -234,8 +234,8 @@ int cls_cxx_stat(cls_method_context_t hctx, uint64_t *size, time_t *mtime)
   utime_t ut;
   uint64_t s;
   try {
-    ::decode(s, iter);
-    ::decode(ut, iter);
+    decode(s, iter);
+    decode(ut, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -259,8 +259,8 @@ int cls_cxx_stat2(cls_method_context_t hctx, uint64_t *size, ceph::real_time *mt
   real_time ut;
   uint64_t s;
   try {
-    ::decode(s, iter);
-    ::decode(ut, iter);
+    decode(s, iter);
+    decode(ut, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -370,7 +370,7 @@ int cls_cxx_getxattrs(cls_method_context_t hctx, map<string, bufferlist> *attrse
 
   bufferlist::iterator iter = op.outdata.begin();
   try {
-    ::decode(*attrset, iter);
+    decode(*attrset, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -417,9 +417,9 @@ int cls_cxx_map_get_all_vals(cls_method_context_t hctx, map<string, bufferlist>*
   string filter_prefix;
   uint64_t max = (uint64_t)-1;
 
-  ::encode(start_after, op.indata);
-  ::encode(max, op.indata);
-  ::encode(filter_prefix, op.indata);
+  encode(start_after, op.indata);
+  encode(max, op.indata);
+  encode(filter_prefix, op.indata);
 
   op.op.op = CEPH_OSD_OP_OMAPGETVALS;
   
@@ -429,8 +429,8 @@ int cls_cxx_map_get_all_vals(cls_method_context_t hctx, map<string, bufferlist>*
 
   bufferlist::iterator iter = op.outdata.begin();
   try {
-    ::decode(*vals, iter);
-    ::decode(*more, iter);
+    decode(*vals, iter);
+    decode(*more, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -446,8 +446,8 @@ int cls_cxx_map_get_keys(cls_method_context_t hctx, const string &start_obj,
   OSDOp& op = ops[0];
   int ret;
 
-  ::encode(start_obj, op.indata);
-  ::encode(max_to_get, op.indata);
+  encode(start_obj, op.indata);
+  encode(max_to_get, op.indata);
 
   op.op.op = CEPH_OSD_OP_OMAPGETKEYS;
 
@@ -457,8 +457,8 @@ int cls_cxx_map_get_keys(cls_method_context_t hctx, const string &start_obj,
 
   bufferlist::iterator iter = op.outdata.begin();
   try {
-    ::decode(*keys, iter);
-    ::decode(*more, iter);
+    decode(*keys, iter);
+    decode(*more, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -474,9 +474,9 @@ int cls_cxx_map_get_vals(cls_method_context_t hctx, const string &start_obj,
   OSDOp& op = ops[0];
   int ret;
 
-  ::encode(start_obj, op.indata);
-  ::encode(max_to_get, op.indata);
-  ::encode(filter_prefix, op.indata);
+  encode(start_obj, op.indata);
+  encode(max_to_get, op.indata);
+  encode(filter_prefix, op.indata);
 
   op.op.op = CEPH_OSD_OP_OMAPGETVALS;
   
@@ -486,8 +486,8 @@ int cls_cxx_map_get_vals(cls_method_context_t hctx, const string &start_obj,
 
   bufferlist::iterator iter = op.outdata.begin();
   try {
-    ::decode(*vals, iter);
-    ::decode(*more, iter);
+    decode(*vals, iter);
+    decode(*more, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }
@@ -520,7 +520,7 @@ int cls_cxx_map_get_val(cls_method_context_t hctx, const string &key,
 
   set<string> k;
   k.insert(key);
-  ::encode(k, op.indata);
+  encode(k, op.indata);
 
   op.op.op = CEPH_OSD_OP_OMAPGETVALSBYKEYS;
   ret = (*pctx)->pg->do_osd_ops(*pctx, ops);
@@ -531,7 +531,7 @@ int cls_cxx_map_get_val(cls_method_context_t hctx, const string &key,
   try {
     map<string, bufferlist> m;
 
-    ::decode(m, iter);
+    decode(m, iter);
     map<string, bufferlist>::iterator iter = m.begin();
     if (iter == m.end())
       return -ENOENT;
@@ -552,7 +552,7 @@ int cls_cxx_map_set_val(cls_method_context_t hctx, const string &key,
   bufferlist& update_bl = op.indata;
   map<string, bufferlist> m;
   m[key] = *inbl;
-  ::encode(m, update_bl);
+  encode(m, update_bl);
 
   op.op.op = CEPH_OSD_OP_OMAPSETVALS;
 
@@ -566,7 +566,7 @@ int cls_cxx_map_set_vals(cls_method_context_t hctx,
   vector<OSDOp> ops(1);
   OSDOp& op = ops[0];
   bufferlist& update_bl = op.indata;
-  ::encode(*map, update_bl);
+  encode(*map, update_bl);
 
   op.op.op = CEPH_OSD_OP_OMAPSETVALS;
 
@@ -605,7 +605,7 @@ int cls_cxx_map_remove_key(cls_method_context_t hctx, const string &key)
   set<string> to_rm;
   to_rm.insert(key);
 
-  ::encode(to_rm, update_bl);
+  encode(to_rm, update_bl);
 
   op.op.op = CEPH_OSD_OP_OMAPRMKEYS;
 
@@ -627,7 +627,7 @@ int cls_cxx_list_watchers(cls_method_context_t hctx,
 
   bufferlist::iterator iter = op.outdata.begin();
   try {
-    ::decode(*watchers, iter);
+    decode(*watchers, iter);
   } catch (buffer::error& err) {
     return -EIO;
   }