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

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
24 files changed:
src/ceph_mon.cc
src/mon/AuthMonitor.cc
src/mon/AuthMonitor.h
src/mon/CreatingPGs.h
src/mon/HealthMonitor.cc
src/mon/LogMonitor.cc
src/mon/MDSMonitor.cc
src/mon/MgrMap.h
src/mon/MgrMonitor.cc
src/mon/MgrStatMonitor.cc
src/mon/MonCap.cc
src/mon/MonClient.cc
src/mon/MonClient.h
src/mon/MonCommand.h
src/mon/MonMap.cc
src/mon/Monitor.cc
src/mon/MonitorDBStore.h
src/mon/OSDMonitor.cc
src/mon/PGMap.cc
src/mon/PGMap.h
src/mon/Paxos.cc
src/mon/PaxosService.cc
src/mon/PaxosService.h
src/mon/mon_types.h

index 9139e8b83ef1004b0a4261fb9bdf6f94cb3d70dc..ea022d0c42feecdc900ce554b26e77c4bb59ded2 100644 (file)
@@ -571,8 +571,8 @@ int main(int argc, const char **argv)
     bufferlist mapbl;
     tmp.encode(mapbl, CEPH_FEATURES_ALL);
     bufferlist final;
-    ::encode(v, final);
-    ::encode(mapbl, final);
+    encode(v, final);
+    encode(mapbl, final);
 
     auto t(std::make_shared<MonitorDBStore::Transaction>());
     // save it
index c5e3786eea7b9b5d005efa32e9e6280783cc9fd1..e2d303a0ae16e047a09128d08d065f94baf50ac0 100644 (file)
@@ -103,7 +103,7 @@ void AuthMonitor::create_initial()
       KeyRing keyring;
       bufferlist::iterator p = bl.begin();
 
-      ::decode(keyring, p);
+      decode(keyring, p);
       import_keyring(keyring);
     }
   }
@@ -141,9 +141,9 @@ void AuthMonitor::update_from_paxos(bool *need_bootstrap)
     dout(7) << __func__ << " latest length " << latest_bl.length() << dendl;
     bufferlist::iterator p = latest_bl.begin();
     __u8 struct_v;
-    ::decode(struct_v, p);
-    ::decode(max_global_id, p);
-    ::decode(mon->key_server, p);
+    decode(struct_v, p);
+    decode(max_global_id, p);
+    decode(mon->key_server, p);
     mon->key_server.set_ver(latest_full);
     keys_ver = latest_full;
   }
@@ -168,10 +168,10 @@ void AuthMonitor::update_from_paxos(bool *need_bootstrap)
 
     bufferlist::iterator p = bl.begin();
     __u8 v;
-    ::decode(v, p);
+    decode(v, p);
     while (!p.end()) {
       Incremental inc;
-      ::decode(inc, p);
+      decode(inc, p);
       switch (inc.inc_type) {
       case GLOBAL_ID:
        max_global_id = inc.max_global_id;
@@ -181,7 +181,7 @@ void AuthMonitor::update_from_paxos(bool *need_bootstrap)
         {
           KeyServerData::Incremental auth_inc;
           bufferlist::iterator iter = inc.auth_data.begin();
-          ::decode(auth_inc, iter);
+          decode(auth_inc, iter);
           mon->key_server.apply_data_incremental(auth_inc);
           break;
         }
@@ -237,7 +237,7 @@ void AuthMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   bufferlist bl;
 
   __u8 v = 1;
-  ::encode(v, bl);
+  encode(v, bl);
   vector<Incremental>::iterator p;
   for (p = pending_auth.begin(); p != pending_auth.end(); ++p)
     p->encode(bl, mon->get_quorum_con_features());
@@ -263,9 +263,9 @@ void AuthMonitor::encode_full(MonitorDBStore::TransactionRef t)
            << (mon->key_server.has_secrets() ? "" : "no ")
            << "secrets!" << dendl;
   __u8 v = 1;
-  ::encode(v, full_bl);
-  ::encode(max_global_id, full_bl);
-  ::encode(mon->key_server, full_bl);
+  encode(v, full_bl);
+  encode(max_global_id, full_bl);
+  encode(mon->key_server, full_bl);
 
   put_version_full(t, version, full_bl);
   put_version_latest_full(t, version);
@@ -382,10 +382,10 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable)
 
     try {
       __u8 struct_v = 1;
-      ::decode(struct_v, indata);
-      ::decode(supported, indata);
-      ::decode(entity_name, indata);
-      ::decode(s->global_id, indata);
+      decode(struct_v, indata);
+      decode(supported, indata);
+      decode(entity_name, indata);
+      decode(s->global_id, indata);
     } catch (const buffer::error &e) {
       dout(10) << "failed to decode initial auth message" << dendl;
       ret = -EINVAL;
@@ -497,7 +497,7 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable)
       bufferlist::iterator p = caps_info.caps.begin();
       string str;
       try {
-       ::decode(str, p);
+       decode(str, p);
       } catch (const buffer::error &err) {
        derr << "corrupt cap data for " << entity_name << " in auth db" << dendl;
        str.clear();
@@ -689,7 +689,7 @@ bool AuthMonitor::entity_is_pending(EntityName& entity)
     if (p.inc_type == AUTH_DATA) {
       KeyServerData::Incremental inc;
       bufferlist::iterator q = p.auth_data.begin();
-      ::decode(inc, q);
+      decode(inc, q);
       if (inc.op == KeyServerData::AUTH_INC_ADD &&
           inc.name == entity) {
         return true;
@@ -843,7 +843,7 @@ int AuthMonitor::do_osd_destroy(
 bufferlist _encode_cap(const string& cap)
 {
   bufferlist bl;
-  ::encode(cap, bl);
+  encode(cap, bl);
   return bl;
 }
 
@@ -1061,7 +1061,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
     bufferlist::iterator iter = bl.begin();
     KeyRing keyring;
     try {
-      ::decode(keyring, iter);
+      decode(keyring, iter);
     } catch (const buffer::error &ex) {
       ss << "error decoding keyring" << " " << ex.what();
       err = -EINVAL;
@@ -1096,7 +1096,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
     if (has_keyring) {
       bufferlist::iterator iter = bl.begin();
       try {
-        ::decode(new_keyring, iter);
+        decode(new_keyring, iter);
       } catch (const buffer::error &ex) {
         ss << "error decoding keyring";
         err = -EINVAL;
@@ -1117,7 +1117,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
         it += 2) {
       string sys = *it;
       bufferlist cap;
-      ::encode(*(it+1), cap);
+      encode(*(it+1), cap);
       new_caps[sys] = cap;
     }
 
@@ -1188,7 +1188,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
         it += 2) {
       const std::string &sys = *it;
       bufferlist cap;
-      ::encode(*(it+1), cap);
+      encode(*(it+1), cap);
       wanted_caps[sys] = cap;
     }
 
@@ -1232,7 +1232,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
       if (p->inc_type == AUTH_DATA) {
        KeyServerData::Incremental auth_inc;
        bufferlist::iterator q = p->auth_data.begin();
-       ::decode(auth_inc, q);
+       decode(auth_inc, q);
        if (auth_inc.op == KeyServerData::AUTH_INC_ADD &&
            auth_inc.name == entity) {
          wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
@@ -1382,7 +1382,7 @@ bool AuthMonitor::prepare_command(MonOpRequestRef op)
     map<string,bufferlist> newcaps;
     for (vector<string>::iterator it = caps_vec.begin();
         it != caps_vec.end(); it += 2)
-      ::encode(*(it+1), newcaps[*it]);
+      encode(*(it+1), newcaps[*it]);
 
     auth_inc.op = KeyServerData::AUTH_INC_ADD;
     auth_inc.auth.caps = newcaps;
@@ -1451,7 +1451,7 @@ void AuthMonitor::upgrade_format()
        continue;
       try {
        bufferlist::iterator it = p->second.caps["mon"].begin();
-       ::decode(mon_caps, it);
+       decode(mon_caps, it);
       }
       catch (buffer::error) {
        dout(10) << __func__ << " unable to parse mon cap for "
@@ -1481,7 +1481,7 @@ void AuthMonitor::upgrade_format()
                << mon_caps << " to " << new_caps << dendl;
 
        bufferlist bl;
-       ::encode(new_caps, bl);
+       encode(new_caps, bl);
 
        KeyServerData::Incremental auth_inc;
        auth_inc.name = p->first;
@@ -1520,7 +1520,7 @@ void AuthMonitor::upgrade_format()
       if (newcap.length() > 0) {
        dout(5) << " giving " << n << " mgr '" << newcap << "'" << dendl;
        bufferlist bl;
-       ::encode(newcap, bl);
+       encode(newcap, bl);
 
        KeyServerData::Incremental auth_inc;
        auth_inc.name = p->first;
@@ -1535,12 +1535,12 @@ void AuthMonitor::upgrade_format()
        // the kraken ceph-mgr@.service set the mon cap to 'allow *'.
        auto blp = p->second.caps["mon"].begin();
        string oldcaps;
-       ::decode(oldcaps, blp);
+       decode(oldcaps, blp);
        if (oldcaps == "allow *") {
          dout(5) << " fixing " << n << " mon cap to 'allow profile mgr'"
                  << dendl;
          bufferlist bl;
-         ::encode("allow profile mgr", bl);
+         encode("allow profile mgr", bl);
          KeyServerData::Incremental auth_inc;
          auth_inc.name = p->first;
          auth_inc.auth = p->second;
@@ -1560,7 +1560,7 @@ void AuthMonitor::upgrade_format()
     if (!mon->key_server.contains(bootstrap_mgr_name)) {
       KeyServerData::Incremental auth_inc;
       auth_inc.name = bootstrap_mgr_name;
-      ::encode("allow profile bootstrap-mgr", auth_inc.auth.caps["mon"]);
+      encode("allow profile bootstrap-mgr", auth_inc.auth.caps["mon"]);
       auth_inc.op = KeyServerData::AUTH_INC_ADD;
       // generate key
       auth_inc.auth.key.create(g_ceph_context, CEPH_CRYPTO_AES);
index 777f2e80361d3b2519f14580fe69385c6430bcbc..1304c80d2f45f0fa1c66720e206d2c4acd67e0a0 100644 (file)
@@ -46,41 +46,42 @@ public:
     Incremental() : inc_type(GLOBAL_ID), max_global_id(0), auth_type(0) {}
 
     void encode(bufferlist& bl, uint64_t features=-1) const {
+      using ceph::encode;
       if ((features & CEPH_FEATURE_MONENC) == 0) {
        __u8 v = 1;
-       ::encode(v, bl);
+       encode(v, bl);
        __u32 _type = (__u32)inc_type;
-       ::encode(_type, bl);
+       encode(_type, bl);
        if (_type == GLOBAL_ID) {
-         ::encode(max_global_id, bl);
+         encode(max_global_id, bl);
        } else {
-         ::encode(auth_type, bl);
-         ::encode(auth_data, bl);
+         encode(auth_type, bl);
+         encode(auth_data, bl);
        }
        return;
       } 
       ENCODE_START(2, 2, bl);
       __u32 _type = (__u32)inc_type;
-      ::encode(_type, bl);
+      encode(_type, bl);
       if (_type == GLOBAL_ID) {
-       ::encode(max_global_id, bl);
+       encode(max_global_id, bl);
       } else {
-       ::encode(auth_type, bl);
-       ::encode(auth_data, bl);
+       encode(auth_type, bl);
+       encode(auth_data, bl);
       }
       ENCODE_FINISH(bl);
     }
     void decode(bufferlist::iterator& bl) {
       DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
       __u32 _type;
-      ::decode(_type, bl);
+      decode(_type, bl);
       inc_type = (IncType)_type;
       assert(inc_type >= GLOBAL_ID && inc_type <= AUTH_DATA);
       if (_type == GLOBAL_ID) {
-       ::decode(max_global_id, bl);
+       decode(max_global_id, bl);
       } else {
-       ::decode(auth_type, bl);
-       ::decode(auth_data, bl);
+       decode(auth_type, bl);
+       decode(auth_data, bl);
       }
       DECODE_FINISH(bl);
     }
@@ -122,7 +123,7 @@ private:
   void push_cephx_inc(KeyServerData::Incremental& auth_inc) {
     Incremental inc;
     inc.inc_type = AUTH_DATA;
-    ::encode(auth_inc, inc.auth_data);
+    encode(auth_inc, inc.auth_data);
     inc.auth_type = CEPH_AUTH_CEPHX;
     pending_auth.push_back(inc);
   }
index 49935108c442fdd02b4a805c28e494b2a07cdd78..fae7e6f2ce5ab5f3addea85059d4eb64f4986be1 100644 (file)
@@ -5,7 +5,11 @@
 
 #include <map>
 #include <set>
+
 #include "include/encoding.h"
+#include "include/utime.h"
+
+#include "osd/osd_types.h"
 
 struct creating_pgs_t {
   epoch_t last_scan_epoch = 0;
@@ -22,16 +26,18 @@ struct creating_pgs_t {
       return start >= end;
     }
     void encode(bufferlist& bl) const {
-      ::encode(created, bl);
-      ::encode(modified, bl);
-      ::encode(start, bl);
-      ::encode(end, bl);
+      using ceph::encode;
+      encode(created, bl);
+      encode(modified, bl);
+      encode(start, bl);
+      encode(end, bl);
     }
     void decode(bufferlist::iterator& p) {
-      ::decode(created, p);
-      ::decode(modified, p);
-      ::decode(start, p);
-      ::decode(end, p);
+      using ceph::decode;
+      decode(created, p);
+      decode(modified, p);
+      decode(start, p);
+      decode(end, p);
     }
   };
 
@@ -65,19 +71,19 @@ struct creating_pgs_t {
   }
   void encode(bufferlist& bl) const {
     ENCODE_START(2, 1, bl);
-    ::encode(last_scan_epoch, bl);
-    ::encode(pgs, bl);
-    ::encode(created_pools, bl);
-    ::encode(queue, bl);
+    encode(last_scan_epoch, bl);
+    encode(pgs, bl);
+    encode(created_pools, bl);
+    encode(queue, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& bl) {
     DECODE_START(2, bl);
-    ::decode(last_scan_epoch, bl);
-    ::decode(pgs, bl);
-    ::decode(created_pools, bl);
+    decode(last_scan_epoch, bl);
+    decode(pgs, bl);
+    decode(created_pools, bl);
     if (struct_v >= 2)
-      ::decode(queue, bl);
+      decode(queue, bl);
     DECODE_FINISH(bl);
   }
   void dump(ceph::Formatter *f) const {
index 16e3a069043bde078cf15a22416b9d663353de37..4c406732aacc457ca6df48d2699fa3269d4a2148 100644 (file)
@@ -61,7 +61,7 @@ void HealthMonitor::update_from_paxos(bool *need_bootstrap)
   mon->store->get(service_name, "quorum", qbl);
   if (qbl.length()) {
     auto p = qbl.begin();
-    ::decode(quorum_checks, p);
+    decode(quorum_checks, p);
   } else {
     quorum_checks.clear();
   }
@@ -70,7 +70,7 @@ void HealthMonitor::update_from_paxos(bool *need_bootstrap)
   mon->store->get(service_name, "leader", lbl);
   if (lbl.length()) {
     auto p = lbl.begin();
-    ::decode(leader_checks, p);
+    decode(leader_checks, p);
   } else {
     leader_checks.clear();
   }
@@ -102,10 +102,10 @@ void HealthMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   put_last_committed(t, version);
 
   bufferlist qbl;
-  ::encode(quorum_checks, qbl);
+  encode(quorum_checks, qbl);
   t->put(service_name, "quorum", qbl);
   bufferlist lbl;
-  ::encode(leader_checks, lbl);
+  encode(leader_checks, lbl);
   t->put(service_name, "leader", lbl);
 
   health_check_map_t pending_health;
index ffd50ba5050d6f7cfd54d3efbf73c231c443ce8d..0c1065d45ab09cdba1deb214628f4f47c7db0e15 100644 (file)
@@ -93,7 +93,7 @@ void LogMonitor::update_from_paxos(bool *need_bootstrap)
     assert(latest_bl.length() != 0);
     dout(7) << __func__ << " loading summary e" << latest_full << dendl;
     bufferlist::iterator p = latest_bl.begin();
-    ::decode(summary, p);
+    decode(summary, p);
     dout(7) << __func__ << " loaded summary e" << summary.version << dendl;
   }
 
@@ -106,7 +106,7 @@ void LogMonitor::update_from_paxos(bool *need_bootstrap)
 
     bufferlist::iterator p = bl.begin();
     __u8 v;
-    ::decode(v, p);
+    decode(v, p);
     while (!p.end()) {
       LogEntry le;
       le.decode(p);
@@ -217,7 +217,7 @@ void LogMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   bufferlist bl;
   dout(10) << __func__ << " v" << version << dendl;
   __u8 v = 1;
-  ::encode(v, bl);
+  encode(v, bl);
   multimap<utime_t,LogEntry>::iterator p;
   for (p = pending_log.begin(); p != pending_log.end(); ++p)
     p->second.encode(bl, mon->get_quorum_con_features());
@@ -232,7 +232,7 @@ void LogMonitor::encode_full(MonitorDBStore::TransactionRef t)
   assert(get_last_committed() == summary.version);
 
   bufferlist summary_bl;
-  ::encode(summary, summary_bl, mon->get_quorum_con_features());
+  encode(summary, summary_bl, mon->get_quorum_con_features());
 
   put_version_full(t, summary.version, summary_bl);
   put_version_latest_full(t, summary.version);
@@ -654,7 +654,7 @@ void LogMonitor::_create_sub_incremental(MLog *mlog, int level, version_t sv)
     assert(bl.length());
     bufferlist::iterator p = bl.begin();
     __u8 v;
-    ::decode(v,p);
+    decode(v,p);
     while (!p.end()) {
       LogEntry le;
       le.decode(p);
index 53bac5d8ce87b07ce5e9a8905df62d1b1cf0220c..a59a72a920f1863dd0c43317d110792e60510b1b 100644 (file)
@@ -1637,7 +1637,7 @@ void MDSMonitor::update_metadata(mds_gid_t gid,
 
   MonitorDBStore::TransactionRef t = paxos->get_pending_transaction();
   bufferlist bl;
-  ::encode(pending_metadata, bl);
+  encode(pending_metadata, bl);
   t->put(MDS_METADATA_PREFIX, "last_metadata", bl);
   paxos->trigger_propose();
 }
@@ -1657,7 +1657,7 @@ void MDSMonitor::remove_from_metadata(MonitorDBStore::TransactionRef t)
   if (!update)
     return;
   bufferlist bl;
-  ::encode(pending_metadata, bl);
+  encode(pending_metadata, bl);
   t->put(MDS_METADATA_PREFIX, "last_metadata", bl);
 }
 
@@ -1671,7 +1671,7 @@ int MDSMonitor::load_metadata(map<mds_gid_t, Metadata>& m)
   }
 
   bufferlist::iterator it = bl.begin();
-  ::decode(m, it);
+  decode(m, it);
   return 0;
 }
 
index 1af3a0ee7667e7050cffdb5582fcbf93fdfb13bc..79d5b3b0c22147cb8966ebcdf5134561ffa52fd4 100644 (file)
@@ -39,19 +39,19 @@ public:
   void encode(bufferlist& bl) const
   {
     ENCODE_START(2, 1, bl);
-    ::encode(gid, bl);
-    ::encode(name, bl);
-    ::encode(available_modules, bl);
+    encode(gid, bl);
+    encode(name, bl);
+    encode(available_modules, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& p)
   {
     DECODE_START(2, p);
-    ::decode(gid, p);
-    ::decode(name, p);
+    decode(gid, p);
+    decode(name, p);
     if (struct_v >= 2) {
-      ::decode(available_modules, p);
+      decode(available_modules, p);
     }
     DECODE_FINISH(p);
   }
@@ -125,33 +125,33 @@ public:
   void encode(bufferlist& bl, uint64_t features) const
   {
     ENCODE_START(3, 1, bl);
-    ::encode(epoch, bl);
-    ::encode(active_addr, bl, features);
-    ::encode(active_gid, bl);
-    ::encode(available, bl);
-    ::encode(active_name, bl);
-    ::encode(standbys, bl);
-    ::encode(modules, bl);
-    ::encode(available_modules, bl);
-    ::encode(services, bl);
+    encode(epoch, bl);
+    encode(active_addr, bl, features);
+    encode(active_gid, bl);
+    encode(available, bl);
+    encode(active_name, bl);
+    encode(standbys, bl);
+    encode(modules, bl);
+    encode(available_modules, bl);
+    encode(services, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& p)
   {
     DECODE_START(2, p);
-    ::decode(epoch, p);
-    ::decode(active_addr, p);
-    ::decode(active_gid, p);
-    ::decode(available, p);
-    ::decode(active_name, p);
-    ::decode(standbys, p);
+    decode(epoch, p);
+    decode(active_addr, p);
+    decode(active_gid, p);
+    decode(available, p);
+    decode(active_name, p);
+    decode(standbys, p);
     if (struct_v >= 2) {
-      ::decode(modules, p);
-      ::decode(available_modules, p);
+      decode(modules, p);
+      decode(available_modules, p);
     }
     if (struct_v >= 3) {
-      ::decode(services, p);
+      decode(services, p);
     }
     DECODE_FINISH(p);
   }
index f47dbfb3f62acc8ce3711eec4716dd969f900c99..302221ca968efb8bfa2fe09a7533f4ffeb8654b9 100644 (file)
@@ -113,7 +113,7 @@ void MgrMonitor::update_from_paxos(bool *need_bootstrap)
         derr << "Failed to load mgr commands: " << cpp_strerror(r) << dendl;
       } else {
         auto p = loaded_commands.begin();
-        ::decode(command_descs, p);
+        decode(command_descs, p);
       }
     }
   }
@@ -189,7 +189,7 @@ void MgrMonitor::encode_pending(MonitorDBStore::TransactionRef t)
       p.set_flag(MonCommand::FLAG_MGR);
     }
     bufferlist bl;
-    ::encode(pending_command_descs, bl);
+    encode(pending_command_descs, bl);
     t->put(command_descs_prefix, "", bl);
     pending_command_descs.clear();
   }
@@ -366,7 +366,7 @@ bool MgrMonitor::prepare_beacon(MonOpRequestRef op)
     pending_map.active_gid = m->get_gid();
     pending_map.active_name = m->get_name();
     pending_map.available_modules = m->get_available_modules();
-    ::encode(m->get_metadata(), pending_metadata[m->get_name()]);
+    encode(m->get_metadata(), pending_metadata[m->get_name()]);
     pending_metadata_rm.erase(m->get_name());
 
     mon->clog->info() << "Activating manager daemon "
@@ -392,7 +392,7 @@ bool MgrMonitor::prepare_beacon(MonOpRequestRef op)
                          << " started";
       pending_map.standbys[m->get_gid()] = {m->get_gid(), m->get_name(),
                                            m->get_available_modules()};
-      ::encode(m->get_metadata(), pending_metadata[m->get_name()]);
+      encode(m->get_metadata(), pending_metadata[m->get_name()]);
       pending_metadata_rm.erase(m->get_name());
       updated = true;
     }
@@ -935,7 +935,7 @@ int MgrMonitor::load_metadata(const string& name, std::map<string, string>& m,
     return r;
   try {
     bufferlist::iterator p = bl.begin();
-    ::decode(m, p);
+    decode(m, p);
   }
   catch (buffer::error& e) {
     if (err)
index 471f9748cd7db314723da8de297b3f355e09e8aa..8df859c899824880b1b81d4a9b5049b259116628 100644 (file)
@@ -32,7 +32,7 @@ void MgrStatMonitor::create_initial()
   dout(10) << __func__ << dendl;
   version = 0;
   service_map.epoch = 1;
-  ::encode(service_map, pending_service_map_bl, CEPH_FEATURES_ALL);
+  encode(service_map, pending_service_map_bl, CEPH_FEATURES_ALL);
 }
 
 void MgrStatMonitor::update_from_paxos(bool *need_bootstrap)
@@ -46,8 +46,8 @@ void MgrStatMonitor::update_from_paxos(bool *need_bootstrap)
     assert(bl.length());
     try {
       auto p = bl.begin();
-      ::decode(digest, p);
-      ::decode(service_map, p);
+      decode(digest, p);
+      decode(service_map, p);
       dout(10) << __func__ << " v" << version
               << " service_map e" << service_map.epoch << dendl;
     }
@@ -106,7 +106,7 @@ void MgrStatMonitor::create_pending()
   pending_digest = digest;
   pending_health_checks = get_health_checks();
   pending_service_map_bl.clear();
-  ::encode(service_map, pending_service_map_bl, mon->get_quorum_con_features());
+  encode(service_map, pending_service_map_bl, mon->get_quorum_con_features());
 }
 
 void MgrStatMonitor::encode_pending(MonitorDBStore::TransactionRef t)
@@ -114,7 +114,7 @@ void MgrStatMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   ++version;
   dout(10) << " " << version << dendl;
   bufferlist bl;
-  ::encode(pending_digest, bl, mon->get_quorum_con_features());
+  encode(pending_digest, bl, mon->get_quorum_con_features());
   assert(pending_service_map_bl.length());
   bl.append(pending_service_map_bl);
   put_version(t, version, bl);
@@ -181,7 +181,7 @@ bool MgrStatMonitor::prepare_report(MonOpRequestRef op)
   auto m = static_cast<MMonMgrReport*>(op->get_req());
   bufferlist bl = m->get_data();
   auto p = bl.begin();
-  ::decode(pending_digest, p);
+  decode(pending_digest, p);
   pending_health_checks.swap(m->health_checks);
   if (m->service_map_bl.length()) {
     pending_service_map_bl.swap(m->service_map_bl);
index f40b9d6669197b42d786bd2a016474ceaf65fda3..ef2872aea1d49b8efb70ee65793b98892cd4acdd 100644 (file)
@@ -426,7 +426,7 @@ bool MonCap::is_capable(CephContext *cct,
 void MonCap::encode(bufferlist& bl) const
 {
   ENCODE_START(4, 4, bl);   // legacy MonCaps was 3, 3
-  ::encode(text, bl);
+  encode(text, bl);
   ENCODE_FINISH(bl);
 }
 
@@ -434,7 +434,7 @@ void MonCap::decode(bufferlist::iterator& bl)
 {
   string s;
   DECODE_START(4, bl);
-  ::decode(s, bl);
+  decode(s, bl);
   DECODE_FINISH(bl);
   parse(s, NULL);
 }
index 35323e9c4de18eb3bd1cc92ff9cc9669ce1a94d8..fd48ee6e125d9e4759ce381b3a05f11ede21bdab 100644 (file)
@@ -328,7 +328,7 @@ void MonClient::handle_monmap(MMonMap *m)
   string cur_mon = monmap.get_name(peer);
 
   bufferlist::iterator p = m->monmapbl.begin();
-  ::decode(monmap, p);
+  decode(monmap, p);
 
   ldout(cct, 10) << " got monmap " << monmap.epoch
                 << ", mon." << cur_mon << " is now rank " << monmap.get_rank(cur_mon)
@@ -1205,10 +1205,10 @@ void MonConnection::start(epoch_t epoch,
   m->protocol = 0;
   m->monmap_epoch = epoch;
   __u8 struct_v = 1;
-  ::encode(struct_v, m->auth_payload);
-  ::encode(auth_supported.get_supported_set(), m->auth_payload);
-  ::encode(entity_name, m->auth_payload);
-  ::encode(global_id, m->auth_payload);
+  encode(struct_v, m->auth_payload);
+  encode(auth_supported.get_supported_set(), m->auth_payload);
+  encode(entity_name, m->auth_payload);
+  encode(global_id, m->auth_payload);
   con->send_message(m);
 }
 
index 703da88fa2bbbf7633f3146c599db1005c1e4f86..3dc95f71c7d497c80fa7c2c640edef7e2a9531f8 100644 (file)
@@ -33,7 +33,7 @@ class MMonCommandAck;
 struct MAuthReply;
 class MAuthRotating;
 class LogClient;
-struct AuthAuthorizer;
+class AuthAuthorizer;
 class AuthMethodList;
 class AuthClientHandler;
 class KeyRing;
@@ -75,7 +75,7 @@ struct MonClientPinger : public Dispatcher {
     bufferlist &payload = m->get_payload();
     if (result && payload.length() > 0) {
       bufferlist::iterator p = payload.begin();
-      ::decode(*result, p);
+      decode(*result, p);
     }
     done = true;
     ping_recvd_cond.SignalAll();
index ce2429fbc949cde15ca32f2c76b5cfdea993321c..b15b0915374e6e7320ef30702b60d1b44729606d 100644 (file)
@@ -38,14 +38,14 @@ struct MonCommand {
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
     encode_bare(bl);
-    ::encode(flags, bl);
+    encode(flags, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator &bl) {
     DECODE_START(1, bl);
     decode_bare(bl);
-    ::decode(flags, bl);
+    decode(flags, bl);
     DECODE_FINISH(bl);
   }
 
@@ -53,18 +53,20 @@ struct MonCommand {
    * Unversioned encoding for use within encode_array.
    */
   void encode_bare(bufferlist &bl) const {
-    ::encode(cmdstring, bl);
-    ::encode(helpstring, bl);
-    ::encode(module, bl);
-    ::encode(req_perms, bl);
-    ::encode(availability, bl);
+    using ceph::encode;
+    encode(cmdstring, bl);
+    encode(helpstring, bl);
+    encode(module, bl);
+    encode(req_perms, bl);
+    encode(availability, bl);
   }
   void decode_bare(bufferlist::iterator &bl) {
-    ::decode(cmdstring, bl);
-    ::decode(helpstring, bl);
-    ::decode(module, bl);
-    ::decode(req_perms, bl);
-    ::decode(availability, bl);
+    using ceph::decode;
+    decode(cmdstring, bl);
+    decode(helpstring, bl);
+    decode(module, bl);
+    decode(req_perms, bl);
+    decode(availability, bl);
   }
   bool is_compat(const MonCommand* o) const {
     return cmdstring == o->cmdstring &&
@@ -91,12 +93,12 @@ struct MonCommand {
   static void encode_array(const MonCommand *cmds, int size, bufferlist &bl) {
     ENCODE_START(2, 1, bl);
     uint16_t s = size;
-    ::encode(s, bl);
+    encode(s, bl);
     for (int i = 0; i < size; ++i) {
       cmds[i].encode_bare(bl);
     }
     for (int i = 0; i < size; i++) {
-      ::encode(cmds[i].flags, bl);
+      encode(cmds[i].flags, bl);
     }
     ENCODE_FINISH(bl);
   }
@@ -104,7 +106,7 @@ struct MonCommand {
                            bufferlist::iterator &bl) {
     DECODE_START(2, bl);
     uint16_t s = 0;
-    ::decode(s, bl);
+    decode(s, bl);
     *size = s;
     *cmds = new MonCommand[*size];
     for (int i = 0; i < *size; ++i) {
@@ -112,7 +114,7 @@ struct MonCommand {
     }
     if (struct_v >= 2) {
       for (int i = 0; i < *size; i++)
-        ::decode((*cmds)[i].flags, bl);
+        decode((*cmds)[i].flags, bl);
     } else {
       for (int i = 0; i < *size; i++)
         (*cmds)[i].flags = 0;
@@ -125,12 +127,12 @@ struct MonCommand {
                            bufferlist &bl) {
     ENCODE_START(2, 1, bl);
     uint16_t s = cmds.size();
-    ::encode(s, bl);
+    encode(s, bl);
     for (unsigned i = 0; i < s; ++i) {
       cmds[i].encode_bare(bl);
     }
     for (unsigned i = 0; i < s; i++) {
-      ::encode(cmds[i].flags, bl);
+      encode(cmds[i].flags, bl);
     }
     ENCODE_FINISH(bl);
   }
@@ -138,14 +140,14 @@ struct MonCommand {
                            bufferlist::iterator &bl) {
     DECODE_START(2, bl);
     uint16_t s = 0;
-    ::decode(s, bl);
+    decode(s, bl);
     cmds.resize(s);
     for (unsigned i = 0; i < s; ++i) {
       cmds[i].decode_bare(bl);
     }
     if (struct_v >= 2) {
       for (unsigned i = 0; i < s; i++)
-        ::decode(cmds[i].flags, bl);
+        decode(cmds[i].flags, bl);
     } else {
       for (unsigned i = 0; i < s; i++)
         cmds[i].flags = 0;
index 7a1b9420e77fdcdb8a2397f1d851cf20ce0145fd..74b39e927f6912296724215be7b818ba6f8dfbca 100644 (file)
@@ -21,19 +21,19 @@ using ceph::Formatter;
 void mon_info_t::encode(bufferlist& bl, uint64_t features) const
 {
   ENCODE_START(2, 1, bl);
-  ::encode(name, bl);
-  ::encode(public_addr, bl, features);
-  ::encode(priority, bl);
+  encode(name, bl);
+  encode(public_addr, bl, features);
+  encode(priority, bl);
   ENCODE_FINISH(bl);
 }
 
 void mon_info_t::decode(bufferlist::iterator& p)
 {
   DECODE_START(1, p);
-  ::decode(name, p);
-  ::decode(public_addr, p);
+  decode(name, p);
+  decode(public_addr, p);
   if (struct_v >= 2) {
-    ::decode(priority, p);
+    decode(priority, p);
   }
   DECODE_FINISH(p);
 }
@@ -151,39 +151,41 @@ void MonMap::encode(bufferlist& blist, uint64_t con_features) const
   }
 
   if ((con_features & CEPH_FEATURE_MONNAMES) == 0) {
+    using ceph::encode;
     __u16 v = 1;
-    ::encode(v, blist);
-    ::encode_raw(fsid, blist);
-    ::encode(epoch, blist);
+    encode(v, blist);
+    encode_raw(fsid, blist);
+    encode(epoch, blist);
     vector<entity_inst_t> mon_inst(mon_addr.size());
     for (unsigned n = 0; n < mon_addr.size(); n++)
       mon_inst[n] = get_inst(n);
-    ::encode(mon_inst, blist, con_features);
-    ::encode(last_changed, blist);
-    ::encode(created, blist);
+    encode(mon_inst, blist, con_features);
+    encode(last_changed, blist);
+    encode(created, blist);
     return;
   }
 
   if ((con_features & CEPH_FEATURE_MONENC) == 0) {
+    using ceph::encode;
     __u16 v = 2;
-    ::encode(v, blist);
-    ::encode_raw(fsid, blist);
-    ::encode(epoch, blist);
-    ::encode(mon_addr, blist, con_features);
-    ::encode(last_changed, blist);
-    ::encode(created, blist);
+    encode(v, blist);
+    encode_raw(fsid, blist);
+    encode(epoch, blist);
+    encode(mon_addr, blist, con_features);
+    encode(last_changed, blist);
+    encode(created, blist);
   }
 
   ENCODE_START(5, 3, blist);
-  ::encode_raw(fsid, blist);
-  ::encode(epoch, blist);
-  ::encode(mon_addr, blist, con_features);
-  ::encode(last_changed, blist);
-  ::encode(created, blist);
-  ::encode(persistent_features, blist);
-  ::encode(optional_features, blist);
+  encode_raw(fsid, blist);
+  encode(epoch, blist);
+  encode(mon_addr, blist, con_features);
+  encode(last_changed, blist);
+  encode(created, blist);
+  encode(persistent_features, blist);
+  encode(optional_features, blist);
   // this superseeds 'mon_addr'
-  ::encode(mon_info, blist, con_features);
+  encode(mon_info, blist, con_features);
   ENCODE_FINISH(blist);
 }
 
@@ -191,11 +193,11 @@ void MonMap::decode(bufferlist::iterator &p)
 {
   map<string,entity_addr_t> mon_addr;
   DECODE_START_LEGACY_COMPAT_LEN_16(5, 3, 3, p);
-  ::decode_raw(fsid, p);
-  ::decode(epoch, p);
+  decode_raw(fsid, p);
+  decode(epoch, p);
   if (struct_v == 1) {
     vector<entity_inst_t> mon_inst;
-    ::decode(mon_inst, p);
+    decode(mon_inst, p);
     for (unsigned i = 0; i < mon_inst.size(); i++) {
       char n[2];
       n[0] = '0' + i;
@@ -204,16 +206,16 @@ void MonMap::decode(bufferlist::iterator &p)
       mon_addr[name] = mon_inst[i].addr;
     }
   } else {
-    ::decode(mon_addr, p);
+    decode(mon_addr, p);
   }
-  ::decode(last_changed, p);
-  ::decode(created, p);
+  decode(last_changed, p);
+  decode(created, p);
   if (struct_v >= 4) {
-    ::decode(persistent_features, p);
-    ::decode(optional_features, p);
+    decode(persistent_features, p);
+    decode(optional_features, p);
   }
   if (struct_v >= 5) {
-    ::decode(mon_info, p);
+    decode(mon_info, p);
   } else {
     // we may be decoding to an existing monmap; if we do not
     // clear the mon_info map now, we will likely incur in problems
index 488e3a4a6e4e6454d23b5a5a097c6864ec02d874..d6341cb0a0cf67bf36e250767de16cc0ca48026a 100644 (file)
@@ -682,7 +682,7 @@ int Monitor::preinit()
         // Attempt to decode and extract keyring only if it is found.
         KeyRing keyring;
         bufferlist::iterator p = bl.begin();
-        ::decode(keyring, p);
+        decode(keyring, p);
         extract_save_mon_key(keyring);
       }
     }
@@ -809,7 +809,7 @@ void Monitor::refresh_from_paxos(bool *need_bootstrap)
   if (r >= 0) {
     try {
       bufferlist::iterator p = bl.begin();
-      ::decode(fingerprint, p);
+      decode(fingerprint, p);
     }
     catch (buffer::error& e) {
       dout(10) << __func__ << " failed to decode cluster_fingerprint" << dendl;
@@ -1433,7 +1433,7 @@ void Monitor::handle_sync_get_chunk(MonOpRequestRef op)
     sync_providers.erase(sp.cookie);
   }
 
-  ::encode(*tx, reply->chunk_bl);
+  encode(*tx, reply->chunk_bl);
 
   m->get_connection()->send_message(reply);
 }
@@ -1951,7 +1951,7 @@ void Monitor::win_election(epoch_t epoch, set<int>& active, uint64_t features,
     // do that anyway for other reasons, though.
     MonitorDBStore::TransactionRef t = paxos->get_pending_transaction();
     bufferlist bl;
-    ::encode(m, bl);
+    encode(m, bl);
     t->put(MONITOR_STORE_PREFIX, "last_metadata", bl);
   }
 
@@ -4270,7 +4270,7 @@ void Monitor::handle_ping(MonOpRequestRef op)
   f->close_section();
   stringstream ss;
   f->flush(ss);
-  ::encode(ss.str(), payload);
+  encode(ss.str(), payload);
   reply->set_payload(payload);
   dout(10) << __func__ << " reply payload len " << reply->get_payload().length() << dendl;
   messenger->send_message(reply, inst);
@@ -4903,7 +4903,7 @@ void Monitor::update_mon_metadata(int from, Metadata&& m)
 
   MonitorDBStore::TransactionRef t = paxos->get_pending_transaction();
   bufferlist bl;
-  ::encode(pending_metadata, bl);
+  encode(pending_metadata, bl);
   t->put(MONITOR_STORE_PREFIX, "last_metadata", bl);
   paxos->trigger_propose();
 }
@@ -4915,7 +4915,7 @@ int Monitor::load_metadata()
   if (r)
     return r;
   bufferlist::iterator it = bl.begin();
-  ::decode(mon_metadata, it);
+  decode(mon_metadata, it);
 
   pending_metadata = mon_metadata;
   return 0;
@@ -5389,7 +5389,7 @@ void Monitor::prepare_new_fingerprint(MonitorDBStore::TransactionRef t)
   dout(10) << __func__ << " proposing cluster_fingerprint " << nf << dendl;
 
   bufferlist bl;
-  ::encode(nf, bl);
+  encode(nf, bl);
   t->put(MONITOR_NAME, "cluster_fingerprint", bl);
 }
 
@@ -5645,11 +5645,11 @@ bool Monitor::ms_get_authorizer(int service_id, AuthAuthorizer **authorizer,
     return false;
   }
   bufferlist ticket_data;
-  ::encode(blob, ticket_data);
+  encode(blob, ticket_data);
 
   bufferlist::iterator iter = ticket_data.begin();
   CephXTicketHandler handler(g_ceph_context, service_id);
-  ::decode(handler.ticket, iter);
+  decode(handler.ticket, iter);
 
   handler.session_key = info.session_key;
 
index 8569fc23940ecb6f16c83d6942cbcb646011e238..f1e0efd7da879ecaf66bc49c6b735058086b08e1 100644 (file)
@@ -65,22 +65,22 @@ class MonitorDBStore
 
     void encode(bufferlist& encode_bl) const {
       ENCODE_START(2, 1, encode_bl);
-      ::encode(type, encode_bl);
-      ::encode(prefix, encode_bl);
-      ::encode(key, encode_bl);
-      ::encode(bl, encode_bl);
-      ::encode(endkey, encode_bl);
+      encode(type, encode_bl);
+      encode(prefix, encode_bl);
+      encode(key, encode_bl);
+      encode(bl, encode_bl);
+      encode(endkey, encode_bl);
       ENCODE_FINISH(encode_bl);
     }
 
     void decode(bufferlist::iterator& decode_bl) {
       DECODE_START(2, decode_bl);
-      ::decode(type, decode_bl);
-      ::decode(prefix, decode_bl);
-      ::decode(key, decode_bl);
-      ::decode(bl, decode_bl);
+      decode(type, decode_bl);
+      decode(prefix, decode_bl);
+      decode(key, decode_bl);
+      decode(bl, decode_bl);
       if (struct_v >= 2)
-       ::decode(endkey, decode_bl);
+       decode(endkey, decode_bl);
       DECODE_FINISH(decode_bl);
     }
 
@@ -125,8 +125,9 @@ class MonitorDBStore
     }
 
     void put(string prefix, string key, version_t ver) {
+      using ceph::encode;
       bufferlist bl;
-      ::encode(ver, bl);
+      encode(ver, bl);
       put(prefix, key, bl);
     }
 
@@ -152,18 +153,18 @@ class MonitorDBStore
 
     void encode(bufferlist& bl) const {
       ENCODE_START(2, 1, bl);
-      ::encode(ops, bl);
-      ::encode(bytes, bl);
-      ::encode(keys, bl);
+      encode(ops, bl);
+      encode(bytes, bl);
+      encode(keys, bl);
       ENCODE_FINISH(bl);
     }
 
     void decode(bufferlist::iterator& bl) {
       DECODE_START(2, bl);
-      ::decode(ops, bl);
+      decode(ops, bl);
       if (struct_v >= 2) {
-       ::decode(bytes, bl);
-       ::decode(keys, bl);
+       decode(bytes, bl);
+       decode(keys, bl);
       }
       DECODE_FINISH(bl);
     }
@@ -395,9 +396,9 @@ class MonitorDBStore
       last_key.second = key;
 
       if (g_conf->mon_sync_debug) {
-       ::encode(prefix, crc_bl);
-       ::encode(key, crc_bl);
-       ::encode(value, crc_bl);
+       encode(prefix, crc_bl);
+       encode(key, crc_bl);
+       encode(value, crc_bl);
       }
 
       return true;
@@ -538,7 +539,7 @@ class MonitorDBStore
     assert(bl.length());
     version_t ver;
     bufferlist::iterator p = bl.begin();
-    ::decode(ver, p);
+    decode(ver, p);
     return ver;
   }
 
index a0d6c6c3c50f003b0889ae37daea2a6a8c1af3b2..aea742fdc6c7a912f0a531c0530be68c2506ee82 100644 (file)
@@ -153,7 +153,8 @@ epoch_t LastEpochClean::get_lower_bound(const OSDMap& latest) const
 }
 
 
-struct C_UpdateCreatingPGs : public Context {
+class C_UpdateCreatingPGs : public Context {
+public:
   OSDMonitor *osdmon;
   utime_t start;
   epoch_t epoch;
@@ -1179,7 +1180,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
                 << " legacy removed_snaps" << dendl;
        string k = make_snap_epoch_key(p.first, pending_inc.epoch);
        bufferlist v;
-       ::encode(p.second.removed_snaps, v);
+       encode(p.second.removed_snaps, v);
        t->put(OSD_SNAP_PREFIX, k, v);
        for (auto q = p.second.removed_snaps.begin();
             q != p.second.removed_snaps.end();
@@ -1253,7 +1254,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
     dout(10) << __func__ << " encoding full map with " << features << dendl;
 
     bufferlist fullbl;
-    ::encode(tmp, fullbl, features | CEPH_FEATURE_RESERVED);
+    encode(tmp, fullbl, features | CEPH_FEATURE_RESERVED);
     pending_inc.full_crc = tmp.get_crc();
 
     // include full map in the txn.  note that old monitors will
@@ -1265,7 +1266,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   // encode
   assert(get_last_committed() + 1 == pending_inc.epoch);
   bufferlist bl;
-  ::encode(pending_inc, bl, features | CEPH_FEATURE_RESERVED);
+  encode(pending_inc, bl, features | CEPH_FEATURE_RESERVED);
 
   dout(20) << " full_crc " << tmp.get_crc()
           << " inc_crc " << pending_inc.inc_crc << dendl;
@@ -1289,7 +1290,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   // and pg creating, also!
   auto pending_creatings = update_pending_pgs(pending_inc);
   bufferlist creatings_bl;
-  ::encode(pending_creatings, creatings_bl);
+  encode(pending_creatings, creatings_bl);
   t->put(OSD_PG_CREATING_PREFIX, "creating", creatings_bl);
 
   // removed_snaps
@@ -1299,7 +1300,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
        // all snaps removed this epoch
        string k = make_snap_epoch_key(i.first, pending_inc.epoch);
        bufferlist v;
-       ::encode(i.second, v);
+       encode(i.second, v);
        t->put(OSD_SNAP_PREFIX, k, v);
       }
       for (auto q = i.second.begin();
@@ -1355,7 +1356,7 @@ int OSDMonitor::load_metadata(int osd, map<string, string>& m, ostream *err)
     return r;
   try {
     bufferlist::iterator p = bl.begin();
-    ::decode(m, p);
+    decode(m, p);
   }
   catch (buffer::error& e) {
     if (err)
@@ -2382,7 +2383,7 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op)
 
     // metadata
     bufferlist osd_metadata;
-    ::encode(m->metadata, osd_metadata);
+    encode(m->metadata, osd_metadata);
     pending_metadata[from] = osd_metadata;
     pending_metadata_rm.erase(from);
 
@@ -3101,7 +3102,7 @@ void OSDMonitor::get_removed_snaps_range(
       if (v.length()) {
        auto q = v.begin();
        OSDMap::snap_interval_set_t snaps;
-       ::decode(snaps, q);
+       decode(snaps, q);
        t.union_of(snaps);
       }
     }
@@ -4984,9 +4985,9 @@ string OSDMonitor::make_snap_key_value(
 {
   // encode the *last* epoch in the key so that we can use forward
   // iteration only to search for an epoch in an interval.
-  ::encode(snap, *v);
-  ::encode(snap + num, *v);
-  ::encode(epoch, *v);
+  encode(snap, *v);
+  encode(snap + num, *v);
+  encode(epoch, *v);
   return make_snap_key(pool, snap + num - 1);
 }
 
@@ -5003,9 +5004,9 @@ string OSDMonitor::make_snap_purged_key_value(
 {
   // encode the *last* epoch in the key so that we can use forward
   // iteration only to search for an epoch in an interval.
-  ::encode(snap, *v);
-  ::encode(snap + num, *v);
-  ::encode(epoch, *v);
+  encode(snap, *v);
+  encode(snap + num, *v);
+  encode(epoch, *v);
   return make_snap_purged_key(pool, snap + num - 1);
 }
 
@@ -5023,8 +5024,8 @@ int OSDMonitor::lookup_pruned_snap(int64_t pool, snapid_t snap,
   }
   bufferlist v = it->value();
   auto p = v.begin();
-  ::decode(*begin, p);
-  ::decode(*end, p);
+  decode(*begin, p);
+  decode(*end, p);
   if (snap < *begin || snap >= *end) {
     return -ENOENT;
   }
@@ -5408,7 +5409,7 @@ bool OSDMonitor::validate_crush_against_features(const CrushWrapper *newcrush,
                                                  stringstream& ss)
 {
   OSDMap::Incremental new_pending = pending_inc;
-  ::encode(*newcrush, new_pending.crush, mon->get_quorum_con_features());
+  encode(*newcrush, new_pending.crush, mon->get_quorum_con_features());
   OSDMap newmap;
   newmap.deepish_copy_from(osdmap);
   newmap.apply_incremental(new_pending);
@@ -11136,7 +11137,7 @@ bool OSDMonitor::prepare_pool_op(MonOpRequestRef op)
     {
       uint64_t snapid;
       pp.add_unmanaged_snap(snapid);
-      ::encode(snapid, reply_data);
+      encode(snapid, reply_data);
       changed = true;
     }
     break;
index 335969315605e62f4b9a9ac346e9366e8039349b..13c2af0b5e6d123464adb305655babb24b606578 100644 (file)
@@ -32,33 +32,33 @@ void PGMapDigest::encode(bufferlist& bl, uint64_t features) const
     v = 1;
   }
   ENCODE_START(v, 1, bl);
-  ::encode(num_pg, bl);
-  ::encode(num_pg_active, bl);
-  ::encode(num_pg_unknown, bl);
-  ::encode(num_osd, bl);
-  ::encode(pg_pool_sum, bl, features);
-  ::encode(pg_sum, bl, features);
-  ::encode(osd_sum, bl);
+  encode(num_pg, bl);
+  encode(num_pg_active, bl);
+  encode(num_pg_unknown, bl);
+  encode(num_osd, bl);
+  encode(pg_pool_sum, bl, features);
+  encode(pg_sum, bl, features);
+  encode(osd_sum, bl);
   if (v >= 2) {
-    ::encode(num_pg_by_state, bl);
+    encode(num_pg_by_state, bl);
   } else {
     uint32_t n = num_pg_by_state.size();
-    ::encode(n, bl);
+    encode(n, bl);
     for (auto p : num_pg_by_state) {
-      ::encode((uint32_t)p.first, bl);
-      ::encode(p.second, bl);
-    }
-  }
-  ::encode(num_pg_by_osd, bl);
-  ::encode(num_pg_by_pool, bl);
-  ::encode(osd_last_seq, bl);
-  ::encode(per_pool_sum_delta, bl, features);
-  ::encode(per_pool_sum_deltas_stamps, bl);
-  ::encode(pg_sum_delta, bl, features);
-  ::encode(stamp_delta, bl);
-  ::encode(avail_space_by_rule, bl);
+      encode((uint32_t)p.first, bl);
+      encode(p.second, bl);
+    }
+  }
+  encode(num_pg_by_osd, bl);
+  encode(num_pg_by_pool, bl);
+  encode(osd_last_seq, bl);
+  encode(per_pool_sum_delta, bl, features);
+  encode(per_pool_sum_deltas_stamps, bl);
+  encode(pg_sum_delta, bl, features);
+  encode(stamp_delta, bl);
+  encode(avail_space_by_rule, bl);
   if (struct_v >= 3) {
-    ::encode(purged_snaps, bl);
+    encode(purged_snaps, bl);
   }
   ENCODE_FINISH(bl);
 }
@@ -66,32 +66,32 @@ void PGMapDigest::encode(bufferlist& bl, uint64_t features) const
 void PGMapDigest::decode(bufferlist::iterator& p)
 {
   DECODE_START(3, p);
-  ::decode(num_pg, p);
-  ::decode(num_pg_active, p);
-  ::decode(num_pg_unknown, p);
-  ::decode(num_osd, p);
-  ::decode(pg_pool_sum, p);
-  ::decode(pg_sum, p);
-  ::decode(osd_sum, p);
+  decode(num_pg, p);
+  decode(num_pg_active, p);
+  decode(num_pg_unknown, p);
+  decode(num_osd, p);
+  decode(pg_pool_sum, p);
+  decode(pg_sum, p);
+  decode(osd_sum, p);
   if (struct_v >= 2) {
-    ::decode(num_pg_by_state, p);
+    decode(num_pg_by_state, p);
   } else {
     map<int32_t, int32_t> nps;
-    ::decode(nps, p);
+    decode(nps, p);
     for (auto i : nps) {
       num_pg_by_state[i.first] = i.second;
     }
   }
-  ::decode(num_pg_by_osd, p);
-  ::decode(num_pg_by_pool, p);
-  ::decode(osd_last_seq, p);
-  ::decode(per_pool_sum_delta, p);
-  ::decode(per_pool_sum_deltas_stamps, p);
-  ::decode(pg_sum_delta, p);
-  ::decode(stamp_delta, p);
-  ::decode(avail_space_by_rule, p);
+  decode(num_pg_by_osd, p);
+  decode(num_pg_by_pool, p);
+  decode(osd_last_seq, p);
+  decode(per_pool_sum_delta, p);
+  decode(per_pool_sum_deltas_stamps, p);
+  decode(pg_sum_delta, p);
+  decode(stamp_delta, p);
+  decode(avail_space_by_rule, p);
   if (struct_v >= 3) {
-    ::decode(purged_snaps, p);
+    decode(purged_snaps, p);
   }
   DECODE_FINISH(p);
 }
@@ -1338,24 +1338,24 @@ void PGMap::encode_digest(const OSDMap& osdmap,
 void PGMap::encode(bufferlist &bl, uint64_t features) const
 {
   ENCODE_START(7, 7, bl);
-  ::encode(version, bl);
-  ::encode(pg_stat, bl);
-  ::encode(osd_stat, bl);
-  ::encode(last_osdmap_epoch, bl);
-  ::encode(last_pg_scan, bl);
-  ::encode(stamp, bl);
+  encode(version, bl);
+  encode(pg_stat, bl);
+  encode(osd_stat, bl);
+  encode(last_osdmap_epoch, bl);
+  encode(last_pg_scan, bl);
+  encode(stamp, bl);
   ENCODE_FINISH(bl);
 }
 
 void PGMap::decode(bufferlist::iterator &bl)
 {
   DECODE_START(7, bl);
-  ::decode(version, bl);
-  ::decode(pg_stat, bl);
-  ::decode(osd_stat, bl);
-  ::decode(last_osdmap_epoch, bl);
-  ::decode(last_pg_scan, bl);
-  ::decode(stamp, bl);
+  decode(version, bl);
+  decode(pg_stat, bl);
+  decode(osd_stat, bl);
+  decode(last_osdmap_epoch, bl);
+  decode(last_pg_scan, bl);
+  decode(stamp, bl);
   DECODE_FINISH(bl);
 
   calc_stats();
index ea43ba3dc41b0a3f9723d03f7eb05ecce0a5f010..42719df952c137a4bad0b87c4ec55d4c2449d06c 100644 (file)
@@ -58,14 +58,16 @@ public:
     int32_t up = 0;
     int32_t primary = 0;
     void encode(bufferlist& bl) const {
-      ::encode(acting, bl);
-      ::encode(up, bl);
-      ::encode(primary, bl);
+      using ceph::encode;
+      encode(acting, bl);
+      encode(up, bl);
+      encode(primary, bl);
     }
     void decode(bufferlist::iterator& p) {
-      ::decode(acting, p);
-      ::decode(up, p);
-      ::decode(primary, p);
+      using ceph::decode;
+      decode(acting, p);
+      decode(up, p);
+      decode(primary, p);
     }
   };
   mempool::pgmap::unordered_map<int32_t,pg_count> num_pg_by_osd;
index 3a9968e0a533cde26a21ebda9ef71c417dd7ee88..24b3d609644048bf44df69b9efbd48bb8a517495 100644 (file)
@@ -1128,7 +1128,7 @@ void Paxos::handle_lease(MonOpRequestRef op)
   ack->last_committed = last_committed;
   ack->first_committed = first_committed;
   ack->lease_timestamp = ceph_clock_now();
-  ::encode(mon->session_map.feature_map, ack->feature_map);
+  encode(mon->session_map.feature_map, ack->feature_map);
   lease->get_connection()->send_message(ack);
 
   // (re)set timeout event.
@@ -1155,7 +1155,7 @@ void Paxos::handle_lease_ack(MonOpRequestRef op)
     if (ack->feature_map.length()) {
       auto p = ack->feature_map.begin();
       FeatureMap& t = mon->quorum_feature_map[from];
-      ::decode(t, p);
+      decode(t, p);
     }
     if (acked_lease == mon->get_quorum()) {
       // yay!
index de732c322301956af95f9e7276495fb842f2467b..8f36197b0558f8e63f706c0c233e017c836065c1 100644 (file)
@@ -437,6 +437,6 @@ void PaxosService::load_health()
   mon->store->get("health", service_name, bl);
   if (bl.length()) {
     auto p = bl.begin();
-    ::decode(health_checks, p);
+    decode(health_checks, p);
   }
 }
index 8b025aa0fec1522d9e9aa3374b79afabd1dc71ec..94a9ebdb083b1bb6fde8b5dfe3c6655b7a497fa0 100644 (file)
@@ -428,7 +428,7 @@ public:
   void encode_health(const health_check_map_t& next,
                     MonitorDBStore::TransactionRef t) {
     bufferlist bl;
-    ::encode(next, bl);
+    encode(next, bl);
     t->put("health", service_name, bl);
     mon->log_health(next, health_checks, t);
   }
index 68139a40bc9ef731232ab714bc6d4e4558013643..bbb1f3e60c1ab967dd7ba7eeead78e05522ee5e9 100644 (file)
@@ -92,13 +92,13 @@ struct FeatureMap {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(m, bl);
+    encode(m, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& p) {
     DECODE_START(1, p);
-    ::decode(m, p);
+    decode(m, p);
     DECODE_FINISH(p);
   }
 
@@ -154,21 +154,21 @@ struct LevelDBStoreStats {
 
   void encode(bufferlist &bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(bytes_total, bl);
-    ::encode(bytes_sst, bl);
-    ::encode(bytes_log, bl);
-    ::encode(bytes_misc, bl);
-    ::encode(last_update, bl);
+    encode(bytes_total, bl);
+    encode(bytes_sst, bl);
+    encode(bytes_log, bl);
+    encode(bytes_misc, bl);
+    encode(last_update, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator &p) {
     DECODE_START(1, p);
-    ::decode(bytes_total, p);
-    ::decode(bytes_sst, p);
-    ::decode(bytes_log, p);
-    ::decode(bytes_misc, p);
-    ::decode(last_update, p);
+    decode(bytes_total, p);
+    decode(bytes_sst, p);
+    decode(bytes_log, p);
+    decode(bytes_misc, p);
+    decode(last_update, p);
     DECODE_FINISH(p);
   }
 
@@ -206,34 +206,34 @@ struct DataStats {
 
   void encode(bufferlist &bl) const {
     ENCODE_START(3, 1, bl);
-    ::encode(fs_stats.byte_total, bl);
-    ::encode(fs_stats.byte_used, bl);
-    ::encode(fs_stats.byte_avail, bl);
-    ::encode(fs_stats.avail_percent, bl);
-    ::encode(last_update, bl);
-    ::encode(store_stats, bl);
+    encode(fs_stats.byte_total, bl);
+    encode(fs_stats.byte_used, bl);
+    encode(fs_stats.byte_avail, bl);
+    encode(fs_stats.avail_percent, bl);
+    encode(last_update, bl);
+    encode(store_stats, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator &p) {
     DECODE_START(1, p);
     // we moved from having fields in kb to fields in byte
     if (struct_v > 2) {
-      ::decode(fs_stats.byte_total, p);
-      ::decode(fs_stats.byte_used, p);
-      ::decode(fs_stats.byte_avail, p);
+      decode(fs_stats.byte_total, p);
+      decode(fs_stats.byte_used, p);
+      decode(fs_stats.byte_avail, p);
     } else {
       uint64_t t;
-      ::decode(t, p);
+      decode(t, p);
       fs_stats.byte_total = t*1024;
-      ::decode(t, p);
+      decode(t, p);
       fs_stats.byte_used = t*1024;
-      ::decode(t, p);
+      decode(t, p);
       fs_stats.byte_avail = t*1024;
     }
-    ::decode(fs_stats.avail_percent, p);
-    ::decode(last_update, p);
+    decode(fs_stats.avail_percent, p);
+    decode(last_update, p);
     if (struct_v > 1)
-      ::decode(store_stats, p);
+      decode(store_stats, p);
 
     DECODE_FINISH(p);
   }
@@ -250,14 +250,14 @@ struct ScrubResult {
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
-    ::encode(prefix_crc, bl);
-    ::encode(prefix_keys, bl);
+    encode(prefix_crc, bl);
+    encode(prefix_keys, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& p) {
     DECODE_START(1, p);
-    ::decode(prefix_crc, p);
-    ::decode(prefix_keys, p);
+    decode(prefix_crc, p);
+    decode(prefix_keys, p);
     DECODE_FINISH(p);
   }
   void dump(Formatter *f) const {
@@ -279,7 +279,7 @@ struct ScrubResult {
 };
 WRITE_CLASS_ENCODER(ScrubResult)
 
-static inline ostream& operator<<(ostream& out, const ScrubResult& r) {
+inline ostream& operator<<(ostream& out, const ScrubResult& r) {
   return out << "ScrubResult(keys " << r.prefix_keys << " crc " << r.prefix_crc << ")";
 }
 
@@ -472,12 +472,12 @@ public:
 
   void encode(bufferlist& bl) const {
     ENCODE_START(HEAD_VERSION, COMPAT_VERSION, bl);
-    ::encode(features, bl);
+    encode(features, bl);
     ENCODE_FINISH(bl);
   }
   void decode(bufferlist::iterator& p) {
     DECODE_START(COMPAT_VERSION, p);
-    ::decode(features, p);
+    decode(features, p);
     DECODE_FINISH(p);
   }
 };
@@ -545,8 +545,7 @@ static inline const char *ceph::features::mon::get_feature_name(uint64_t b) {
   return "unknown";
 }
 
-static inline
-mon_feature_t ceph::features::mon::get_feature_by_name(std::string n) {
+inline mon_feature_t ceph::features::mon::get_feature_by_name(std::string n) {
 
   if (n == "kraken") {
     return FEATURE_KRAKEN;
@@ -560,7 +559,7 @@ mon_feature_t ceph::features::mon::get_feature_by_name(std::string n) {
   return FEATURE_NONE;
 }
 
-static inline ostream& operator<<(ostream& out, const mon_feature_t& f) {
+inline ostream& operator<<(ostream& out, const mon_feature_t& f) {
   out << "mon_feature_t(";
   f.print(out);
   out << ")";