This is a portion of the namespace project.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* 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
*/
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;
// 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;
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) {
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);
}
};
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);
}
};
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);
}
};
// 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;
// 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;
if (layout_bl.length()) {
try {
bufferlist::iterator q = layout_bl.begin();
- ::decode(*layout, q);
+ decode(*layout, q);
} catch (buffer::error &e) {
return -EINVAL;
}
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);
}
-
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;
}
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;
template <typename T>
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) {
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());
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;
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(),
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;
return r;
}
- ::encode(order, *out);
+ encode(order, *out);
return 0;
}
return r;
}
- ::encode(splay_width, *out);
+ encode(splay_width, *out);
return 0;
}
return r;
}
- ::encode(pool_id, *out);
+ encode(pool_id, *out);
return 0;
}
return r;
}
- ::encode(minimum_set, *out);
+ encode(minimum_set, *out);
return 0;
}
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;
return r;
}
- ::encode(active_set, *out);
+ encode(active_set, *out);
return 0;
}
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;
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;
return r;
}
- ::encode(client, *out);
+ encode(client, *out);
return 0;
}
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;
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;
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<cls::journal::ClientState>(state_raw);
} catch (const buffer::error &err) {
CLS_ERR("failed to decode input parameters: %s", err.what());
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;
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;
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;
if (r < 0)
return r;
- ::encode(clients, *out);
+ encode(clients, *out);
return 0;
}
return r;
}
- ::encode(tag_tid, *out);
+ encode(tag_tid, *out);
return 0;
}
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;
return r;
}
- ::encode(tag, *out);
+ encode(tag, *out);
return 0;
}
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;
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;
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;
}
} while (tag_pass != TAG_PASS_DONE);
- ::encode(tags, *out);
+ encode(tags, *out);
return 0;
}
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;
namespace cls {
namespace journal {
namespace client {
+using ceph::encode;
+using ceph::decode;
namespace {
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);
try {
bufferlist::iterator iter = outbl.begin();
std::set<cls::journal::Client> partial_clients;
- ::decode(partial_clients, iter);
+ decode(partial_clients, iter);
std::string start_after;
if (!partial_clients.empty()) {
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;
}
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;
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);
}
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);
}
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;
}
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);
}
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);
}
const std::string &id,
cls::journal::ClientState state) {
bufferlist bl;
- ::encode(id, bl);
- ::encode(static_cast<uint8_t>(state), bl);
+ encode(id, bl);
+ encode(static_cast<uint8_t>(state), bl);
op->exec("journal", "client_update_state", bl);
}
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);
}
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;
}
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;
}
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);
}
const std::string &client_id,
boost::optional<uint64_t> 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<cls::journal::Tag> *tags) {
try {
- ::decode(*tags, *iter);
+ decode(*tags, *iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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);
}
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);
}
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);
}
void Client::encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(id, bl);
- ::encode(data, bl);
- ::encode(commit_position, bl);
- ::encode(static_cast<uint8_t>(state), bl);
+ encode(id, bl);
+ encode(data, bl);
+ encode(commit_position, bl);
+ encode(static_cast<uint8_t>(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<ClientState>(state_raw);
DECODE_FINISH(iter);
}
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);
}
} // namespace journal
} // namespace cls
-using cls::journal::encode;
-using cls::journal::decode;
-
#endif // CEPH_CLS_JOURNAL_TYPES_H
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);
cls_lock_lock_op op;
try {
bufferlist::iterator iter = in->begin();
- ::decode(op, iter);
+ decode(op, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
cls_lock_unlock_op op;
try {
bufferlist::iterator iter = in->begin();
- ::decode(op, iter);
+ decode(op, iter);
} catch (const buffer::error& err) {
return -EINVAL;
}
cls_lock_break_op op;
try {
bufferlist::iterator iter = in->begin();
- ::decode(op, iter);
+ decode(op, iter);
} catch (const buffer::error& err) {
return -EINVAL;
}
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;
}
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;
}
}
}
- ::encode(ret, *out);
+ encode(ret, *out);
return 0;
}
cls_lock_assert_op op;
try {
bufferlist::iterator iter = in->begin();
- ::decode(op, iter);
+ decode(op, iter);
} catch (const buffer::error& err) {
return -EINVAL;
}
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;
}
op.duration = duration;
op.flags = flags;
bufferlist in;
- ::encode(op, in);
+ encode(op, in);
rados_op->exec("lock", "lock", in);
}
op.name = name;
op.cookie = cookie;
bufferlist in;
- ::encode(op, in);
+ encode(op, in);
rados_op->exec("lock", "unlock", in);
}
op.cookie = cookie;
op.locker = locker;
bufferlist in;
- ::encode(op, in);
+ encode(op, in);
rados_op->exec("lock", "break_lock", in);
}
cls_lock_list_locks_reply ret;
bufferlist::iterator iter = out.begin();
try {
- ::decode(ret, iter);
+ decode(ret, iter);
} catch (buffer::error& err) {
return -EBADMSG;
}
bufferlist in;
cls_lock_get_info_op op;
op.name = name;
- ::encode(op, in);
+ encode(op, in);
rados_op->exec("lock", "get_info", in);
}
{
cls_lock_get_info_reply ret;
try {
- ::decode(ret, *iter);
+ decode(ret, *iter);
} catch (buffer::error& err) {
return -EBADMSG;
}
op.cookie = cookie;
op.tag = tag;
bufferlist in;
- ::encode(op, in);
+ encode(op, in);
rados_op->exec("lock", "assert_locked", in);
}
op.tag = tag;
op.new_cookie = new_cookie;
bufferlist in;
- ::encode(op, in);
+ encode(op, in);
rados_op->exec("lock", "set_cookie", in);
}
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;
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;
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;
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;
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;
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;
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;
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;
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:
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);
}
void dump(Formatter *f) const;
static void generate_test_instances(list<locker_id_t*>& o);
};
- WRITE_CLASS_ENCODER(rados::cls::lock::locker_id_t)
+ WRITE_CLASS_ENCODER(locker_id_t)
struct locker_info_t
{
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<locker_info_t *>& o);
};
- WRITE_CLASS_ENCODER_FEATURES(rados::cls::lock::locker_info_t)
+ WRITE_CLASS_ENCODER_FEATURES(locker_info_t)
struct lock_info_t {
map<locker_id_t, locker_info_t> lockers; // map of lockers
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<lock_info_t *>& o);
};
- WRITE_CLASS_ENCODER_FEATURES(rados::cls::lock::lock_info_t)
+ WRITE_CLASS_ENCODER_FEATURES(lock_info_t);
}
}
}
-// -*- 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"
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)
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");
}
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)
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;
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;
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());
ret.marker = marker;
- ::encode(ret, *out);
+ encode(ret, *out);
return 0;
}
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;
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;
if (rc < 0)
return rc;
- ::encode(ret, *out);
+ encode(ret, *out);
return 0;
}
bufferlist in;
cls_log_add_op call;
call.entries = entries;
- ::encode(call, in);
+ encode(call, in);
op.exec("log", "add", in);
}
bufferlist in;
cls_log_add_op call;
call.entries.push_back(entry);
- ::encode(call, in);
+ encode(call, in);
op.exec("log", "add", in);
}
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);
}
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)
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));
}
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) {
bufferlist inbl;
cls_log_info_op call;
- ::encode(call, inbl);
+ encode(call, inbl);
op.exec("log", "info", inbl, new LogInfoCtx(header));
}
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);
}
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);
}
};
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);
}
};
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);
}
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);
}
};
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);
}
};
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);
}
};
#endif
-
-
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;
op.input = input;
bufferlist inbl;
- ::encode(op, inbl);
+ encode(op, inbl);
return ioctx.exec(oid, "lua", "eval_bufferlist", inbl, output);
}
#ifndef CEPH_CLS_LUA_OPS_H
#define CEPH_CLS_LUA_OPS_H
+#include <string>
+
+#include "include/encoding.h"
+
struct cls_lua_eval_op {
std::string script;
std::string handler;
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);
}
};
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;
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;
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);
}
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);
}
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;
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;
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<string, bufferlist> omap_vals;
omap_vals["size"] = sizebl;
}
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");
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;
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;
}
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;
}
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());
bufferlist::iterator iter = in->begin();
try {
- ::decode(snap_id, iter);
+ decode(snap_id, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
size = snap.image_size;
}
- ::encode(order, *out);
- ::encode(size, *out);
+ encode(order, *out);
+ encode(size, *out);
return 0;
}
bufferlist::iterator iter = in->begin();
try {
- ::decode(size, iter);
+ decode(size, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
(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());
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());
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;
return -EIO;
}
- ::encode(snap.protection_status, *out);
+ encode(snap.protection_status, *out);
return 0;
}
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;
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());
if (r < 0)
return r;
- ::encode(stripe_unit, *out);
- ::encode(stripe_count, *out);
+ encode(stripe_unit, *out);
+ encode(stripe_count, *out);
return 0;
}
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;
}
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());
} 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;
}
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;
}
flags = snap.flags;
}
- ::encode(flags, *out);
+ encode(flags, *out);
return 0;
}
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;
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);
}
bufferlist::iterator iter = in->begin();
try {
- ::decode(snap_id, iter);
+ decode(snap_id, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
}
}
- ::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;
}
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;
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());
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",
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;
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;
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());
}
// 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());
} 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());
CLS_LOG(20, "get_children: read omap failed: %s", cpp_strerror(r).c_str());
return r;
}
- ::encode(children, *out);
+ encode(children, *out);
return 0;
}
// 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;
}
return r;
}
- ::encode(object_prefix, *out);
+ encode(object_prefix, *out);
return 0;
}
return r;
}
- ::encode(data_pool_id, *out);
+ encode(data_pool_id, *out);
return 0;
}
bufferlist::iterator iter = in->begin();
try {
- ::decode(snap_id, iter);
+ decode(snap_id, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
if (r < 0)
return r;
- ::encode(snap.name, *out);
+ encode(snap.name, *out);
return 0;
}
bufferlist::iterator iter = in->begin();
try {
- ::decode(snap_id, iter);
+ decode(snap_id, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
return r;
}
- ::encode(snap.timestamp, *out);
+ encode(snap.timestamp, *out);
return 0;
}
bufferlist::iterator iter = in->begin();
try {
- ::decode(snap_id, iter);
+ decode(snap_id, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
return r;
}
- ::encode(snap.snapshot_namespace, *out);
+ encode(snap.snapshot_namespace, *out);
return 0;
}
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;
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",
}
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);
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;
}
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());
}
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) {
try {
bufferlist::iterator iter = in->begin();
- ::decode(snap_id, iter);
+ decode(snap_id, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
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;
}
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;
}
string id;
try {
bufferlist::iterator iter = in->begin();
- ::decode(id, iter);
+ decode(id, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
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);
}
return -EBADF;
}
bufferlist id_bl, name_bl;
- ::encode(id, id_bl);
- ::encode(name, name_bl);
+ encode(id, id_bl);
+ encode(name, name_bl);
map<string, bufferlist> omap_vals;
omap_vals[name_key] = id_bl;
omap_vals[id_key] = name_bl;
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;
}
try {
bufferlist::iterator iter = in->begin();
- ::decode(name, iter);
+ decode(name, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
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;
}
try {
bufferlist::iterator iter = in->begin();
- ::decode(id, iter);
+ decode(id, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
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;
}
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;
}
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;
}
}
- ::encode(images, *out);
+ encode(images, *out);
return 0;
}
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;
}
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;
}
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;
}
boost::optional<uint8_t> 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;
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;
}
}
}
- ::encode(data, *out);
+ encode(data, *out);
return 0;
}
bufferlist::iterator iter = in->begin();
try {
- ::decode(data, iter);
+ decode(data, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
bufferlist::iterator iter = in->begin();
try {
- ::decode(key, iter);
+ decode(key, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
bufferlist::iterator iter = in->begin();
try {
- ::decode(key, iter);
+ decode(key, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
return r;
}
- ::encode(value, *out);
+ encode(value, *out);
return 0;
}
}
CLS_LOG(20, "read snapshot limit %" PRIu64, snap_limit);
- ::encode(snap_limit, *out);
+ encode(snap_limit, *out);
return 0;
}
try {
bufferlist::iterator iter = in->begin();
- ::decode(new_limit, iter);
+ decode(new_limit, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
} 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);
}
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)
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;
}
struct rbd_obj_snap_ondisk snap;
try {
- ::decode(s, iter);
+ decode(s, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
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;
}
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());
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;
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) {
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;
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);
}
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) {
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);
}
void decode_meta(bufferlist::iterator &it) {
DECODE_START(1, it);
- ::decode(origin, it);
+ decode(origin, it);
DECODE_FINISH(it);
}
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());
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());
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;
return r;
}
- ::encode(mirror_uuid, *out);
+ encode(mirror_uuid, *out);
return 0;
}
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;
}
return r;
}
- ::encode(mirror_mode_decode, *out);
+ encode(mirror_mode_decode, *out);
return 0;
}
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;
}
}
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) {
return r;
}
- ::encode(peers, *out);
+ encode(peers, *out);
return 0;
}
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;
}
}
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) {
std::string uuid;
try {
bufferlist::iterator it = in->begin();
- ::decode(uuid, it);
+ decode(uuid, it);
} catch (const buffer::error &err) {
return -EINVAL;
}
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;
}
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;
}
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;
}
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());
}
}
- ::encode(mirror_images, *out);
+ encode(mirror_images, *out);
return 0;
}
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;
}
return r;
}
- ::encode(image_id, *out);
+ encode(image_id, *out);
return 0;
}
string image_id;
try {
bufferlist::iterator it = in->begin();
- ::decode(image_id, it);
+ decode(image_id, it);
} catch (const buffer::error &err) {
return -EINVAL;
}
return r;
}
- ::encode(mirror_image, *out);
+ encode(mirror_image, *out);
return 0;
}
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;
}
string image_id;
try {
bufferlist::iterator it = in->begin();
- ::decode(image_id, it);
+ decode(image_id, it);
} catch (const buffer::error &err) {
return -EINVAL;
}
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;
}
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;
}
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;
}
return r;
}
- ::encode(status, *out);
+ encode(status, *out);
return 0;
}
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;
}
return r;
}
- ::encode(images, *out);
- ::encode(statuses, *out);
+ encode(images, *out);
+ encode(statuses, *out);
return 0;
}
return r;
}
- ::encode(states, *out);
+ encode(states, *out);
return 0;
}
return r;
}
- ::encode(instance_ids, *out);
+ encode(instance_ids, *out);
return 0;
}
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;
}
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;
}
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;
}
return r;
}
- ::encode(image_mapping, *out);
+ encode(image_mapping, *out);
return 0;
}
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);
try {
bufferlist::iterator it = in->begin();
- ::decode(global_image_id, it);
+ decode(global_image_id, it);
} catch (const buffer::error &err) {
return -EINVAL;
}
{
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;
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;
}
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;
}
}
- ::encode(groups, *out);
+ encode(groups, *out);
return 0;
}
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;
}
return -EBADF;
}
bufferlist id_bl, name_bl;
- ::encode(id, id_bl);
- ::encode(name, name_bl);
+ encode(id, id_bl);
+ encode(name, name_bl);
map<string, bufferlist> omap_vals;
omap_vals[name_key] = id_bl;
omap_vals[id_key] = name_bl;
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;
}
cls::rbd::GroupImageStatus st;
try {
bufferlist::iterator iter = in->begin();
- ::decode(st, iter);
+ decode(st, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
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;
cls::rbd::GroupImageSpec spec;
try {
bufferlist::iterator iter = in->begin();
- ::decode(spec, iter);
+ decode(spec, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
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;
}
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;
}
} while (more && (res.size() < max_return));
- ::encode(res, *out);
+ encode(res, *out);
return 0;
}
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;
}
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;
}
}
bufferlist refbl;
- ::encode(new_group, refbl);
+ encode(new_group, refbl);
r = cls_cxx_map_set_val(hctx, RBD_GROUP_REF, &refbl);
if (r < 0) {
cls::rbd::GroupSpec spec;
try {
bufferlist::iterator iter = in->begin();
- ::decode(spec, iter);
+ decode(spec, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
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;
}
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;
}
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;
}
}
map<string, bufferlist> omap_vals;
- ::encode(trash_spec, omap_vals[key]);
+ encode(trash_spec, omap_vals[key]);
return cls_cxx_map_set_vals(hctx, &omap_vals);
}
string id;
try {
bufferlist::iterator iter = in->begin();
- ::decode(id, iter);
+ decode(id, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
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;
}
map<string, bufferlist>::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) {
last_read = raw_data.rbegin()->first;
}
- ::encode(data, *out);
+ encode(data, *out);
return 0;
}
string id;
try {
bufferlist::iterator iter = in->begin();
- ::decode(id, iter);
+ decode(id, iter);
} catch (const buffer::error &err) {
return -EINVAL;
}
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 {
{}
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);
}
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);
}
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;
}
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);
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;
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);
}
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)
try {
bufferlist::iterator iter = outbl.begin();
- ::decode(*features, iter);
+ decode(*features, iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
uint64_t mask)
{
bufferlist bl;
- ::encode(features, bl);
- ::encode(mask, bl);
+ encode(features, bl);
+ encode(mask, bl);
op->exec("rbd", "set_features", bl);
}
try {
bufferlist::iterator iter = outbl.begin();
- ::decode(*object_prefix, iter);
+ decode(*object_prefix, iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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;
}
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)
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;
}
void set_size(librados::ObjectWriteOperation *op, uint64_t size)
{
bufferlist bl;
- ::encode(size, bl);
+ encode(size, bl);
op->exec("rbd", "set_size", bl);
}
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)
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;
}
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);
}
void get_flags_start(librados::ObjectReadOperation *op,
const std::vector<snapid_t> &snap_ids) {
bufferlist in_bl;
- ::encode(static_cast<snapid_t>(CEPH_NOSNAP), in_bl);
+ encode(static_cast<snapid_t>(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);
}
std::vector<uint64_t> *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;
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);
}
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);
}
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);
}
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<std::string>* children) {
try {
- ::decode(*children, *it);
+ decode(*children, *it);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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);
}
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);
}
::SnapContext *snapc)
{
try {
- ::decode(*snapc, *it);
+ decode(*snapc, *it);
} catch (const buffer::error &err) {
return -EBADMSG;
}
const std::vector<snapid_t> &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);
}
}
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;
{
for (auto snap_id : ids) {
bufferlist bl;
- ::encode(snap_id, bl);
+ encode(snap_id, bl);
op->exec("rbd", "get_snapshot_timestamp", bl);
}
}
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) {
{
for (auto snap_id : ids) {
bufferlist bl;
- ::encode(snap_id, bl);
+ encode(snap_id, bl);
op->exec("rbd", "get_snapshot_namespace", bl);
}
}
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) {
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);
}
const std::string &snap_name)
{
bufferlist bl;
- ::encode(snap_name, bl);
+ encode(snap_name, bl);
op->exec("rbd", "snap_remove", bl);
}
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);
}
::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;
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;
}
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)
try {
bufferlist::iterator iter = out.begin();
- ::decode(*protection_status, iter);
+ decode(*protection_status, iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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);
}
try {
bufferlist::iterator iter = out.begin();
- ::decode(*limit, iter);
+ decode(*limit, iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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);
}
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;
}
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);
}
assert(timestamp);
try {
- ::decode(*timestamp, *it);
+ decode(*timestamp, *it);
} catch (const buffer::error &err) {
return -EBADMSG;
}
int get_id_finish(bufferlist::iterator *it, std::string *id) {
try {
- ::decode(*id, *it);
+ decode(*id, *it);
} catch (const buffer::error &err) {
return -EBADMSG;
}
void set_id(librados::ObjectWriteOperation *op, const std::string id)
{
bufferlist bl;
- ::encode(id, bl);
+ encode(id, bl);
op->exec("rbd", "set_id", bl);
}
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;
}
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;
}
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);
}
int dir_list_finish(bufferlist::iterator *it, map<string, string> *images)
{
try {
- ::decode(*images, *it);
+ decode(*images, *it);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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);
}
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);
}
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);
}
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);
}
const boost::optional<uint8_t> ¤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);
}
const map<string, bufferlist> &data)
{
bufferlist bl;
- ::encode(data, bl);
+ encode(data, bl);
op->exec("rbd", "metadata_set", bl);
}
const std::string &key)
{
bufferlist bl;
- ::encode(key, bl);
+ encode(key, bl);
op->exec("rbd", "metadata_remove", bl);
}
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);
}
{
assert(pairs);
try {
- ::decode(*pairs, *it);
+ decode(*pairs, *it);
} catch (const buffer::error &err) {
return -EBADMSG;
}
{
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;
}
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;
}
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,
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<cls::rbd::MirrorMode>(mirror_mode_decode);
} catch (const buffer::error &err) {
return -EBADMSG;
int mirror_mode_set(librados::IoCtx *ioctx,
cls::rbd::MirrorMode mirror_mode) {
bufferlist in_bl;
- ::encode(static_cast<uint32_t>(mirror_mode), in_bl);
+ encode(static_cast<uint32_t>(mirror_mode), in_bl);
bufferlist out_bl;
int r = ioctx->exec(RBD_MIRRORING, "rbd", "mirror_mode_set", in_bl,
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;
}
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,
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,
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",
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",
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);
}
std::map<string, string> *mirror_image_ids)
{
try {
- ::decode(*mirror_image_ids, *it);
+ decode(*mirror_image_ids, *it);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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;
}
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);
}
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;
}
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);
}
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);
}
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);
}
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);
}
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;
}
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);
}
images->clear();
statuses->clear();
try {
- ::decode(*images, *iter);
- ::decode(*statuses, *iter);
+ decode(*images, *iter);
+ decode(*statuses, *iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
int mirror_image_status_get_summary_finish(bufferlist::iterator *iter,
std::map<cls::rbd::MirrorImageStatusState, int> *states) {
try {
- ::decode(*states, *iter);
+ decode(*states, *iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
std::vector<std::string> *instance_ids) {
instance_ids->clear();
try {
- ::decode(*instance_ids, *iter);
+ decode(*instance_ids, *iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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);
}
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);
}
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);
}
int mirror_image_map_list_finish(bufferlist::iterator *iter,
std::map<std::string, cls::rbd::MirrorImageMap> *image_mapping) {
try {
- ::decode(*image_mapping, *iter);
+ decode(*image_mapping, *iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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);
}
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);
}
map<string, string> *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;
}
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);
}
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);
}
const cls::rbd::GroupImageSpec &spec)
{
bufferlist bl, bl2;
- ::encode(spec, bl);
+ encode(spec, bl);
return ioctx->exec(oid, "rbd", "group_image_remove", bl, bl2);
}
std::vector<cls::rbd::GroupImageStatus> *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)
bufferlist::iterator iter = bl2.begin();
try {
- ::decode(*images, iter);
+ decode(*images, iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
const cls::rbd::GroupImageStatus &st)
{
bufferlist bl, bl2;
- ::encode(st, bl);
+ encode(st, bl);
return ioctx->exec(oid, "rbd", "group_image_set", bl, bl2);
}
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);
}
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);
}
cls::rbd::GroupSpec *group_spec)
{
try {
- ::decode(*group_spec, *iter);
+ decode(*group_spec, *iter);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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);
}
const std::string &id)
{
bufferlist bl;
- ::encode(id, bl);
+ encode(id, bl);
op->exec("rbd", "trash_remove", bl);
}
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);
}
assert(entries);
try {
- ::decode(*entries, *it);
+ decode(*entries, *it);
} catch (const buffer::error &err) {
return -EBADMSG;
}
const std::string &id)
{
bufferlist bl;
- ::encode(id, bl);
+ encode(id, bl);
op->exec("rbd", "trash_get", bl);
}
cls::rbd::TrashImageSpec *trash_spec) {
assert(trash_spec);
try {
- ::decode(*trash_spec, *it);
+ decode(*trash_spec, *it);
} catch (const buffer::error &err) {
return -EBADMSG;
}
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);
}
void MirrorImage::encode(bufferlist &bl) const {
ENCODE_START(1, 1, bl);
- ::encode(global_image_id, bl);
- ::encode(static_cast<uint8_t>(state), bl);
+ encode(global_image_id, bl);
+ encode(static_cast<uint8_t>(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<MirrorImageState>(int_state);
DECODE_FINISH(it);
}
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);
}
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);
}
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);
}
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);
}
}
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 {
template <typename T>
inline void operator()(const T& t) const {
- ::encode(static_cast<uint32_t>(T::SNAPSHOT_NAMESPACE_TYPE), m_bl);
+ using ceph::encode;
+ encode(static_cast<uint32_t>(T::SNAPSHOT_NAMESPACE_TYPE), m_bl);
t.encode(m_bl);
}
{
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();
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);
}
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);
}
inline void encode(const GroupImageLinkState &state, bufferlist& bl,
uint64_t features=0)
{
- ::encode(static_cast<uint8_t>(state), bl);
+ using ceph::encode;
+ encode(static_cast<uint8_t>(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<GroupImageLinkState>(int_state);
}
inline void encode(const MirrorImageStatusState &state, bufferlist& bl,
uint64_t features=0)
{
- ::encode(static_cast<uint8_t>(state), bl);
+ using ceph::encode;
+ encode(static_cast<uint8_t>(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<MirrorImageStatusState>(int_state);
}
inline void encode(const TrashImageSource &source, bufferlist& bl,
uint64_t features=0)
{
- ::encode(static_cast<uint8_t>(source), bl);
+ using ceph::encode;
+ encode(static_cast<uint8_t>(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<TrashImageSource>(int_source);
}
} // namespace rbd
} // namespace cls
-using cls::rbd::encode;
-using cls::rbd::decode;
-
#endif // CEPH_CLS_RBD_TYPES_H
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);
}
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;
{
bufferlist bl;
- ::encode(objr, bl);
+ encode(objr, bl);
int ret = cls_cxx_setxattr(hctx, REFCOUNT_ATTR, &bl);
if (ret < 0)
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;
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;
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;
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;
read_ret.refs.push_back(iter->first);
}
- ::encode(read_ret, *out);
+ encode(read_ret, *out);
return 0;
}
cls_refcount_get_op call;
call.tag = tag;
call.implicit_ref = implicit_ref;
- ::encode(call, in);
+ encode(call, in);
op.exec("refcount", "get", in);
}
cls_refcount_put_op call;
call.tag = tag;
call.implicit_ref = implicit_ref;
- ::encode(call, in);
+ encode(call, in);
op.exec("refcount", "put", in);
}
bufferlist in;
cls_refcount_set_op call;
call.refs = refs;
- ::encode(call, in);
+ encode(call, in);
op.exec("refcount", "set", in);
}
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;
cls_refcount_read_ret ret;
try {
bufferlist::iterator iter = out.begin();
- ::decode(ret, iter);
+ decode(ret, iter);
} catch (buffer::error& err) {
return -EIO;
}
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;
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 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);
}
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);
}
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);
}
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");
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);
}
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;
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;
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;
ret.position_marker = bound.get_lowest_marker_bound();
bound.get_markers(ret.markers);
- ::encode(ret, *out);
+ encode(ret, *out);
return 0;
}
{
cls_replica_log_set_marker_op op(progress);
bufferlist in;
- ::encode(op, in);
+ encode(op, in);
o.exec("replica_log", "set", in);
}
{
cls_replica_log_delete_marker_op op(entity);
bufferlist in;
- ::encode(op, in);
+ encode(op, in);
o.exec("replica_log", "delete", in);
}
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;
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;
}
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);
}
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);
}
{}
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);
}
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);
}
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);
}
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);
}
-// -*- 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"
#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 */
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;
}
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;
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;
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;
ret.is_truncated = more && !done;
- ::encode(ret, *out);
+ encode(ret, *out);
return 0;
}
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;
if (rc < 0)
return rc;
- ::encode(ret, *out);
+ encode(ret, *out);
return 0;
}
header->ver++;
bufferlist header_bl;
- ::encode(*header, header_bl);
+ encode(*header, header_bl);
return cls_cxx_map_write_header(hctx, &header_bl);
}
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;
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;
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;
// 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;
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;
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;
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;
} 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;
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;
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);
}
map<string, bufferlist>::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;
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;
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;
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;
op_ret.is_truncated = (iter != log.end());
}
- ::encode(op_ret, *out);
+ encode(op_ret, *out);
return 0;
}
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;
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;
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;
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;
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;
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;
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;
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);
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;
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;
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;
return r;
}
- ::encode(op_ret, *out);
+ encode(op_ret, *out);
return 0;
}
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;
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;
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;
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;
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;
count--;
}
- ::encode(op_ret, *out);
+ encode(op_ret, *out);
return 0;
}
{
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;
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;
if (ret < 0)
return ret;
- ::encode(op_ret, *out);
+ encode(op_ret, *out);
return 0;
}
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;
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;
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;
{
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;
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;
}
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;
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;
if (ret_info.truncated)
ret_info.next_iter = iter;
- ::encode(ret_info, *out);
+ encode(ret_info, *out);
return 0;
}
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;
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());
}
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);
{
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;
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;
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;
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;
if (ret < 0)
return ret;
- ::encode(op_ret, *out);
+ encode(op_ret, *out);
return 0;
}
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;
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;
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;
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;
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;
}
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;
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;
}
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;
}
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;
}
cls_rgw_lc_get_head_ret op_ret;
op_ret.head = head;
- ::encode(op_ret, *out);
+ encode(op_ret, *out);
return 0;
}
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;
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());
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;
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;
}
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;
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;
cls_rgw_reshard_get_ret op_ret;
op_ret.entry = entry;
- ::encode(op_ret, *out);
+ encode(op_ret, *out);
return 0;
}
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;
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;
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;
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;
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;
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;
}
if (r >= 0) {
try {
bufferlist::iterator iter = outbl.begin();
- ::decode((*data), iter);
+ decode((*data), iter);
} catch (buffer::error& err) {
r = -EIO;
}
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);
call.absolute = absolute;
call.stats = stats;
bufferlist in;
- ::encode(call, in);
+ encode(call, in);
o.exec(RGW_CLASS, RGW_BUCKET_UPDATE_STATS, in);
}
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);
}
if (zones_trace) {
call.zones_trace = *zones_trace;
}
- ::encode(call, in);
+ encode(call, in);
o.exec(RGW_CLASS, RGW_BUCKET_COMPLETE_OP, in);
}
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<struct rgw_cls_list_ret>(pdata, NULL));
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);
}
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);
}
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);
}
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);
}
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;
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;
}
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;
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);
}
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;
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;
}
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)
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)
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);
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;
}
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);
}
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);
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<struct cls_rgw_bi_log_list_ret>(pdata, NULL));
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);
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)
struct rgw_cls_list_ret ret;
try {
bufferlist::iterator iter = outbl.begin();
- ::decode(ret, iter);
+ decode(ret, iter);
} catch (buffer::error& err) {
r = -EIO;
}
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);
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;
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;
call.start_epoch = start_epoch;
call.end_epoch = end_epoch;
call.user = user;
- ::encode(call, in);
+ encode(call, in);
bool done = false;
do {
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);
}
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);
}
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);
}
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;
cls_rgw_gc_list_ret ret;
try {
bufferlist::iterator iter = out.begin();
- ::decode(ret, iter);
+ decode(ret, iter);
} catch (buffer::error& err) {
return -EIO;
}
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);
}
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;
}
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;
}
bufferlist in, out;
cls_rgw_lc_get_next_entry_op call;
call.marker = marker;
- ::encode(call, in);
+ encode(call, in);
int r = io_ctx.exec(oid, RGW_CLASS, RGW_LC_GET_NEXT_ENTRY, in, out);
if (r < 0)
return r;
cls_rgw_lc_get_next_entry_ret ret;
try {
bufferlist::iterator iter = out.begin();
- ::decode(ret, iter);
+ decode(ret, iter);
} catch (buffer::error& err) {
return -EIO;
}
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;
}
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;
}
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)
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;
}
bufferlist in;
struct cls_rgw_reshard_add_op call;
call.entry = entry;
- ::encode(call, in);
+ encode(call, in);
op.exec("rgw", "reshard_add", in);
}
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;
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;
}
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;
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;
}
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);
}
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);
}
{
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);
}
{
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;
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;
}
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);
}
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);
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;
} 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;
{
rgw_bucket_olh_entry entry;
JSONDecoder::decode_json("entry", entry, obj);
- ::encode(entry, data);
+ encode(entry, data);
if (effective_key) {
*effective_key = entry.key;
{
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++;
case OLHIdx:
{
rgw_bucket_olh_entry entry;
- ::decode(entry, iter);
+ decode(entry, iter);
*key = entry.key;
}
break;
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;
{
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";
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)
}
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;
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;
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;
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());
ret.marker = marker;
}
- ::encode(ret, *out);
+ encode(ret, *out);
return 0;
}
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;
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;
bufferlist in;
cls_statelog_add_op call;
call.entries = entries;
- ::encode(call, in);
+ encode(call, in);
op.exec("statelog", "add", in);
}
bufferlist in;
cls_statelog_add_op call;
call.entries.push_back(entry);
- ::encode(call, in);
+ encode(call, in);
op.exec("statelog", "add", in);
}
cls_statelog_remove_op call;
call.client_id = client_id;
call.op_id = op_id;
- ::encode(call, in);
+ encode(call, in);
op.exec("statelog", "remove", in);
}
cls_statelog_remove_op call;
call.object = object;
call.op_id = op_id;
- ::encode(call, in);
+ encode(call, in);
op.exec("statelog", "remove", in);
}
cls_statelog_list_ret ret;
try {
bufferlist::iterator iter = outbl.begin();
- ::decode(ret, iter);
+ decode(ret, iter);
if (entries)
*entries = ret.entries;
if (truncated)
call.marker = in_marker;
call.max_entries = max_entries;
- ::encode(call, inbl);
+ encode(call, inbl);
op.exec("statelog", "list", inbl, new StateLogListCtx(&entries, out_marker, truncated));
}
call.object = object;
call.state = state;
- ::encode(call, inbl);
+ encode(call, inbl);
op.exec("statelog", "check_state", inbl, NULL);
}
-
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(entries, bl);
+ encode(entries, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(entries, bl);
+ decode(entries, bl);
DECODE_FINISH(bl);
}
};
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(object, bl);
- ::encode(client_id, bl);
- ::encode(op_id, bl);
- ::encode(marker, bl);
- ::encode(max_entries, bl);
+ encode(object, bl);
+ encode(client_id, bl);
+ encode(op_id, bl);
+ encode(marker, bl);
+ encode(max_entries, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(object, bl);
- ::decode(client_id, bl);
- ::decode(op_id, bl);
- ::decode(marker, bl);
- ::decode(max_entries, bl);
+ decode(object, bl);
+ decode(client_id, bl);
+ decode(op_id, bl);
+ decode(marker, bl);
+ decode(max_entries, bl);
DECODE_FINISH(bl);
}
};
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);
}
};
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(client_id, bl);
- ::encode(op_id, bl);
- ::encode(object, bl);
+ encode(client_id, bl);
+ encode(op_id, bl);
+ encode(object, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(client_id, bl);
- ::decode(op_id, bl);
- ::decode(object, bl);
+ decode(client_id, bl);
+ decode(op_id, bl);
+ decode(object, bl);
DECODE_FINISH(bl);
}
};
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(client_id, bl);
- ::encode(op_id, bl);
- ::encode(object, bl);
- ::encode(state, bl);
+ encode(client_id, bl);
+ encode(op_id, bl);
+ encode(object, bl);
+ encode(state, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(client_id, bl);
- ::decode(op_id, bl);
- ::decode(object, bl);
- ::decode(state, bl);
+ decode(client_id, bl);
+ decode(op_id, bl);
+ decode(object, bl);
+ decode(state, bl);
DECODE_FINISH(bl);
}
};
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(client_id, bl);
- ::encode(op_id, bl);
- ::encode(object, bl);
- ::encode(timestamp, bl);
- ::encode(data, bl);
- ::encode(state, bl);
+ encode(client_id, bl);
+ encode(op_id, bl);
+ encode(object, bl);
+ encode(timestamp, bl);
+ encode(data, bl);
+ encode(state, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(client_id, bl);
- ::decode(op_id, bl);
- ::decode(object, bl);
- ::decode(timestamp, bl);
- ::decode(data, bl);
- ::decode(state, bl);
+ decode(client_id, bl);
+ decode(op_id, bl);
+ decode(object, bl);
+ decode(timestamp, bl);
+ decode(data, bl);
+ decode(state, bl);
DECODE_FINISH(bl);
}
#endif
-
-
cls_timeindex_add_op op;
try {
- ::decode(op, in_iter);
+ decode(op, in_iter);
} catch (buffer::error& err) {
CLS_LOG(1, "ERROR: cls_timeindex_add_op(): failed to decode op");
return -EINVAL;
cls_timeindex_list_op op;
try {
- ::decode(op, in_iter);
+ decode(op, in_iter);
} catch (buffer::error& err) {
CLS_LOG(1, "ERROR: cls_timeindex_list_op(): failed to decode op");
return -EINVAL;
ret.marker = marker;
- ::encode(ret, *out);
+ encode(ret, *out);
return 0;
}
cls_timeindex_trim_op op;
try {
- ::decode(op, in_iter);
+ decode(op, in_iter);
} catch (buffer::error& err) {
CLS_LOG(1, "ERROR: cls_timeindex_trim: failed to decode entry");
return -EINVAL;
cls_timeindex_add_op call;
call.entries = entries;
- ::encode(call, in);
+ encode(call, in);
op.exec("timeindex", "add", in);
}
cls_timeindex_add_op call;
call.entries.push_back(entry);
- ::encode(call, in);
+ encode(call, in);
op.exec("timeindex", "add", in);
}
call.from_marker = from_marker;
call.to_marker = to_marker;
- ::encode(call, in);
+ encode(call, in);
op.exec("timeindex", "trim", in);
}
call.marker = in_marker;
call.max_entries = max_entries;
- ::encode(call, in);
+ encode(call, in);
op.exec("timeindex", "list", in,
new TimeindexListCtx(&entries, out_marker, truncated));
cls_timeindex_list_ret ret;
try {
bufferlist::iterator iter = bl.begin();
- ::decode(ret, iter);
+ decode(ret, iter);
if (entries)
*entries = ret.entries;
if (truncated)
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(entries, bl);
+ encode(entries, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(entries, bl);
+ decode(entries, bl);
DECODE_FINISH(bl);
}
};
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);
}
};
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);
}
};
void encode(bufferlist& bl) const {
ENCODE_START(1, 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(1, bl);
- ::decode(from_time, bl);
- ::decode(to_time, bl);
- ::decode(from_marker, bl);
- ::decode(to_marker, bl);
+ decode(from_time, bl);
+ decode(to_time, bl);
+ decode(from_marker, bl);
+ decode(to_marker, bl);
DECODE_FINISH(bl);
}
};
void encode(bufferlist& bl) const {
ENCODE_START(1, 1, bl);
- ::encode(key_ts, bl);
- ::encode(key_ext, bl);
- ::encode(value, bl);
+ encode(key_ts, bl);
+ encode(key_ext, bl);
+ encode(value, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& bl) {
DECODE_START(1, bl);
- ::decode(key_ts, bl);
- ::decode(key_ext, bl);
- ::decode(value, bl);
+ decode(key_ts, bl);
+ decode(key_ext, bl);
+ decode(value, bl);
DECODE_FINISH(bl);
}
};
static int write_entry(cls_method_context_t hctx, const string& key, const cls_user_bucket_entry& entry)
{
bufferlist bl;
- ::encode(entry, bl);
+ encode(entry, bl);
int ret = cls_cxx_map_set_val(hctx, key, &bl);
if (ret < 0)
}
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", key.c_str());
return -EIO;
}
try {
- ::decode(*header, bl);
+ decode(*header, bl);
} catch (buffer::error& err) {
CLS_LOG(0, "ERROR: failed to decode user header");
return -EIO;
cls_user_set_buckets_op op;
try {
- ::decode(op, in_iter);
+ decode(op, in_iter);
} catch (buffer::error& err) {
CLS_LOG(1, "ERROR: cls_user_add_op(): failed to decode op");
return -EINVAL;
if (header.last_stats_update < op.time)
header.last_stats_update = op.time;
- ::encode(header, bl);
+ encode(header, bl);
ret = cls_cxx_map_write_header(hctx, &bl);
if (ret < 0)
cls_user_complete_stats_sync_op op;
try {
- ::decode(op, in_iter);
+ decode(op, in_iter);
} catch (buffer::error& err) {
CLS_LOG(1, "ERROR: cls_user_add_op(): failed to decode op");
return -EINVAL;
bufferlist bl;
- ::encode(header, bl);
+ encode(header, bl);
ret = cls_cxx_map_write_header(hctx, &bl);
if (ret < 0)
cls_user_remove_bucket_op op;
try {
- ::decode(op, in_iter);
+ decode(op, in_iter);
} catch (buffer::error& err) {
CLS_LOG(1, "ERROR: cls_user_add_op(): failed to decode op");
return -EINVAL;
cls_user_list_buckets_op op;
try {
- ::decode(op, in_iter);
+ decode(op, in_iter);
} catch (buffer::error& err) {
CLS_LOG(1, "ERROR: cls_user_list_op(): failed to decode op");
return -EINVAL;
bufferlist::iterator biter = bl.begin();
try {
cls_user_bucket_entry e;
- ::decode(e, biter);
+ decode(e, biter);
entries.push_back(e);
} catch (buffer::error& err) {
CLS_LOG(0, "ERROR: cls_user_list: could not decode entry, index=%s", index.c_str());
ret.marker = marker;
}
- ::encode(ret, *out);
+ encode(ret, *out);
return 0;
}
cls_user_get_header_op op;
try {
- ::decode(op, in_iter);
+ decode(op, in_iter);
} catch (buffer::error& err) {
CLS_LOG(1, "ERROR: cls_user_get_header_op(): failed to decode op");
return -EINVAL;
if (ret < 0)
return ret;
- ::encode(op_ret, *out);
+ encode(op_ret, *out);
return 0;
}
-// -*- 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 <errno.h>
call.entries = entries;
call.add = add;
call.time = real_clock::now();
- ::encode(call, in);
+ encode(call, in);
op.exec("user", "set_buckets_info", in);
}
bufferlist in;
cls_user_complete_stats_sync_op call;
call.time = real_clock::now();
- ::encode(call, in);
+ encode(call, in);
op.exec("user", "complete_stats_sync", in);
}
bufferlist in;
cls_user_remove_bucket_op call;
call.bucket = bucket;
- ::encode(call, in);
+ encode(call, in);
op.exec("user", "remove_bucket", in);
}
cls_user_list_buckets_ret ret;
try {
bufferlist::iterator iter = outbl.begin();
- ::decode(ret, iter);
+ decode(ret, iter);
if (entries)
*entries = ret.entries;
if (truncated)
call.end_marker = end_marker;
call.max_entries = max_entries;
- ::encode(call, inbl);
+ encode(call, inbl);
op.exec("user", "list_buckets", inbl, new ClsUserListCtx(&entries, out_marker, truncated, pret));
}
cls_user_get_header_ret ret;
try {
bufferlist::iterator iter = outbl.begin();
- ::decode(ret, iter);
+ decode(ret, iter);
if (header)
*header = ret.header;
} catch (buffer::error& err) {
bufferlist inbl;
cls_user_get_header_op call;
- ::encode(call, inbl);
+ encode(call, inbl);
op.exec("user", "get_header", inbl, new ClsUserGetHeaderCtx(header, NULL, pret));
}
{
bufferlist in, out;
cls_user_get_header_op call;
- ::encode(call, in);
+ encode(call, in);
ObjectReadOperation op;
op.exec("user", "get_header", in, new ClsUserGetHeaderCtx(NULL, ctx, NULL)); /* no need to pass pret, as we'll call ctx->handle_response() with correct error */
AioCompletion *c = librados::Rados::aio_create_completion(NULL, NULL, NULL);
-// -*- 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 <errno.h>
{
bufferlist bl;
- ::encode(*objv, bl);
+ encode(*objv, bl);
CLS_LOG(20, "cls_version: set_version %s:%d", objv->tag.c_str(), (int)objv->ver);
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;
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;
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;
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;
if (ret < 0)
return ret;
- ::encode(read_ret, *out);
+ encode(read_ret, *out);
return 0;
}
bufferlist in;
cls_version_set_op call;
call.objv = objv;
- ::encode(call, in);
+ encode(call, in);
op.exec("version", "set", in);
}
{
bufferlist in;
cls_version_inc_op call;
- ::encode(call, in);
+ encode(call, in);
op.exec("version", "inc", in);
}
call.conds.push_back(c);
- ::encode(call, in);
+ encode(call, in);
op.exec("version", "inc_conds", in);
}
call.conds.push_back(c);
- ::encode(call, in);
+ encode(call, in);
op.exec("version", "check_conds", in);
}
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
cls_version_read_ret ret;
try {
bufferlist::iterator iter = out.begin();
- ::decode(ret, iter);
+ decode(ret, iter);
} catch (buffer::error& err) {
return -EIO;
}
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);
}
};
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);
}
};
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);
}
};
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);
}
};
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);
}
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);
}
#endif
-
-
}
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;
}
}
}
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;
}
}
}
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;
}
}
}
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;
}
}
}
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;
}
}
} // 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 {
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);
}
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);
DencoderImplFeaturefulNoCopy(bool stray_ok, bool nondeterministic)
: DencoderBase<T>(stray_ok, nondeterministic) {}
void encode(bufferlist& out, uint64_t features) override {
+ using ceph::encode;
+ using ::encode;
out.clear();
using ::encode;
using ceph::encode;
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"),
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,
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"),
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"), _, _, _))
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"), _, _, _))