mgr: Use unqualified encode/decode

This is a portion of Part 1 of the namespace project: using ADL
properly in encode and decode so we can use namespaces easily in Ceph.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
Adam C. Emerson 2017-12-25 03:33:57 -05:00
parent f45e480e8e
commit 156c941ad0
5 changed files with 29 additions and 29 deletions

View File

@ -179,7 +179,7 @@ bool DaemonServer::ms_verify_authorizer(Connection *con,
bufferlist::iterator p = caps_info.caps.begin(); bufferlist::iterator p = caps_info.caps.begin();
string str; string str;
try { try {
::decode(str, p); decode(str, p);
} }
catch (buffer::error& e) { catch (buffer::error& e) {
is_valid = false; is_valid = false;
@ -1427,7 +1427,7 @@ void DaemonServer::send_report()
_prune_pending_service_map(); _prune_pending_service_map();
if (pending_service_map_dirty >= pending_service_map.epoch) { if (pending_service_map_dirty >= pending_service_map.epoch) {
pending_service_map.modified = ceph_clock_now(); pending_service_map.modified = ceph_clock_now();
::encode(pending_service_map, m->service_map_bl, CEPH_FEATURES_ALL); encode(pending_service_map, m->service_map_bl, CEPH_FEATURES_ALL);
dout(10) << "sending service_map e" << pending_service_map.epoch dout(10) << "sending service_map e" << pending_service_map.epoch
<< dendl; << dendl;
pending_service_map.epoch++; pending_service_map.epoch++;

View File

@ -150,10 +150,10 @@ void DaemonPerfCounters::update(MMgrReport *report)
uint64_t avgcount = 0; uint64_t avgcount = 0;
uint64_t avgcount2 = 0; uint64_t avgcount2 = 0;
::decode(val, p); decode(val, p);
if (t.type & PERFCOUNTER_LONGRUNAVG) { if (t.type & PERFCOUNTER_LONGRUNAVG) {
::decode(avgcount, p); decode(avgcount, p);
::decode(avgcount2, p); decode(avgcount2, p);
} }
// TODO: interface for insertion of avgs // TODO: interface for insertion of avgs
instances[t_path].push(now, val); instances[t_path].push(now, val);

View File

@ -297,10 +297,10 @@ void MgrClient::send_report()
session->declared.insert(path); session->declared.insert(path);
} }
::encode(static_cast<uint64_t>(data.u64), report->packed); encode(static_cast<uint64_t>(data.u64), report->packed);
if (data.type & PERFCOUNTER_LONGRUNAVG) { if (data.type & PERFCOUNTER_LONGRUNAVG) {
::encode(static_cast<uint64_t>(data.avgcount), report->packed); encode(static_cast<uint64_t>(data.avgcount), report->packed);
::encode(static_cast<uint64_t>(data.avgcount2), report->packed); encode(static_cast<uint64_t>(data.avgcount2), report->packed);
} }
} }
ENCODE_FINISH(report->packed); ENCODE_FINISH(report->packed);

View File

@ -359,7 +359,7 @@ static PyObject *osdmap_inc_set_compat_weight_set_weights(
CrushWrapper crush; CrushWrapper crush;
assert(self->inc->crush.length()); // see new_incremental assert(self->inc->crush.length()); // see new_incremental
auto p = self->inc->crush.begin(); auto p = self->inc->crush.begin();
::decode(crush, p); decode(crush, p);
crush.create_choose_args(CrushWrapper::DEFAULT_CHOOSE_ARGS, 1); crush.create_choose_args(CrushWrapper::DEFAULT_CHOOSE_ARGS, 1);
for (auto i : wm) { for (auto i : wm) {
crush.choose_args_adjust_item_weightf( crush.choose_args_adjust_item_weightf(

View File

@ -10,22 +10,22 @@
void ServiceMap::Daemon::encode(bufferlist& bl, uint64_t features) const void ServiceMap::Daemon::encode(bufferlist& bl, uint64_t features) const
{ {
ENCODE_START(1, 1, bl); ENCODE_START(1, 1, bl);
::encode(gid, bl); encode(gid, bl);
::encode(addr, bl, features); encode(addr, bl, features);
::encode(start_epoch, bl); encode(start_epoch, bl);
::encode(start_stamp, bl); encode(start_stamp, bl);
::encode(metadata, bl); encode(metadata, bl);
ENCODE_FINISH(bl); ENCODE_FINISH(bl);
} }
void ServiceMap::Daemon::decode(bufferlist::iterator& p) void ServiceMap::Daemon::decode(bufferlist::iterator& p)
{ {
DECODE_START(1, p); DECODE_START(1, p);
::decode(gid, p); decode(gid, p);
::decode(addr, p); decode(addr, p);
::decode(start_epoch, p); decode(start_epoch, p);
::decode(start_stamp, p); decode(start_stamp, p);
::decode(metadata, p); decode(metadata, p);
DECODE_FINISH(p); DECODE_FINISH(p);
} }
@ -55,16 +55,16 @@ void ServiceMap::Daemon::generate_test_instances(std::list<Daemon*>& ls)
void ServiceMap::Service::encode(bufferlist& bl, uint64_t features) const void ServiceMap::Service::encode(bufferlist& bl, uint64_t features) const
{ {
ENCODE_START(1, 1, bl); ENCODE_START(1, 1, bl);
::encode(daemons, bl, features); encode(daemons, bl, features);
::encode(summary, bl); encode(summary, bl);
ENCODE_FINISH(bl); ENCODE_FINISH(bl);
} }
void ServiceMap::Service::decode(bufferlist::iterator& p) void ServiceMap::Service::decode(bufferlist::iterator& p)
{ {
DECODE_START(1, p); DECODE_START(1, p);
::decode(daemons, p); decode(daemons, p);
::decode(summary, p); decode(summary, p);
DECODE_FINISH(p); DECODE_FINISH(p);
} }
@ -91,18 +91,18 @@ void ServiceMap::Service::generate_test_instances(std::list<Service*>& ls)
void ServiceMap::encode(bufferlist& bl, uint64_t features) const void ServiceMap::encode(bufferlist& bl, uint64_t features) const
{ {
ENCODE_START(1, 1, bl); ENCODE_START(1, 1, bl);
::encode(epoch, bl); encode(epoch, bl);
::encode(modified, bl); encode(modified, bl);
::encode(services, bl, features); encode(services, bl, features);
ENCODE_FINISH(bl); ENCODE_FINISH(bl);
} }
void ServiceMap::decode(bufferlist::iterator& p) void ServiceMap::decode(bufferlist::iterator& p)
{ {
DECODE_START(1, p); DECODE_START(1, p);
::decode(epoch, p); decode(epoch, p);
::decode(modified, p); decode(modified, p);
::decode(services, p); decode(services, p);
DECODE_FINISH(p); DECODE_FINISH(p);
} }