From: Adam C. Emerson Date: Sat, 23 Dec 2017 04:48:20 +0000 (-0500) Subject: key_value_store: Use unqualified encode/decode X-Git-Tag: v13.0.2~540^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4caccb334108fa91a93742046005ae7e642f5e2c;p=ceph.git key_value_store: Use unqualified encode/decode This is a portion of the namespace project. Signed-off-by: Adam C. Emerson --- diff --git a/src/key_value_store/cls_kvs.cc b/src/key_value_store/cls_kvs.cc index 183c8d6f9468..42613a1041a1 100644 --- a/src/key_value_store/cls_kvs.cc +++ b/src/key_value_store/cls_kvs.cc @@ -72,7 +72,7 @@ static int get_idata_from_key_op(cls_method_context_t hctx, idata_from_key_args op; bufferlist::iterator it = in->begin(); try { - ::decode(op, it); + decode(op, it); } catch (buffer::error& err) { CLS_LOG(20, "error decoding idata_from_key_args."); return -EINVAL; @@ -81,7 +81,7 @@ static int get_idata_from_key_op(cls_method_context_t hctx, if (r < 0) { return r; } else { - ::encode(op, *out); + encode(op, *out); return 0; } } @@ -125,7 +125,7 @@ static int get_next_idata_op(cls_method_context_t hctx, idata_from_idata_args op; bufferlist::iterator it = in->begin(); try { - ::decode(op, it); + decode(op, it); } catch (buffer::error& err) { return -EINVAL; } @@ -187,7 +187,7 @@ static int get_prev_idata_op(cls_method_context_t hctx, idata_from_idata_args op; bufferlist::iterator it = in->begin(); try { - ::decode(op, it); + decode(op, it); } catch (buffer::error& err) { return -EINVAL; } @@ -231,7 +231,7 @@ static int read_many_op(cls_method_context_t hctx, bufferlist *in, map outmap; bufferlist::iterator it = in->begin(); try { - ::decode(op, it); + decode(op, it); } catch (buffer::error & err) { return -EINVAL; } @@ -318,7 +318,7 @@ static int assert_size_in_bound_op(cls_method_context_t hctx, assert_size_args op; bufferlist::iterator it = in->begin(); try { - ::decode(op, it); + decode(op, it); } catch (buffer::error& err) { return -EINVAL; } @@ -414,7 +414,7 @@ static int omap_insert_op(cls_method_context_t hctx, omap_set_args op; bufferlist::iterator it = in->begin(); try { - ::decode(op, it); + decode(op, it); } catch (buffer::error& err) { return -EINVAL; } @@ -468,7 +468,7 @@ static int create_with_omap_op(cls_method_context_t hctx, map omap; bufferlist::iterator it = in->begin(); try { - ::decode(omap, it); + decode(omap, it); } catch (buffer::error& err) { return -EINVAL; } @@ -559,7 +559,7 @@ static int omap_remove_op(cls_method_context_t hctx, omap_rm_args op; bufferlist::iterator it = in->begin(); try { - ::decode(op, it); + decode(op, it); } catch (buffer::error& err) { return -EINVAL; } @@ -623,7 +623,7 @@ static int maybe_read_for_balance_op(cls_method_context_t hctx, rebalance_args op; bufferlist::iterator it = in->begin(); try { - ::decode(op, it); + decode(op, it); } catch (buffer::error& err) { return -EINVAL; } diff --git a/src/key_value_store/kv_flat_btree_async.cc b/src/key_value_store/kv_flat_btree_async.cc index 25dc5c1f6b7e..34839aa20b97 100644 --- a/src/key_value_store/kv_flat_btree_async.cc +++ b/src/key_value_store/kv_flat_btree_async.cc @@ -810,7 +810,7 @@ void KvFlatBtreeAsync::set_up_make_object( const map &to_set, librados::ObjectWriteOperation *owo) { bufferlist inbl; - ::encode(to_set, inbl); + encode(to_set, inbl); owo->exec("kvs", "create_with_omap", inbl); } @@ -1826,7 +1826,7 @@ int KvFlatBtreeAsync::set_many(const map &in_map) { if (verbose) cout << "created key set and big_map" << std::endl; - ::encode(keys, inbl); + encode(keys, inbl); librados::AioCompletion * aioc = rados.aio_create_completion(); io_ctx.aio_exec(index_name, aioc, "kvs", "read_many", inbl, &outbl); aioc->wait_for_safe(); @@ -1839,7 +1839,7 @@ int KvFlatBtreeAsync::set_many(const map &in_map) { map imap;//read from the index bufferlist::iterator blit = outbl.begin(); - ::decode(imap, blit); + decode(imap, blit); if (verbose) cout << "finished reading index for objects. there are " << imap.size() << " entries that need to be changed. " << std::endl; diff --git a/src/key_value_store/kv_flat_btree_async.h b/src/key_value_store/kv_flat_btree_async.h index 2b3761850e95..be356b9f120b 100644 --- a/src/key_value_store/kv_flat_btree_async.h +++ b/src/key_value_store/kv_flat_btree_async.h @@ -104,14 +104,14 @@ struct key_data { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(raw_key, bl); - ::encode(prefix, bl); + encode(raw_key, bl); + encode(prefix, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(raw_key, p); - ::decode(prefix, p); + decode(raw_key, p); + decode(prefix, p); DECODE_FINISH(p); } }; @@ -175,24 +175,24 @@ struct object_data { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(min_kdata, bl); - ::encode(max_kdata, bl); - ::encode(name, bl); - ::encode(omap, bl); - ::encode(unwritable, bl); - ::encode(version, bl); - ::encode(size, bl); + encode(min_kdata, bl); + encode(max_kdata, bl); + encode(name, bl); + encode(omap, bl); + encode(unwritable, bl); + encode(version, bl); + encode(size, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(min_kdata, p); - ::decode(max_kdata, p); - ::decode(name, p); - ::decode(omap, p); - ::decode(unwritable, p); - ::decode(version, p); - ::decode(size, p); + decode(min_kdata, p); + decode(max_kdata, p); + decode(name, p); + decode(omap, p); + decode(unwritable, p); + decode(version, p); + decode(size, p); DECODE_FINISH(p); } }; @@ -231,16 +231,16 @@ struct create_data { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(min, bl); - ::encode(max, bl); - ::encode(obj, bl); + encode(min, bl); + encode(max, bl); + encode(obj, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(min, p); - ::decode(max, p); - ::decode(obj, p); + decode(min, p); + decode(max, p); + decode(obj, p); DECODE_FINISH(p); } }; @@ -278,18 +278,18 @@ struct delete_data { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(min, bl); - ::encode(max, bl); - ::encode(obj, bl); - ::encode(version, bl); + encode(min, bl); + encode(max, bl); + encode(obj, bl); + encode(version, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(min, p); - ::decode(max, p); - ::decode(obj, p); - ::decode(version, p); + decode(min, p); + decode(max, p); + decode(obj, p); + decode(version, p); DECODE_FINISH(p); } }; @@ -354,24 +354,24 @@ struct index_data { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(prefix, bl); - ::encode(min_kdata, bl); - ::encode(kdata, bl); - ::encode(ts, bl); - ::encode(to_create, bl); - ::encode(to_delete, bl); - ::encode(obj, bl); + encode(prefix, bl); + encode(min_kdata, bl); + encode(kdata, bl); + encode(ts, bl); + encode(to_create, bl); + encode(to_delete, bl); + encode(obj, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(prefix, p); - ::decode(min_kdata, p); - ::decode(kdata, p); - ::decode(ts, p); - ::decode(to_create, p); - ::decode(to_delete, p); - ::decode(obj, p); + decode(prefix, p); + decode(min_kdata, p); + decode(kdata, p); + decode(ts, p); + decode(to_create, p); + decode(to_delete, p); + decode(obj, p); DECODE_FINISH(p); } diff --git a/src/key_value_store/kvs_arg_types.h b/src/key_value_store/kvs_arg_types.h index 98063621e38e..1306f87fed70 100644 --- a/src/key_value_store/kvs_arg_types.h +++ b/src/key_value_store/kvs_arg_types.h @@ -23,14 +23,14 @@ struct assert_size_args { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(bound, bl); - ::encode(comparator, bl); + encode(bound, bl); + encode(comparator, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(bound, p); - ::decode(comparator, p); + decode(bound, p); + decode(comparator, p); DECODE_FINISH(p); } }; @@ -43,16 +43,16 @@ struct idata_from_key_args { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(key, bl); - ::encode(idata, bl); - ::encode(next_idata, bl); + encode(key, bl); + encode(idata, bl); + encode(next_idata, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(key, p); - ::decode(idata, p); - ::decode(next_idata, p); + decode(key, p); + decode(idata, p); + decode(next_idata, p); DECODE_FINISH(p); } }; @@ -64,14 +64,14 @@ struct idata_from_idata_args { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(idata, bl); - ::encode(next_idata, bl); + encode(idata, bl); + encode(next_idata, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(idata, p); - ::decode(next_idata, p); + decode(idata, p); + decode(next_idata, p); DECODE_FINISH(p); } }; @@ -84,16 +84,16 @@ struct omap_set_args { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(omap, bl); - ::encode(bound, bl); - ::encode(exclusive, bl); + encode(omap, bl); + encode(bound, bl); + encode(exclusive, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(omap, p); - ::decode(bound, p); - ::decode(exclusive, p); + decode(omap, p); + decode(bound, p); + decode(exclusive, p); DECODE_FINISH(p); } }; @@ -105,14 +105,14 @@ struct omap_rm_args { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(omap, bl); - ::encode(bound, bl); + encode(omap, bl); + encode(bound, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(omap, p); - ::decode(bound, p); + decode(omap, p); + decode(bound, p); DECODE_FINISH(p); } }; @@ -125,16 +125,16 @@ struct rebalance_args { void encode(bufferlist &bl) const { ENCODE_START(1,1,bl); - ::encode(odata, bl); - ::encode(bound, bl); - ::encode(comparator, bl); + encode(odata, bl); + encode(bound, bl); + encode(comparator, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(odata,p); - ::decode(bound, p); - ::decode(comparator, p); + decode(odata,p); + decode(bound, p); + decode(comparator, p); DECODE_FINISH(p); } };