From 06aa3dd961e9da686b5acdfae0b7408cc56ae885 Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Fri, 22 Dec 2017 21:52:50 -0500 Subject: [PATCH] cls: Use unqualified encode/decode This is a portion of the namespace project. Signed-off-by: Adam C. Emerson --- src/cls/cephfs/cls_cephfs.cc | 8 +- src/cls/cephfs/cls_cephfs.h | 36 +- src/cls/cephfs/cls_cephfs_client.cc | 9 +- src/cls/hello/cls_hello.cc | 4 +- src/cls/journal/cls_journal.cc | 84 ++-- src/cls/journal/cls_journal_client.cc | 74 +-- src/cls/journal/cls_journal_types.cc | 44 +- src/cls/journal/cls_journal_types.h | 3 - src/cls/lock/cls_lock.cc | 17 +- src/cls/lock/cls_lock_client.cc | 16 +- src/cls/lock/cls_lock_ops.h | 104 ++-- src/cls/lock/cls_lock_types.h | 40 +- src/cls/log/cls_log.cc | 22 +- src/cls/log/cls_log_client.cc | 14 +- src/cls/log/cls_log_ops.h | 56 +-- src/cls/log/cls_log_types.h | 30 +- src/cls/lua/cls_lua.cc | 2 +- src/cls/lua/cls_lua_client.cc | 2 +- src/cls/lua/cls_lua_ops.h | 16 +- src/cls/numops/cls_numops.cc | 8 +- src/cls/numops/cls_numops_client.cc | 8 +- src/cls/rbd/cls_rbd.cc | 450 +++++++++--------- src/cls/rbd/cls_rbd.h | 52 +- src/cls/rbd/cls_rbd_client.cc | 402 ++++++++-------- src/cls/rbd/cls_rbd_types.cc | 111 ++--- src/cls/rbd/cls_rbd_types.h | 21 +- src/cls/refcount/cls_refcount.cc | 22 +- src/cls/refcount/cls_refcount_client.cc | 10 +- src/cls/refcount/cls_refcount_ops.h | 28 +- src/cls/replica_log/cls_replica_log.cc | 12 +- src/cls/replica_log/cls_replica_log_client.cc | 8 +- src/cls/replica_log/cls_replica_log_ops.h | 20 +- src/cls/replica_log/cls_replica_log_types.h | 40 +- src/cls/rgw/cls_rgw.cc | 182 +++---- src/cls/rgw/cls_rgw_client.cc | 112 ++--- src/cls/rgw/cls_rgw_types.cc | 18 +- src/cls/statelog/cls_statelog.cc | 16 +- src/cls/statelog/cls_statelog_client.cc | 15 +- src/cls/statelog/cls_statelog_ops.h | 64 +-- src/cls/statelog/cls_statelog_types.h | 26 +- src/cls/timeindex/cls_timeindex.cc | 8 +- src/cls/timeindex/cls_timeindex_client.cc | 8 +- src/cls/timeindex/cls_timeindex_client.h | 2 +- src/cls/timeindex/cls_timeindex_ops.h | 48 +- src/cls/timeindex/cls_timeindex_types.h | 12 +- src/cls/user/cls_user.cc | 26 +- src/cls/user/cls_user_client.cc | 18 +- src/cls/version/cls_version.cc | 14 +- src/cls/version/cls_version_client.cc | 12 +- src/cls/version/cls_version_ops.h | 24 +- src/cls/version/cls_version_types.h | 18 +- src/librbd/WatchNotifyTypes.cc | 9 +- src/librbd/journal/Types.cc | 15 +- src/librbd/trash_watcher/Types.cc | 6 +- src/test/cls_rbd/test_cls_rbd.cc | 4 +- src/test/encoding/ceph_dencoder.cc | 2 + .../librbd/mirror/test_mock_DisableRequest.cc | 3 +- .../librbd/trash/test_mock_MoveRequest.cc | 2 +- .../test_mock_TrashMoveRequest.cc | 2 +- .../test_mock_CreateImageRequest.cc | 2 +- .../test_mock_PrepareLocalImageRequest.cc | 2 +- 61 files changed, 1230 insertions(+), 1213 deletions(-) diff --git a/src/cls/cephfs/cls_cephfs.cc b/src/cls/cephfs/cls_cephfs.cc index 1d656c13789..047fbd6d801 100644 --- a/src/cls/cephfs/cls_cephfs.cc +++ b/src/cls/cephfs/cls_cephfs.cc @@ -38,7 +38,7 @@ std::ostream &operator<<(std::ostream &out, const ObjCeiling &in) * If the xattr is missing, then it is set to the input integer. * * @param xattr_name: name of xattr to compare against and set - * @param input_val: candidate new value, of ::encode()'able type + * @param input_val: candidate new value, of encode()'able type * @returns 0 on success (irrespective of whether our new value * was used) else an error code */ @@ -56,7 +56,7 @@ static int set_if_greater(cls_method_context_t hctx, bufferlist::iterator existing_p = existing_val_bl.begin(); try { A existing_val; - ::decode(existing_val, existing_p); + decode(existing_val, existing_p); if (!existing_p.end()) { // Trailing junk? Consider it invalid and overwrite set_val = true; @@ -75,7 +75,7 @@ static int set_if_greater(cls_method_context_t hctx, // Conditionally set the new xattr if (set_val) { bufferlist set_bl; - ::encode(input_val, set_bl); + encode(input_val, set_bl); return cls_cxx_setxattr(hctx, xattr_name.c_str(), &set_bl); } else { return 0; @@ -169,7 +169,7 @@ bool PGLSCephFSFilter::filter(const hobject_t &obj, std::string tag_ondisk; bufferlist::iterator q = xattr_data.begin(); try { - ::decode(tag_ondisk, q); + decode(tag_ondisk, q); if (tag_ondisk == scrub_tag) return false; } catch (const buffer::error &err) { diff --git a/src/cls/cephfs/cls_cephfs.h b/src/cls/cephfs/cls_cephfs.h index ca631c66d90..dc426c1c934 100644 --- a/src/cls/cephfs/cls_cephfs.h +++ b/src/cls/cephfs/cls_cephfs.h @@ -39,16 +39,16 @@ class ObjCeiling { void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(id, bl); - ::encode(size, bl); + encode(id, bl); + encode(size, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &p) { DECODE_START(1, p); - ::decode(id, p); - ::decode(size, p); + decode(id, p); + decode(size, p); DECODE_FINISH(p); } }; @@ -86,24 +86,24 @@ public: void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(obj_xattr_name, bl); - ::encode(mtime_xattr_name, bl); - ::encode(obj_size_xattr_name, bl); - ::encode(obj_index, bl); - ::encode(obj_size, bl); - ::encode(mtime, bl); + encode(obj_xattr_name, bl); + encode(mtime_xattr_name, bl); + encode(obj_size_xattr_name, bl); + encode(obj_index, bl); + encode(obj_size, bl); + encode(mtime, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(obj_xattr_name, bl); - ::decode(mtime_xattr_name, bl); - ::decode(obj_size_xattr_name, bl); - ::decode(obj_index, bl); - ::decode(obj_size, bl); - ::decode(mtime, bl); + decode(obj_xattr_name, bl); + decode(mtime_xattr_name, bl); + decode(obj_size_xattr_name, bl); + decode(obj_index, bl); + decode(obj_size, bl); + decode(mtime, bl); DECODE_FINISH(bl); } }; @@ -116,14 +116,14 @@ class InodeTagFilterArgs void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(scrub_tag, bl); + encode(scrub_tag, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(scrub_tag, bl); + decode(scrub_tag, bl); DECODE_FINISH(bl); } }; diff --git a/src/cls/cephfs/cls_cephfs_client.cc b/src/cls/cephfs/cls_cephfs_client.cc index b039242731f..73e72f75e0d 100644 --- a/src/cls/cephfs/cls_cephfs_client.cc +++ b/src/cls/cephfs/cls_cephfs_client.cc @@ -120,7 +120,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result( // Load scan_max_size try { bufferlist::iterator scan_max_size_bl_iter = scan_max_size_bl.begin(); - ::decode(result->max_obj_size, scan_max_size_bl_iter); + decode(result->max_obj_size, scan_max_size_bl_iter); } catch (const buffer::error &err) { //dout(4) << "Invalid size attr on '" << oid << "'" << dendl; return -EINVAL; @@ -129,7 +129,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result( // Load scan_max_mtime try { bufferlist::iterator scan_max_mtime_bl_iter = scan_max_mtime_bl.begin(); - ::decode(result->max_mtime, scan_max_mtime_bl_iter); + decode(result->max_mtime, scan_max_mtime_bl_iter); } catch (const buffer::error &err) { //dout(4) << "Invalid size attr on '" << oid << "'" << dendl; return -EINVAL; @@ -150,7 +150,7 @@ int ClsCephFSClient::fetch_inode_accumulate_result( if (layout_bl.length()) { try { bufferlist::iterator q = layout_bl.begin(); - ::decode(*layout, q); + decode(*layout, q); } catch (buffer::error &e) { return -EINVAL; } @@ -166,11 +166,10 @@ void ClsCephFSClient::build_tag_filter( assert(out_bl != NULL); // Leading part of bl is un-versioned string naming the filter - ::encode(std::string("cephfs.inode_tag"), *out_bl); + encode(std::string("cephfs.inode_tag"), *out_bl); // Filter-specific part of the bl: in our case this is a versioned structure InodeTagFilterArgs args; args.scrub_tag = scrub_tag; args.encode(*out_bl); } - diff --git a/src/cls/hello/cls_hello.cc b/src/cls/hello/cls_hello.cc index 030c775bfe0..a373148d48c 100644 --- a/src/cls/hello/cls_hello.cc +++ b/src/cls/hello/cls_hello.cc @@ -254,8 +254,8 @@ class PGLSHelloFilter : public PGLSFilter { public: int init(bufferlist::iterator& params) override { try { - ::decode(xattr, params); - ::decode(val, params); + decode(xattr, params); + decode(val, params); } catch (buffer::error &e) { return -EINVAL; } diff --git a/src/cls/journal/cls_journal.cc b/src/cls/journal/cls_journal.cc index bae5b2108c0..8befbf74fc5 100644 --- a/src/cls/journal/cls_journal.cc +++ b/src/cls/journal/cls_journal.cc @@ -64,7 +64,7 @@ int read_key(cls_method_context_t hctx, const string &key, T *t, try { bufferlist::iterator iter = bl.begin(); - ::decode(*t, iter); + decode(*t, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -75,7 +75,7 @@ int read_key(cls_method_context_t hctx, const string &key, T *t, template int write_key(cls_method_context_t hctx, const string &key, const T &t) { bufferlist bl; - ::encode(t, bl); + encode(t, bl); int r = cls_cxx_map_set_val(hctx, key, &bl); if (r < 0) { @@ -123,7 +123,7 @@ int expire_tags(cls_method_context_t hctx, const std::string *skip_client_id) { cls::journal::Client client; bufferlist::iterator iter = val.second.begin(); try { - ::decode(client, iter); + decode(client, iter); } catch (const buffer::error &err) { CLS_ERR("error decoding registered client: %s", val.first.c_str()); @@ -172,7 +172,7 @@ int expire_tags(cls_method_context_t hctx, const std::string *skip_client_id) { cls::journal::Tag tag; bufferlist::iterator iter = val.second.begin(); try { - ::decode(tag, iter); + decode(tag, iter); } catch (const buffer::error &err) { CLS_ERR("error decoding tag: %s", val.first.c_str()); return -EIO; @@ -234,7 +234,7 @@ int get_client_list_range(cls_method_context_t hctx, bufferlist::iterator iter = it->second.begin(); cls::journal::Client client; - ::decode(client, iter); + decode(client, iter); clients->insert(client); } catch (const buffer::error &err) { CLS_ERR("could not decode client '%s': %s", it->first.c_str(), @@ -307,9 +307,9 @@ int journal_create(cls_method_context_t hctx, bufferlist *in, bufferlist *out) { int64_t pool_id; try { bufferlist::iterator iter = in->begin(); - ::decode(order, iter); - ::decode(splay_width, iter); - ::decode(pool_id, iter); + decode(order, iter); + decode(splay_width, iter); + decode(pool_id, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -379,7 +379,7 @@ int journal_get_order(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(order, *out); + encode(order, *out); return 0; } @@ -399,7 +399,7 @@ int journal_get_splay_width(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(splay_width, *out); + encode(splay_width, *out); return 0; } @@ -419,7 +419,7 @@ int journal_get_pool_id(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(pool_id, *out); + encode(pool_id, *out); return 0; } @@ -439,7 +439,7 @@ int journal_get_minimum_set(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(minimum_set, *out); + encode(minimum_set, *out); return 0; } @@ -455,7 +455,7 @@ int journal_set_minimum_set(cls_method_context_t hctx, bufferlist *in, uint64_t object_set; try { bufferlist::iterator iter = in->begin(); - ::decode(object_set, iter); + decode(object_set, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -510,7 +510,7 @@ int journal_get_active_set(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(active_set, *out); + encode(active_set, *out); return 0; } @@ -526,7 +526,7 @@ int journal_set_active_set(cls_method_context_t hctx, bufferlist *in, uint64_t object_set; try { bufferlist::iterator iter = in->begin(); - ::decode(object_set, iter); + decode(object_set, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -578,7 +578,7 @@ int journal_get_client(cls_method_context_t hctx, bufferlist *in, std::string id; try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); + decode(id, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -591,7 +591,7 @@ int journal_get_client(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(client, *out); + encode(client, *out); return 0; } @@ -609,8 +609,8 @@ int journal_client_register(cls_method_context_t hctx, bufferlist *in, bufferlist data; try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); - ::decode(data, iter); + decode(id, iter); + decode(data, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -659,8 +659,8 @@ int journal_client_update_data(cls_method_context_t hctx, bufferlist *in, bufferlist data; try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); - ::decode(data, iter); + decode(id, iter); + decode(data, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -696,9 +696,9 @@ int journal_client_update_state(cls_method_context_t hctx, bufferlist *in, bufferlist data; try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); + decode(id, iter); uint8_t state_raw; - ::decode(state_raw, iter); + decode(state_raw, iter); state = static_cast(state_raw); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); @@ -732,7 +732,7 @@ int journal_client_unregister(cls_method_context_t hctx, bufferlist *in, std::string id; try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); + decode(id, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -774,8 +774,8 @@ int journal_client_commit(cls_method_context_t hctx, bufferlist *in, cls::journal::ObjectSetPosition commit_position; try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); - ::decode(commit_position, iter); + decode(id, iter); + decode(commit_position, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -825,8 +825,8 @@ int journal_client_list(cls_method_context_t hctx, bufferlist *in, uint64_t max_return; try { bufferlist::iterator iter = in->begin(); - ::decode(start_after, iter); - ::decode(max_return, iter); + decode(start_after, iter); + decode(max_return, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -837,7 +837,7 @@ int journal_client_list(cls_method_context_t hctx, bufferlist *in, if (r < 0) return r; - ::encode(clients, *out); + encode(clients, *out); return 0; } @@ -856,7 +856,7 @@ int journal_get_next_tag_tid(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(tag_tid, *out); + encode(tag_tid, *out); return 0; } @@ -873,7 +873,7 @@ int journal_get_tag(cls_method_context_t hctx, bufferlist *in, uint64_t tag_tid; try { bufferlist::iterator iter = in->begin(); - ::decode(tag_tid, iter); + decode(tag_tid, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -886,7 +886,7 @@ int journal_get_tag(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(tag, *out); + encode(tag, *out); return 0; } @@ -906,9 +906,9 @@ int journal_tag_create(cls_method_context_t hctx, bufferlist *in, bufferlist data; try { bufferlist::iterator iter = in->begin(); - ::decode(tag_tid, iter); - ::decode(tag_class, iter); - ::decode(data, iter); + decode(tag_tid, iter); + decode(tag_class, iter); + decode(data, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -1000,10 +1000,10 @@ int journal_tag_list(cls_method_context_t hctx, bufferlist *in, tag_class = boost::none; try { bufferlist::iterator iter = in->begin(); - ::decode(start_after_tag_tid, iter); - ::decode(max_return, iter); - ::decode(client_id, iter); - ::decode(tag_class, iter); + decode(start_after_tag_tid, iter); + decode(max_return, iter); + decode(client_id, iter); + decode(tag_class, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; @@ -1044,7 +1044,7 @@ int journal_tag_list(cls_method_context_t hctx, bufferlist *in, cls::journal::Tag tag; bufferlist::iterator iter = val.second.begin(); try { - ::decode(tag, iter); + decode(tag, iter); } catch (const buffer::error &err) { CLS_ERR("error decoding tag: %s", val.first.c_str()); return -EIO; @@ -1082,7 +1082,7 @@ int journal_tag_list(cls_method_context_t hctx, bufferlist *in, } } while (tag_pass != TAG_PASS_DONE); - ::encode(tags, *out); + encode(tags, *out); return 0; } @@ -1098,7 +1098,7 @@ int journal_object_guard_append(cls_method_context_t hctx, bufferlist *in, uint64_t soft_max_size; try { bufferlist::iterator iter = in->begin(); - ::decode(soft_max_size, iter); + decode(soft_max_size, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode input parameters: %s", err.what()); return -EINVAL; diff --git a/src/cls/journal/cls_journal_client.cc b/src/cls/journal/cls_journal_client.cc index c4744ebeee8..a003468616e 100644 --- a/src/cls/journal/cls_journal_client.cc +++ b/src/cls/journal/cls_journal_client.cc @@ -11,6 +11,8 @@ namespace cls { namespace journal { namespace client { +using ceph::encode; +using ceph::decode; namespace { @@ -40,8 +42,8 @@ struct C_ClientList : public C_AioExec { void send(const std::string &start_after) { bufferlist inbl; - ::encode(start_after, inbl); - ::encode(JOURNAL_MAX_RETURN, inbl); + encode(start_after, inbl); + encode(JOURNAL_MAX_RETURN, inbl); librados::ObjectReadOperation op; op.exec("journal", "client_list", inbl); @@ -63,7 +65,7 @@ struct C_ClientList : public C_AioExec { try { bufferlist::iterator iter = outbl.begin(); std::set partial_clients; - ::decode(partial_clients, iter); + decode(partial_clients, iter); std::string start_after; if (!partial_clients.empty()) { @@ -119,9 +121,9 @@ struct C_ImmutableMetadata : public C_AioExec { if (r == 0) { try { bufferlist::iterator iter = outbl.begin(); - ::decode(*order, iter); - ::decode(*splay_width, iter); - ::decode(*pool_id, iter); + decode(*order, iter); + decode(*splay_width, iter); + decode(*pool_id, iter); } catch (const buffer::error &err) { r = -EBADMSG; } @@ -159,8 +161,8 @@ struct C_MutableMetadata : public C_AioExec { if (r == 0) { try { bufferlist::iterator iter = outbl.begin(); - ::decode(*minimum_set, iter); - ::decode(*active_set, iter); + decode(*minimum_set, iter); + decode(*active_set, iter); client_list->send(""); } catch (const buffer::error &err) { r = -EBADMSG; @@ -178,9 +180,9 @@ struct C_MutableMetadata : public C_AioExec { void create(librados::ObjectWriteOperation *op, uint8_t order, uint8_t splay, int64_t pool_id) { bufferlist bl; - ::encode(order, bl); - ::encode(splay, bl); - ::encode(pool_id, bl); + encode(order, bl); + encode(splay, bl); + encode(pool_id, bl); op->exec("journal", "create", bl); } @@ -218,13 +220,13 @@ void get_mutable_metadata(librados::IoCtx &ioctx, const std::string &oid, void set_minimum_set(librados::ObjectWriteOperation *op, uint64_t object_set) { bufferlist bl; - ::encode(object_set, bl); + encode(object_set, bl); op->exec("journal", "set_minimum_set", bl); } void set_active_set(librados::ObjectWriteOperation *op, uint64_t object_set) { bufferlist bl; - ::encode(object_set, bl); + encode(object_set, bl); op->exec("journal", "set_active_set", bl); } @@ -250,14 +252,14 @@ int get_client(librados::IoCtx &ioctx, const std::string &oid, void get_client_start(librados::ObjectReadOperation *op, const std::string &id) { bufferlist bl; - ::encode(id, bl); + encode(id, bl); op->exec("journal", "get_client", bl); } int get_client_finish(bufferlist::iterator *iter, cls::journal::Client *client) { try { - ::decode(*client, *iter); + decode(*client, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -274,8 +276,8 @@ int client_register(librados::IoCtx &ioctx, const std::string &oid, void client_register(librados::ObjectWriteOperation *op, const std::string &id, const bufferlist &data) { bufferlist bl; - ::encode(id, bl); - ::encode(data, bl); + encode(id, bl); + encode(data, bl); op->exec("journal", "client_register", bl); } @@ -289,8 +291,8 @@ int client_update_data(librados::IoCtx &ioctx, const std::string &oid, void client_update_data(librados::ObjectWriteOperation *op, const std::string &id, const bufferlist &data) { bufferlist bl; - ::encode(id, bl); - ::encode(data, bl); + encode(id, bl); + encode(data, bl); op->exec("journal", "client_update_data", bl); } @@ -305,8 +307,8 @@ void client_update_state(librados::ObjectWriteOperation *op, const std::string &id, cls::journal::ClientState state) { bufferlist bl; - ::encode(id, bl); - ::encode(static_cast(state), bl); + encode(id, bl); + encode(static_cast(state), bl); op->exec("journal", "client_update_state", bl); } @@ -321,15 +323,15 @@ void client_unregister(librados::ObjectWriteOperation *op, const std::string &id) { bufferlist bl; - ::encode(id, bl); + encode(id, bl); op->exec("journal", "client_unregister", bl); } void client_commit(librados::ObjectWriteOperation *op, const std::string &id, const cls::journal::ObjectSetPosition &commit_position) { bufferlist bl; - ::encode(id, bl); - ::encode(commit_position, bl); + encode(id, bl); + encode(commit_position, bl); op->exec("journal", "client_commit", bl); } @@ -373,7 +375,7 @@ void get_next_tag_tid_start(librados::ObjectReadOperation *op) { int get_next_tag_tid_finish(bufferlist::iterator *iter, uint64_t *tag_tid) { try { - ::decode(*tag_tid, *iter); + decode(*tag_tid, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -402,13 +404,13 @@ int get_tag(librados::IoCtx &ioctx, const std::string &oid, void get_tag_start(librados::ObjectReadOperation *op, uint64_t tag_tid) { bufferlist bl; - ::encode(tag_tid, bl); + encode(tag_tid, bl); op->exec("journal", "get_tag", bl); } int get_tag_finish(bufferlist::iterator *iter, cls::journal::Tag *tag) { try { - ::decode(*tag, *iter); + decode(*tag, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -426,9 +428,9 @@ int tag_create(librados::IoCtx &ioctx, const std::string &oid, void tag_create(librados::ObjectWriteOperation *op, uint64_t tag_tid, uint64_t tag_class, const bufferlist &data) { bufferlist bl; - ::encode(tag_tid, bl); - ::encode(tag_class, bl); - ::encode(data, bl); + encode(tag_tid, bl); + encode(tag_class, bl); + encode(data, bl); op->exec("journal", "tag_create", bl); } @@ -468,17 +470,17 @@ void tag_list_start(librados::ObjectReadOperation *op, const std::string &client_id, boost::optional tag_class) { bufferlist bl; - ::encode(start_after_tag_tid, bl); - ::encode(max_return, bl); - ::encode(client_id, bl); - ::encode(tag_class, bl); + encode(start_after_tag_tid, bl); + encode(max_return, bl); + encode(client_id, bl); + encode(tag_class, bl); op->exec("journal", "tag_list", bl); } int tag_list_finish(bufferlist::iterator *iter, std::set *tags) { try { - ::decode(*tags, *iter); + decode(*tags, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -487,7 +489,7 @@ int tag_list_finish(bufferlist::iterator *iter, void guard_append(librados::ObjectWriteOperation *op, uint64_t soft_max_size) { bufferlist bl; - ::encode(soft_max_size, bl); + encode(soft_max_size, bl); op->exec("journal", "guard_append", bl); } diff --git a/src/cls/journal/cls_journal_types.cc b/src/cls/journal/cls_journal_types.cc index c8757e20a90..0714c4160df 100644 --- a/src/cls/journal/cls_journal_types.cc +++ b/src/cls/journal/cls_journal_types.cc @@ -10,17 +10,17 @@ namespace journal { void ObjectPosition::encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(object_number, bl); - ::encode(tag_tid, bl); - ::encode(entry_tid, bl); + encode(object_number, bl); + encode(tag_tid, bl); + encode(entry_tid, bl); ENCODE_FINISH(bl); } void ObjectPosition::decode(bufferlist::iterator& iter) { DECODE_START(1, iter); - ::decode(object_number, iter); - ::decode(tag_tid, iter); - ::decode(entry_tid, iter); + decode(object_number, iter); + decode(tag_tid, iter); + decode(entry_tid, iter); DECODE_FINISH(iter); } @@ -37,13 +37,13 @@ void ObjectPosition::generate_test_instances(std::list &o) { void ObjectSetPosition::encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(object_positions, bl); + encode(object_positions, bl); ENCODE_FINISH(bl); } void ObjectSetPosition::decode(bufferlist::iterator& iter) { DECODE_START(1, iter); - ::decode(object_positions, iter); + decode(object_positions, iter); DECODE_FINISH(iter); } @@ -65,21 +65,21 @@ void ObjectSetPosition::generate_test_instances( void Client::encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(id, bl); - ::encode(data, bl); - ::encode(commit_position, bl); - ::encode(static_cast(state), bl); + encode(id, bl); + encode(data, bl); + encode(commit_position, bl); + encode(static_cast(state), bl); ENCODE_FINISH(bl); } void Client::decode(bufferlist::iterator& iter) { DECODE_START(1, iter); - ::decode(id, iter); - ::decode(data, iter); - ::decode(commit_position, iter); + decode(id, iter); + decode(data, iter); + decode(commit_position, iter); uint8_t state_raw; - ::decode(state_raw, iter); + decode(state_raw, iter); state = static_cast(state_raw); DECODE_FINISH(iter); } @@ -109,17 +109,17 @@ void Client::generate_test_instances(std::list &o) { void Tag::encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(tid, bl); - ::encode(tag_class, bl); - ::encode(data, bl); + encode(tid, bl); + encode(tag_class, bl); + encode(data, bl); ENCODE_FINISH(bl); } void Tag::decode(bufferlist::iterator& iter) { DECODE_START(1, iter); - ::decode(tid, iter); - ::decode(tag_class, iter); - ::decode(data, iter); + decode(tid, iter); + decode(tag_class, iter); + decode(data, iter); DECODE_FINISH(iter); } diff --git a/src/cls/journal/cls_journal_types.h b/src/cls/journal/cls_journal_types.h index f2cb841973f..289abd4b379 100644 --- a/src/cls/journal/cls_journal_types.h +++ b/src/cls/journal/cls_journal_types.h @@ -151,7 +151,4 @@ std::ostream &operator<<(std::ostream &os, const Tag &tag); } // namespace journal } // namespace cls -using cls::journal::encode; -using cls::journal::decode; - #endif // CEPH_CLS_JOURNAL_TYPES_H diff --git a/src/cls/lock/cls_lock.cc b/src/cls/lock/cls_lock.cc index 32c70143f57..99ab3a6837f 100644 --- a/src/cls/lock/cls_lock.cc +++ b/src/cls/lock/cls_lock.cc @@ -84,6 +84,7 @@ static int read_lock(cls_method_context_t hctx, const string& name, lock_info_t static int write_lock(cls_method_context_t hctx, const string& name, const lock_info_t& lock) { + using ceph::encode; string key = LOCK_PREFIX; key.append(name); @@ -214,7 +215,7 @@ static int lock_op(cls_method_context_t hctx, cls_lock_lock_op op; try { bufferlist::iterator iter = in->begin(); - ::decode(op, iter); + decode(op, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -279,7 +280,7 @@ static int unlock_op(cls_method_context_t hctx, cls_lock_unlock_op op; try { bufferlist::iterator iter = in->begin(); - ::decode(op, iter); + decode(op, iter); } catch (const buffer::error& err) { return -EINVAL; } @@ -307,7 +308,7 @@ static int break_lock(cls_method_context_t hctx, cls_lock_break_op op; try { bufferlist::iterator iter = in->begin(); - ::decode(op, iter); + decode(op, iter); } catch (const buffer::error& err) { return -EINVAL; } @@ -333,7 +334,7 @@ static int get_info(cls_method_context_t hctx, bufferlist *in, bufferlist *out) cls_lock_get_info_op op; try { bufferlist::iterator iter = in->begin(); - ::decode(op, iter); + decode(op, iter); } catch (const buffer::error& err) { return -EINVAL; } @@ -355,7 +356,7 @@ static int get_info(cls_method_context_t hctx, bufferlist *in, bufferlist *out) ret.lock_type = linfo.lock_type; ret.tag = linfo.tag; - ::encode(ret, *out, cls_get_client_features(hctx)); + encode(ret, *out, cls_get_client_features(hctx)); return 0; } @@ -393,7 +394,7 @@ static int list_locks(cls_method_context_t hctx, bufferlist *in, bufferlist *out } } - ::encode(ret, *out); + encode(ret, *out); return 0; } @@ -416,7 +417,7 @@ int assert_locked(cls_method_context_t hctx, bufferlist *in, bufferlist *out) cls_lock_assert_op op; try { bufferlist::iterator iter = in->begin(); - ::decode(op, iter); + decode(op, iter); } catch (const buffer::error& err) { return -EINVAL; } @@ -488,7 +489,7 @@ int set_cookie(cls_method_context_t hctx, bufferlist *in, bufferlist *out) cls_lock_set_cookie_op op; try { bufferlist::iterator iter = in->begin(); - ::decode(op, iter); + decode(op, iter); } catch (const buffer::error& err) { return -EINVAL; } diff --git a/src/cls/lock/cls_lock_client.cc b/src/cls/lock/cls_lock_client.cc index 3a3cef36794..0e64ff914a4 100644 --- a/src/cls/lock/cls_lock_client.cc +++ b/src/cls/lock/cls_lock_client.cc @@ -41,7 +41,7 @@ namespace rados { op.duration = duration; op.flags = flags; bufferlist in; - ::encode(op, in); + encode(op, in); rados_op->exec("lock", "lock", in); } @@ -64,7 +64,7 @@ namespace rados { op.name = name; op.cookie = cookie; bufferlist in; - ::encode(op, in); + encode(op, in); rados_op->exec("lock", "unlock", in); } @@ -95,7 +95,7 @@ namespace rados { op.cookie = cookie; op.locker = locker; bufferlist in; - ::encode(op, in); + encode(op, in); rados_op->exec("lock", "break_lock", in); } @@ -118,7 +118,7 @@ namespace rados { cls_lock_list_locks_reply ret; bufferlist::iterator iter = out.begin(); try { - ::decode(ret, iter); + decode(ret, iter); } catch (buffer::error& err) { return -EBADMSG; } @@ -134,7 +134,7 @@ namespace rados { bufferlist in; cls_lock_get_info_op op; op.name = name; - ::encode(op, in); + encode(op, in); rados_op->exec("lock", "get_info", in); } @@ -144,7 +144,7 @@ namespace rados { { cls_lock_get_info_reply ret; try { - ::decode(ret, *iter); + decode(ret, *iter); } catch (buffer::error& err) { return -EBADMSG; } @@ -188,7 +188,7 @@ namespace rados { op.cookie = cookie; op.tag = tag; bufferlist in; - ::encode(op, in); + encode(op, in); rados_op->exec("lock", "assert_locked", in); } @@ -204,7 +204,7 @@ namespace rados { op.tag = tag; op.new_cookie = new_cookie; bufferlist in; - ::encode(op, in); + encode(op, in); rados_op->exec("lock", "set_cookie", in); } diff --git a/src/cls/lock/cls_lock_ops.h b/src/cls/lock/cls_lock_ops.h index dbdddfe2140..68805b7ba16 100644 --- a/src/cls/lock/cls_lock_ops.h +++ b/src/cls/lock/cls_lock_ops.h @@ -19,27 +19,27 @@ struct cls_lock_lock_op void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(name, bl); + encode(name, bl); uint8_t t = (uint8_t)type; - ::encode(t, bl); - ::encode(cookie, bl); - ::encode(tag, bl); - ::encode(description, bl); - ::encode(duration, bl); - ::encode(flags, bl); + encode(t, bl); + encode(cookie, bl); + encode(tag, bl); + encode(description, bl); + encode(duration, bl); + encode(flags, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(name, bl); + decode(name, bl); uint8_t t; - ::decode(t, bl); + decode(t, bl); type = (ClsLockType)t; - ::decode(cookie, bl); - ::decode(tag, bl); - ::decode(description, bl); - ::decode(duration, bl); - ::decode(flags, bl); + decode(cookie, bl); + decode(tag, bl); + decode(description, bl); + decode(duration, bl); + decode(flags, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -56,14 +56,14 @@ struct cls_lock_unlock_op void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(name, bl); - ::encode(cookie, bl); + encode(name, bl); + encode(cookie, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(name, bl); - ::decode(cookie, bl); + decode(name, bl); + decode(cookie, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -81,16 +81,16 @@ struct cls_lock_break_op void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(name, bl); - ::encode(locker, bl); - ::encode(cookie, bl); + encode(name, bl); + encode(locker, bl); + encode(cookie, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(name, bl); - ::decode(locker, bl); - ::decode(cookie, bl); + decode(name, bl); + decode(locker, bl); + decode(cookie, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -106,12 +106,12 @@ struct cls_lock_get_info_op void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(name, bl); + encode(name, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(name, bl); + decode(name, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -129,19 +129,19 @@ struct cls_lock_get_info_reply void encode(bufferlist &bl, uint64_t features) const { ENCODE_START(1, 1, bl); - ::encode(lockers, bl, features); + encode(lockers, bl, features); uint8_t t = (uint8_t)lock_type; - ::encode(t, bl); - ::encode(tag, bl); + encode(t, bl); + encode(tag, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(lockers, bl); + decode(lockers, bl); uint8_t t; - ::decode(t, bl); + decode(t, bl); lock_type = (ClsLockType)t; - ::decode(tag, bl); + decode(tag, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -157,12 +157,12 @@ struct cls_lock_list_locks_reply void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(locks, bl); + encode(locks, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(locks, bl); + decode(locks, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -181,21 +181,21 @@ struct cls_lock_assert_op void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(name, bl); + encode(name, bl); uint8_t t = (uint8_t)type; - ::encode(t, bl); - ::encode(cookie, bl); - ::encode(tag, bl); + encode(t, bl); + encode(cookie, bl); + encode(tag, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(name, bl); + decode(name, bl); uint8_t t; - ::decode(t, bl); + decode(t, bl); type = (ClsLockType)t; - ::decode(cookie, bl); - ::decode(tag, bl); + decode(cookie, bl); + decode(tag, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -215,23 +215,23 @@ struct cls_lock_set_cookie_op void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(name, bl); + encode(name, bl); uint8_t t = (uint8_t)type; - ::encode(t, bl); - ::encode(cookie, bl); - ::encode(tag, bl); - ::encode(new_cookie, bl); + encode(t, bl); + encode(cookie, bl); + encode(tag, bl); + encode(new_cookie, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(name, bl); + decode(name, bl); uint8_t t; - ::decode(t, bl); + decode(t, bl); type = (ClsLockType)t; - ::decode(cookie, bl); - ::decode(tag, bl); - ::decode(new_cookie, bl); + decode(cookie, bl); + decode(tag, bl); + decode(new_cookie, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; diff --git a/src/cls/lock/cls_lock_types.h b/src/cls/lock/cls_lock_types.h index e28a312d106..064a64d8964 100644 --- a/src/cls/lock/cls_lock_types.h +++ b/src/cls/lock/cls_lock_types.h @@ -15,7 +15,7 @@ enum ClsLockType { LOCK_SHARED = 2, }; -static inline const char *cls_lock_type_str(ClsLockType type) +inline const char *cls_lock_type_str(ClsLockType type) { switch (type) { case LOCK_NONE: @@ -45,14 +45,14 @@ namespace rados { void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(locker, bl); - ::encode(cookie, bl); + encode(locker, bl); + encode(cookie, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(locker, bl); - ::decode(cookie, bl); + decode(locker, bl); + decode(cookie, bl); DECODE_FINISH(bl); } @@ -66,7 +66,7 @@ namespace rados { void dump(Formatter *f) const; static void generate_test_instances(list& o); }; - WRITE_CLASS_ENCODER(rados::cls::lock::locker_id_t) + WRITE_CLASS_ENCODER(locker_id_t) struct locker_info_t { @@ -80,22 +80,22 @@ namespace rados { void encode(bufferlist &bl, uint64_t features) const { ENCODE_START(1, 1, bl); - ::encode(expiration, bl); - ::encode(addr, bl, features); - ::encode(description, bl); + encode(expiration, bl); + encode(addr, bl, features); + encode(description, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(expiration, bl); - ::decode(addr, bl); - ::decode(description, bl); + decode(expiration, bl); + decode(addr, bl); + decode(description, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; static void generate_test_instances(list& o); }; - WRITE_CLASS_ENCODER_FEATURES(rados::cls::lock::locker_info_t) + WRITE_CLASS_ENCODER_FEATURES(locker_info_t) struct lock_info_t { map lockers; // map of lockers @@ -106,26 +106,26 @@ namespace rados { void encode(bufferlist &bl, uint64_t features) const { ENCODE_START(1, 1, bl); - ::encode(lockers, bl, features); + encode(lockers, bl, features); uint8_t t = (uint8_t)lock_type; - ::encode(t, bl); - ::encode(tag, bl); + encode(t, bl); + encode(tag, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START_LEGACY_COMPAT_LEN(1, 1, 1, bl); - ::decode(lockers, bl); + decode(lockers, bl); uint8_t t; - ::decode(t, bl); + decode(t, bl); lock_type = (ClsLockType)t; - ::decode(tag, bl); + decode(tag, bl); DECODE_FINISH(bl); } lock_info_t() : lock_type(LOCK_NONE) {} void dump(Formatter *f) const; static void generate_test_instances(list& o); }; - WRITE_CLASS_ENCODER_FEATURES(rados::cls::lock::lock_info_t) + WRITE_CLASS_ENCODER_FEATURES(lock_info_t); } } } diff --git a/src/cls/log/cls_log.cc b/src/cls/log/cls_log.cc index c7ed1f5bfa0..fd94a2fd16f 100644 --- a/src/cls/log/cls_log.cc +++ b/src/cls/log/cls_log.cc @@ -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) @@ -52,7 +52,7 @@ static int read_header(cls_method_context_t hctx, cls_log_header& header) bufferlist::iterator iter = header_bl.begin(); 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) @@ -89,7 +89,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_log_add_op(): failed to decode op"); return -EINVAL; @@ -144,7 +144,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_log_list_op(): failed to decode op"); return -EINVAL; @@ -193,7 +193,7 @@ static int cls_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *o bufferlist::iterator biter = bl.begin(); 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; } @@ -214,7 +214,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: cls_log_list_op(): failed to decode entry"); return -EINVAL; @@ -277,7 +277,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); + 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; } diff --git a/src/cls/log/cls_log_client.cc b/src/cls/log/cls_log_client.cc index 0aa6e16d4a0..ac9ad2844dc 100644 --- a/src/cls/log/cls_log_client.cc +++ b/src/cls/log/cls_log_client.cc @@ -14,7 +14,7 @@ void cls_log_add(librados::ObjectWriteOperation& op, list& entrie bufferlist in; cls_log_add_op call; call.entries = entries; - ::encode(call, in); + encode(call, in); op.exec("log", "add", in); } @@ -23,7 +23,7 @@ void cls_log_add(librados::ObjectWriteOperation& op, cls_log_entry& entry) bufferlist in; cls_log_add_op call; call.entries.push_back(entry); - ::encode(call, in); + encode(call, in); op.exec("log", "add", in); } @@ -54,7 +54,7 @@ void cls_log_trim(librados::ObjectWriteOperation& op, const utime_t& from_time, call.to_time = to_time; call.from_marker = from_marker; call.to_marker = to_marker; - ::encode(call, in); + encode(call, in); op.exec("log", "trim", in); } @@ -92,7 +92,7 @@ public: cls_log_list_ret ret; try { bufferlist::iterator iter = outbl.begin(); - ::decode(ret, iter); + decode(ret, iter); if (entries) *entries = std::move(ret.entries); if (truncated) @@ -118,7 +118,7 @@ void cls_log_list(librados::ObjectReadOperation& op, utime_t& from, utime_t& to, call.marker = in_marker; call.max_entries = max_entries; - ::encode(call, inbl); + encode(call, inbl); op.exec("log", "list", inbl, new LogListCtx(&entries, out_marker, truncated)); } @@ -132,7 +132,7 @@ public: cls_log_info_ret ret; try { bufferlist::iterator iter = outbl.begin(); - ::decode(ret, iter); + decode(ret, iter); if (header) *header = ret.header; } catch (buffer::error& err) { @@ -147,7 +147,7 @@ void cls_log_info(librados::ObjectReadOperation& op, cls_log_header *header) bufferlist inbl; cls_log_info_op call; - ::encode(call, inbl); + encode(call, inbl); op.exec("log", "info", inbl, new LogInfoCtx(header)); } diff --git a/src/cls/log/cls_log_ops.h b/src/cls/log/cls_log_ops.h index 67dfcd5c5ec..514b2b82039 100644 --- a/src/cls/log/cls_log_ops.h +++ b/src/cls/log/cls_log_ops.h @@ -14,16 +14,16 @@ struct cls_log_add_op { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(entries, bl); - ::encode(monotonic_inc, bl); + encode(entries, bl); + encode(monotonic_inc, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(entries, bl); + decode(entries, bl); if (struct_v >= 2) { - ::decode(monotonic_inc, bl); + decode(monotonic_inc, bl); } DECODE_FINISH(bl); } @@ -41,19 +41,19 @@ struct cls_log_list_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(from_time, bl); - ::encode(marker, bl); - ::encode(to_time, bl); - ::encode(max_entries, bl); + encode(from_time, bl); + encode(marker, bl); + encode(to_time, bl); + encode(max_entries, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(from_time, bl); - ::decode(marker, bl); - ::decode(to_time, bl); - ::decode(max_entries, bl); + decode(from_time, bl); + decode(marker, bl); + decode(to_time, bl); + decode(max_entries, bl); DECODE_FINISH(bl); } }; @@ -68,17 +68,17 @@ struct cls_log_list_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entries, bl); - ::encode(marker, bl); - ::encode(truncated, bl); + encode(entries, bl); + encode(marker, bl); + encode(truncated, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entries, bl); - ::decode(marker, bl); - ::decode(truncated, bl); + decode(entries, bl); + decode(marker, bl); + decode(truncated, bl); DECODE_FINISH(bl); } }; @@ -99,20 +99,20 @@ struct cls_log_trim_op { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(from_time, bl); - ::encode(to_time, bl); - ::encode(from_marker, bl); - ::encode(to_marker, bl); + encode(from_time, bl); + encode(to_time, bl); + encode(from_marker, bl); + encode(to_marker, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(from_time, bl); - ::decode(to_time, bl); + decode(from_time, bl); + decode(to_time, bl); if (struct_v >= 2) { - ::decode(from_marker, bl); - ::decode(to_marker, bl); + decode(from_marker, bl); + decode(to_marker, bl); } DECODE_FINISH(bl); } @@ -141,13 +141,13 @@ struct cls_log_info_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(header, bl); + encode(header, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(header, bl); + decode(header, bl); DECODE_FINISH(bl); } }; diff --git a/src/cls/log/cls_log_types.h b/src/cls/log/cls_log_types.h index 7d9679488dd..482048bcdb3 100644 --- a/src/cls/log/cls_log_types.h +++ b/src/cls/log/cls_log_types.h @@ -20,22 +20,22 @@ struct cls_log_entry { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(section, bl); - ::encode(name, bl); - ::encode(timestamp, bl); - ::encode(data, bl); - ::encode(id, bl); + encode(section, bl); + encode(name, bl); + encode(timestamp, bl); + encode(data, bl); + encode(id, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(section, bl); - ::decode(name, bl); - ::decode(timestamp, bl); - ::decode(data, bl); + decode(section, bl); + decode(name, bl); + decode(timestamp, bl); + decode(data, bl); if (struct_v >= 2) - ::decode(id, bl); + decode(id, bl); DECODE_FINISH(bl); } }; @@ -47,15 +47,15 @@ struct cls_log_header { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(max_marker, bl); - ::encode(max_time, bl); + encode(max_marker, bl); + encode(max_time, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(max_marker, bl); - ::decode(max_time, bl); + decode(max_marker, bl); + decode(max_time, bl); DECODE_FINISH(bl); } }; @@ -63,5 +63,3 @@ WRITE_CLASS_ENCODER(cls_log_header) #endif - - diff --git a/src/cls/lua/cls_lua.cc b/src/cls/lua/cls_lua.cc index 3c84570c5df..f4d24c27618 100644 --- a/src/cls/lua/cls_lua.cc +++ b/src/cls/lua/cls_lua.cc @@ -866,7 +866,7 @@ static int clslua_eval(lua_State *L) try { bufferlist::iterator it = ctx->inbl->begin(); - ::decode(op, it); + decode(op, it); } catch (const buffer::error &err) { CLS_ERR("error: could not decode ceph encoded input"); ctx->ret = -EINVAL; diff --git a/src/cls/lua/cls_lua_client.cc b/src/cls/lua/cls_lua_client.cc index 44348270c80..0e6544a2693 100644 --- a/src/cls/lua/cls_lua_client.cc +++ b/src/cls/lua/cls_lua_client.cc @@ -27,7 +27,7 @@ namespace cls_lua_client { op.input = input; bufferlist inbl; - ::encode(op, inbl); + encode(op, inbl); return ioctx.exec(oid, "lua", "eval_bufferlist", inbl, output); } diff --git a/src/cls/lua/cls_lua_ops.h b/src/cls/lua/cls_lua_ops.h index 2bf95051d34..d516ee1b27e 100644 --- a/src/cls/lua/cls_lua_ops.h +++ b/src/cls/lua/cls_lua_ops.h @@ -1,6 +1,10 @@ #ifndef CEPH_CLS_LUA_OPS_H #define CEPH_CLS_LUA_OPS_H +#include + +#include "include/encoding.h" + struct cls_lua_eval_op { std::string script; std::string handler; @@ -8,17 +12,17 @@ struct cls_lua_eval_op { void encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(script, bl); - ::encode(handler, bl); - ::encode(input, bl); + encode(script, bl); + encode(handler, bl); + encode(input, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { DECODE_START(1, bl); - ::decode(script, bl); - ::decode(handler, bl); - ::decode(input, bl); + decode(script, bl); + decode(handler, bl); + decode(input, bl); DECODE_FINISH(bl); } }; diff --git a/src/cls/numops/cls_numops.cc b/src/cls/numops/cls_numops.cc index 968966c2785..4ade9cf7d51 100644 --- a/src/cls/numops/cls_numops.cc +++ b/src/cls/numops/cls_numops.cc @@ -37,8 +37,8 @@ static int add(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist::iterator iter = in->begin(); try { - ::decode(key, iter); - ::decode(diff_str, iter); + decode(key, iter); + decode(diff_str, iter); } catch (const buffer::error &err) { CLS_LOG(20, "add: invalid decode of input"); return -EINVAL; @@ -92,8 +92,8 @@ static int mul(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist::iterator iter = in->begin(); try { - ::decode(key, iter); - ::decode(diff_str, iter); + decode(key, iter); + decode(diff_str, iter); } catch (const buffer::error &err) { CLS_LOG(20, "add: invalid decode of input"); return -EINVAL; diff --git a/src/cls/numops/cls_numops_client.cc b/src/cls/numops/cls_numops_client.cc index c91d5692b2c..fa1a69f2e22 100644 --- a/src/cls/numops/cls_numops_client.cc +++ b/src/cls/numops/cls_numops_client.cc @@ -29,12 +29,12 @@ namespace rados { double value_to_add) { bufferlist in, out; - ::encode(key, in); + encode(key, in); std::stringstream stream; stream << value_to_add; - ::encode(stream.str(), in); + encode(stream.str(), in); return ioctx->exec(oid, "numops", "add", in, out); } @@ -53,12 +53,12 @@ namespace rados { double value_to_multiply) { bufferlist in, out; - ::encode(key, in); + encode(key, in); std::stringstream stream; stream << value_to_multiply; - ::encode(stream.str(), in); + encode(stream.str(), in); return ioctx->exec(oid, "numops", "mul", in, out); } diff --git a/src/cls/rbd/cls_rbd.cc b/src/cls/rbd/cls_rbd.cc index 3932180a841..2177d868228 100644 --- a/src/cls/rbd/cls_rbd.cc +++ b/src/cls/rbd/cls_rbd.cc @@ -132,7 +132,7 @@ static int read_key(cls_method_context_t hctx, const string &key, T *out) try { bufferlist::iterator it = bl.begin(); - ::decode(*out, it); + decode(*out, it); } catch (const buffer::error &err) { CLS_ERR("error decoding %s", key.c_str()); return -EIO; @@ -188,12 +188,12 @@ int create(cls_method_context_t hctx, bufferlist *in, bufferlist *out) try { bufferlist::iterator iter = in->begin(); - ::decode(size, iter); - ::decode(order, iter); - ::decode(features, iter); - ::decode(object_prefix, iter); + decode(size, iter); + decode(order, iter); + decode(features, iter); + decode(object_prefix, iter); if (!iter.end()) { - ::decode(data_pool_id, iter); + decode(data_pool_id, iter); } } catch (const buffer::error &err) { return -EINVAL; @@ -226,12 +226,12 @@ int create(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist create_timestampbl; uint64_t snap_seq = 0; utime_t create_timestamp = ceph_clock_now(); - ::encode(size, sizebl); - ::encode(order, orderbl); - ::encode(features, featuresbl); - ::encode(object_prefix, object_prefixbl); - ::encode(snap_seq, snap_seqbl); - ::encode(create_timestamp, create_timestampbl); + encode(size, sizebl); + encode(order, orderbl); + encode(features, featuresbl); + encode(object_prefix, object_prefixbl); + encode(snap_seq, snap_seqbl); + encode(create_timestamp, create_timestampbl); map omap_vals; omap_vals["size"] = sizebl; @@ -248,7 +248,7 @@ int create(cls_method_context_t hctx, bufferlist *in, bufferlist *out) } bufferlist data_pool_id_bl; - ::encode(data_pool_id, data_pool_id_bl); + encode(data_pool_id, data_pool_id_bl); omap_vals["data_pool_id"] = data_pool_id_bl; } else if (data_pool_id != -1) { CLS_ERR("data pool provided with feature disabled"); @@ -279,9 +279,9 @@ int get_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist::iterator iter = in->begin(); try { - ::decode(snap_id, iter); + decode(snap_id, iter); if (!iter.end()) { - ::decode(read_only, iter); + decode(read_only, iter); } } catch (const buffer::error &err) { return -EINVAL; @@ -312,8 +312,8 @@ int get_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out) uint64_t incompatible = (read_only ? features & RBD_FEATURES_INCOMPATIBLE : features & RBD_FEATURES_RW_INCOMPATIBLE); - ::encode(features, *out); - ::encode(incompatible, *out); + encode(features, *out); + encode(incompatible, *out); return 0; } @@ -335,8 +335,8 @@ int set_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out) uint64_t mask; bufferlist::iterator iter = in->begin(); try { - ::decode(features, iter); - ::decode(mask, iter); + decode(features, iter); + decode(mask, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -374,7 +374,7 @@ int set_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out) features, orig_features); bufferlist bl; - ::encode(features, bl); + encode(features, bl); r = cls_cxx_map_set_val(hctx, "features", &bl); if (r < 0) { CLS_ERR("error updating features: %s", cpp_strerror(r).c_str()); @@ -422,7 +422,7 @@ int get_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist::iterator iter = in->begin(); try { - ::decode(snap_id, iter); + decode(snap_id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -452,8 +452,8 @@ int get_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out) size = snap.image_size; } - ::encode(order, *out); - ::encode(size, *out); + encode(order, *out); + encode(size, *out); return 0; } @@ -471,7 +471,7 @@ int set_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist::iterator iter = in->begin(); try { - ::decode(size, iter); + decode(size, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -489,7 +489,7 @@ int set_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out) (unsigned long long)orig_size); bufferlist sizebl; - ::encode(size, sizebl); + encode(size, sizebl); r = cls_cxx_map_set_val(hctx, "size", &sizebl); if (r < 0) { CLS_ERR("error writing snapshot metadata: %s", cpp_strerror(r).c_str()); @@ -508,7 +508,7 @@ int set_size(cls_method_context_t hctx, bufferlist *in, bufferlist *out) if (parent.exists() && parent.overlap > size) { bufferlist parentbl; parent.overlap = size; - ::encode(parent, parentbl); + encode(parent, parentbl); r = cls_cxx_map_set_val(hctx, "parent", &parentbl); if (r < 0) { CLS_ERR("error writing parent: %s", cpp_strerror(r).c_str()); @@ -552,7 +552,7 @@ int get_protection_status(cls_method_context_t hctx, bufferlist *in, bufferlist::iterator iter = in->begin(); try { - ::decode(snap_id, iter); + decode(snap_id, iter); } catch (const buffer::error &err) { CLS_LOG(20, "get_protection_status: invalid decode"); return -EINVAL; @@ -583,7 +583,7 @@ int get_protection_status(cls_method_context_t hctx, bufferlist *in, return -EIO; } - ::encode(snap.protection_status, *out); + encode(snap.protection_status, *out); return 0; } @@ -606,8 +606,8 @@ int set_protection_status(cls_method_context_t hctx, bufferlist *in, bufferlist::iterator iter = in->begin(); try { - ::decode(snap_id, iter); - ::decode(status, iter); + decode(snap_id, iter); + decode(status, iter); } catch (const buffer::error &err) { CLS_LOG(20, "set_protection_status: invalid decode"); return -EINVAL; @@ -646,7 +646,7 @@ int set_protection_status(cls_method_context_t hctx, bufferlist *in, snap.protection_status = status; bufferlist snapshot_bl; - ::encode(snap, snapshot_bl); + encode(snap, snapshot_bl); r = cls_cxx_map_set_val(hctx, snapshot_key, &snapshot_bl); if (r < 0) { CLS_ERR("error writing snapshot metadata: %s", cpp_strerror(r).c_str()); @@ -703,8 +703,8 @@ int get_stripe_unit_count(cls_method_context_t hctx, bufferlist *in, bufferlist if (r < 0) return r; - ::encode(stripe_unit, *out); - ::encode(stripe_count, *out); + encode(stripe_unit, *out); + encode(stripe_count, *out); return 0; } @@ -723,8 +723,8 @@ int set_stripe_unit_count(cls_method_context_t hctx, bufferlist *in, bufferlist bufferlist::iterator iter = in->begin(); try { - ::decode(stripe_unit, iter); - ::decode(stripe_count, iter); + decode(stripe_unit, iter); + decode(stripe_count, iter); } catch (const buffer::error &err) { CLS_LOG(20, "set_stripe_unit_count: invalid decode"); return -EINVAL; @@ -756,14 +756,14 @@ int set_stripe_unit_count(cls_method_context_t hctx, bufferlist *in, bufferlist } bufferlist bl, bl2; - ::encode(stripe_unit, bl); + encode(stripe_unit, bl); r = cls_cxx_map_set_val(hctx, "stripe_unit", &bl); if (r < 0) { CLS_ERR("error writing stripe_unit metadata: %s", cpp_strerror(r).c_str()); return r; } - ::encode(stripe_count, bl2); + encode(stripe_count, bl2); r = cls_cxx_map_set_val(hctx, "stripe_count", &bl2); if (r < 0) { CLS_ERR("error writing stripe_count metadata: %s", cpp_strerror(r).c_str()); @@ -788,14 +788,14 @@ int get_create_timestamp(cls_method_context_t hctx, bufferlist *in, bufferlist * } else { try { bufferlist::iterator it = bl.begin(); - ::decode(timestamp, it); + decode(timestamp, it); } catch (const buffer::error &err) { CLS_ERR("could not decode create_timestamp"); return -EIO; } } - ::encode(timestamp, *out); + encode(timestamp, *out); return 0; } @@ -815,7 +815,7 @@ int get_flags(cls_method_context_t hctx, bufferlist *in, bufferlist *out) uint64_t snap_id; bufferlist::iterator iter = in->begin(); try { - ::decode(snap_id, iter); + decode(snap_id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -840,7 +840,7 @@ int get_flags(cls_method_context_t hctx, bufferlist *in, bufferlist *out) flags = snap.flags; } - ::encode(flags, *out); + encode(flags, *out); return 0; } @@ -864,10 +864,10 @@ int set_flags(cls_method_context_t hctx, bufferlist *in, bufferlist *out) uint64_t snap_id = CEPH_NOSNAP; bufferlist::iterator iter = in->begin(); try { - ::decode(flags, iter); - ::decode(mask, iter); + decode(flags, iter); + decode(mask, iter); if (!iter.end()) { - ::decode(snap_id, iter); + decode(snap_id, iter); } } catch (const buffer::error &err) { return -EINVAL; @@ -904,13 +904,13 @@ int set_flags(cls_method_context_t hctx, bufferlist *in, bufferlist *out) if (snap_id == CEPH_NOSNAP) { bufferlist bl; - ::encode(flags, bl); + encode(flags, bl); r = cls_cxx_map_set_val(hctx, "flags", &bl); } else { snap_meta.flags = flags; bufferlist bl; - ::encode(snap_meta, bl); + encode(snap_meta, bl); r = cls_cxx_map_set_val(hctx, snap_meta_key, &bl); } @@ -941,7 +941,7 @@ int get_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist::iterator iter = in->begin(); try { - ::decode(snap_id, iter); + decode(snap_id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -970,10 +970,10 @@ int get_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out) } } - ::encode(parent.pool, *out); - ::encode(parent.id, *out); - ::encode(parent.snapid, *out); - ::encode(parent.overlap, *out); + encode(parent.pool, *out); + encode(parent.id, *out); + encode(parent.snapid, *out); + encode(parent.overlap, *out); return 0; } @@ -997,10 +997,10 @@ int set_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist::iterator iter = in->begin(); try { - ::decode(pool, iter); - ::decode(id, iter); - ::decode(snapid, iter); - ::decode(size, iter); + decode(pool, iter); + decode(id, iter); + decode(snapid, iter); + decode(size, iter); } catch (const buffer::error &err) { CLS_LOG(20, "cls_rbd::set_parent: invalid decode"); return -EINVAL; @@ -1048,7 +1048,7 @@ int set_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out) parent.id = id; parent.snapid = snapid; parent.overlap = MIN(our_size, size); - ::encode(parent, parentbl); + encode(parent, parentbl); r = cls_cxx_map_set_val(hctx, "parent", &parentbl); if (r < 0) { CLS_ERR("error writing parent: %s", cpp_strerror(r).c_str()); @@ -1114,7 +1114,7 @@ int remove_parent(cls_method_context_t hctx, bufferlist *in, bufferlist *out) snap_meta.parent = cls_rbd_parent(); bufferlist bl; - ::encode(snap_meta, bl); + encode(snap_meta, bl); r = cls_cxx_map_set_val(hctx, *it, &bl); if (r < 0) { CLS_ERR("Could not update snapshot: snap_id=%" PRIu64 ": %s", @@ -1150,9 +1150,9 @@ static int decode_parent_common(bufferlist::iterator& it, uint64_t *pool_id, string *image_id, snapid_t *snap_id) { try { - ::decode(*pool_id, it); - ::decode(*image_id, it); - ::decode(*snap_id, it); + decode(*pool_id, it); + decode(*image_id, it); + decode(*snap_id, it); } catch (const buffer::error &err) { CLS_ERR("error decoding parent spec"); return -EINVAL; @@ -1176,7 +1176,7 @@ static int decode_parent_and_child(bufferlist *in, uint64_t *pool_id, if (r < 0) return r; try { - ::decode(*c_image_id, it); + decode(*c_image_id, it); } catch (const buffer::error &err) { CLS_ERR("error decoding child image id"); return -EINVAL; @@ -1187,9 +1187,9 @@ static int decode_parent_and_child(bufferlist *in, uint64_t *pool_id, static string parent_key(uint64_t pool_id, string image_id, snapid_t snap_id) { bufferlist key_bl; - ::encode(pool_id, key_bl); - ::encode(image_id, key_bl); - ::encode(snap_id, key_bl); + encode(pool_id, key_bl); + encode(image_id, key_bl); + encode(snap_id, key_bl); return string(key_bl.c_str(), key_bl.length()); } @@ -1244,7 +1244,7 @@ int add_child(cls_method_context_t hctx, bufferlist *in, bufferlist *out) // write back bufferlist childbl; - ::encode(children, childbl); + encode(children, childbl); r = cls_cxx_map_set_val(hctx, key, &childbl); if (r < 0) CLS_LOG(20, "add_child: omap write failed: %s", cpp_strerror(r).c_str()); @@ -1306,7 +1306,7 @@ int remove_child(cls_method_context_t hctx, bufferlist *in, bufferlist *out) } else { // write back shortened children list bufferlist childbl; - ::encode(children, childbl); + encode(children, childbl); r = cls_cxx_map_set_val(hctx, key, &childbl); if (r < 0) CLS_LOG(20, "remove_child: write omap failed: %s", cpp_strerror(r).c_str()); @@ -1349,7 +1349,7 @@ int get_children(cls_method_context_t hctx, bufferlist *in, bufferlist *out) CLS_LOG(20, "get_children: read omap failed: %s", cpp_strerror(r).c_str()); return r; } - ::encode(children, *out); + encode(children, *out); return 0; } @@ -1400,8 +1400,8 @@ int get_snapcontext(cls_method_context_t hctx, bufferlist *in, bufferlist *out) // snap_ids must be descending in a snap context std::reverse(snap_ids.begin(), snap_ids.end()); - ::encode(snap_seq, *out); - ::encode(snap_ids, *out); + encode(snap_seq, *out); + encode(snap_ids, *out); return 0; } @@ -1423,7 +1423,7 @@ int get_object_prefix(cls_method_context_t hctx, bufferlist *in, bufferlist *out return r; } - ::encode(object_prefix, *out); + encode(object_prefix, *out); return 0; } @@ -1449,7 +1449,7 @@ int get_data_pool(cls_method_context_t hctx, bufferlist *in, bufferlist *out) return r; } - ::encode(data_pool_id, *out); + encode(data_pool_id, *out); return 0; } @@ -1459,7 +1459,7 @@ int get_snapshot_name(cls_method_context_t hctx, bufferlist *in, bufferlist *out bufferlist::iterator iter = in->begin(); try { - ::decode(snap_id, iter); + decode(snap_id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -1476,7 +1476,7 @@ int get_snapshot_name(cls_method_context_t hctx, bufferlist *in, bufferlist *out if (r < 0) return r; - ::encode(snap.name, *out); + encode(snap.name, *out); return 0; } @@ -1487,7 +1487,7 @@ int get_snapshot_timestamp(cls_method_context_t hctx, bufferlist *in, bufferlist bufferlist::iterator iter = in->begin(); try { - ::decode(snap_id, iter); + decode(snap_id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -1506,7 +1506,7 @@ int get_snapshot_timestamp(cls_method_context_t hctx, bufferlist *in, bufferlist return r; } - ::encode(snap.timestamp, *out); + encode(snap.timestamp, *out); return 0; } @@ -1526,7 +1526,7 @@ int get_snapshot_namespace(cls_method_context_t hctx, bufferlist *in, bufferlist bufferlist::iterator iter = in->begin(); try { - ::decode(snap_id, iter); + decode(snap_id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -1545,7 +1545,7 @@ int get_snapshot_namespace(cls_method_context_t hctx, bufferlist *in, bufferlist return r; } - ::encode(snap.snapshot_namespace, *out); + encode(snap.snapshot_namespace, *out); return 0; } @@ -1571,10 +1571,10 @@ int snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out) try { bufferlist::iterator iter = in->begin(); - ::decode(snap_meta.name, iter); - ::decode(snap_meta.id, iter); + decode(snap_meta.name, iter); + decode(snap_meta.id, iter); if (!iter.end()) { - ::decode(snap_meta.snapshot_namespace, iter); + decode(snap_meta.snapshot_namespace, iter); } } catch (const buffer::error &err) { return -EINVAL; @@ -1652,7 +1652,7 @@ int snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out) cls_rbd_snap old_meta; bufferlist::iterator iter = it->second.begin(); try { - ::decode(old_meta, iter); + decode(old_meta, iter); } catch (const buffer::error &err) { snapid_t snap_id = snap_id_from_key(it->first); CLS_ERR("error decoding snapshot metadata for snap_id: %llu", @@ -1683,8 +1683,8 @@ int snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out) } bufferlist snap_metabl, snap_seqbl; - ::encode(snap_meta, snap_metabl); - ::encode(snap_meta.id, snap_seqbl); + encode(snap_meta, snap_metabl); + encode(snap_meta.id, snap_seqbl); string snapshot_key; key_from_snap_id(snap_meta.id, &snapshot_key); @@ -1721,8 +1721,8 @@ int snapshot_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *out) try { bufferlist::iterator iter = in->begin(); - ::decode(src_snap_id, iter); - ::decode(dst_snap_name, iter); + decode(src_snap_id, iter); + decode(dst_snap_name, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -1744,7 +1744,7 @@ int snapshot_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *out) it != vals.end(); ++it) { bufferlist::iterator iter = it->second.begin(); try { - ::decode(snap_meta, iter); + decode(snap_meta, iter); } catch (const buffer::error &err) { CLS_ERR("error decoding snapshot metadata for snap : %s", dst_snap_name.c_str()); @@ -1768,7 +1768,7 @@ int snapshot_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *out) } snap_meta.name = dst_snap_name; bufferlist snap_metabl; - ::encode(snap_meta, snap_metabl); + encode(snap_meta, snap_metabl); r = cls_cxx_map_set_val(hctx, src_snap_key, &snap_metabl); if (r < 0) { @@ -1793,7 +1793,7 @@ int snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out) try { bufferlist::iterator iter = in->begin(); - ::decode(snap_id, iter); + decode(snap_id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -1829,7 +1829,7 @@ int snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out) int get_all_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out) { uint64_t all_features = RBD_FEATURES_ALL; - ::encode(all_features, *out); + encode(all_features, *out); return 0; } @@ -1891,12 +1891,12 @@ int get_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string id; try { bufferlist::iterator iter = read_bl.begin(); - ::decode(id, iter); + decode(id, iter); } catch (const buffer::error &err) { return -EIO; } - ::encode(id, *out); + encode(id, *out); return 0; } @@ -1919,7 +1919,7 @@ int set_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string id; try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); + decode(id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -1939,7 +1939,7 @@ int set_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out) CLS_LOG(20, "set_id: id=%s", id.c_str()); bufferlist write_bl; - ::encode(id, write_bl); + encode(id, write_bl); return cls_cxx_write(hctx, 0, write_bl.length(), &write_bl); } @@ -1986,8 +1986,8 @@ static int dir_add_image_helper(cls_method_context_t hctx, return -EBADF; } bufferlist id_bl, name_bl; - ::encode(id, id_bl); - ::encode(name, name_bl); + encode(id, id_bl); + encode(name, name_bl); map omap_vals; omap_vals[name_key] = id_bl; omap_vals[id_key] = name_bl; @@ -2059,9 +2059,9 @@ int dir_rename_image(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string src, dest, id; try { bufferlist::iterator iter = in->begin(); - ::decode(src, iter); - ::decode(dest, iter); - ::decode(id, iter); + decode(src, iter); + decode(dest, iter); + decode(id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2090,7 +2090,7 @@ int dir_get_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out) try { bufferlist::iterator iter = in->begin(); - ::decode(name, iter); + decode(name, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2104,7 +2104,7 @@ int dir_get_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out) CLS_ERR("error reading id for name '%s': %s", name.c_str(), cpp_strerror(r).c_str()); return r; } - ::encode(id, *out); + encode(id, *out); return 0; } @@ -2124,7 +2124,7 @@ int dir_get_name(cls_method_context_t hctx, bufferlist *in, bufferlist *out) try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); + decode(id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2137,7 +2137,7 @@ int dir_get_name(cls_method_context_t hctx, bufferlist *in, bufferlist *out) CLS_ERR("error reading name for id '%s': %s", id.c_str(), cpp_strerror(r).c_str()); return r; } - ::encode(name, *out); + encode(name, *out); return 0; } @@ -2161,8 +2161,8 @@ int dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) try { bufferlist::iterator iter = in->begin(); - ::decode(start_after, iter); - ::decode(max_return, iter); + decode(start_after, iter); + decode(max_return, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2187,7 +2187,7 @@ int dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string id; bufferlist::iterator iter = it->second.begin(); try { - ::decode(id, iter); + decode(id, iter); } catch (const buffer::error &err) { CLS_ERR("could not decode id of image '%s'", it->first.c_str()); return -EIO; @@ -2202,7 +2202,7 @@ int dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) } } - ::encode(images, *out); + encode(images, *out); return 0; } @@ -2231,8 +2231,8 @@ int dir_add_image(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string name, id; try { bufferlist::iterator iter = in->begin(); - ::decode(name, iter); - ::decode(id, iter); + decode(name, iter); + decode(id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2256,8 +2256,8 @@ int dir_remove_image(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string name, id; try { bufferlist::iterator iter = in->begin(); - ::decode(name, iter); - ::decode(id, iter); + decode(name, iter); + decode(id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2359,8 +2359,8 @@ int object_map_resize(cls_method_context_t hctx, bufferlist *in, bufferlist *out uint8_t default_state; try { bufferlist::iterator iter = in->begin(); - ::decode(object_count, iter); - ::decode(default_state, iter); + decode(object_count, iter); + decode(default_state, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2420,10 +2420,10 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out boost::optional current_object_state; try { bufferlist::iterator iter = in->begin(); - ::decode(start_object_no, iter); - ::decode(end_object_no, iter); - ::decode(new_object_state, iter); - ::decode(current_object_state, iter); + decode(start_object_no, iter); + decode(end_object_no, iter); + decode(new_object_state, iter); + decode(current_object_state, iter); } catch (const buffer::error &err) { CLS_ERR("failed to decode message"); return -EINVAL; @@ -2644,8 +2644,8 @@ int metadata_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) try { bufferlist::iterator iter = in->begin(); - ::decode(start_after, iter); - ::decode(max_return, iter); + decode(start_after, iter); + decode(max_return, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2678,7 +2678,7 @@ int metadata_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) } } - ::encode(data, *out); + encode(data, *out); return 0; } @@ -2695,7 +2695,7 @@ int metadata_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist::iterator iter = in->begin(); try { - ::decode(data, iter); + decode(data, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2728,7 +2728,7 @@ int metadata_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist::iterator iter = in->begin(); try { - ::decode(key, iter); + decode(key, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2759,7 +2759,7 @@ int metadata_get(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist::iterator iter = in->begin(); try { - ::decode(key, iter); + decode(key, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2772,7 +2772,7 @@ int metadata_get(cls_method_context_t hctx, bufferlist *in, bufferlist *out) return r; } - ::encode(value, *out); + encode(value, *out); return 0; } @@ -2789,7 +2789,7 @@ int snapshot_get_limit(cls_method_context_t hctx, bufferlist *in, } CLS_LOG(20, "read snapshot limit %" PRIu64, snap_limit); - ::encode(snap_limit, *out); + encode(snap_limit, *out); return 0; } @@ -2804,7 +2804,7 @@ int snapshot_set_limit(cls_method_context_t hctx, bufferlist *in, try { bufferlist::iterator iter = in->begin(); - ::decode(new_limit, iter); + decode(new_limit, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -2855,7 +2855,7 @@ int snapshot_set_limit(cls_method_context_t hctx, bufferlist *in, } else { CLS_LOG(20, "set snapshot limit to %" PRIu64 "\n", new_limit); bl.clear(); - ::encode(new_limit, bl); + encode(new_limit, bl); rc = cls_cxx_map_set_val(hctx, "snap_limit", &bl); } @@ -2882,14 +2882,14 @@ int old_snapshots_list(cls_method_context_t hctx, bufferlist *in, bufferlist *ou buf + sizeof(*header) + header->snap_count * sizeof(struct rbd_obj_snap_ondisk), header->snap_names_len); - ::encode(header->snap_seq, *out); - ::encode(header->snap_count, *out); + encode(header->snap_seq, *out); + encode(header->snap_count, *out); for (unsigned i = 0; i < header->snap_count; i++) { string s = name; - ::encode(header->snaps[i].id, *out); - ::encode(header->snaps[i].image_size, *out); - ::encode(s, *out); + encode(header->snaps[i].id, *out); + encode(header->snaps[i].image_size, *out); + encode(s, *out); name += strlen(name) + 1; if (name > end) @@ -2923,8 +2923,8 @@ int old_snapshot_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out) uint64_t snap_id; try { - ::decode(s, iter); - ::decode(snap_id, iter); + decode(s, iter); + decode(snap_id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -3012,7 +3012,7 @@ int old_snapshot_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *o struct rbd_obj_snap_ondisk snap; try { - ::decode(s, iter); + decode(s, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -3105,8 +3105,8 @@ int old_snapshot_rename(cls_method_context_t hctx, bufferlist *in, bufferlist *o bool found = false; try { - ::decode(src_snap_id, iter); - ::decode(dst, iter); + decode(src_snap_id, iter); + decode(dst, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -3249,7 +3249,7 @@ int read_peers(cls_method_context_t hctx, try { bufferlist::iterator bl_it = it.second.begin(); cls::rbd::MirrorPeer peer; - ::decode(peer, bl_it); + decode(peer, bl_it); peers->push_back(peer); } catch (const buffer::error &err) { CLS_ERR("could not decode peer '%s'", it.first.c_str()); @@ -3276,7 +3276,7 @@ int read_peer(cls_method_context_t hctx, const std::string &id, try { bufferlist::iterator bl_it = bl.begin(); - ::decode(*peer, bl_it); + decode(*peer, bl_it); } catch (const buffer::error &err) { CLS_ERR("could not decode peer '%s'", id.c_str()); return -EIO; @@ -3287,7 +3287,7 @@ int read_peer(cls_method_context_t hctx, const std::string &id, int write_peer(cls_method_context_t hctx, const std::string &id, const cls::rbd::MirrorPeer &peer) { bufferlist bl; - ::encode(peer, bl); + encode(peer, bl); int r = cls_cxx_map_set_val(hctx, peer_key(id), &bl); if (r < 0) { @@ -3312,7 +3312,7 @@ int image_get(cls_method_context_t hctx, const string &image_id, try { bufferlist::iterator it = bl.begin(); - ::decode(*mirror_image, it); + decode(*mirror_image, it); } catch (const buffer::error &err) { CLS_ERR("could not decode mirrored image '%s'", image_id.c_str()); return -EIO; @@ -3324,7 +3324,7 @@ int image_get(cls_method_context_t hctx, const string &image_id, int image_set(cls_method_context_t hctx, const string &image_id, const cls::rbd::MirrorImage &mirror_image) { bufferlist bl; - ::encode(mirror_image, bl); + encode(mirror_image, bl); cls::rbd::MirrorImage existing_mirror_image; int r = image_get(hctx, image_id, &existing_mirror_image); @@ -3364,7 +3364,7 @@ int image_set(cls_method_context_t hctx, const string &image_id, } bufferlist image_id_bl; - ::encode(image_id, image_id_bl); + encode(image_id, image_id_bl); r = cls_cxx_map_set_val(hctx, global_key(mirror_image.global_image_id), &image_id_bl); if (r < 0) { @@ -3427,7 +3427,7 @@ struct MirrorImageStatusOnDisk : cls::rbd::MirrorImageStatus { void encode_meta(bufferlist &bl, uint64_t features) const { ENCODE_START(1, 1, bl); - ::encode(origin, bl, features); + encode(origin, bl, features); ENCODE_FINISH(bl); } @@ -3438,7 +3438,7 @@ struct MirrorImageStatusOnDisk : cls::rbd::MirrorImageStatus { void decode_meta(bufferlist::iterator &it) { DECODE_START(1, it); - ::decode(origin, it); + decode(origin, it); DECODE_FINISH(it); } @@ -3543,7 +3543,7 @@ int image_status_list(cls_method_context_t hctx, cls::rbd::MirrorImage mirror_image; bufferlist::iterator iter = it->second.begin(); try { - ::decode(mirror_image, iter); + decode(mirror_image, iter); } catch (const buffer::error &err) { CLS_ERR("could not decode mirror image payload of image '%s'", image_id.c_str()); @@ -3601,7 +3601,7 @@ int image_status_get_summary(cls_method_context_t hctx, cls::rbd::MirrorImage mirror_image; bufferlist::iterator iter = list_it.second.begin(); try { - ::decode(mirror_image, iter); + decode(mirror_image, iter); } catch (const buffer::error &err) { CLS_ERR("could not decode mirror image payload for key '%s'", key.c_str()); @@ -3761,7 +3761,7 @@ int mirror_image_map_list(cls_method_context_t hctx, cls::rbd::MirrorImageMap mirror_image_map; bufferlist::iterator iter = it->second.begin(); try { - ::decode(mirror_image_map, iter); + decode(mirror_image_map, iter); } catch (const buffer::error &err) { CLS_ERR("could not decode image map payload: %s", cpp_strerror(r).c_str()); return -EINVAL; @@ -3796,7 +3796,7 @@ int mirror_uuid_get(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(mirror_uuid, *out); + encode(mirror_uuid, *out); return 0; } @@ -3812,7 +3812,7 @@ int mirror_uuid_set(cls_method_context_t hctx, bufferlist *in, std::string mirror_uuid; try { bufferlist::iterator bl_it = in->begin(); - ::decode(mirror_uuid, bl_it); + decode(mirror_uuid, bl_it); } catch (const buffer::error &err) { return -EINVAL; } @@ -3857,7 +3857,7 @@ int mirror_mode_get(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(mirror_mode_decode, *out); + encode(mirror_mode_decode, *out); return 0; } @@ -3873,7 +3873,7 @@ int mirror_mode_set(cls_method_context_t hctx, bufferlist *in, uint32_t mirror_mode_decode; try { bufferlist::iterator bl_it = in->begin(); - ::decode(mirror_mode_decode, bl_it); + decode(mirror_mode_decode, bl_it); } catch (const buffer::error &err) { return -EINVAL; } @@ -3903,7 +3903,7 @@ int mirror_mode_set(cls_method_context_t hctx, bufferlist *in, } bufferlist bl; - ::encode(mirror_mode_decode, bl); + encode(mirror_mode_decode, bl); r = cls_cxx_map_set_val(hctx, mirror::MODE, &bl); if (r < 0) { @@ -3951,7 +3951,7 @@ int mirror_peer_list(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(peers, *out); + encode(peers, *out); return 0; } @@ -3967,7 +3967,7 @@ int mirror_peer_add(cls_method_context_t hctx, bufferlist *in, cls::rbd::MirrorPeer mirror_peer; try { bufferlist::iterator it = in->begin(); - ::decode(mirror_peer, it); + decode(mirror_peer, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4017,7 +4017,7 @@ int mirror_peer_add(cls_method_context_t hctx, bufferlist *in, } bufferlist bl; - ::encode(mirror_peer, bl); + encode(mirror_peer, bl); r = cls_cxx_map_set_val(hctx, mirror::peer_key(mirror_peer.uuid), &bl); if (r < 0) { @@ -4039,7 +4039,7 @@ int mirror_peer_remove(cls_method_context_t hctx, bufferlist *in, std::string uuid; try { bufferlist::iterator it = in->begin(); - ::decode(uuid, it); + decode(uuid, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4066,8 +4066,8 @@ int mirror_peer_set_client(cls_method_context_t hctx, bufferlist *in, std::string client_name; try { bufferlist::iterator it = in->begin(); - ::decode(uuid, it); - ::decode(client_name, it); + decode(uuid, it); + decode(client_name, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4100,8 +4100,8 @@ int mirror_peer_set_cluster(cls_method_context_t hctx, bufferlist *in, std::string cluster_name; try { bufferlist::iterator it = in->begin(); - ::decode(uuid, it); - ::decode(cluster_name, it); + decode(uuid, it); + decode(cluster_name, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4136,8 +4136,8 @@ int mirror_image_list(cls_method_context_t hctx, bufferlist *in, uint64_t max_return; try { bufferlist::iterator iter = in->begin(); - ::decode(start_after, iter); - ::decode(max_return, iter); + decode(start_after, iter); + decode(max_return, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4164,7 +4164,7 @@ int mirror_image_list(cls_method_context_t hctx, bufferlist *in, cls::rbd::MirrorImage mirror_image; bufferlist::iterator iter = it->second.begin(); try { - ::decode(mirror_image, iter); + decode(mirror_image, iter); } catch (const buffer::error &err) { CLS_ERR("could not decode mirror image payload of image '%s'", image_id.c_str()); @@ -4181,7 +4181,7 @@ int mirror_image_list(cls_method_context_t hctx, bufferlist *in, } } - ::encode(mirror_images, *out); + encode(mirror_images, *out); return 0; } @@ -4198,7 +4198,7 @@ int mirror_image_get_image_id(cls_method_context_t hctx, bufferlist *in, std::string global_id; try { bufferlist::iterator it = in->begin(); - ::decode(global_id, it); + decode(global_id, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4211,7 +4211,7 @@ int mirror_image_get_image_id(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(image_id, *out); + encode(image_id, *out); return 0; } @@ -4228,7 +4228,7 @@ int mirror_image_get(cls_method_context_t hctx, bufferlist *in, string image_id; try { bufferlist::iterator it = in->begin(); - ::decode(image_id, it); + decode(image_id, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4239,7 +4239,7 @@ int mirror_image_get(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(mirror_image, *out); + encode(mirror_image, *out); return 0; } @@ -4258,8 +4258,8 @@ int mirror_image_set(cls_method_context_t hctx, bufferlist *in, cls::rbd::MirrorImage mirror_image; try { bufferlist::iterator it = in->begin(); - ::decode(image_id, it); - ::decode(mirror_image, it); + decode(image_id, it); + decode(mirror_image, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4283,7 +4283,7 @@ int mirror_image_remove(cls_method_context_t hctx, bufferlist *in, string image_id; try { bufferlist::iterator it = in->begin(); - ::decode(image_id, it); + decode(image_id, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4309,8 +4309,8 @@ int mirror_image_status_set(cls_method_context_t hctx, bufferlist *in, cls::rbd::MirrorImageStatus status; try { bufferlist::iterator it = in->begin(); - ::decode(global_image_id, it); - ::decode(status, it); + decode(global_image_id, it); + decode(status, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4334,7 +4334,7 @@ int mirror_image_status_remove(cls_method_context_t hctx, bufferlist *in, string global_image_id; try { bufferlist::iterator it = in->begin(); - ::decode(global_image_id, it); + decode(global_image_id, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4359,7 +4359,7 @@ int mirror_image_status_get(cls_method_context_t hctx, bufferlist *in, string global_image_id; try { bufferlist::iterator it = in->begin(); - ::decode(global_image_id, it); + decode(global_image_id, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4376,7 +4376,7 @@ int mirror_image_status_get(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(status, *out); + encode(status, *out); return 0; } @@ -4397,8 +4397,8 @@ int mirror_image_status_list(cls_method_context_t hctx, bufferlist *in, uint64_t max_return; try { bufferlist::iterator iter = in->begin(); - ::decode(start_after, iter); - ::decode(max_return, iter); + decode(start_after, iter); + decode(max_return, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4411,8 +4411,8 @@ int mirror_image_status_list(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(images, *out); - ::encode(statuses, *out); + encode(images, *out); + encode(statuses, *out); return 0; } @@ -4433,7 +4433,7 @@ int mirror_image_status_get_summary(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(states, *out); + encode(states, *out); return 0; } @@ -4470,7 +4470,7 @@ int mirror_instances_list(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(instance_ids, *out); + encode(instance_ids, *out); return 0; } @@ -4486,7 +4486,7 @@ int mirror_instances_add(cls_method_context_t hctx, bufferlist *in, std::string instance_id; try { bufferlist::iterator iter = in->begin(); - ::decode(instance_id, iter); + decode(instance_id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4510,7 +4510,7 @@ int mirror_instances_remove(cls_method_context_t hctx, bufferlist *in, std::string instance_id; try { bufferlist::iterator iter = in->begin(); - ::decode(instance_id, iter); + decode(instance_id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4537,8 +4537,8 @@ int mirror_image_map_list(cls_method_context_t hctx, bufferlist *in, uint64_t max_return; try { bufferlist::iterator it = in->begin(); - ::decode(start_after, it); - ::decode(max_return, it); + decode(start_after, it); + decode(max_return, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4549,7 +4549,7 @@ int mirror_image_map_list(cls_method_context_t hctx, bufferlist *in, return r; } - ::encode(image_mapping, *out); + encode(image_mapping, *out); return 0; } @@ -4568,14 +4568,14 @@ int mirror_image_map_update(cls_method_context_t hctx, bufferlist *in, try { bufferlist::iterator it = in->begin(); - ::decode(global_image_id, it); - ::decode(image_map, it); + decode(global_image_id, it); + decode(image_map, it); } catch (const buffer::error &err) { return -EINVAL; } bufferlist bl; - ::encode(image_map, bl); + encode(image_map, bl); const std::string key = mirror::mirror_image_map_key(global_image_id); int r = cls_cxx_map_set_val(hctx, key, &bl); @@ -4601,7 +4601,7 @@ int mirror_image_map_remove(cls_method_context_t hctx, bufferlist *in, try { bufferlist::iterator it = in->begin(); - ::decode(global_image_id, it); + decode(global_image_id, it); } catch (const buffer::error &err) { return -EINVAL; } @@ -4631,7 +4631,7 @@ int group_create(cls_method_context_t hctx, bufferlist *in, bufferlist *out) { bufferlist snap_seqbl; uint64_t snap_seq = 0; - ::encode(snap_seq, snap_seqbl); + encode(snap_seq, snap_seqbl); int r = cls_cxx_map_set_val(hctx, GROUP_SNAP_SEQ, &snap_seqbl); if (r < 0) return r; @@ -4657,8 +4657,8 @@ int group_dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) try { bufferlist::iterator iter = in->begin(); - ::decode(start_after, iter); - ::decode(max_return, iter); + decode(start_after, iter); + decode(max_return, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4682,7 +4682,7 @@ int group_dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string id; bufferlist::iterator iter = val.second.begin(); try { - ::decode(id, iter); + decode(id, iter); } catch (const buffer::error &err) { CLS_ERR("could not decode id of consistency group '%s'", val.first.c_str()); return -EIO; @@ -4697,7 +4697,7 @@ int group_dir_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) } } - ::encode(groups, *out); + encode(groups, *out); return 0; } @@ -4725,8 +4725,8 @@ int group_dir_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string name, id; try { bufferlist::iterator iter = in->begin(); - ::decode(name, iter); - ::decode(id, iter); + decode(name, iter); + decode(id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4753,8 +4753,8 @@ int group_dir_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out) return -EBADF; } bufferlist id_bl, name_bl; - ::encode(id, id_bl); - ::encode(name, name_bl); + encode(id, id_bl); + encode(name, name_bl); map omap_vals; omap_vals[name_key] = id_bl; omap_vals[id_key] = name_bl; @@ -4776,8 +4776,8 @@ int group_dir_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string name, id; try { bufferlist::iterator iter = in->begin(); - ::decode(name, iter); - ::decode(id, iter); + decode(name, iter); + decode(id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4839,7 +4839,7 @@ int group_image_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out) cls::rbd::GroupImageStatus st; try { bufferlist::iterator iter = in->begin(); - ::decode(st, iter); + decode(st, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4847,7 +4847,7 @@ int group_image_set(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string image_key = st.spec.image_key(); bufferlist image_val_bl; - ::encode(st.state, image_val_bl); + encode(st.state, image_val_bl); int r = cls_cxx_map_set_val(hctx, image_key, &image_val_bl); if (r < 0) { return r; @@ -4872,7 +4872,7 @@ int group_image_remove(cls_method_context_t hctx, cls::rbd::GroupImageSpec spec; try { bufferlist::iterator iter = in->begin(); - ::decode(spec, iter); + decode(spec, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4908,8 +4908,8 @@ int group_image_list(cls_method_context_t hctx, uint64_t max_return; try { bufferlist::iterator iter = in->begin(); - ::decode(start_after, iter); - ::decode(max_return, iter); + decode(start_after, iter); + decode(max_return, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4931,7 +4931,7 @@ int group_image_list(cls_method_context_t hctx, bufferlist::iterator iter = it->second.begin(); cls::rbd::GroupImageLinkState state; try { - ::decode(state, iter); + decode(state, iter); } catch (const buffer::error &err) { CLS_ERR("error decoding state for image: %s", it->first.c_str()); return -EIO; @@ -4951,7 +4951,7 @@ int group_image_list(cls_method_context_t hctx, } } while (more && (res.size() < max_return)); - ::encode(res, *out); + encode(res, *out); return 0; } @@ -4973,7 +4973,7 @@ int image_add_group(cls_method_context_t hctx, cls::rbd::GroupSpec new_group; try { bufferlist::iterator iter = in->begin(); - ::decode(new_group, iter); + decode(new_group, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -4987,7 +4987,7 @@ int image_add_group(cls_method_context_t hctx, cls::rbd::GroupSpec old_group; try { bufferlist::iterator iter = existing_refbl.begin(); - ::decode(old_group, iter); + decode(old_group, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -5003,7 +5003,7 @@ int image_add_group(cls_method_context_t hctx, } bufferlist refbl; - ::encode(new_group, refbl); + encode(new_group, refbl); r = cls_cxx_map_set_val(hctx, RBD_GROUP_REF, &refbl); if (r < 0) { @@ -5031,7 +5031,7 @@ int image_remove_group(cls_method_context_t hctx, cls::rbd::GroupSpec spec; try { bufferlist::iterator iter = in->begin(); - ::decode(spec, iter); + decode(spec, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -5045,7 +5045,7 @@ int image_remove_group(cls_method_context_t hctx, cls::rbd::GroupSpec ref_spec; bufferlist::iterator iter = refbl.begin(); try { - ::decode(ref_spec, iter); + decode(ref_spec, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -5087,13 +5087,13 @@ int image_get_group(cls_method_context_t hctx, if (r != -ENOENT) { bufferlist::iterator iter = refbl.begin(); try { - ::decode(spec, iter); + decode(spec, iter); } catch (const buffer::error &err) { return -EINVAL; } } - ::encode(spec, *out); + encode(spec, *out); return 0; } @@ -5135,8 +5135,8 @@ int trash_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out) cls::rbd::TrashImageSpec trash_spec; try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); - ::decode(trash_spec, iter); + decode(id, iter); + decode(trash_spec, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -5161,7 +5161,7 @@ int trash_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out) } map omap_vals; - ::encode(trash_spec, omap_vals[key]); + encode(trash_spec, omap_vals[key]); return cls_cxx_map_set_vals(hctx, &omap_vals); } @@ -5181,7 +5181,7 @@ int trash_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string id; try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); + decode(id, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -5228,8 +5228,8 @@ int trash_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) try { bufferlist::iterator iter = in->begin(); - ::decode(start_after, iter); - ::decode(max_return, iter); + decode(start_after, iter); + decode(max_return, iter); } catch (const buffer::error &err) { return -EINVAL; } @@ -5256,7 +5256,7 @@ int trash_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) map::iterator it = raw_data.begin(); for (; it != raw_data.end(); ++it) { - ::decode(data[trash::image_id_from_key(it->first)], it->second); + decode(data[trash::image_id_from_key(it->first)], it->second); } if (!more) { @@ -5266,7 +5266,7 @@ int trash_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) last_read = raw_data.rbegin()->first; } - ::encode(data, *out); + encode(data, *out); return 0; } @@ -5287,7 +5287,7 @@ int trash_get(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string id; try { bufferlist::iterator iter = in->begin(); - ::decode(id, iter); + decode(id, iter); } catch (const buffer::error &err) { return -EINVAL; } diff --git a/src/cls/rbd/cls_rbd.h b/src/cls/rbd/cls_rbd.h index f08fc1b1f0a..d1a8948ad12 100644 --- a/src/cls/rbd/cls_rbd.h +++ b/src/cls/rbd/cls_rbd.h @@ -25,18 +25,18 @@ struct cls_rbd_parent { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(pool, bl); - ::encode(id, bl); - ::encode(snapid, bl); - ::encode(overlap, bl); + encode(pool, bl); + encode(id, bl); + encode(snapid, bl); + encode(overlap, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(pool, bl); - ::decode(id, bl); - ::decode(snapid, bl); - ::decode(overlap, bl); + decode(pool, bl); + decode(id, bl); + decode(snapid, bl); + decode(overlap, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const { @@ -80,37 +80,37 @@ struct cls_rbd_snap { {} void encode(bufferlist& bl) const { ENCODE_START(6, 1, bl); - ::encode(id, bl); - ::encode(name, bl); - ::encode(image_size, bl); - ::encode(features, bl); - ::encode(parent, bl); - ::encode(protection_status, bl); - ::encode(flags, bl); - ::encode(snapshot_namespace, bl); - ::encode(timestamp, bl); + encode(id, bl); + encode(name, bl); + encode(image_size, bl); + encode(features, bl); + encode(parent, bl); + encode(protection_status, bl); + encode(flags, bl); + encode(snapshot_namespace, bl); + encode(timestamp, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& p) { DECODE_START(6, p); - ::decode(id, p); - ::decode(name, p); - ::decode(image_size, p); - ::decode(features, p); + decode(id, p); + decode(name, p); + decode(image_size, p); + decode(features, p); if (struct_v >= 2) { - ::decode(parent, p); + decode(parent, p); } if (struct_v >= 3) { - ::decode(protection_status, p); + decode(protection_status, p); } if (struct_v >= 4) { - ::decode(flags, p); + decode(flags, p); } if (struct_v >= 5) { - ::decode(snapshot_namespace, p); + decode(snapshot_namespace, p); } if (struct_v >= 6) { - ::decode(timestamp, p); + decode(timestamp, p); } DECODE_FINISH(p); } diff --git a/src/cls/rbd/cls_rbd_client.cc b/src/cls/rbd/cls_rbd_client.cc index 9e12ab61584..bdfb17892ac 100644 --- a/src/cls/rbd/cls_rbd_client.cc +++ b/src/cls/rbd/cls_rbd_client.cc @@ -16,12 +16,12 @@ namespace librbd { void get_initial_metadata_start(librados::ObjectReadOperation *op) { bufferlist bl, empty_bl, features_bl; snapid_t snap = CEPH_NOSNAP; - ::encode(snap, bl); + encode(snap, bl); op->exec("rbd", "get_size", bl); op->exec("rbd", "get_object_prefix", empty_bl); - ::encode(snap, features_bl); - ::encode(true, features_bl); + encode(snap, features_bl); + encode(true, features_bl); op->exec("rbd", "get_features", features_bl); } @@ -33,13 +33,13 @@ namespace librbd { uint64_t size; uint64_t incompatible_features; // get_size - ::decode(*order, *it); - ::decode(size, *it); + decode(*order, *it); + decode(size, *it); // get_object_prefix - ::decode(*object_prefix, *it); + decode(*object_prefix, *it); // get_features - ::decode(*features, *it); - ::decode(incompatible_features, *it); + decode(*features, *it); + decode(incompatible_features, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -67,19 +67,19 @@ namespace librbd { bool read_only) { snapid_t snap = CEPH_NOSNAP; bufferlist size_bl; - ::encode(snap, size_bl); + encode(snap, size_bl); op->exec("rbd", "get_size", size_bl); bufferlist features_bl; - ::encode(snap, features_bl); - ::encode(read_only, features_bl); + encode(snap, features_bl); + encode(read_only, features_bl); op->exec("rbd", "get_features", features_bl); bufferlist empty_bl; op->exec("rbd", "get_snapcontext", empty_bl); bufferlist parent_bl; - ::encode(snap, parent_bl); + encode(snap, parent_bl); op->exec("rbd", "get_parent", parent_bl); rados::cls::lock::get_lock_info_start(op, RBD_LOCK_NAME); @@ -103,18 +103,18 @@ namespace librbd { try { uint8_t order; // get_size - ::decode(order, *it); - ::decode(*size, *it); + decode(order, *it); + decode(*size, *it); // get_features - ::decode(*features, *it); - ::decode(*incompatible_features, *it); + decode(*features, *it); + decode(*incompatible_features, *it); // get_snapcontext - ::decode(*snapc, *it); + decode(*snapc, *it); // get_parent - ::decode(parent->spec.pool_id, *it); - ::decode(parent->spec.image_id, *it); - ::decode(parent->spec.snap_id, *it); - ::decode(parent->overlap, *it); + decode(parent->spec.pool_id, *it); + decode(parent->spec.image_id, *it); + decode(parent->spec.snap_id, *it); + decode(parent->overlap, *it); // get_lock_info ClsLockType lock_type = LOCK_NONE; @@ -163,11 +163,11 @@ namespace librbd { const std::string &object_prefix, int64_t data_pool_id) { bufferlist bl; - ::encode(size, bl); - ::encode(order, bl); - ::encode(features, bl); - ::encode(object_prefix, bl); - ::encode(data_pool_id, bl); + encode(size, bl); + encode(order, bl); + encode(features, bl); + encode(object_prefix, bl); + encode(data_pool_id, bl); op->exec("rbd", "create", bl); } @@ -186,7 +186,7 @@ namespace librbd { snapid_t snap_id, uint64_t *features) { bufferlist inbl, outbl; - ::encode(snap_id, inbl); + encode(snap_id, inbl); int r = ioctx->exec(oid, "rbd", "get_features", inbl, outbl); if (r < 0) @@ -194,7 +194,7 @@ namespace librbd { try { bufferlist::iterator iter = outbl.begin(); - ::decode(*features, iter); + decode(*features, iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -206,8 +206,8 @@ namespace librbd { uint64_t mask) { bufferlist bl; - ::encode(features, bl); - ::encode(mask, bl); + encode(features, bl); + encode(mask, bl); op->exec("rbd", "set_features", bl); } @@ -231,7 +231,7 @@ namespace librbd { try { bufferlist::iterator iter = outbl.begin(); - ::decode(*object_prefix, iter); + decode(*object_prefix, iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -246,7 +246,7 @@ namespace librbd { int get_data_pool_finish(bufferlist::iterator *it, int64_t *data_pool_id) { try { - ::decode(*data_pool_id, *it); + decode(*data_pool_id, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -272,7 +272,7 @@ namespace librbd { snapid_t snap_id, uint64_t *size, uint8_t *order) { bufferlist inbl, outbl; - ::encode(snap_id, inbl); + encode(snap_id, inbl); int r = ioctx->exec(oid, "rbd", "get_size", inbl, outbl); if (r < 0) @@ -280,8 +280,8 @@ namespace librbd { try { bufferlist::iterator iter = outbl.begin(); - ::decode(*order, iter); - ::decode(*size, iter); + decode(*order, iter); + decode(*size, iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -300,7 +300,7 @@ namespace librbd { void set_size(librados::ObjectWriteOperation *op, uint64_t size) { bufferlist bl; - ::encode(size, bl); + encode(size, bl); op->exec("rbd", "set_size", bl); } @@ -309,7 +309,7 @@ namespace librbd { uint64_t *parent_overlap) { bufferlist inbl, outbl; - ::encode(snap_id, inbl); + encode(snap_id, inbl); int r = ioctx->exec(oid, "rbd", "get_parent", inbl, outbl); if (r < 0) @@ -317,10 +317,10 @@ namespace librbd { try { bufferlist::iterator iter = outbl.begin(); - ::decode(pspec->pool_id, iter); - ::decode(pspec->image_id, iter); - ::decode(pspec->snap_id, iter); - ::decode(*parent_overlap, iter); + decode(pspec->pool_id, iter); + decode(pspec->image_id, iter); + decode(pspec->snap_id, iter); + decode(*parent_overlap, iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -339,10 +339,10 @@ namespace librbd { void set_parent(librados::ObjectWriteOperation *op, const ParentSpec &pspec, uint64_t parent_overlap) { bufferlist in_bl; - ::encode(pspec.pool_id, in_bl); - ::encode(pspec.image_id, in_bl); - ::encode(pspec.snap_id, in_bl); - ::encode(parent_overlap, in_bl); + encode(pspec.pool_id, in_bl); + encode(pspec.image_id, in_bl); + encode(pspec.snap_id, in_bl); + encode(parent_overlap, in_bl); op->exec("rbd", "set_parent", in_bl); } @@ -350,12 +350,12 @@ namespace librbd { void get_flags_start(librados::ObjectReadOperation *op, const std::vector &snap_ids) { bufferlist in_bl; - ::encode(static_cast(CEPH_NOSNAP), in_bl); + encode(static_cast(CEPH_NOSNAP), in_bl); op->exec("rbd", "get_flags", in_bl); for (size_t i = 0; i < snap_ids.size(); ++i) { bufferlist snap_bl; - ::encode(snap_ids[i], snap_bl); + encode(snap_ids[i], snap_bl); op->exec("rbd", "get_flags", snap_bl); } @@ -366,9 +366,9 @@ namespace librbd { std::vector *snap_flags) { snap_flags->resize(snap_ids.size()); try { - ::decode(*flags, *it); + decode(*flags, *it); for (size_t i = 0; i < snap_flags->size(); ++i) { - ::decode((*snap_flags)[i], *it); + decode((*snap_flags)[i], *it); } } catch (const buffer::error &err) { return -EBADMSG; @@ -397,9 +397,9 @@ namespace librbd { uint64_t flags, uint64_t mask) { bufferlist inbl; - ::encode(flags, inbl); - ::encode(mask, inbl); - ::encode(snap_id, inbl); + encode(flags, inbl); + encode(mask, inbl); + encode(snap_id, inbl); op->exec("rbd", "set_flags", inbl); } @@ -428,10 +428,10 @@ namespace librbd { const ParentSpec pspec, const std::string &c_imageid) { bufferlist in; - ::encode(pspec.pool_id, in); - ::encode(pspec.image_id, in); - ::encode(pspec.snap_id, in); - ::encode(c_imageid, in); + encode(pspec.pool_id, in); + encode(pspec.image_id, in); + encode(pspec.snap_id, in); + encode(c_imageid, in); op->exec("rbd", "add_child", in); } @@ -440,10 +440,10 @@ namespace librbd { const ParentSpec &pspec, const std::string &c_imageid) { bufferlist in; - ::encode(pspec.pool_id, in); - ::encode(pspec.image_id, in); - ::encode(pspec.snap_id, in); - ::encode(c_imageid, in); + encode(pspec.pool_id, in); + encode(pspec.image_id, in); + encode(pspec.snap_id, in); + encode(c_imageid, in); op->exec("rbd", "remove_child", in); } @@ -458,16 +458,16 @@ namespace librbd { void get_children_start(librados::ObjectReadOperation *op, const ParentSpec &pspec) { bufferlist in_bl; - ::encode(pspec.pool_id, in_bl); - ::encode(pspec.image_id, in_bl); - ::encode(pspec.snap_id, in_bl); + encode(pspec.pool_id, in_bl); + encode(pspec.image_id, in_bl); + encode(pspec.snap_id, in_bl); op->exec("rbd", "get_children", in_bl); } int get_children_finish(bufferlist::iterator *it, std::set* children) { try { - ::decode(*children, *it); + decode(*children, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -494,16 +494,16 @@ namespace librbd { const std::string &snap_name, const cls::rbd::SnapshotNamespace &snap_namespace) { bufferlist bl; - ::encode(snap_name, bl); - ::encode(snap_id, bl); - ::encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl); + encode(snap_name, bl); + encode(snap_id, bl); + encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl); op->exec("rbd", "snapshot_add", bl); } void snapshot_remove(librados::ObjectWriteOperation *op, snapid_t snap_id) { bufferlist bl; - ::encode(snap_id, bl); + encode(snap_id, bl); op->exec("rbd", "snapshot_remove", bl); } @@ -512,8 +512,8 @@ namespace librbd { const std::string &dst_name) { bufferlist bl; - ::encode(src_snap_id, bl); - ::encode(dst_name, bl); + encode(src_snap_id, bl); + encode(dst_name, bl); op->exec("rbd", "snapshot_rename", bl); } @@ -527,7 +527,7 @@ namespace librbd { ::SnapContext *snapc) { try { - ::decode(*snapc, *it); + decode(*snapc, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -557,13 +557,13 @@ namespace librbd { const std::vector &ids) { for (auto snap_id : ids) { bufferlist bl1, bl2, bl3, bl4; - ::encode(snap_id, bl1); + encode(snap_id, bl1); op->exec("rbd", "get_snapshot_name", bl1); - ::encode(snap_id, bl2); + encode(snap_id, bl2); op->exec("rbd", "get_size", bl2); - ::encode(snap_id, bl3); + encode(snap_id, bl3); op->exec("rbd", "get_parent", bl3); - ::encode(snap_id, bl4); + encode(snap_id, bl4); op->exec("rbd", "get_protection_status", bl4); } } @@ -583,17 +583,17 @@ namespace librbd { for (size_t i = 0; i < names->size(); ++i) { uint8_t order; // get_snapshot_name - ::decode((*names)[i], *it); + decode((*names)[i], *it); // get_size - ::decode(order, *it); - ::decode((*sizes)[i], *it); + decode(order, *it); + decode((*sizes)[i], *it); // get_parent - ::decode((*parents)[i].spec.pool_id, *it); - ::decode((*parents)[i].spec.image_id, *it); - ::decode((*parents)[i].spec.snap_id, *it); - ::decode((*parents)[i].overlap, *it); + decode((*parents)[i].spec.pool_id, *it); + decode((*parents)[i].spec.image_id, *it); + decode((*parents)[i].spec.snap_id, *it); + decode((*parents)[i].overlap, *it); // get_protection_status - ::decode((*protection_statuses)[i], *it); + decode((*protection_statuses)[i], *it); } } catch (const buffer::error &err) { return -EBADMSG; @@ -627,7 +627,7 @@ namespace librbd { { for (auto snap_id : ids) { bufferlist bl; - ::encode(snap_id, bl); + encode(snap_id, bl); op->exec("rbd", "get_snapshot_timestamp", bl); } } @@ -640,7 +640,7 @@ namespace librbd { try { for (size_t i = 0; i < timestamps->size(); ++i) { utime_t t; - ::decode(t, *it); + decode(t, *it); (*timestamps)[i] = t; } } catch (const buffer::error &err) { @@ -671,7 +671,7 @@ namespace librbd { { for (auto snap_id : ids) { bufferlist bl; - ::encode(snap_id, bl); + encode(snap_id, bl); op->exec("rbd", "get_snapshot_namespace", bl); } } @@ -684,7 +684,7 @@ namespace librbd { try { for (size_t i = 0; i < namespaces->size(); ++i) { cls::rbd::SnapshotNamespaceOnDisk e; - ::decode(e, *it); + decode(e, *it); (*namespaces)[i] = e.snapshot_namespace; } } catch (const buffer::error &err) { @@ -714,8 +714,8 @@ namespace librbd { snapid_t snap_id, const std::string &snap_name) { bufferlist bl; - ::encode(snap_name, bl); - ::encode(snap_id, bl); + encode(snap_name, bl); + encode(snap_id, bl); op->exec("rbd", "snap_add", bl); } @@ -723,7 +723,7 @@ namespace librbd { const std::string &snap_name) { bufferlist bl; - ::encode(snap_name, bl); + encode(snap_name, bl); op->exec("rbd", "snap_remove", bl); } @@ -731,8 +731,8 @@ namespace librbd { snapid_t src_snap_id, const std::string &dst_name) { bufferlist bl; - ::encode(src_snap_id, bl); - ::encode(dst_name, bl); + encode(src_snap_id, bl); + encode(dst_name, bl); op->exec("rbd", "snap_rename", bl); } @@ -747,16 +747,16 @@ namespace librbd { ::SnapContext *snapc) { try { uint32_t num_snaps; - ::decode(snapc->seq, *it); - ::decode(num_snaps, *it); + decode(snapc->seq, *it); + decode(num_snaps, *it); names->resize(num_snaps); sizes->resize(num_snaps); snapc->snaps.resize(num_snaps); for (uint32_t i = 0; i < num_snaps; ++i) { - ::decode(snapc->snaps[i], *it); - ::decode((*sizes)[i], *it); - ::decode((*names)[i], *it); + decode(snapc->snaps[i], *it); + decode((*sizes)[i], *it); + decode((*names)[i], *it); } } catch (const buffer::error &err) { return -EBADMSG; @@ -790,7 +790,7 @@ namespace librbd { int get_all_features_finish(bufferlist::iterator *it, uint64_t *all_features) { try { - ::decode(*all_features, *it); + decode(*all_features, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -822,7 +822,7 @@ namespace librbd { snapid_t snap_id, uint8_t *protection_status) { bufferlist in, out; - ::encode(snap_id.val, in); + encode(snap_id.val, in); int r = ioctx->exec(oid, "rbd", "get_protection_status", in, out); if (r < 0) @@ -830,7 +830,7 @@ namespace librbd { try { bufferlist::iterator iter = out.begin(); - ::decode(*protection_status, iter); + decode(*protection_status, iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -851,8 +851,8 @@ namespace librbd { snapid_t snap_id, uint8_t protection_status) { bufferlist in; - ::encode(snap_id, in); - ::encode(protection_status, in); + encode(snap_id, in); + encode(protection_status, in); op->exec("rbd", "set_protection_status", in); } @@ -868,7 +868,7 @@ namespace librbd { try { bufferlist::iterator iter = out.begin(); - ::decode(*limit, iter); + decode(*limit, iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -879,7 +879,7 @@ namespace librbd { void snapshot_set_limit(librados::ObjectWriteOperation *op, uint64_t limit) { bufferlist in; - ::encode(limit, in); + encode(limit, in); op->exec("rbd", "snapshot_set_limit", in); } @@ -895,8 +895,8 @@ namespace librbd { assert(stripe_count); try { - ::decode(*stripe_unit, *it); - ::decode(*stripe_count, *it); + decode(*stripe_unit, *it); + decode(*stripe_count, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -923,8 +923,8 @@ namespace librbd { uint64_t stripe_unit, uint64_t stripe_count) { bufferlist bl; - ::encode(stripe_unit, bl); - ::encode(stripe_count, bl); + encode(stripe_unit, bl); + encode(stripe_count, bl); op->exec("rbd", "set_stripe_unit_count", bl); } @@ -948,7 +948,7 @@ namespace librbd { assert(timestamp); try { - ::decode(*timestamp, *it); + decode(*timestamp, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -980,7 +980,7 @@ namespace librbd { int get_id_finish(bufferlist::iterator *it, std::string *id) { try { - ::decode(*id, *it); + decode(*id, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1005,7 +1005,7 @@ namespace librbd { void set_id(librados::ObjectWriteOperation *op, const std::string id) { bufferlist bl; - ::encode(id, bl); + encode(id, bl); op->exec("rbd", "set_id", bl); } @@ -1022,14 +1022,14 @@ namespace librbd { void dir_get_id_start(librados::ObjectReadOperation *op, const std::string &image_name) { bufferlist bl; - ::encode(image_name, bl); + encode(image_name, bl); op->exec("rbd", "dir_get_id", bl); } int dir_get_id_finish(bufferlist::iterator *iter, std::string *image_id) { try { - ::decode(*image_id, *iter); + decode(*image_id, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1055,13 +1055,13 @@ namespace librbd { void dir_get_name_start(librados::ObjectReadOperation *op, const std::string &id) { bufferlist in_bl; - ::encode(id, in_bl); + encode(id, in_bl); op->exec("rbd", "dir_get_name", in_bl); } int dir_get_name_finish(bufferlist::iterator *it, std::string *name) { try { - ::decode(*name, *it); + decode(*name, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1087,8 +1087,8 @@ namespace librbd { const std::string &start, uint64_t max_return) { bufferlist in_bl; - ::encode(start, in_bl); - ::encode(max_return, in_bl); + encode(start, in_bl); + encode(max_return, in_bl); op->exec("rbd", "dir_list", in_bl); } @@ -1096,7 +1096,7 @@ namespace librbd { int dir_list_finish(bufferlist::iterator *it, map *images) { try { - ::decode(*images, *it); + decode(*images, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1124,8 +1124,8 @@ namespace librbd { const std::string &name, const std::string &id) { bufferlist bl; - ::encode(name, bl); - ::encode(id, bl); + encode(name, bl); + encode(id, bl); op->exec("rbd", "dir_add_image", bl); } @@ -1151,8 +1151,8 @@ namespace librbd { const std::string &name, const std::string &id) { bufferlist bl; - ::encode(name, bl); - ::encode(id, bl); + encode(name, bl); + encode(id, bl); op->exec("rbd", "dir_remove_image", bl); } @@ -1162,9 +1162,9 @@ namespace librbd { const std::string &id) { bufferlist in; - ::encode(src, in); - ::encode(dest, in); - ::encode(id, in); + encode(src, in); + encode(dest, in); + encode(id, in); op->exec("rbd", "dir_rename_image", in); } @@ -1214,8 +1214,8 @@ namespace librbd { uint64_t object_count, uint8_t default_state) { bufferlist in; - ::encode(object_count, in); - ::encode(default_state, in); + encode(object_count, in); + encode(default_state, in); rados_op->exec("rbd", "object_map_resize", in); } @@ -1225,10 +1225,10 @@ namespace librbd { const boost::optional ¤t_object_state) { bufferlist in; - ::encode(start_object_no, in); - ::encode(end_object_no, in); - ::encode(new_object_state, in); - ::encode(current_object_state, in); + encode(start_object_no, in); + encode(end_object_no, in); + encode(new_object_state, in); + encode(current_object_state, in); rados_op->exec("rbd", "object_map_update", in); } @@ -1253,7 +1253,7 @@ namespace librbd { const map &data) { bufferlist bl; - ::encode(data, bl); + encode(data, bl); op->exec("rbd", "metadata_set", bl); } @@ -1271,7 +1271,7 @@ namespace librbd { const std::string &key) { bufferlist bl; - ::encode(key, bl); + encode(key, bl); op->exec("rbd", "metadata_remove", bl); } @@ -1306,8 +1306,8 @@ namespace librbd { const std::string &start, uint64_t max_return) { bufferlist in_bl; - ::encode(start, in_bl); - ::encode(max_return, in_bl); + encode(start, in_bl); + encode(max_return, in_bl); op->exec("rbd", "metadata_list", in_bl); } @@ -1316,7 +1316,7 @@ namespace librbd { { assert(pairs); try { - ::decode(*pairs, *it); + decode(*pairs, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1328,14 +1328,14 @@ namespace librbd { { assert(s); bufferlist in, out; - ::encode(key, in); + encode(key, in); int r = ioctx->exec(oid, "rbd", "metadata_get", in, out); if (r < 0) return r; bufferlist::iterator iter = out.begin(); try { - ::decode(*s, iter); + decode(*s, iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1351,7 +1351,7 @@ namespace librbd { int mirror_uuid_get_finish(bufferlist::iterator *it, std::string *uuid) { try { - ::decode(*uuid, *it); + decode(*uuid, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1378,7 +1378,7 @@ namespace librbd { int mirror_uuid_set(librados::IoCtx *ioctx, const std::string &uuid) { bufferlist in_bl; - ::encode(uuid, in_bl); + encode(uuid, in_bl); bufferlist out_bl; int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_uuid_set", in_bl, @@ -1398,7 +1398,7 @@ namespace librbd { cls::rbd::MirrorMode *mirror_mode) { try { uint32_t mirror_mode_decode; - ::decode(mirror_mode_decode, *it); + decode(mirror_mode_decode, *it); *mirror_mode = static_cast(mirror_mode_decode); } catch (const buffer::error &err) { return -EBADMSG; @@ -1432,7 +1432,7 @@ namespace librbd { int mirror_mode_set(librados::IoCtx *ioctx, cls::rbd::MirrorMode mirror_mode) { bufferlist in_bl; - ::encode(static_cast(mirror_mode), in_bl); + encode(static_cast(mirror_mode), in_bl); bufferlist out_bl; int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_mode_set", in_bl, @@ -1456,7 +1456,7 @@ namespace librbd { peers->clear(); try { bufferlist::iterator bl_it = out_bl.begin(); - ::decode(*peers, bl_it); + decode(*peers, bl_it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1468,7 +1468,7 @@ namespace librbd { const std::string &client_name, int64_t pool_id) { cls::rbd::MirrorPeer peer(uuid, cluster_name, client_name, pool_id); bufferlist in_bl; - ::encode(peer, in_bl); + encode(peer, in_bl); bufferlist out_bl; int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_peer_add", in_bl, @@ -1482,7 +1482,7 @@ namespace librbd { int mirror_peer_remove(librados::IoCtx *ioctx, const std::string &uuid) { bufferlist in_bl; - ::encode(uuid, in_bl); + encode(uuid, in_bl); bufferlist out_bl; int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_peer_remove", in_bl, @@ -1497,8 +1497,8 @@ namespace librbd { const std::string &uuid, const std::string &client_name) { bufferlist in_bl; - ::encode(uuid, in_bl); - ::encode(client_name, in_bl); + encode(uuid, in_bl); + encode(client_name, in_bl); bufferlist out_bl; int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_peer_set_client", @@ -1513,8 +1513,8 @@ namespace librbd { const std::string &uuid, const std::string &cluster_name) { bufferlist in_bl; - ::encode(uuid, in_bl); - ::encode(cluster_name, in_bl); + encode(uuid, in_bl); + encode(cluster_name, in_bl); bufferlist out_bl; int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_peer_set_cluster", @@ -1529,8 +1529,8 @@ namespace librbd { const std::string &start, uint64_t max_return) { bufferlist in_bl; - ::encode(start, in_bl); - ::encode(max_return, in_bl); + encode(start, in_bl); + encode(max_return, in_bl); op->exec("rbd", "mirror_image_list", in_bl); } @@ -1538,7 +1538,7 @@ namespace librbd { std::map *mirror_image_ids) { try { - ::decode(*mirror_image_ids, *it); + decode(*mirror_image_ids, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1564,14 +1564,14 @@ namespace librbd { void mirror_image_get_image_id_start(librados::ObjectReadOperation *op, const std::string &global_image_id) { bufferlist in_bl; - ::encode(global_image_id, in_bl); + encode(global_image_id, in_bl); op->exec( "rbd", "mirror_image_get_image_id", in_bl); } int mirror_image_get_image_id_finish(bufferlist::iterator *it, std::string *image_id) { try { - ::decode(*image_id, *it); + decode(*image_id, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1616,7 +1616,7 @@ namespace librbd { void mirror_image_get_start(librados::ObjectReadOperation *op, const std::string &image_id) { bufferlist in_bl; - ::encode(image_id, in_bl); + encode(image_id, in_bl); op->exec("rbd", "mirror_image_get", in_bl); } @@ -1624,7 +1624,7 @@ namespace librbd { int mirror_image_get_finish(bufferlist::iterator *iter, cls::rbd::MirrorImage *mirror_image) { try { - ::decode(*mirror_image, *iter); + decode(*mirror_image, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1635,8 +1635,8 @@ namespace librbd { const std::string &image_id, const cls::rbd::MirrorImage &mirror_image) { bufferlist bl; - ::encode(image_id, bl); - ::encode(mirror_image, bl); + encode(image_id, bl); + encode(mirror_image, bl); op->exec("rbd", "mirror_image_set", bl); } @@ -1656,7 +1656,7 @@ namespace librbd { void mirror_image_remove(librados::ObjectWriteOperation *op, const std::string &image_id) { bufferlist bl; - ::encode(image_id, bl); + encode(image_id, bl); op->exec("rbd", "mirror_image_remove", bl); } @@ -1684,8 +1684,8 @@ namespace librbd { const std::string &global_image_id, const cls::rbd::MirrorImageStatus &status) { bufferlist bl; - ::encode(global_image_id, bl); - ::encode(status, bl); + encode(global_image_id, bl); + encode(status, bl); op->exec("rbd", "mirror_image_status_set", bl); } @@ -1699,7 +1699,7 @@ namespace librbd { void mirror_image_status_remove(librados::ObjectWriteOperation *op, const std::string &global_image_id) { bufferlist bl; - ::encode(global_image_id, bl); + encode(global_image_id, bl); op->exec("rbd", "mirror_image_status_remove", bl); } @@ -1726,14 +1726,14 @@ namespace librbd { void mirror_image_status_get_start(librados::ObjectReadOperation *op, const std::string &global_image_id) { bufferlist bl; - ::encode(global_image_id, bl); + encode(global_image_id, bl); op->exec("rbd", "mirror_image_status_get", bl); } int mirror_image_status_get_finish(bufferlist::iterator *iter, cls::rbd::MirrorImageStatus *status) { try { - ::decode(*status, *iter); + decode(*status, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1765,8 +1765,8 @@ namespace librbd { const std::string &start, uint64_t max_return) { bufferlist bl; - ::encode(start, bl); - ::encode(max_return, bl); + encode(start, bl); + encode(max_return, bl); op->exec("rbd", "mirror_image_status_list", bl); } @@ -1776,8 +1776,8 @@ namespace librbd { images->clear(); statuses->clear(); try { - ::decode(*images, *iter); - ::decode(*statuses, *iter); + decode(*images, *iter); + decode(*statuses, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1812,7 +1812,7 @@ namespace librbd { int mirror_image_status_get_summary_finish(bufferlist::iterator *iter, std::map *states) { try { - ::decode(*states, *iter); + decode(*states, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1839,7 +1839,7 @@ namespace librbd { std::vector *instance_ids) { instance_ids->clear(); try { - ::decode(*instance_ids, *iter); + decode(*instance_ids, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1868,7 +1868,7 @@ namespace librbd { void mirror_instances_add(librados::ObjectWriteOperation *op, const std::string &instance_id) { bufferlist bl; - ::encode(instance_id, bl); + encode(instance_id, bl); op->exec("rbd", "mirror_instances_add", bl); } @@ -1882,7 +1882,7 @@ namespace librbd { void mirror_instances_remove(librados::ObjectWriteOperation *op, const std::string &instance_id) { bufferlist bl; - ::encode(instance_id, bl); + encode(instance_id, bl); op->exec("rbd", "mirror_instances_remove", bl); } @@ -1897,8 +1897,8 @@ namespace librbd { const std::string &start_after, uint64_t max_read) { bufferlist bl; - ::encode(start_after, bl); - ::encode(max_read, bl); + encode(start_after, bl); + encode(max_read, bl); op->exec("rbd", "mirror_image_map_list", bl); } @@ -1906,7 +1906,7 @@ namespace librbd { int mirror_image_map_list_finish(bufferlist::iterator *iter, std::map *image_mapping) { try { - ::decode(*image_mapping, *iter); + decode(*image_mapping, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1917,8 +1917,8 @@ namespace librbd { const std::string &global_image_id, const cls::rbd::MirrorImageMap &image_map) { bufferlist bl; - ::encode(global_image_id, bl); - ::encode(image_map, bl); + encode(global_image_id, bl); + encode(image_map, bl); op->exec("rbd", "mirror_image_map_update", bl); } @@ -1926,7 +1926,7 @@ namespace librbd { void mirror_image_map_remove(librados::ObjectWriteOperation *op, const std::string &global_image_id) { bufferlist bl; - ::encode(global_image_id, bl); + encode(global_image_id, bl); op->exec("rbd", "mirror_image_map_remove", bl); } @@ -1944,15 +1944,15 @@ namespace librbd { map *cgs) { bufferlist in, out; - ::encode(start, in); - ::encode(max_return, in); + encode(start, in); + encode(max_return, in); int r = ioctx->exec(oid, "rbd", "group_dir_list", in, out); if (r < 0) return r; bufferlist::iterator iter = out.begin(); try { - ::decode(*cgs, iter); + decode(*cgs, iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -1964,8 +1964,8 @@ namespace librbd { const std::string &name, const std::string &id) { bufferlist in, out; - ::encode(name, in); - ::encode(id, in); + encode(name, in); + encode(id, in); return ioctx->exec(oid, "rbd", "group_dir_add", in, out); } @@ -1973,8 +1973,8 @@ namespace librbd { const std::string &name, const std::string &id) { bufferlist in, out; - ::encode(name, in); - ::encode(id, in); + encode(name, in); + encode(id, in); return ioctx->exec(oid, "rbd", "group_dir_remove", in, out); } @@ -1982,7 +1982,7 @@ namespace librbd { const cls::rbd::GroupImageSpec &spec) { bufferlist bl, bl2; - ::encode(spec, bl); + encode(spec, bl); return ioctx->exec(oid, "rbd", "group_image_remove", bl, bl2); } @@ -1994,8 +1994,8 @@ namespace librbd { std::vector *images) { bufferlist bl, bl2; - ::encode(start, bl); - ::encode(max_return, bl); + encode(start, bl); + encode(max_return, bl); int r = ioctx->exec(oid, "rbd", "group_image_list", bl, bl2); if (r < 0) @@ -2003,7 +2003,7 @@ namespace librbd { bufferlist::iterator iter = bl2.begin(); try { - ::decode(*images, iter); + decode(*images, iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -2015,7 +2015,7 @@ namespace librbd { const cls::rbd::GroupImageStatus &st) { bufferlist bl, bl2; - ::encode(st, bl); + encode(st, bl); return ioctx->exec(oid, "rbd", "group_image_set", bl, bl2); } @@ -2024,7 +2024,7 @@ namespace librbd { const cls::rbd::GroupSpec &group_spec) { bufferlist bl, bl2; - ::encode(group_spec, bl); + encode(group_spec, bl); return ioctx->exec(oid, "rbd", "image_add_group", bl, bl2); } @@ -2033,7 +2033,7 @@ namespace librbd { const cls::rbd::GroupSpec &group_spec) { bufferlist bl, bl2; - ::encode(group_spec, bl); + encode(group_spec, bl); return ioctx->exec(oid, "rbd", "image_remove_group", bl, bl2); } @@ -2048,7 +2048,7 @@ namespace librbd { cls::rbd::GroupSpec *group_spec) { try { - ::decode(*group_spec, *iter); + decode(*group_spec, *iter); } catch (const buffer::error &err) { return -EBADMSG; } @@ -2077,8 +2077,8 @@ namespace librbd { const cls::rbd::TrashImageSpec &trash_spec) { bufferlist bl; - ::encode(id, bl); - ::encode(trash_spec, bl); + encode(id, bl); + encode(trash_spec, bl); op->exec("rbd", "trash_add", bl); } @@ -2095,7 +2095,7 @@ namespace librbd { const std::string &id) { bufferlist bl; - ::encode(id, bl); + encode(id, bl); op->exec("rbd", "trash_remove", bl); } @@ -2111,8 +2111,8 @@ namespace librbd { const std::string &start, uint64_t max_return) { bufferlist bl; - ::encode(start, bl); - ::encode(max_return, bl); + encode(start, bl); + encode(max_return, bl); op->exec("rbd", "trash_list", bl); } @@ -2122,7 +2122,7 @@ namespace librbd { assert(entries); try { - ::decode(*entries, *it); + decode(*entries, *it); } catch (const buffer::error &err) { return -EBADMSG; } @@ -2151,7 +2151,7 @@ namespace librbd { const std::string &id) { bufferlist bl; - ::encode(id, bl); + encode(id, bl); op->exec("rbd", "trash_get", bl); } @@ -2159,7 +2159,7 @@ namespace librbd { cls::rbd::TrashImageSpec *trash_spec) { assert(trash_spec); try { - ::decode(*trash_spec, *it); + decode(*trash_spec, *it); } catch (const buffer::error &err) { return -EBADMSG; } diff --git a/src/cls/rbd/cls_rbd_types.cc b/src/cls/rbd/cls_rbd_types.cc index 8c1767c4edf..86a2a0d4da0 100644 --- a/src/cls/rbd/cls_rbd_types.cc +++ b/src/cls/rbd/cls_rbd_types.cc @@ -10,19 +10,19 @@ namespace rbd { void MirrorPeer::encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(uuid, bl); - ::encode(cluster_name, bl); - ::encode(client_name, bl); - ::encode(pool_id, bl); + encode(uuid, bl); + encode(cluster_name, bl); + encode(client_name, bl); + encode(pool_id, bl); ENCODE_FINISH(bl); } void MirrorPeer::decode(bufferlist::iterator &it) { DECODE_START(1, it); - ::decode(uuid, it); - ::decode(cluster_name, it); - ::decode(client_name, it); - ::decode(pool_id, it); + decode(uuid, it); + decode(cluster_name, it); + decode(client_name, it); + decode(pool_id, it); DECODE_FINISH(it); } @@ -77,16 +77,16 @@ std::ostream& operator<<(std::ostream& os, const MirrorPeer& peer) { void MirrorImage::encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(global_image_id, bl); - ::encode(static_cast(state), bl); + encode(global_image_id, bl); + encode(static_cast(state), bl); ENCODE_FINISH(bl); } void MirrorImage::decode(bufferlist::iterator &it) { uint8_t int_state; DECODE_START(1, it); - ::decode(global_image_id, it); - ::decode(int_state, it); + decode(global_image_id, it); + decode(int_state, it); state = static_cast(int_state); DECODE_FINISH(it); } @@ -135,19 +135,19 @@ std::ostream& operator<<(std::ostream& os, const MirrorImage& mirror_image) { void MirrorImageStatus::encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(state, bl); - ::encode(description, bl); - ::encode(last_update, bl); - ::encode(up, bl); + encode(state, bl); + encode(description, bl); + encode(last_update, bl); + encode(up, bl); ENCODE_FINISH(bl); } void MirrorImageStatus::decode(bufferlist::iterator &it) { DECODE_START(1, it); - ::decode(state, it); - ::decode(description, it); - ::decode(last_update, it); - ::decode(up, it); + decode(state, it); + decode(description, it); + decode(last_update, it); + decode(up, it); DECODE_FINISH(it); } @@ -214,15 +214,15 @@ std::ostream& operator<<(std::ostream& os, const MirrorImageStatus& status) { void GroupImageSpec::encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(image_id, bl); - ::encode(pool_id, bl); + encode(image_id, bl); + encode(pool_id, bl); ENCODE_FINISH(bl); } void GroupImageSpec::decode(bufferlist::iterator &it) { DECODE_START(1, it); - ::decode(image_id, it); - ::decode(pool_id, it); + decode(image_id, it); + decode(pool_id, it); DECODE_FINISH(it); } @@ -266,15 +266,15 @@ std::string GroupImageSpec::image_key() { void GroupImageStatus::encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(spec, bl); - ::encode(state, bl); + encode(spec, bl); + encode(state, bl); ENCODE_FINISH(bl); } void GroupImageStatus::decode(bufferlist::iterator &it) { DECODE_START(1, it); - ::decode(spec, it); - ::decode(state, it); + decode(spec, it); + decode(state, it); DECODE_FINISH(it); } @@ -296,15 +296,15 @@ void GroupImageStatus::dump(Formatter *f) const { void GroupSpec::encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(pool_id, bl); - ::encode(group_id, bl); + encode(pool_id, bl); + encode(group_id, bl); ENCODE_FINISH(bl); } void GroupSpec::decode(bufferlist::iterator &it) { DECODE_START(1, it); - ::decode(pool_id, it); - ::decode(group_id, it); + decode(pool_id, it); + decode(group_id, it); DECODE_FINISH(it); } @@ -318,15 +318,17 @@ bool GroupSpec::is_valid() const { } void GroupSnapshotNamespace::encode(bufferlist& bl) const { - ::encode(group_pool, bl); - ::encode(group_id, bl); - ::encode(snapshot_id, bl); + using ceph::encode; + encode(group_pool, bl); + encode(group_id, bl); + encode(snapshot_id, bl); } void GroupSnapshotNamespace::decode(bufferlist::iterator& it) { - ::decode(group_pool, it); - ::decode(group_id, it); - ::decode(snapshot_id, it); + using ceph::decode; + decode(group_pool, it); + decode(group_id, it); + decode(snapshot_id, it); } void GroupSnapshotNamespace::dump(Formatter *f) const { @@ -342,7 +344,8 @@ public: template inline void operator()(const T& t) const { - ::encode(static_cast(T::SNAPSHOT_NAMESPACE_TYPE), m_bl); + using ceph::encode; + encode(static_cast(T::SNAPSHOT_NAMESPACE_TYPE), m_bl); t.encode(m_bl); } @@ -404,7 +407,7 @@ void SnapshotNamespaceOnDisk::decode(bufferlist::iterator &p) { DECODE_START(1, p); uint32_t snap_type; - ::decode(snap_type, p); + decode(snap_type, p); switch (snap_type) { case cls::rbd::SNAPSHOT_NAMESPACE_TYPE_USER: snapshot_namespace = UserSnapshotNamespace(); @@ -450,19 +453,19 @@ std::ostream& operator<<(std::ostream& os, const UnknownSnapshotNamespace& ns) { void TrashImageSpec::encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(source, bl); - ::encode(name, bl); - ::encode(deletion_time, bl); - ::encode(deferment_end_time, bl); + encode(source, bl); + encode(name, bl); + encode(deletion_time, bl); + encode(deferment_end_time, bl); ENCODE_FINISH(bl); } void TrashImageSpec::decode(bufferlist::iterator &it) { DECODE_START(1, it); - ::decode(source, it); - ::decode(name, it); - ::decode(deletion_time, it); - ::decode(deferment_end_time, it); + decode(source, it); + decode(name, it); + decode(deletion_time, it); + decode(deferment_end_time, it); DECODE_FINISH(it); } @@ -481,17 +484,17 @@ void TrashImageSpec::dump(Formatter *f) const { void MirrorImageMap::encode(bufferlist &bl) const { ENCODE_START(1, 1, bl); - ::encode(instance_id, bl); - ::encode(mapped_time, bl); - ::encode(data, bl); + encode(instance_id, bl); + encode(mapped_time, bl); + encode(data, bl); ENCODE_FINISH(bl); } void MirrorImageMap::decode(bufferlist::iterator &it) { DECODE_START(1, it); - ::decode(instance_id, it); - ::decode(mapped_time, it); - ::decode(data, it); + decode(instance_id, it); + decode(mapped_time, it); + decode(data, it); DECODE_FINISH(it); } diff --git a/src/cls/rbd/cls_rbd_types.h b/src/cls/rbd/cls_rbd_types.h index d50281d8bf4..266daac8c78 100644 --- a/src/cls/rbd/cls_rbd_types.h +++ b/src/cls/rbd/cls_rbd_types.h @@ -37,13 +37,15 @@ enum GroupImageLinkState { inline void encode(const GroupImageLinkState &state, bufferlist& bl, uint64_t features=0) { - ::encode(static_cast(state), bl); + using ceph::encode; + encode(static_cast(state), bl); } inline void decode(GroupImageLinkState &state, bufferlist::iterator& it) { uint8_t int_state; - ::decode(int_state, it); + using ceph::decode; + decode(int_state, it); state = static_cast(int_state); } @@ -121,13 +123,15 @@ enum MirrorImageStatusState { inline void encode(const MirrorImageStatusState &state, bufferlist& bl, uint64_t features=0) { - ::encode(static_cast(state), bl); + using ceph::encode; + encode(static_cast(state), bl); } inline void decode(MirrorImageStatusState &state, bufferlist::iterator& it) { uint8_t int_state; - ::decode(int_state, it); + using ceph::decode; + decode(int_state, it); state = static_cast(int_state); } @@ -336,13 +340,15 @@ enum TrashImageSource { inline void encode(const TrashImageSource &source, bufferlist& bl, uint64_t features=0) { - ::encode(static_cast(source), bl); + using ceph::encode; + encode(static_cast(source), bl); } inline void decode(TrashImageSource &source, bufferlist::iterator& it) { uint8_t int_source; - ::decode(int_source, it); + using ceph::decode; + decode(int_source, it); source = static_cast(int_source); } @@ -405,7 +411,4 @@ WRITE_CLASS_ENCODER(MirrorImageMap); } // namespace rbd } // namespace cls -using cls::rbd::encode; -using cls::rbd::decode; - #endif // CEPH_CLS_RBD_TYPES_H diff --git a/src/cls/refcount/cls_refcount.cc b/src/cls/refcount/cls_refcount.cc index 8f06e6f855d..11a600d50db 100644 --- a/src/cls/refcount/cls_refcount.cc +++ b/src/cls/refcount/cls_refcount.cc @@ -22,16 +22,16 @@ struct obj_refcount { void encode(bufferlist& bl) const { ENCODE_START(2, 1, bl); - ::encode(refs, bl); - ::encode(retired_refs, bl); + encode(refs, bl); + encode(retired_refs, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(2, bl); - ::decode(refs, bl); + decode(refs, bl); if (struct_v >= 2) { - ::decode(retired_refs, bl); + decode(retired_refs, bl); } DECODE_FINISH(bl); } @@ -56,7 +56,7 @@ static int read_refcount(cls_method_context_t hctx, bool implicit_ref, obj_refco try { bufferlist::iterator iter = bl.begin(); - ::decode(*objr, iter); + decode(*objr, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: read_refcount(): failed to decode refcount entry\n"); return -EIO; @@ -69,7 +69,7 @@ static int set_refcount(cls_method_context_t hctx, const struct obj_refcount& ob { bufferlist bl; - ::encode(objr, bl); + encode(objr, bl); int ret = cls_cxx_setxattr(hctx, REFCOUNT_ATTR, &bl); if (ret < 0) @@ -84,7 +84,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_rc_refcount_get(): failed to decode entry\n"); return -EINVAL; @@ -112,7 +112,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_rc_refcount_put(): failed to decode entry\n"); return -EINVAL; @@ -165,7 +165,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_refcount_set(): failed to decode entry\n"); return -EINVAL; @@ -194,7 +194,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_rc_refcount_read(): failed to decode entry\n"); return -EINVAL; @@ -212,7 +212,7 @@ static int cls_rc_refcount_read(cls_method_context_t hctx, bufferlist *in, buffe read_ret.refs.push_back(iter->first); } - ::encode(read_ret, *out); + encode(read_ret, *out); return 0; } diff --git a/src/cls/refcount/cls_refcount_client.cc b/src/cls/refcount/cls_refcount_client.cc index 1c27a80add4..14da2ff2b31 100644 --- a/src/cls/refcount/cls_refcount_client.cc +++ b/src/cls/refcount/cls_refcount_client.cc @@ -13,7 +13,7 @@ void cls_refcount_get(librados::ObjectWriteOperation& op, const string& tag, boo cls_refcount_get_op call; call.tag = tag; call.implicit_ref = implicit_ref; - ::encode(call, in); + encode(call, in); op.exec("refcount", "get", in); } @@ -23,7 +23,7 @@ void cls_refcount_put(librados::ObjectWriteOperation& op, const string& tag, boo cls_refcount_put_op call; call.tag = tag; call.implicit_ref = implicit_ref; - ::encode(call, in); + encode(call, in); op.exec("refcount", "put", in); } @@ -32,7 +32,7 @@ void cls_refcount_set(librados::ObjectWriteOperation& op, list& refs) bufferlist in; cls_refcount_set_op call; call.refs = refs; - ::encode(call, in); + encode(call, in); op.exec("refcount", "set", in); } @@ -41,7 +41,7 @@ int cls_refcount_read(librados::IoCtx& io_ctx, string& oid, list *refs, bufferlist in, out; cls_refcount_read_op call; call.implicit_ref = implicit_ref; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, "refcount", "read", in, out); if (r < 0) return r; @@ -49,7 +49,7 @@ int cls_refcount_read(librados::IoCtx& io_ctx, string& oid, list *refs, cls_refcount_read_ret ret; try { bufferlist::iterator iter = out.begin(); - ::decode(ret, iter); + decode(ret, iter); } catch (buffer::error& err) { return -EIO; } diff --git a/src/cls/refcount/cls_refcount_ops.h b/src/cls/refcount/cls_refcount_ops.h index 5cbfe3b8b65..24aa28482ca 100644 --- a/src/cls/refcount/cls_refcount_ops.h +++ b/src/cls/refcount/cls_refcount_ops.h @@ -16,15 +16,15 @@ struct cls_refcount_get_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(tag, bl); - ::encode(implicit_ref, bl); + encode(tag, bl); + encode(implicit_ref, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(tag, bl); - ::decode(implicit_ref, bl); + decode(tag, bl); + decode(implicit_ref, bl); DECODE_FINISH(bl); } void dump(ceph::Formatter *f) const; @@ -41,15 +41,15 @@ struct cls_refcount_put_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(tag, bl); - ::encode(implicit_ref, bl); + encode(tag, bl); + encode(implicit_ref, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(tag, bl); - ::decode(implicit_ref, bl); + decode(tag, bl); + decode(implicit_ref, bl); DECODE_FINISH(bl); } @@ -65,13 +65,13 @@ struct cls_refcount_set_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(refs, bl); + encode(refs, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(refs, bl); + decode(refs, bl); DECODE_FINISH(bl); } @@ -88,13 +88,13 @@ struct cls_refcount_read_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(implicit_ref, bl); + encode(implicit_ref, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(implicit_ref, bl); + decode(implicit_ref, bl); DECODE_FINISH(bl); } @@ -110,13 +110,13 @@ struct cls_refcount_read_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(refs, bl); + encode(refs, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(refs, bl); + decode(refs, bl); DECODE_FINISH(bl); } diff --git a/src/cls/replica_log/cls_replica_log.cc b/src/cls/replica_log/cls_replica_log.cc index e8ae3bc3ded..35ed639e69e 100644 --- a/src/cls/replica_log/cls_replica_log.cc +++ b/src/cls/replica_log/cls_replica_log.cc @@ -30,7 +30,7 @@ static int get_bounds(cls_method_context_t hctx, cls_replica_log_bound& bound) try { bufferlist::iterator bounds_bl_i = bounds_bl.begin(); - ::decode(bound, bounds_bl_i); + decode(bound, bounds_bl_i); } catch (buffer::error& err) { bound = cls_replica_log_bound(); CLS_LOG(0, "ERROR: get_bounds(): failed to decode on-disk bounds object"); @@ -44,7 +44,7 @@ static int write_bounds(cls_method_context_t hctx, const cls_replica_log_bound& bound) { bufferlist bounds_bl; - ::encode(bound, bounds_bl); + encode(bound, bounds_bl); return cls_cxx_map_set_val(hctx, replica_log_bounds, &bounds_bl); } @@ -55,7 +55,7 @@ static int cls_replica_log_set(cls_method_context_t hctx, cls_replica_log_set_marker_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: cls_replica_log_set(): failed to decode op"); return -EINVAL; @@ -82,7 +82,7 @@ static int cls_replica_log_delete(cls_method_context_t hctx, cls_replica_log_delete_marker_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: cls_replica_log_delete(): failed to decode op"); return -EINVAL; @@ -109,7 +109,7 @@ static int cls_replica_log_get(cls_method_context_t hctx, cls_replica_log_get_bounds_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: cls_replica_log_get(): failed to decode op"); return -EINVAL; @@ -126,7 +126,7 @@ static int cls_replica_log_get(cls_method_context_t hctx, ret.position_marker = bound.get_lowest_marker_bound(); bound.get_markers(ret.markers); - ::encode(ret, *out); + encode(ret, *out); return 0; } diff --git a/src/cls/replica_log/cls_replica_log_client.cc b/src/cls/replica_log/cls_replica_log_client.cc index 13e876dc22e..cb764e74308 100644 --- a/src/cls/replica_log/cls_replica_log_client.cc +++ b/src/cls/replica_log/cls_replica_log_client.cc @@ -50,7 +50,7 @@ void cls_replica_log_update_bound(librados::ObjectWriteOperation& o, { cls_replica_log_set_marker_op op(progress); bufferlist in; - ::encode(op, in); + encode(op, in); o.exec("replica_log", "set", in); } @@ -59,7 +59,7 @@ void cls_replica_log_delete_bound(librados::ObjectWriteOperation& o, { cls_replica_log_delete_marker_op op(entity); bufferlist in; - ::encode(op, in); + encode(op, in); o.exec("replica_log", "delete", in); } @@ -71,7 +71,7 @@ int cls_replica_log_get_bounds(librados::IoCtx& io_ctx, const string& oid, bufferlist in; bufferlist out; cls_replica_log_get_bounds_op op; - ::encode(op, in); + encode(op, in); int r = io_ctx.exec(oid, "replica_log", "get", in, out); if (r < 0) return r; @@ -79,7 +79,7 @@ int cls_replica_log_get_bounds(librados::IoCtx& io_ctx, const string& oid, cls_replica_log_get_bounds_ret ret; try { bufferlist::iterator i = out.begin(); - ::decode(ret, i); + decode(ret, i); } catch (buffer::error& err) { return -EIO; } diff --git a/src/cls/replica_log/cls_replica_log_ops.h b/src/cls/replica_log/cls_replica_log_ops.h index 85ba5e08de4..07227de0fa2 100644 --- a/src/cls/replica_log/cls_replica_log_ops.h +++ b/src/cls/replica_log/cls_replica_log_ops.h @@ -19,13 +19,13 @@ struct cls_replica_log_delete_marker_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entity_id, bl); + encode(entity_id, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entity_id, bl); + decode(entity_id, bl); DECODE_FINISH(bl); } @@ -43,13 +43,13 @@ struct cls_replica_log_set_marker_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(marker, bl); + encode(marker, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(marker, bl); + decode(marker, bl); DECODE_FINISH(bl); } @@ -89,17 +89,17 @@ struct cls_replica_log_get_bounds_ret { {} void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(position_marker, bl); - ::encode(oldest_time, bl); - ::encode(markers, bl); + encode(position_marker, bl); + encode(oldest_time, bl); + encode(markers, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(position_marker, bl); - ::decode(oldest_time, bl); - ::decode(markers, bl); + decode(position_marker, bl); + decode(oldest_time, bl); + decode(markers, bl); DECODE_FINISH(bl); } diff --git a/src/cls/replica_log/cls_replica_log_types.h b/src/cls/replica_log/cls_replica_log_types.h index b1cfe8e836b..4121f1f8787 100644 --- a/src/cls/replica_log/cls_replica_log_types.h +++ b/src/cls/replica_log/cls_replica_log_types.h @@ -29,15 +29,15 @@ struct cls_replica_log_item_marker { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(item_name, bl); - ::encode(item_timestamp, bl); + encode(item_name, bl); + encode(item_timestamp, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(item_name, bl); - ::decode(item_timestamp, bl); + decode(item_name, bl); + decode(item_timestamp, bl); DECODE_FINISH(bl); } @@ -68,19 +68,19 @@ struct cls_replica_log_progress_marker { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(entity_id, bl); - ::encode(position_marker, bl); - ::encode(position_time, bl); - ::encode(items, bl); + encode(entity_id, bl); + encode(position_marker, bl); + encode(position_time, bl); + encode(items, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(entity_id, bl); - ::decode(position_marker, bl); - ::decode(position_time, bl); - ::decode(items, bl); + decode(entity_id, bl); + decode(position_marker, bl); + decode(position_time, bl); + decode(items, bl); DECODE_FINISH(bl); } @@ -166,21 +166,21 @@ public: void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(position_marker, bl); - ::encode(position_time, bl); - ::encode(marker_exists, bl); + encode(position_marker, bl); + encode(position_time, bl); + encode(marker_exists, bl); if (marker_exists) { - ::encode(marker, bl); + encode(marker, bl); } ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(position_marker, bl); - ::decode(position_time, bl); - ::decode(marker_exists, bl); + decode(position_marker, bl); + decode(position_time, bl); + decode(marker_exists, bl); if (marker_exists) { - ::decode(marker, bl); + decode(marker, bl); } DECODE_FINISH(bl); } diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index bd726c85e8d..ca404ca1e27 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -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" @@ -27,7 +27,7 @@ CLS_NAME(rgw) #define BI_BUCKET_LAST_INDEX 4 -static string bucket_index_prefixes[] = { "", /* special handling for the objs list index */ +static std::string bucket_index_prefixes[] = { "", /* special handling for the objs list index */ "0_", /* bucket log index */ "1000_", /* obj instance index */ "1001_", /* olh data index */ @@ -133,7 +133,7 @@ static int log_index_operation(cls_method_context_t hctx, cls_rgw_obj_key& obj_k string key; bi_log_index_key(hctx, key, entry.id, index_ver); - ::encode(entry, bl); + encode(entry, bl); if (entry.id > max_marker) max_marker = entry.id; @@ -365,7 +365,7 @@ static int read_bucket_header(cls_method_context_t hctx, struct rgw_bucket_dir_h } bufferlist::iterator iter = bl.begin(); try { - ::decode(*header, iter); + decode(*header, iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: read_bucket_header(): failed to decode header\n"); return -EIO; @@ -380,7 +380,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) struct rgw_cls_list_op op; try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode request\n"); return -EINVAL; @@ -422,7 +422,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) bufferlist& entrybl = kiter->second; bufferlist::iterator eiter = entrybl.begin(); try { - ::decode(entry, eiter); + decode(entry, eiter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode entry, key=%s\n", kiter->first.c_str()); return -EINVAL; @@ -456,7 +456,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) ret.is_truncated = more && !done; - ::encode(ret, *out); + encode(ret, *out); return 0; } @@ -494,7 +494,7 @@ static int check_index(cls_method_context_t hctx, struct rgw_bucket_dir_header * struct rgw_bucket_dir_entry entry; bufferlist::iterator eiter = kiter->second.begin(); try { - ::decode(entry, eiter); + decode(entry, eiter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode entry, key=%s\n", kiter->first.c_str()); return -EIO; @@ -520,7 +520,7 @@ int rgw_bucket_check_index(cls_method_context_t hctx, bufferlist *in, bufferlist if (rc < 0) return rc; - ::encode(ret, *out); + encode(ret, *out); return 0; } @@ -530,7 +530,7 @@ static int write_bucket_header(cls_method_context_t hctx, struct rgw_bucket_dir_ header->ver++; bufferlist header_bl; - ::encode(*header, header_bl); + encode(*header, header_bl); return cls_cxx_map_write_header(hctx, &header_bl); } @@ -552,7 +552,7 @@ int rgw_bucket_update_stats(cls_method_context_t hctx, bufferlist *in, bufferlis rgw_cls_bucket_update_stats_op op; auto iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: %s(): failed to decode request\n", __func__); return -EINVAL; @@ -611,7 +611,7 @@ int rgw_bucket_set_tag_timeout(cls_method_context_t hctx, bufferlist *in, buffer rgw_cls_tag_timeout_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_bucket_set_tag_timeout(): failed to decode request\n"); return -EINVAL; @@ -638,7 +638,7 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist rgw_cls_obj_prepare_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_bucket_prepare_op(): failed to decode request\n"); return -EINVAL; @@ -694,7 +694,7 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist // write out new key to disk bufferlist info_bl; - ::encode(entry, info_bl); + encode(entry, info_bl); rc = cls_cxx_map_set_val(hctx, idx, &info_bl); if (rc < 0) return rc; @@ -738,7 +738,7 @@ static int read_index_entry(cls_method_context_t hctx, string& name, T *entry) bufferlist::iterator cur_iter = current_entry.begin(); try { - ::decode(*entry, cur_iter); + decode(*entry, cur_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: read_index_entry(): failed to decode entry\n"); return -EIO; @@ -786,7 +786,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist rgw_cls_obj_complete_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_bucket_complete_op(): failed to decode request\n"); return -EINVAL; @@ -853,7 +853,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist if (op.tag.size()) { bufferlist new_key_bl; - ::encode(entry, new_key_bl); + encode(entry, new_key_bl); return cls_cxx_map_set_val(hctx, idx, &new_key_bl); } else { return 0; @@ -876,7 +876,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist } else { entry.exists = false; bufferlist new_key_bl; - ::encode(entry, new_key_bl); + encode(entry, new_key_bl); int ret = cls_cxx_map_set_val(hctx, idx, &new_key_bl); if (ret < 0) return ret; @@ -898,7 +898,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist stats.total_size_rounded += cls_rgw_get_rounded_size(meta.accounted_size); stats.actual_size += meta.size; bufferlist new_key_bl; - ::encode(entry, new_key_bl); + encode(entry, new_key_bl); int ret = cls_cxx_map_set_val(hctx, idx, &new_key_bl); if (ret < 0) return ret; @@ -953,7 +953,7 @@ template static int write_entry(cls_method_context_t hctx, T& entry, const string& key) { bufferlist bl; - ::encode(entry, bl); + encode(entry, bl); return cls_cxx_map_set_val(hctx, key, &bl); } @@ -1174,7 +1174,7 @@ public: map::reverse_iterator last = keys.rbegin(); try { bufferlist::iterator iter = last->second.begin(); - ::decode(next_entry, iter); + decode(next_entry, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR; failed to decode entry: %s", last->first.c_str()); return -EIO; @@ -1366,7 +1366,7 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer rgw_cls_link_olh_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: rgw_bucket_link_olh_op(): failed to decode request\n"); return -EINVAL; @@ -1548,7 +1548,7 @@ static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in, rgw_cls_unlink_instance_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: rgw_bucket_rm_obj_instance_op(): failed to decode request\n"); return -EINVAL; @@ -1693,7 +1693,7 @@ static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bu rgw_cls_read_olh_log_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: rgw_bucket_read_olh_log(): failed to decode request\n"); return -EINVAL; @@ -1735,7 +1735,7 @@ static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bu op_ret.is_truncated = (iter != log.end()); } - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } @@ -1746,7 +1746,7 @@ static int rgw_bucket_trim_olh_log(cls_method_context_t hctx, bufferlist *in, bu rgw_cls_trim_olh_log_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: rgw_bucket_trim_olh_log(): failed to decode request\n"); return -EINVAL; @@ -1797,7 +1797,7 @@ static int rgw_bucket_clear_olh(cls_method_context_t hctx, bufferlist *in, buffe rgw_cls_bucket_clear_olh_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: rgw_bucket_clear_olh(): failed to decode request\n"); return -EINVAL; @@ -1882,8 +1882,8 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx, rgw_bucket_dir_entry cur_change; rgw_bucket_dir_entry cur_disk; try { - ::decode(op, in_iter); - ::decode(cur_change, in_iter); + decode(op, in_iter); + decode(cur_change, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_dir_suggest_changes(): failed to decode request\n"); return -EINVAL; @@ -1899,7 +1899,7 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx, if (cur_disk_bl.length()) { bufferlist::iterator cur_disk_iter = cur_disk_bl.begin(); try { - ::decode(cur_disk, cur_disk_iter); + decode(cur_disk, cur_disk_iter); } catch (buffer::error& error) { CLS_LOG(1, "ERROR: rgw_dir_suggest_changes(): failed to decode cur_disk\n"); return -EINVAL; @@ -1972,7 +1972,7 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx, header_changed = true; cur_change.index_ver = header.ver; bufferlist cur_state_bl; - ::encode(cur_change, cur_state_bl); + encode(cur_change, cur_state_bl); ret = cls_cxx_map_set_val(hctx, cur_change_key, &cur_state_bl); if (ret < 0) return ret; @@ -2001,7 +2001,7 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist rgw_cls_obj_remove_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__); return -EINVAL; @@ -2074,7 +2074,7 @@ static int rgw_obj_store_pg_ver(cls_method_context_t hctx, bufferlist *in, buffe rgw_cls_obj_store_pg_ver_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__); return -EINVAL; @@ -2082,7 +2082,7 @@ static int rgw_obj_store_pg_ver(cls_method_context_t hctx, bufferlist *in, buffe bufferlist bl; uint64_t ver = cls_current_version(hctx); - ::encode(ver, bl); + encode(ver, bl); int ret = cls_cxx_setxattr(hctx, op.attr.c_str(), &bl); if (ret < 0) { CLS_LOG(0, "ERROR: %s(): cls_cxx_setxattr (attr=%s) returned %d", __func__, op.attr.c_str(), ret); @@ -2098,7 +2098,7 @@ static int rgw_obj_check_attrs_prefix(cls_method_context_t hctx, bufferlist *in, rgw_cls_obj_check_attrs_prefix op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__); return -EINVAL; @@ -2141,7 +2141,7 @@ static int rgw_obj_check_mtime(cls_method_context_t hctx, bufferlist *in, buffer rgw_cls_obj_check_mtime op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__); return -EINVAL; @@ -2204,7 +2204,7 @@ static int rgw_bi_get_op(cls_method_context_t hctx, bufferlist *in, bufferlist * rgw_cls_bi_get_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__); return -EINVAL; @@ -2240,7 +2240,7 @@ static int rgw_bi_get_op(cls_method_context_t hctx, bufferlist *in, bufferlist * return r; } - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } @@ -2251,7 +2251,7 @@ static int rgw_bi_put_op(cls_method_context_t hctx, bufferlist *in, bufferlist * rgw_cls_bi_put_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__); return -EINVAL; @@ -2299,7 +2299,7 @@ static int list_plain_entries(cls_method_context_t hctx, const string& name, con rgw_bucket_dir_entry e; try { - ::decode(e, biter); + decode(e, biter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s(): failed to decode buffer", __func__); return -EIO; @@ -2379,7 +2379,7 @@ static int list_instance_entries(cls_method_context_t hctx, const string& name, rgw_bucket_dir_entry e; try { - ::decode(e, biter); + decode(e, biter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s(): failed to decode buffer (size=%d)", __func__, entry.data.length()); return -EIO; @@ -2456,7 +2456,7 @@ static int list_olh_entries(cls_method_context_t hctx, const string& name, const rgw_bucket_olh_entry e; try { - ::decode(e, biter); + decode(e, biter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s(): failed to decode buffer (size=%d)", __func__, entry.data.length()); return -EIO; @@ -2480,7 +2480,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx, bufferlist *in, bufferlist rgw_cls_bi_list_op op; bufferlist::iterator iter = in->begin(); try { - ::decode(op, iter); + decode(op, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__); return -EINVAL; @@ -2528,7 +2528,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx, bufferlist *in, bufferlist count--; } - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } @@ -2537,7 +2537,7 @@ int bi_log_record_decode(bufferlist& bl, rgw_bi_log_entry& e) { bufferlist::iterator iter = bl.begin(); try { - ::decode(e, iter); + decode(e, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: failed to decode rgw_bi_log_entry"); return -EIO; @@ -2645,7 +2645,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_bi_log_list(): failed to decode entry\n"); return -EINVAL; @@ -2656,7 +2656,7 @@ static int rgw_bi_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist if (ret < 0) return ret; - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } @@ -2696,7 +2696,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_bi_log_list(): failed to decode entry\n"); return -EINVAL; @@ -2745,7 +2745,7 @@ static int rgw_bi_log_resync(cls_method_context_t hctx, bufferlist *in, bufferli string key; bi_log_index_key(hctx, key, entry.id, header.ver); - ::encode(entry, bl); + encode(entry, bl); if (entry.id > header.max_marker) header.max_marker = entry.id; @@ -2779,7 +2779,7 @@ static int rgw_bi_log_stop(cls_method_context_t hctx, bufferlist *in, bufferlist string key; bi_log_index_key(hctx, key, entry.id, header.ver); - ::encode(entry, bl); + encode(entry, bl); if (entry.id > header.max_marker) header.max_marker = entry.id; @@ -2825,7 +2825,7 @@ static int usage_record_decode(bufferlist& record_bl, rgw_usage_log_entry& e) { bufferlist::iterator kiter = record_bl.begin(); try { - ::decode(e, kiter); + decode(e, kiter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: usage_record_decode(): failed to decode record_bl\n"); return -EINVAL; @@ -2842,7 +2842,7 @@ int rgw_user_usage_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist rgw_cls_usage_log_add_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_user_usage_log_add(): failed to decode request\n"); return -EINVAL; @@ -2877,7 +2877,7 @@ int rgw_user_usage_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist } bufferlist new_record_bl; - ::encode(entry, new_record_bl); + encode(entry, new_record_bl); ret = cls_cxx_map_set_val(hctx, key_by_time, &new_record_bl); if (ret < 0) return ret; @@ -3004,7 +3004,7 @@ int rgw_user_usage_log_read(cls_method_context_t hctx, bufferlist *in, bufferlis rgw_cls_usage_log_read_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_user_usage_log_read(): failed to decode request\n"); return -EINVAL; @@ -3022,7 +3022,7 @@ int rgw_user_usage_log_read(cls_method_context_t hctx, bufferlist *in, bufferlis if (ret_info.truncated) ret_info.next_iter = iter; - ::encode(ret_info, *out); + encode(ret_info, *out); return 0; } @@ -3055,7 +3055,7 @@ int rgw_user_usage_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlis rgw_cls_usage_log_trim_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_user_log_usage_log_trim(): failed to decode request\n"); return -EINVAL; @@ -3103,7 +3103,7 @@ static int gc_omap_get(cls_method_context_t hctx, int type, const string& key, c try { bufferlist::iterator iter = bl.begin(); - ::decode(*info, iter); + decode(*info, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: rgw_cls_gc_omap_get(): failed to decode index=%s\n", index.c_str()); } @@ -3114,7 +3114,7 @@ static int gc_omap_get(cls_method_context_t hctx, int type, const string& key, c static int gc_omap_set(cls_method_context_t hctx, int type, const string& key, const cls_rgw_gc_obj_info *info) { bufferlist bl; - ::encode(*info, bl); + encode(*info, bl); string index = gc_index_prefixes[type]; index.append(key); @@ -3194,7 +3194,7 @@ int gc_record_decode(bufferlist& bl, cls_rgw_gc_obj_info& e) { bufferlist::iterator iter = bl.begin(); try { - ::decode(e, iter); + decode(e, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: failed to decode cls_rgw_gc_obj_info"); return -EIO; @@ -3208,7 +3208,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_gc_set_entry(): failed to decode entry\n"); return -EINVAL; @@ -3223,7 +3223,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_gc_defer_entry(): failed to decode entry\n"); return -EINVAL; @@ -3327,7 +3327,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_gc_list(): failed to decode entry\n"); return -EINVAL; @@ -3340,7 +3340,7 @@ static int rgw_cls_gc_list(cls_method_context_t hctx, bufferlist *in, bufferlist if (ret < 0) return ret; - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } @@ -3384,7 +3384,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_gc_remove(): failed to decode entry\n"); return -EINVAL; @@ -3399,14 +3399,14 @@ 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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_lc_set_entry(): failed to decode entry\n"); return -EINVAL; } bufferlist bl; - ::encode(op.entry, bl); + encode(op.entry, bl); int ret = cls_cxx_map_set_val(hctx, op.entry.first, &bl); return ret; @@ -3418,7 +3418,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_lc_rm_entry(): failed to decode entry\n"); return -EINVAL; @@ -3434,7 +3434,7 @@ static int rgw_cls_lc_get_next_entry(cls_method_context_t hctx, bufferlist *in, cls_rgw_lc_get_next_entry_ret op_ret; cls_rgw_lc_get_next_entry_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_lc_get_next_entry: failed to decode op\n"); return -EINVAL; @@ -3452,14 +3452,14 @@ static int rgw_cls_lc_get_next_entry(cls_method_context_t hctx, bufferlist *in, it=vals.begin(); in_iter = it->second.begin(); try { - ::decode(entry, in_iter); + decode(entry, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_lc_get_next_entry(): failed to decode entry\n"); return -EIO; } } op_ret.entry = entry; - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } @@ -3468,7 +3468,7 @@ static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in, bu cls_rgw_lc_list_entries_op op; bufferlist::iterator in_iter = in->begin(); try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_lc_list_entries(): failed to decode op\n"); return -EINVAL; @@ -3486,14 +3486,14 @@ static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in, bu for (it = vals.begin(); it != vals.end(); ++it) { iter = it->second.begin(); try { - ::decode(entry, iter); + decode(entry, iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_lc_list_entries(): failed to decode entry\n"); return -EIO; } op_ret.entries.insert(entry); } - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } @@ -3503,14 +3503,14 @@ 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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_lc_put_head(): failed to decode entry\n"); return -EINVAL; } bufferlist bl; - ::encode(op.head, bl); + encode(op.head, bl); int ret = cls_cxx_map_write_header(hctx,&bl); return ret; } @@ -3525,7 +3525,7 @@ static int rgw_cls_lc_get_head(cls_method_context_t hctx, bufferlist *in, buffe if (bl.length() != 0) { bufferlist::iterator iter = bl.begin(); try { - ::decode(head, iter); + decode(head, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: rgw_cls_lc_get_head(): failed to decode entry %s\n",err.what()); return -EINVAL; @@ -3536,7 +3536,7 @@ static int rgw_cls_lc_get_head(cls_method_context_t hctx, bufferlist *in, buffe } cls_rgw_lc_get_head_ret op_ret; op_ret.head = head; - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } @@ -3546,7 +3546,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_reshard_add: failed to decode entry\n"); return -EINVAL; @@ -3557,7 +3557,7 @@ static int rgw_reshard_add(cls_method_context_t hctx, bufferlist *in, bufferlist op.entry.get_key(&key); bufferlist bl; - ::encode(op.entry, bl); + encode(op.entry, bl); int ret = cls_cxx_map_set_val(hctx, key, &bl); if (ret < 0) { CLS_ERR("error adding reshard job for bucket %s with key %s",op.entry.bucket_name.c_str(), key.c_str()); @@ -3572,7 +3572,7 @@ static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlis cls_rgw_reshard_list_op op; bufferlist::iterator in_iter = in->begin(); try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_rehard_list(): failed to decode entry\n"); return -EINVAL; @@ -3593,14 +3593,14 @@ static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlis for (it = vals.begin(); i < (int)op.max && it != vals.end(); ++it, ++i) { iter = it->second.begin(); try { - ::decode(entry, iter); + decode(entry, iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_rehard_list(): failed to decode entry\n"); return -EIO; } op_ret.entries.push_back(entry); } - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } @@ -3612,7 +3612,7 @@ static int get_reshard_entry(cls_method_context_t hctx, const string& key, cls_r return ret; bufferlist::iterator iter = bl.begin(); try { - ::decode(*entry, iter); + decode(*entry, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: %s : failed to decode entry %s\n", __func__, err.what()); return -EIO; @@ -3626,7 +3626,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_reshard_get: failed to decode entry\n"); return -EINVAL; @@ -3642,7 +3642,7 @@ static int rgw_reshard_get(cls_method_context_t hctx, bufferlist *in, bufferlis cls_rgw_reshard_get_ret op_ret; op_ret.entry = entry; - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } @@ -3652,7 +3652,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); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: rgw_cls_rehard_remove: failed to decode entry\n"); return -EINVAL; @@ -3685,7 +3685,7 @@ static int rgw_set_bucket_resharding(cls_method_context_t hctx, bufferlist *in, bufferlist::iterator in_iter = in->begin(); try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_rgw_set_bucket_resharding: failed to decode entry\n"); return -EINVAL; @@ -3709,7 +3709,7 @@ static int rgw_clear_bucket_resharding(cls_method_context_t hctx, bufferlist *in bufferlist::iterator in_iter = in->begin(); try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_rgw_clear_bucket_resharding: failed to decode entry\n"); return -EINVAL; @@ -3732,7 +3732,7 @@ static int rgw_guard_bucket_resharding(cls_method_context_t hctx, bufferlist *in bufferlist::iterator in_iter = in->begin(); try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_rgw_clear_bucket_resharding: failed to decode entry\n"); return -EINVAL; @@ -3758,7 +3758,7 @@ static int rgw_get_bucket_resharding(cls_method_context_t hctx, bufferlist *in, bufferlist::iterator in_iter = in->begin(); try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_rgw_clear_bucket_resharding: failed to decode entry\n"); return -EINVAL; @@ -3774,7 +3774,7 @@ static int rgw_get_bucket_resharding(cls_method_context_t hctx, bufferlist *in, cls_rgw_get_bucket_resharding_ret op_ret; op_ret.new_instance = header.new_instance; - ::encode(op_ret, *out); + encode(op_ret, *out); return 0; } diff --git a/src/cls/rgw/cls_rgw_client.cc b/src/cls/rgw/cls_rgw_client.cc index 3c4ed919a6d..69fb45456ad 100644 --- a/src/cls/rgw/cls_rgw_client.cc +++ b/src/cls/rgw/cls_rgw_client.cc @@ -27,7 +27,7 @@ public: if (r >= 0) { try { bufferlist::iterator iter = outbl.begin(); - ::decode((*data), iter); + decode((*data), iter); } catch (buffer::error& err) { r = -EIO; } @@ -112,7 +112,7 @@ static bool issue_bucket_set_tag_timeout_op(librados::IoCtx& io_ctx, bufferlist in; struct rgw_cls_tag_timeout_op call; call.tag_timeout = timeout; - ::encode(call, in); + encode(call, in); ObjectWriteOperation op; op.exec(RGW_CLASS, RGW_BUCKET_SET_TAG_TIMEOUT, in); return manager->aio_operate(io_ctx, oid, &op); @@ -143,7 +143,7 @@ void cls_rgw_bucket_update_stats(librados::ObjectWriteOperation& o, bool absolut call.absolute = absolute; call.stats = stats; bufferlist in; - ::encode(call, in); + encode(call, in); o.exec(RGW_CLASS, RGW_BUCKET_UPDATE_STATS, in); } @@ -160,7 +160,7 @@ void cls_rgw_bucket_prepare_op(ObjectWriteOperation& o, RGWModifyOp op, string& call.bilog_flags = bilog_flags; call.zones_trace = zones_trace; bufferlist in; - ::encode(call, in); + encode(call, in); o.exec(RGW_CLASS, RGW_BUCKET_PREPARE_OP, in); } @@ -187,7 +187,7 @@ void cls_rgw_bucket_complete_op(ObjectWriteOperation& o, RGWModifyOp op, string& if (zones_trace) { call.zones_trace = *zones_trace; } - ::encode(call, in); + encode(call, in); o.exec(RGW_CLASS, RGW_BUCKET_COMPLETE_OP, in); } @@ -201,7 +201,7 @@ static bool issue_bucket_list_op(librados::IoCtx& io_ctx, call.filter_prefix = filter_prefix; call.num_entries = num_entries; call.list_versions = list_versions; - ::encode(call, in); + encode(call, in); librados::ObjectReadOperation op; op.exec(RGW_CLASS, RGW_BUCKET_LIST, in, new ClsBucketIndexOpCtx(pdata, NULL)); @@ -218,7 +218,7 @@ void cls_rgw_remove_obj(librados::ObjectWriteOperation& o, list& keep_at bufferlist in; struct rgw_cls_obj_remove_op call; call.keep_attr_prefixes = keep_attr_prefixes; - ::encode(call, in); + encode(call, in); o.exec(RGW_CLASS, RGW_OBJ_REMOVE, in); } @@ -227,7 +227,7 @@ void cls_rgw_obj_store_pg_ver(librados::ObjectWriteOperation& o, const string& a bufferlist in; struct rgw_cls_obj_store_pg_ver_op call; call.attr = attr; - ::encode(call, in); + encode(call, in); o.exec(RGW_CLASS, RGW_OBJ_STORE_PG_VER, in); } @@ -237,7 +237,7 @@ void cls_rgw_obj_check_attrs_prefix(librados::ObjectOperation& o, const string& struct rgw_cls_obj_check_attrs_prefix call; call.check_prefix = prefix; call.fail_if_exist = fail_if_exist; - ::encode(call, in); + encode(call, in); o.exec(RGW_CLASS, RGW_OBJ_CHECK_ATTRS_PREFIX, in); } @@ -248,7 +248,7 @@ void cls_rgw_obj_check_mtime(librados::ObjectOperation& o, const real_time& mtim call.mtime = mtime; call.high_precision_time = high_precision_time; call.type = type; - ::encode(call, in); + encode(call, in); o.exec(RGW_CLASS, RGW_OBJ_CHECK_MTIME, in); } @@ -260,7 +260,7 @@ int cls_rgw_bi_get(librados::IoCtx& io_ctx, const string oid, struct rgw_cls_bi_get_op call; call.key = key; call.type = index_type; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, RGW_CLASS, RGW_BI_GET, in, out); if (r < 0) return r; @@ -268,7 +268,7 @@ int cls_rgw_bi_get(librados::IoCtx& io_ctx, const string oid, struct rgw_cls_bi_get_ret op_ret; bufferlist::iterator iter = out.begin(); try { - ::decode(op_ret, iter); + decode(op_ret, iter); } catch (buffer::error& err) { return -EIO; } @@ -283,7 +283,7 @@ int cls_rgw_bi_put(librados::IoCtx& io_ctx, const string oid, rgw_cls_bi_entry& bufferlist in, out; struct rgw_cls_bi_put_op call; call.entry = entry; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, RGW_CLASS, RGW_BI_PUT, in, out); if (r < 0) return r; @@ -296,7 +296,7 @@ void cls_rgw_bi_put(ObjectWriteOperation& op, const string oid, rgw_cls_bi_entry bufferlist in, out; struct rgw_cls_bi_put_op call; call.entry = entry; - ::encode(call, in); + encode(call, in); op.exec(RGW_CLASS, RGW_BI_PUT, in); } @@ -309,7 +309,7 @@ int cls_rgw_bi_list(librados::IoCtx& io_ctx, const string oid, call.name = name; call.marker = marker; call.max = max; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, RGW_CLASS, RGW_BI_LIST, in, out); if (r < 0) return r; @@ -317,7 +317,7 @@ int cls_rgw_bi_list(librados::IoCtx& io_ctx, const string oid, struct rgw_cls_bi_list_ret op_ret; bufferlist::iterator iter = out.begin(); try { - ::decode(op_ret, iter); + decode(op_ret, iter); } catch (buffer::error& err) { return -EIO; } @@ -347,7 +347,7 @@ int cls_rgw_bucket_link_olh(librados::IoCtx& io_ctx, librados::ObjectWriteOperat call.unmod_since = unmod_since; call.high_precision_time = high_precision_time; call.zones_trace = zones_trace; - ::encode(call, in); + encode(call, in); op.exec(RGW_CLASS, RGW_BUCKET_LINK_OLH, in); int r = io_ctx.operate(oid, &op); if (r < 0) @@ -369,7 +369,7 @@ int cls_rgw_bucket_unlink_instance(librados::IoCtx& io_ctx, librados::ObjectWrit call.olh_tag = olh_tag; call.log_op = log_op; call.zones_trace = zones_trace; - ::encode(call, in); + encode(call, in); op.exec(RGW_CLASS, RGW_BUCKET_UNLINK_INSTANCE, in); int r = io_ctx.operate(oid, &op); if (r < 0) @@ -387,7 +387,7 @@ int cls_rgw_get_olh_log(IoCtx& io_ctx, string& oid, librados::ObjectReadOperatio call.olh = olh; call.ver_marker = ver_marker; call.olh_tag = olh_tag; - ::encode(call, in); + encode(call, in); int op_ret; op.exec(RGW_CLASS, RGW_BUCKET_READ_OLH_LOG, in, &out, &op_ret); int r = io_ctx.operate(oid, &op, NULL); @@ -401,7 +401,7 @@ int cls_rgw_get_olh_log(IoCtx& io_ctx, string& oid, librados::ObjectReadOperatio struct rgw_cls_read_olh_log_ret ret; try { bufferlist::iterator iter = out.begin(); - ::decode(ret, iter); + decode(ret, iter); } catch (buffer::error& err) { return -EIO; } @@ -423,7 +423,7 @@ void cls_rgw_trim_olh_log(librados::ObjectWriteOperation& op, const cls_rgw_obj_ call.olh = olh; call.ver = ver; call.olh_tag = olh_tag; - ::encode(call, in); + encode(call, in); op.exec(RGW_CLASS, RGW_BUCKET_TRIM_OLH_LOG, in); } @@ -433,7 +433,7 @@ int cls_rgw_clear_olh(IoCtx& io_ctx, librados::ObjectWriteOperation& op, string& struct rgw_cls_bucket_clear_olh_op call; call.key = olh; call.olh_tag = olh_tag; - ::encode(call, in); + encode(call, in); int op_ret; op.exec(RGW_CLASS, RGW_BUCKET_CLEAR_OLH, in, &out, &op_ret); int r = io_ctx.operate(oid, &op); @@ -450,7 +450,7 @@ static bool issue_bi_log_list_op(librados::IoCtx& io_ctx, const string& oid, int cls_rgw_bi_log_list_op call; call.marker = marker_mgr.get(shard_id, ""); call.max = max; - ::encode(call, in); + encode(call, in); librados::ObjectReadOperation op; op.exec(RGW_CLASS, RGW_BI_LOG_LIST, in, new ClsBucketIndexOpCtx(pdata, NULL)); @@ -469,7 +469,7 @@ static bool issue_bi_log_trim(librados::IoCtx& io_ctx, const string& oid, int sh cls_rgw_bi_log_trim_op call; call.start_marker = start_marker_mgr.get(shard_id, ""); call.end_marker = end_marker_mgr.get(shard_id, ""); - ::encode(call, in); + encode(call, in); ObjectWriteOperation op; op.exec(RGW_CLASS, RGW_BI_LOG_TRIM, in); return manager->aio_operate(io_ctx, oid, &op); @@ -510,7 +510,7 @@ int CLSRGWIssueBucketRebuild::issue_op(int shard_id, const string& oid) void cls_rgw_encode_suggestion(char op, rgw_bucket_dir_entry& dirent, bufferlist& updates) { updates.append(op); - ::encode(dirent, updates); + encode(dirent, updates); } void cls_rgw_suggest_changes(ObjectWriteOperation& o, bufferlist& updates) @@ -561,7 +561,7 @@ public: struct rgw_cls_list_ret ret; try { bufferlist::iterator iter = outbl.begin(); - ::decode(ret, iter); + decode(ret, iter); } catch (buffer::error& err) { r = -EIO; } @@ -575,7 +575,7 @@ int cls_rgw_get_dir_header_async(IoCtx& io_ctx, string& oid, RGWGetDirHeader_CB bufferlist in, out; struct rgw_cls_list_op call; call.num_entries = 0; - ::encode(call, in); + encode(call, in); ObjectReadOperation op; GetDirHeaderCompletion *cb = new GetDirHeaderCompletion(ctx); op.exec(RGW_CLASS, RGW_BUCKET_LIST, in, cb); @@ -603,7 +603,7 @@ int cls_rgw_usage_log_read(IoCtx& io_ctx, string& oid, string& user, call.owner = user; call.max_entries = max_entries; call.iter = read_iter; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, RGW_CLASS, RGW_USER_USAGE_LOG_READ, in, out); if (r < 0) return r; @@ -611,7 +611,7 @@ int cls_rgw_usage_log_read(IoCtx& io_ctx, string& oid, string& user, try { rgw_cls_usage_log_read_ret result; bufferlist::iterator iter = out.begin(); - ::decode(result, iter); + decode(result, iter); read_iter = result.next_iter; if (is_truncated) *is_truncated = result.truncated; @@ -632,7 +632,7 @@ int cls_rgw_usage_log_trim(IoCtx& io_ctx, const string& oid, string& user, call.start_epoch = start_epoch; call.end_epoch = end_epoch; call.user = user; - ::encode(call, in); + encode(call, in); bool done = false; do { @@ -655,7 +655,7 @@ void cls_rgw_usage_log_add(ObjectWriteOperation& op, rgw_usage_log_info& info) bufferlist in; rgw_cls_usage_log_add_op call; call.info = info; - ::encode(call, in); + encode(call, in); op.exec(RGW_CLASS, RGW_USER_USAGE_LOG_ADD, in); } @@ -667,7 +667,7 @@ void cls_rgw_gc_set_entry(ObjectWriteOperation& op, uint32_t expiration_secs, cl cls_rgw_gc_set_entry_op call; call.expiration_secs = expiration_secs; call.info = info; - ::encode(call, in); + encode(call, in); op.exec(RGW_CLASS, RGW_GC_SET_ENTRY, in); } @@ -677,7 +677,7 @@ void cls_rgw_gc_defer_entry(ObjectWriteOperation& op, uint32_t expiration_secs, cls_rgw_gc_defer_entry_op call; call.expiration_secs = expiration_secs; call.tag = tag; - ::encode(call, in); + encode(call, in); op.exec(RGW_CLASS, RGW_GC_DEFER_ENTRY, in); } @@ -689,7 +689,7 @@ int cls_rgw_gc_list(IoCtx& io_ctx, string& oid, string& marker, uint32_t max, bo call.marker = marker; call.max = max; call.expired_only = expired_only; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, RGW_CLASS, RGW_GC_LIST, in, out); if (r < 0) return r; @@ -697,7 +697,7 @@ int cls_rgw_gc_list(IoCtx& io_ctx, string& oid, string& marker, uint32_t max, bo cls_rgw_gc_list_ret ret; try { bufferlist::iterator iter = out.begin(); - ::decode(ret, iter); + decode(ret, iter); } catch (buffer::error& err) { return -EIO; } @@ -715,7 +715,7 @@ void cls_rgw_gc_remove(librados::ObjectWriteOperation& op, const list& t bufferlist in; cls_rgw_gc_remove_op call; call.tags = tags; - ::encode(call, in); + encode(call, in); op.exec(RGW_CLASS, RGW_GC_REMOVE, in); } @@ -729,7 +729,7 @@ int cls_rgw_lc_get_head(IoCtx& io_ctx, string& oid, cls_rgw_lc_obj_head& head) cls_rgw_lc_get_head_ret ret; try { bufferlist::iterator iter = out.begin(); - ::decode(ret, iter); + decode(ret, iter); } catch (buffer::error& err) { return -EIO; } @@ -743,7 +743,7 @@ int cls_rgw_lc_put_head(IoCtx& io_ctx, string& oid, cls_rgw_lc_obj_head& head) bufferlist in, out; cls_rgw_lc_put_head_op call; call.head = head; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, RGW_CLASS, RGW_LC_PUT_HEAD, in, out); return r; } @@ -753,7 +753,7 @@ int cls_rgw_lc_get_next_entry(IoCtx& io_ctx, string& oid, string& marker, pair& entry) bufferlist in, out; cls_rgw_lc_rm_entry_op call; call.entry = entry; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, RGW_CLASS, RGW_LC_RM_ENTRY, in, out); return r; } @@ -785,7 +785,7 @@ int cls_rgw_lc_set_entry(IoCtx& io_ctx, string& oid, pair& entry) bufferlist in, out; cls_rgw_lc_set_entry_op call; call.entry = entry; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, RGW_CLASS, RGW_LC_SET_ENTRY, in, out); return r; } @@ -803,7 +803,7 @@ int cls_rgw_lc_list(IoCtx& io_ctx, string& oid, op.marker = marker; op.max_entries = max_entries; - ::encode(op, in); + encode(op, in); int r = io_ctx.exec(oid, RGW_CLASS, RGW_LC_LIST_ENTRIES, in, out); if (r < 0) @@ -812,7 +812,7 @@ int cls_rgw_lc_list(IoCtx& io_ctx, string& oid, cls_rgw_lc_list_entries_ret ret; try { bufferlist::iterator iter = out.begin(); - ::decode(ret, iter); + decode(ret, iter); } catch (buffer::error& err) { return -EIO; } @@ -826,7 +826,7 @@ void cls_rgw_reshard_add(librados::ObjectWriteOperation& op, const cls_rgw_resha bufferlist in; struct cls_rgw_reshard_add_op call; call.entry = entry; - ::encode(call, in); + encode(call, in); op.exec("rgw", "reshard_add", in); } @@ -837,7 +837,7 @@ int cls_rgw_reshard_list(librados::IoCtx& io_ctx, const string& oid, string& mar struct cls_rgw_reshard_list_op call; call.marker = marker; call.max = max; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, "rgw", "reshard_list", in, out); if (r < 0) return r; @@ -845,7 +845,7 @@ int cls_rgw_reshard_list(librados::IoCtx& io_ctx, const string& oid, string& mar struct cls_rgw_reshard_list_ret op_ret; bufferlist::iterator iter = out.begin(); try { - ::decode(op_ret, iter); + decode(op_ret, iter); } catch (buffer::error& err) { return -EIO; } @@ -861,7 +861,7 @@ int cls_rgw_reshard_get(librados::IoCtx& io_ctx, const string& oid, cls_rgw_resh bufferlist in, out; struct cls_rgw_reshard_get_op call; call.entry = entry; - ::encode(call, in); + encode(call, in); int r = io_ctx.exec(oid, "rgw", "reshard_get", in, out); if (r < 0) return r; @@ -869,7 +869,7 @@ int cls_rgw_reshard_get(librados::IoCtx& io_ctx, const string& oid, cls_rgw_resh struct cls_rgw_reshard_get_ret op_ret; bufferlist::iterator iter = out.begin(); try { - ::decode(op_ret, iter); + decode(op_ret, iter); } catch (buffer::error& err) { return -EIO; } @@ -886,7 +886,7 @@ void cls_rgw_reshard_remove(librados::ObjectWriteOperation& op, const cls_rgw_re call.tenant = entry.tenant; call.bucket_name = entry.bucket_name; call.bucket_id = entry.bucket_id; - ::encode(call, in); + encode(call, in); op.exec("rgw", "reshard_remove", in); } @@ -896,7 +896,7 @@ int cls_rgw_set_bucket_resharding(librados::IoCtx& io_ctx, const string& oid, bufferlist in, out; struct cls_rgw_set_bucket_resharding_op call; call.entry = entry; - ::encode(call, in); + encode(call, in); return io_ctx.exec(oid, "rgw", "set_bucket_resharding", in, out); } @@ -904,7 +904,7 @@ int cls_rgw_clear_bucket_resharding(librados::IoCtx& io_ctx, const string& oid) { bufferlist in, out; struct cls_rgw_clear_bucket_resharding_op call; - ::encode(call, in); + encode(call, in); return io_ctx.exec(oid, "rgw", "clear_bucket_resharding", in, out); } @@ -913,7 +913,7 @@ int cls_rgw_get_bucket_resharding(librados::IoCtx& io_ctx, const string& oid, { bufferlist in, out; struct cls_rgw_get_bucket_resharding_op call; - ::encode(call, in); + encode(call, in); int r= io_ctx.exec(oid, "rgw", "get_bucket_resharding", in, out); if (r < 0) return r; @@ -921,7 +921,7 @@ int cls_rgw_get_bucket_resharding(librados::IoCtx& io_ctx, const string& oid, struct cls_rgw_get_bucket_resharding_ret op_ret; bufferlist::iterator iter = out.begin(); try { - ::decode(op_ret, iter); + decode(op_ret, iter); } catch (buffer::error& err) { return -EIO; } @@ -936,7 +936,7 @@ void cls_rgw_guard_bucket_resharding(librados::ObjectOperation& op, int ret_err) bufferlist in, out; struct cls_rgw_guard_bucket_resharding_op call; call.ret_err = ret_err; - ::encode(call, in); + encode(call, in); op.exec("rgw", "guard_bucket_resharding", in); } @@ -946,7 +946,7 @@ static bool issue_set_bucket_resharding(librados::IoCtx& io_ctx, const string& o bufferlist in; struct cls_rgw_set_bucket_resharding_op call; call.entry = entry; - ::encode(call, in); + encode(call, in); librados::ObjectWriteOperation op; op.exec("rgw", "set_bucket_resharding", in); return manager->aio_operate(io_ctx, oid, &op); diff --git a/src/cls/rgw/cls_rgw_types.cc b/src/cls/rgw/cls_rgw_types.cc index 234384f2745..931dd3c38e1 100644 --- a/src/cls/rgw/cls_rgw_types.cc +++ b/src/cls/rgw/cls_rgw_types.cc @@ -160,14 +160,14 @@ static void dump_bi_entry(bufferlist bl, BIIndexType index_type, Formatter *form case InstanceIdx: { rgw_bucket_dir_entry entry; - ::decode(entry, iter); + decode(entry, iter); encode_json("entry", entry, formatter); } break; case OLHIdx: { rgw_bucket_olh_entry entry; - ::decode(entry, iter); + decode(entry, iter); encode_json("entry", entry, formatter); } break; @@ -189,13 +189,14 @@ void rgw_cls_bi_entry::decode_json(JSONObj *obj, cls_rgw_obj_key *effective_key) } else { type = InvalidIdx; } + using ceph::encode; switch (type) { case PlainIdx: case InstanceIdx: { rgw_bucket_dir_entry entry; JSONDecoder::decode_json("entry", entry, obj); - ::encode(entry, data); + encode(entry, data); if (effective_key) { *effective_key = entry.key; @@ -206,7 +207,7 @@ void rgw_cls_bi_entry::decode_json(JSONObj *obj, cls_rgw_obj_key *effective_key) { rgw_bucket_olh_entry entry; JSONDecoder::decode_json("entry", entry, obj); - ::encode(entry, data); + encode(entry, data); if (effective_key) { *effective_key = entry.key; @@ -243,12 +244,13 @@ bool rgw_cls_bi_entry::get_info(cls_rgw_obj_key *key, uint8_t *category, rgw_buc { bool account = false; bufferlist::iterator iter = data.begin(); + using ceph::decode; switch (type) { case PlainIdx: case InstanceIdx: { rgw_bucket_dir_entry entry; - ::decode(entry, iter); + decode(entry, iter); *key = entry.key; *category = entry.meta.category; accounted_stats->num_entries++; @@ -260,7 +262,7 @@ bool rgw_cls_bi_entry::get_info(cls_rgw_obj_key *key, uint8_t *category, rgw_buc case OLHIdx: { rgw_bucket_olh_entry entry; - ::decode(entry, iter); + decode(entry, iter); *key = entry.key; } break; @@ -469,7 +471,7 @@ void rgw_bi_log_entry::generate_test_instances(list& ls) ls.push_back(new rgw_bi_log_entry); ls.back()->id = "midf"; ls.back()->object = "obj"; - ls.back()->timestamp = ceph::real_clock::from_ceph_timespec({2, 3}); + ls.back()->timestamp = ceph::real_clock::from_ceph_timespec({{2}, {3}}); ls.back()->index_ver = 4323; ls.back()->tag = "tagasdfds"; ls.back()->op = CLS_RGW_OP_DEL; @@ -603,7 +605,7 @@ void cls_rgw_reshard_entry::generate_test_instances(list { ls.push_back(new cls_rgw_reshard_entry); ls.push_back(new cls_rgw_reshard_entry); - ls.back()->time = ceph::real_clock::from_ceph_timespec({2, 3}); + ls.back()->time = ceph::real_clock::from_ceph_timespec({{2}, {3}}); ls.back()->tenant = "tenant"; ls.back()->bucket_name = "bucket1"""; ls.back()->bucket_id = "bucket_id"; diff --git a/src/cls/statelog/cls_statelog.cc b/src/cls/statelog/cls_statelog.cc index b2a13764d1e..0a49ae79d40 100644 --- a/src/cls/statelog/cls_statelog.cc +++ b/src/cls/statelog/cls_statelog.cc @@ -18,7 +18,7 @@ static string statelog_index_by_object_prefix = "2_"; static int write_statelog_entry(cls_method_context_t hctx, const string& index, const cls_statelog_entry& entry) { bufferlist bl; - ::encode(entry, bl); + encode(entry, bl); int ret = cls_cxx_map_set_val(hctx, index, &bl); if (ret < 0) @@ -75,7 +75,7 @@ static int get_existing_entry(cls_method_context_t hctx, const string& client_id } try { bufferlist::iterator iter = bl.begin(); - ::decode(entry, iter); + decode(entry, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: failed to decode entry %s", obj_index.c_str()); return -EIO; @@ -98,7 +98,7 @@ static int cls_statelog_add(cls_method_context_t hctx, bufferlist *in, bufferlis cls_statelog_add_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_statelog_add_op(): failed to decode op"); return -EINVAL; @@ -138,7 +138,7 @@ static int cls_statelog_list(cls_method_context_t hctx, bufferlist *in, bufferli cls_statelog_list_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_statelog_list_op(): failed to decode op"); return -EINVAL; @@ -189,7 +189,7 @@ static int cls_statelog_list(cls_method_context_t hctx, bufferlist *in, bufferli bufferlist::iterator biter = bl.begin(); try { cls_statelog_entry e; - ::decode(e, biter); + decode(e, biter); entries.push_back(e); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: cls_statelog_list: could not decode entry, index=%s", index.c_str()); @@ -200,7 +200,7 @@ static int cls_statelog_list(cls_method_context_t hctx, bufferlist *in, bufferli ret.marker = marker; } - ::encode(ret, *out); + encode(ret, *out); return 0; } @@ -211,7 +211,7 @@ static int cls_statelog_remove(cls_method_context_t hctx, bufferlist *in, buffer cls_statelog_remove_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_statelog_remove_op(): failed to decode op"); return -EINVAL; @@ -250,7 +250,7 @@ static int cls_statelog_check_state(cls_method_context_t hctx, bufferlist *in, b cls_statelog_check_state_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_statelog_check_state_op(): failed to decode op"); return -EINVAL; diff --git a/src/cls/statelog/cls_statelog_client.cc b/src/cls/statelog/cls_statelog_client.cc index 895e26a6fa5..6a477a1b187 100644 --- a/src/cls/statelog/cls_statelog_client.cc +++ b/src/cls/statelog/cls_statelog_client.cc @@ -12,7 +12,7 @@ void cls_statelog_add(librados::ObjectWriteOperation& op, list @@ -17,7 +17,7 @@ void cls_user_set_buckets(librados::ObjectWriteOperation& op, listhandle_response() with correct error */ AioCompletion *c = librados::Rados::aio_create_completion(NULL, NULL, NULL); diff --git a/src/cls/version/cls_version.cc b/src/cls/version/cls_version.cc index c68f8c4e1ce..d4ca638d91e 100644 --- a/src/cls/version/cls_version.cc +++ b/src/cls/version/cls_version.cc @@ -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 @@ -19,7 +19,7 @@ static int set_version(cls_method_context_t hctx, struct obj_version *objv) { bufferlist bl; - ::encode(*objv, bl); + encode(*objv, bl); CLS_LOG(20, "cls_version: set_version %s:%d", objv->tag.c_str(), (int)objv->ver); @@ -65,7 +65,7 @@ static int read_version(cls_method_context_t hctx, obj_version *objv, bool impli try { bufferlist::iterator iter = bl.begin(); - ::decode(*objv, iter); + decode(*objv, iter); } catch (buffer::error& err) { CLS_LOG(0, "ERROR: read_version(): failed to decode version entry\n"); return -EIO; @@ -80,7 +80,7 @@ static int cls_version_set(cls_method_context_t hctx, bufferlist *in, bufferlist cls_version_set_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_version_get(): failed to decode entry\n"); return -EINVAL; @@ -146,7 +146,7 @@ static int cls_version_inc(cls_method_context_t hctx, bufferlist *in, bufferlist cls_version_inc_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_version_get(): failed to decode entry\n"); return -EINVAL; @@ -175,7 +175,7 @@ static int cls_version_check(cls_method_context_t hctx, bufferlist *in, bufferli cls_version_check_op op; try { - ::decode(op, in_iter); + decode(op, in_iter); } catch (buffer::error& err) { CLS_LOG(1, "ERROR: cls_version_get(): failed to decode entry\n"); return -EINVAL; @@ -204,7 +204,7 @@ static int cls_version_read(cls_method_context_t hctx, bufferlist *in, bufferlis if (ret < 0) return ret; - ::encode(read_ret, *out); + encode(read_ret, *out); return 0; } diff --git a/src/cls/version/cls_version_client.cc b/src/cls/version/cls_version_client.cc index 36726d6cccb..c26826e903c 100644 --- a/src/cls/version/cls_version_client.cc +++ b/src/cls/version/cls_version_client.cc @@ -12,7 +12,7 @@ void cls_version_set(librados::ObjectWriteOperation& op, obj_version& objv) bufferlist in; cls_version_set_op call; call.objv = objv; - ::encode(call, in); + encode(call, in); op.exec("version", "set", in); } @@ -20,7 +20,7 @@ void cls_version_inc(librados::ObjectWriteOperation& op) { bufferlist in; cls_version_inc_op call; - ::encode(call, in); + encode(call, in); op.exec("version", "inc", in); } @@ -36,7 +36,7 @@ void cls_version_inc(librados::ObjectWriteOperation& op, obj_version& objv, Vers call.conds.push_back(c); - ::encode(call, in); + encode(call, in); op.exec("version", "inc_conds", in); } @@ -52,7 +52,7 @@ void cls_version_check(librados::ObjectOperation& op, obj_version& objv, Version call.conds.push_back(c); - ::encode(call, in); + encode(call, in); op.exec("version", "check_conds", in); } @@ -65,7 +65,7 @@ public: cls_version_read_ret ret; try { bufferlist::iterator iter = outbl.begin(); - ::decode(ret, iter); + decode(ret, iter); *objv = ret.objv; } catch (buffer::error& err) { // nothing we can do about it atm @@ -90,7 +90,7 @@ int cls_version_read(librados::IoCtx& io_ctx, string& oid, obj_version *ver) cls_version_read_ret ret; try { bufferlist::iterator iter = out.begin(); - ::decode(ret, iter); + decode(ret, iter); } catch (buffer::error& err) { return -EIO; } diff --git a/src/cls/version/cls_version_ops.h b/src/cls/version/cls_version_ops.h index 6007e9ade92..56e3f357791 100644 --- a/src/cls/version/cls_version_ops.h +++ b/src/cls/version/cls_version_ops.h @@ -13,13 +13,13 @@ struct cls_version_set_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(objv, bl); + encode(objv, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(objv, bl); + decode(objv, bl); DECODE_FINISH(bl); } }; @@ -33,15 +33,15 @@ struct cls_version_inc_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(objv, bl); - ::encode(conds, bl); + encode(objv, bl); + encode(conds, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(objv, bl); - ::decode(conds, bl); + decode(objv, bl); + decode(conds, bl); DECODE_FINISH(bl); } }; @@ -55,15 +55,15 @@ struct cls_version_check_op { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(objv, bl); - ::encode(conds, bl); + encode(objv, bl); + encode(conds, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(objv, bl); - ::decode(conds, bl); + decode(objv, bl); + decode(conds, bl); DECODE_FINISH(bl); } }; @@ -76,13 +76,13 @@ struct cls_version_read_ret { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(objv, bl); + encode(objv, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(objv, bl); + decode(objv, bl); DECODE_FINISH(bl); } }; diff --git a/src/cls/version/cls_version_types.h b/src/cls/version/cls_version_types.h index 22ae0779ea3..440b6d65507 100644 --- a/src/cls/version/cls_version_types.h +++ b/src/cls/version/cls_version_types.h @@ -15,15 +15,15 @@ struct obj_version { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(ver, bl); - ::encode(tag, bl); + encode(ver, bl); + encode(tag, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(ver, bl); - ::decode(tag, bl); + decode(ver, bl); + decode(tag, bl); DECODE_FINISH(bl); } @@ -67,17 +67,17 @@ struct obj_version_cond { void encode(bufferlist& bl) const { ENCODE_START(1, 1, bl); - ::encode(ver, bl); + encode(ver, bl); uint32_t c = (uint32_t)cond; - ::encode(c, bl); + encode(c, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { DECODE_START(1, bl); - ::decode(ver, bl); + decode(ver, bl); uint32_t c; - ::decode(c, bl); + decode(c, bl); cond = (VersionCond)c; DECODE_FINISH(bl); } @@ -87,5 +87,3 @@ WRITE_CLASS_ENCODER(obj_version_cond) #endif - - diff --git a/src/librbd/WatchNotifyTypes.cc b/src/librbd/WatchNotifyTypes.cc index 6a97f4159e9..82d2dba44df 100644 --- a/src/librbd/WatchNotifyTypes.cc +++ b/src/librbd/WatchNotifyTypes.cc @@ -186,15 +186,17 @@ void ResizePayload::dump(Formatter *f) const { } void SnapPayloadBase::encode(bufferlist &bl) const { + using ceph::encode; ::encode(snap_name, bl); - ::encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl); + encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl); } void SnapPayloadBase::decode(__u8 version, bufferlist::iterator &iter) { + using ceph::decode; ::decode(snap_name, iter); if (version >= 6) { cls::rbd::SnapshotNamespaceOnDisk sn; - ::decode(sn, iter); + decode(sn, iter); snap_namespace = sn.snapshot_namespace; } } @@ -210,10 +212,11 @@ void SnapCreatePayload::encode(bufferlist &bl) const { } void SnapCreatePayload::decode(__u8 version, bufferlist::iterator &iter) { + using ceph::decode; SnapPayloadBase::decode(version, iter); if (version == 5) { cls::rbd::SnapshotNamespaceOnDisk sn; - ::decode(sn, iter); + decode(sn, iter); snap_namespace = sn.snapshot_namespace; } } diff --git a/src/librbd/journal/Types.cc b/src/librbd/journal/Types.cc index 724690b9331..2509780ac26 100644 --- a/src/librbd/journal/Types.cc +++ b/src/librbd/journal/Types.cc @@ -189,17 +189,19 @@ void OpFinishEvent::dump(Formatter *f) const { } void SnapEventBase::encode(bufferlist& bl) const { + using ceph::encode; OpEventBase::encode(bl); ::encode(snap_name, bl); - ::encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl); + encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl); } void SnapEventBase::decode(__u8 version, bufferlist::iterator& it) { + using ceph::decode; OpEventBase::decode(version, it); ::decode(snap_name, it); if (version >= 4) { cls::rbd::SnapshotNamespaceOnDisk sn; - ::decode(sn, it); + decode(sn, it); snap_namespace = sn.snapshot_namespace; } } @@ -215,10 +217,11 @@ void SnapCreateEvent::encode(bufferlist &bl) const { } void SnapCreateEvent::decode(__u8 version, bufferlist::iterator& it) { + using ceph::decode; SnapEventBase::decode(version, it); if (version == 3) { cls::rbd::SnapshotNamespaceOnDisk sn; - ::decode(sn, it); + decode(sn, it); snap_namespace = sn.snapshot_namespace; } } @@ -540,19 +543,21 @@ void ImageClientMeta::dump(Formatter *f) const { } void MirrorPeerSyncPoint::encode(bufferlist& bl) const { + using ceph::encode; ::encode(snap_name, bl); ::encode(from_snap_name, bl); ::encode(object_number, bl); - ::encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl); + encode(cls::rbd::SnapshotNamespaceOnDisk(snap_namespace), bl); } void MirrorPeerSyncPoint::decode(__u8 version, bufferlist::iterator& it) { + using ceph::decode; ::decode(snap_name, it); ::decode(from_snap_name, it); ::decode(object_number, it); if (version >= 2) { cls::rbd::SnapshotNamespaceOnDisk sn; - ::decode(sn, it); + decode(sn, it); snap_namespace = sn.snapshot_namespace; } } diff --git a/src/librbd/trash_watcher/Types.cc b/src/librbd/trash_watcher/Types.cc index 1cbfe7a1bf8..d03bebaee1a 100644 --- a/src/librbd/trash_watcher/Types.cc +++ b/src/librbd/trash_watcher/Types.cc @@ -30,13 +30,15 @@ private: } // anonymous namespace void ImageAddedPayload::encode(bufferlist &bl) const { + using ceph::encode; ::encode(image_id, bl); - ::encode(trash_image_spec, bl); + encode(trash_image_spec, bl); } void ImageAddedPayload::decode(__u8 version, bufferlist::iterator &iter) { + using ceph::decode; ::decode(image_id, iter); - ::decode(trash_image_spec, iter); + decode(trash_image_spec, iter); } void ImageAddedPayload::dump(Formatter *f) const { diff --git a/src/test/cls_rbd/test_cls_rbd.cc b/src/test/cls_rbd/test_cls_rbd.cc index a13c1832931..ce01a516ee3 100644 --- a/src/test/cls_rbd/test_cls_rbd.cc +++ b/src/test/cls_rbd/test_cls_rbd.cc @@ -2162,7 +2162,7 @@ TEST_F(TestClsRbd, group_image_clean) { cls::rbd::GroupImageLinkState ref_state; bufferlist::iterator it = vals[image_key].begin(); - ::decode(ref_state, it); + decode(ref_state, it); ASSERT_EQ(cls::rbd::GROUP_IMAGE_LINK_STATE_ATTACHED, ref_state); } @@ -2186,7 +2186,7 @@ TEST_F(TestClsRbd, image_add_group) { cls::rbd::GroupSpec val_spec; bufferlist::iterator it = vals[RBD_GROUP_REF].begin(); - ::decode(val_spec, it); + decode(val_spec, it); ASSERT_EQ(group_id, val_spec.group_id); ASSERT_EQ(pool_id, val_spec.pool_id); diff --git a/src/test/encoding/ceph_dencoder.cc b/src/test/encoding/ceph_dencoder.cc index 77892ca2f0d..3f0581cab8f 100644 --- a/src/test/encoding/ceph_dencoder.cc +++ b/src/test/encoding/ceph_dencoder.cc @@ -190,6 +190,8 @@ public: DencoderImplFeaturefulNoCopy(bool stray_ok, bool nondeterministic) : DencoderBase(stray_ok, nondeterministic) {} void encode(bufferlist& out, uint64_t features) override { + using ceph::encode; + using ::encode; out.clear(); using ::encode; using ceph::encode; diff --git a/src/test/librbd/mirror/test_mock_DisableRequest.cc b/src/test/librbd/mirror/test_mock_DisableRequest.cc index 6334e9b4f13..65f7620d110 100644 --- a/src/test/librbd/mirror/test_mock_DisableRequest.cc +++ b/src/test/librbd/mirror/test_mock_DisableRequest.cc @@ -117,8 +117,9 @@ public: void expect_get_mirror_image(MockTestImageCtx &mock_image_ctx, const cls::rbd::MirrorImage &mirror_image, int r) { + using ceph::encode; bufferlist bl; - ::encode(mirror_image, bl); + encode(mirror_image, bl); EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx), exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"), diff --git a/src/test/librbd/trash/test_mock_MoveRequest.cc b/src/test/librbd/trash/test_mock_MoveRequest.cc index 7fdc36e757a..43a31f89092 100644 --- a/src/test/librbd/trash/test_mock_MoveRequest.cc +++ b/src/test/librbd/trash/test_mock_MoveRequest.cc @@ -69,7 +69,7 @@ struct TestMockTrashMoveRequest : public TestMockFixture { bufferlist::iterator bl_it = in_bl.begin(); ::decode(id, bl_it); - ::decode(trash_image_spec, bl_it); + decode(trash_image_spec, bl_it); EXPECT_EQ(id, image_id); EXPECT_EQ(trash_image_spec.source, diff --git a/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc b/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc index 4e9074b6566..19103b8f5bf 100644 --- a/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc +++ b/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc @@ -244,7 +244,7 @@ public: bufferlist bl; ::encode(image_id, bl); - ::encode(mirror_image, bl); + encode(mirror_image, bl); EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx), exec(RBD_MIRRORING, _, StrEq("rbd"), diff --git a/src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc b/src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc index 01931b0aeb9..9c60e0689e7 100644 --- a/src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc +++ b/src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc @@ -251,7 +251,7 @@ public: mirror_image.global_image_id = global_id; bufferlist bl; - ::encode(mirror_image, bl); + encode(mirror_image, bl); EXPECT_CALL(get_mock_io_ctx(io_ctx), exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"), _, _, _)) diff --git a/src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc b/src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc index 279debead9b..f80cdffc7aa 100644 --- a/src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc +++ b/src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc @@ -95,7 +95,7 @@ public: mirror_image.global_image_id = global_id; bufferlist bl; - ::encode(mirror_image, bl); + encode(mirror_image, bl); EXPECT_CALL(get_mock_io_ctx(io_ctx), exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"), _, _, _)) -- 2.39.5