]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: build without "using namespace std"
authorKefu Chai <kchai@redhat.com>
Wed, 11 Aug 2021 03:46:14 +0000 (11:46 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 13 Aug 2021 04:21:39 +0000 (12:21 +0800)
* add "std::" prefix in headers
* add "using" declarations in .cc files.

so we don't rely on "using namespace std" in one or more included
headers.

Signed-off-by: Kefu Chai <kchai@redhat.com>
66 files changed:
src/ceph_mds.cc
src/mds/Anchor.cc
src/mds/Anchor.h
src/mds/Beacon.cc
src/mds/CDentry.cc
src/mds/CDir.cc
src/mds/CDir.h
src/mds/CInode.cc
src/mds/FSMap.cc
src/mds/FSMap.h
src/mds/Locker.cc
src/mds/LogEvent.h
src/mds/LogSegment.h
src/mds/MDBalancer.cc
src/mds/MDBalancer.h
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/MDLog.cc
src/mds/MDLog.h
src/mds/MDSDaemon.cc
src/mds/MDSDaemon.h
src/mds/MDSMap.cc
src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mds/MDSTable.cc
src/mds/MDSTable.h
src/mds/MDSTableClient.cc
src/mds/MDSTableClient.h
src/mds/MDSTableServer.cc
src/mds/MDSTableServer.h
src/mds/Migrator.cc
src/mds/Migrator.h
src/mds/Mutation.cc
src/mds/OpenFileTable.cc
src/mds/OpenFileTable.h
src/mds/PurgeQueue.cc
src/mds/RecoveryQueue.cc
src/mds/ScrubStack.cc
src/mds/Server.cc
src/mds/Server.h
src/mds/SessionMap.cc
src/mds/SnapClient.cc
src/mds/SnapClient.h
src/mds/SnapRealm.cc
src/mds/SnapServer.cc
src/mds/SnapServer.h
src/mds/StrayManager.cc
src/mds/cephfs_features.cc
src/mds/events/ECommitted.h
src/mds/events/EExport.h
src/mds/events/EFragment.h
src/mds/events/EImportFinish.h
src/mds/events/EImportStart.h
src/mds/events/EMetaBlob.h
src/mds/events/EOpen.h
src/mds/events/EPeerUpdate.h
src/mds/events/EPurged.h
src/mds/events/EResetJournal.h
src/mds/events/ESession.h
src/mds/events/ESessions.h
src/mds/events/ESubtreeMap.h
src/mds/events/ETableClient.h
src/mds/events/ETableServer.h
src/mds/events/EUpdate.h
src/mds/journal.cc
src/mds/snap.cc

index b5674befc861dbe3487d0c0461f9a3faa79c8aa5..0d6c5ed70649dcb7b8e41cf885f82df102192c0b 100644 (file)
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_mds
 
+using std::cerr;
+using std::cout;
+using std::vector;
+
 static void usage()
 {
   cout << "usage: ceph-mds -i <ID> [flags]\n"
index 609b91188acd3989da2069f8cc07ce1dd00b3c7a..81d55e6b115f55b139b22699d0f87427b5e90f97 100644 (file)
@@ -57,7 +57,7 @@ void Anchor::generate_test_instances(std::list<Anchor*>& ls)
   ls.back()->d_type = DT_DIR;
 }
 
-ostream& operator<<(ostream& out, const Anchor &a)
+std::ostream& operator<<(std::ostream& out, const Anchor &a)
 {
   return out << "a(" << a.ino << " " << a.dirino << "/'" << a.d_name << "' " << a.d_type << ")";
 }
index 9e55ec807bf2a5269ed43cd652f843ecf414c48c..f2e9469d30d2992a273e6a7019e0091ec9b4b9ea 100644 (file)
@@ -69,5 +69,5 @@ public:
   mutable int nref = 0; // how many children
 };
 
-ostream& operator<<(ostream& out, const Anchor &a);
+std::ostream& operator<<(std::ostream& out, const Anchor &a);
 #endif
index 6548970ec87d5b25ce2f74ee2ff79fd4894310e4..766e4c5d26711e7a55b00eafebea1dc223e91bd0 100644 (file)
@@ -34,6 +34,9 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds.beacon." << name << ' '
 
+using std::map;
+using std::string;
+
 using namespace std::chrono_literals;
 
 Beacon::Beacon(CephContext *cct, MonClient *monc, std::string_view name)
@@ -360,7 +363,7 @@ void Beacon::notify_health(MDSRank const *mds)
   //
   // Detect clients failing to advance their old_client_tid
   {
-    set<Session*> sessions;
+    std::set<Session*> sessions;
     mds->sessionmap.get_client_session_set(sessions);
 
     const auto min_caps_working_set = g_conf().get_val<uint64_t>("mds_min_caps_working_set");
index 70d33a00165f2188fcfbc7bf6ce6fb8fc2490279..85d8bc5fb58d8204608d9b907602586d6fe598b7 100644 (file)
@@ -30,6 +30,7 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << dir->mdcache->mds->get_nodeid() << ".cache.den(" << dir->dirfrag() << " " << name << ") "
 
+using namespace std;
 
 ostream& CDentry::print_db_line_prefix(ostream& out)
 {
index 8e78c1caa1f95bc4f0171c219fb33c3e0a901c3d..8bbe34192e7a8b85d1ff71950d7419cc812444b3 100644 (file)
@@ -45,6 +45,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << mdcache->mds->get_nodeid() << ".cache.dir(" << this->dirfrag() << ") "
 
+using namespace std;
+
 int CDir::num_frozen_trees = 0;
 int CDir::num_freezing_trees = 0;
 
index a6793e6a8377dc67bd8f97200b75612dd0fd5064..c8d3e417ad49a154a50de003779867198d8c8c56 100644 (file)
@@ -58,7 +58,7 @@ public:
   }
 
   struct dentry_commit_item {
-    string key;
+    std::string key;
     snapid_t first;
     bool is_remote = false;
 
@@ -646,7 +646,7 @@ protected:
 
   void _omap_fetch(MDSContext *fin, const std::set<dentry_key_t>& keys);
   void _omap_fetch_more(version_t omap_version, bufferlist& hdrbl,
-                       map<string, bufferlist>& omap, MDSContext *fin);
+                       std::map<std::string, bufferlist>& omap, MDSContext *fin);
   CDentry *_load_dentry(
       std::string_view key,
       std::string_view dname,
@@ -673,14 +673,14 @@ protected:
   // -- commit --
   void _commit(version_t want, int op_prio);
   void _omap_commit_ops(int r, int op_prio, int64_t metapool, version_t version, bool _new,
-                       vector<dentry_commit_item> &to_set, bufferlist &dfts,
-                       vector<string> &to_remove,
+                       std::vector<dentry_commit_item> &to_set, bufferlist &dfts,
+                       std::vector<std::string> &to_remove,
                        mempool::mds_co::compact_set<mempool::mds_co::string> &_stale);
   void _encode_primary_inode_base(dentry_commit_item &item, bufferlist &dfts,
                                   bufferlist &bl);
   void _omap_commit(int op_prio);
   void _parse_dentry(CDentry *dn, dentry_commit_item &item,
-                     const set<snapid_t> *snaps, bufferlist &bl);
+                     const std::set<snapid_t> *snaps, bufferlist &bl);
   void _committed(int r, version_t v);
 
   static fnode_const_ptr empty_fnode;
index 4e47fdf7869aa26dd91f1dee0febbb9226b29f9b..b7b78e648248152ad45e41ec783180263ac084f9 100644 (file)
@@ -51,6 +51,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << mdcache->mds->get_nodeid() << ".cache.ino(" << ino() << ") "
 
+using namespace std;
+
 void CInodeCommitOperation::update(ObjectOperation &op, inode_backtrace_t &bt) {
   using ceph::encode;
 
index 7fa5ca9904b5e3d09ffe864e58f7478fb0daea45..d3e5ab836b53054fbe56d7f3d7c282f662149103 100644 (file)
@@ -30,6 +30,7 @@ using std::list;
 using std::pair;
 using std::ostream;
 using std::string;
+using std::string_view;
 
 using ceph::bufferlist;
 using ceph::Formatter;
index 7deee53bef747bab17a2dcaa304435860b76f705..4f732128cc934a130030a5e20f8d35938a6d02fd 100644 (file)
@@ -252,21 +252,21 @@ public:
 
   const CompatSet &get_default_compat() const {return default_compat;}
 
-  void filter(const std::vector<string>& allowed)
+  void filter(const std::vector<std::string>& allowed)
   {
     if (allowed.empty()) {
       return;
     }
 
     for (auto &f : filesystems) {
-      string_view fs_name = f.second->mds_map.get_fs_name();
+      std::string_view fs_name = f.second->mds_map.get_fs_name();
       if (std::find(allowed.begin(), allowed.end(), fs_name) == allowed.end()) {
        filesystems.erase(f.first);
       }
     }
 
     for (auto r : mds_roles) {
-      string_view fs_name = fs_name_from_gid(r.first);
+      std::string_view fs_name = fs_name_from_gid(r.first);
       if (std::find(allowed.begin(), allowed.end(), fs_name) == allowed.end()) {
        mds_roles.erase(r.first);
       }
@@ -324,10 +324,10 @@ public:
    * Does a daemon exist with this GID?
    */
   bool gid_exists(mds_gid_t gid,
-                 const std::vector<string>& in = {}) const
+                 const std::vector<std::string>& in = {}) const
   {
     try {
-      string_view m = fs_name_from_gid(gid);
+      std::string_view m = fs_name_from_gid(gid);
       return in.empty() || std::find(in.begin(), in.end(), m) != in.end();
     } catch (const std::out_of_range&) {
       return false;
@@ -537,7 +537,7 @@ public:
       std::string_view role_str,
       mds_role_t *role,
       std::ostream &ss,
-      const std::vector<string> &filter) const;
+      const std::vector<std::string> &filter) const;
 
   int parse_role(
       std::string_view role_str,
index e6b6e41c2a7a2b9d91b2d8203c3678accee2aad0..78895a40eff67caffd4f942bab480136cbd1b953 100644 (file)
@@ -35,6 +35,9 @@
 #undef dout_prefix
 #define dout_context g_ceph_context
 #define dout_prefix _prefix(_dout, mds)
+
+using namespace std;
+
 static ostream& _prefix(std::ostream *_dout, MDSRank *mds) {
   return *_dout << "mds." << mds->get_nodeid() << ".locker ";
 }
index 4e368c97b5e9de26320a1371ed9d61e8891ce4ac..317b6579fc1dba7c67750a8239c5437543a007df 100644 (file)
@@ -89,7 +89,7 @@ public:
     ENCODE_FINISH(bl);
   }
 
-  virtual void print(ostream& out) const { 
+  virtual void print(std::ostream& out) const {
     out << "event(" << _type << ")";
   }
 
@@ -125,7 +125,7 @@ private:
   LogSegment *_segment = nullptr;
 };
 
-inline ostream& operator<<(ostream& out, const LogEvent &le) {
+inline std::ostream& operator<<(std::ostream& out, const LogEvent &le) {
   le.print(out);
   return out;
 }
index a7f3f39710d2ff7f44eb2e9ff60653991272f9c9..405760c47a83ed2eb8ed363c4c78f45ca64c03d8 100644 (file)
@@ -83,17 +83,17 @@ class LogSegment {
   elist<CInode*>  dirty_dirfrag_nest;
   elist<CInode*>  dirty_dirfrag_dirfragtree;
 
-  set<CInode*> truncating_inodes;
+  std::set<CInode*> truncating_inodes;
   interval_set<inodeno_t> purging_inodes;
   MDSContext* purged_cb = nullptr;
 
-  map<int, ceph::unordered_set<version_t> > pending_commit_tids;  // mdstable
-  set<metareqid_t> uncommitted_leaders;
-  set<metareqid_t> uncommitted_peers;
-  set<dirfrag_t> uncommitted_fragments;
+  std::map<int, ceph::unordered_set<version_t> > pending_commit_tids;  // mdstable
+  std::set<metareqid_t> uncommitted_leaders;
+  std::set<metareqid_t> uncommitted_peers;
+  std::set<dirfrag_t> uncommitted_fragments;
 
   // client request ids
-  map<int, ceph_tid_t> last_client_tids;
+  std::map<int, ceph_tid_t> last_client_tids;
 
   // potentially dirty sessions
   std::set<entity_name_t> touched_sessions;
@@ -101,7 +101,7 @@ class LogSegment {
   // table version
   version_t inotablev = 0;
   version_t sessionmapv = 0;
-  map<int,version_t> tablev;
+  std::map<int,version_t> tablev;
 
   MDSContext::vec expiry_waiters;
 };
index 5ea313560da317c32758fae118f31314f5511fa5..cb63f60544426e43c351e85beccf11ca832cd603 100644 (file)
@@ -31,9 +31,8 @@
 #include <fstream>
 #include <vector>
 #include <map>
-using std::map;
-using std::vector;
-using std::chrono::duration_cast;
+
+using namespace std;
 
 #include "common/config.h"
 #include "common/errno.h"
@@ -240,7 +239,7 @@ void MDBalancer::tick()
   if (mds->get_nodeid() == 0
       && mds->is_active()
       && bal_interval > 0
-      && duration_cast<chrono::seconds>(now - last_heartbeat).count() >= bal_interval
+      && chrono::duration_cast<chrono::seconds>(now - last_heartbeat).count() >= bal_interval
       && (num_bal_times || (bal_max_until >= 0 && mds->get_uptime().count() > bal_max_until))) {
     last_heartbeat = now;
     send_heartbeat();
index d9172e565e1084542e299085a32047202d2fed4b..e3ee3deabcff8ec78b6e7456fe5844baf72e1168 100644 (file)
@@ -96,7 +96,7 @@ private:
                     double amount,
                     std::vector<CDir*>* exports,
                     double& have,
-                    set<CDir*>& already_exporting);
+                    std::set<CDir*>& already_exporting);
 
   double try_match(balance_state_t &state,
                    mds_rank_t ex, double& maxex,
@@ -127,8 +127,8 @@ private:
   MonClient *mon_client;
   int beat_epoch = 0;
 
-  string bal_code;
-  string bal_version;
+  std::string bal_code;
+  std::string bal_version;
 
   time last_heartbeat = clock::zero();
   time last_sample = clock::zero();
@@ -144,12 +144,12 @@ private:
   // just as soon as a delayed context comes back and triggers it.
   // These sets just prevent us from spawning extra timer contexts for
   // dirfrags that already have one in flight.
-  set<dirfrag_t> split_pending, merge_pending;
+  std::set<dirfrag_t> split_pending, merge_pending;
 
   // per-epoch scatter/gathered info
   std::map<mds_rank_t, mds_load_t> mds_load;
   std::map<mds_rank_t, double> mds_meta_load;
-  std::map<mds_rank_t, map<mds_rank_t, float> > mds_import_map;
+  std::map<mds_rank_t, std::map<mds_rank_t, float> > mds_import_map;
   std::map<mds_rank_t, int> mds_last_epoch_under_map;
 
   // per-epoch state
index e824beade1f8422a2bb8bcc5033c90c2146778c1..9f9b3047faf6dbe88de6b04d41a1c2c4b44431a0 100644 (file)
@@ -76,6 +76,9 @@
 #define dout_subsys ceph_subsys_mds
 #undef dout_prefix
 #define dout_prefix _prefix(_dout, mds)
+
+using namespace std;
+
 static ostream& _prefix(std::ostream *_dout, MDSRank *mds) {
   return *_dout << "mds." << mds->get_nodeid() << ".cache ";
 }
index c04f38e1c12632d4e1289fc4f636cd681928bef8..0d4659155a0f1d6617ae79c1c69e297b5a758228 100644 (file)
@@ -176,7 +176,7 @@ class MDCache {
     bool path_locked = false;
     mds_rank_t hint = MDS_RANK_NONE;
     mds_rank_t checking = MDS_RANK_NONE;
-    set<mds_rank_t> checked;
+    std::set<mds_rank_t> checked;
   };
 
   friend class C_MDC_RejoinOpenInoFinish;
@@ -303,17 +303,17 @@ class MDCache {
   void adjust_subtree_auth(CDir *root, mds_rank_t a, mds_rank_t b=CDIR_AUTH_UNKNOWN) {
     adjust_subtree_auth(root, mds_authority_t(a,b));
   }
-  void adjust_bounded_subtree_auth(CDir *dir, const set<CDir*>& bounds, mds_authority_t auth);
-  void adjust_bounded_subtree_auth(CDir *dir, const set<CDir*>& bounds, mds_rank_t a) {
+  void adjust_bounded_subtree_auth(CDir *dir, const std::set<CDir*>& bounds, mds_authority_t auth);
+  void adjust_bounded_subtree_auth(CDir *dir, const std::set<CDir*>& bounds, mds_rank_t a) {
     adjust_bounded_subtree_auth(dir, bounds, mds_authority_t(a, CDIR_AUTH_UNKNOWN));
   }
-  void adjust_bounded_subtree_auth(CDir *dir, const vector<dirfrag_t>& bounds, const mds_authority_t &auth);
-  void adjust_bounded_subtree_auth(CDir *dir, const vector<dirfrag_t>& bounds, mds_rank_t a) {
+  void adjust_bounded_subtree_auth(CDir *dir, const std::vector<dirfrag_t>& bounds, const mds_authority_t &auth);
+  void adjust_bounded_subtree_auth(CDir *dir, const std::vector<dirfrag_t>& bounds, mds_rank_t a) {
     adjust_bounded_subtree_auth(dir, bounds, mds_authority_t(a, CDIR_AUTH_UNKNOWN));
   }
-  void map_dirfrag_set(const list<dirfrag_t>& dfs, set<CDir*>& result);
+  void map_dirfrag_set(const std::list<dirfrag_t>& dfs, std::set<CDir*>& result);
   void try_subtree_merge(CDir *root);
-  void try_subtree_merge_at(CDir *root, set<CInode*> *to_eval, bool adjust_pop=true);
+  void try_subtree_merge_at(CDir *root, std::set<CInode*> *to_eval, bool adjust_pop=true);
   void eval_subtree_root(CInode *diri);
   CDir *get_subtree_root(CDir *dir);
   CDir *get_projected_subtree_root(CDir *dir);
@@ -325,10 +325,10 @@ class MDCache {
   bool is_subtree(CDir *root) {
     return subtrees.count(root);
   }
-  void get_subtree_bounds(CDir *root, set<CDir*>& bounds);
-  void get_wouldbe_subtree_bounds(CDir *root, set<CDir*>& bounds);
-  void verify_subtree_bounds(CDir *root, const set<CDir*>& bounds);
-  void verify_subtree_bounds(CDir *root, const list<dirfrag_t>& bounds);
+  void get_subtree_bounds(CDir *root, std::set<CDir*>& bounds);
+  void get_wouldbe_subtree_bounds(CDir *root, std::set<CDir*>& bounds);
+  void verify_subtree_bounds(CDir *root, const std::set<CDir*>& bounds);
+  void verify_subtree_bounds(CDir *root, const std::list<dirfrag_t>& bounds);
 
   void project_subtree_rename(CInode *diri, CDir *olddir, CDir *newdir);
   void adjust_subtree_after_rename(CInode *diri, CDir *olddir, bool pop);
@@ -389,7 +389,7 @@ class MDCache {
     return active_requests.count(rid);
   }
   MDRequestRef request_get(metareqid_t rid);
-  void request_pin_ref(MDRequestRef& r, CInode *ref, vector<CDentry*>& trace);
+  void request_pin_ref(MDRequestRef& r, CInode *ref, std::vector<CDentry*>& trace);
   void request_finish(MDRequestRef& mdr);
   void request_forward(MDRequestRef& mdr, mds_rank_t mds, int port=0);
   void dispatch_request(MDRequestRef& mdr);
@@ -422,7 +422,7 @@ class MDCache {
                                snapid_t follows=CEPH_NOSNAP);
 
   // peers
-  void add_uncommitted_leader(metareqid_t reqid, LogSegment *ls, set<mds_rank_t> &peers, bool safe=false) {
+  void add_uncommitted_leader(metareqid_t reqid, LogSegment *ls, std::set<mds_rank_t> &peers, bool safe=false) {
     uncommitted_leaders[reqid].ls = ls;
     uncommitted_leaders[reqid].peers = peers;
     uncommitted_leaders[reqid].safe = safe;
@@ -448,7 +448,7 @@ class MDCache {
   MDPeerUpdate* get_uncommitted_peer(metareqid_t reqid, mds_rank_t leader);
   void _logged_peer_commit(mds_rank_t from, metareqid_t reqid);
 
-  void set_recovery_set(set<mds_rank_t>& s);
+  void set_recovery_set(std::set<mds_rank_t>& s);
   void handle_mds_failure(mds_rank_t who);
   void handle_mds_recovery(mds_rank_t who);
 
@@ -477,12 +477,12 @@ class MDCache {
   void finish_rollback(metareqid_t reqid, MDRequestRef& mdr);
 
   // ambiguous imports
-  void add_ambiguous_import(dirfrag_t base, const vector<dirfrag_t>& bounds);
-  void add_ambiguous_import(CDir *base, const set<CDir*>& bounds);
+  void add_ambiguous_import(dirfrag_t base, const std::vector<dirfrag_t>& bounds);
+  void add_ambiguous_import(CDir *base, const std::set<CDir*>& bounds);
   bool have_ambiguous_import(dirfrag_t base) {
     return my_ambiguous_imports.count(base);
   }
-  void get_ambiguous_import_bounds(dirfrag_t base, vector<dirfrag_t>& bounds) {
+  void get_ambiguous_import_bounds(dirfrag_t base, std::vector<dirfrag_t>& bounds) {
     ceph_assert(my_ambiguous_imports.count(base));
     bounds = my_ambiguous_imports[base];
   }
@@ -496,7 +496,7 @@ class MDCache {
   }
   
   void _move_subtree_map_bound(dirfrag_t df, dirfrag_t oldparent, dirfrag_t newparent,
-                              map<dirfrag_t,vector<dirfrag_t> >& subtrees);
+                              std::map<dirfrag_t,std::vector<dirfrag_t> >& subtrees);
   ESubtreeMap *create_subtree_map();
 
   void clean_open_file_lists();
@@ -563,16 +563,16 @@ class MDCache {
 
   void rejoin_open_ino_finish(inodeno_t ino, int ret);
   void rejoin_prefetch_ino_finish(inodeno_t ino, int ret);
-  void rejoin_open_sessions_finish(map<client_t,pair<Session*,uint64_t> >& session_map);
+  void rejoin_open_sessions_finish(std::map<client_t,std::pair<Session*,uint64_t> >& session_map);
   bool process_imported_caps();
   void choose_lock_states_and_reconnect_caps();
   void prepare_realm_split(SnapRealm *realm, client_t client, inodeno_t ino,
-                          map<client_t,ref_t<MClientSnap>>& splits);
-  void prepare_realm_merge(SnapRealm *realm, SnapRealm *parent_realm, map<client_t,ref_t<MClientSnap>>& splits);
-  void send_snaps(map<client_t,ref_t<MClientSnap>>& splits);
+                          std::map<client_t,ref_t<MClientSnap>>& splits);
+  void prepare_realm_merge(SnapRealm *realm, SnapRealm *parent_realm, std::map<client_t,ref_t<MClientSnap>>& splits);
+  void send_snaps(std::map<client_t,ref_t<MClientSnap>>& splits);
   Capability* rejoin_import_cap(CInode *in, client_t client, const cap_reconnect_t& icr, mds_rank_t frommds);
   void finish_snaprealm_reconnect(client_t client, SnapRealm *realm, snapid_t seq,
-                                 map<client_t,ref_t<MClientSnap>>& updates);
+                                 std::map<client_t,ref_t<MClientSnap>>& updates);
   Capability* try_reconnect_cap(CInode *in, Session *session);
   void export_remaining_imported_caps();
 
@@ -742,8 +742,8 @@ class MDCache {
 
   CDir *get_auth_container(CDir *in);
   CDir *get_export_container(CDir *dir);
-  void find_nested_exports(CDir *dir, set<CDir*>& s);
-  void find_nested_exports_under(CDir *import, CDir *dir, set<CDir*>& s);
+  void find_nested_exports(CDir *dir, std::set<CDir*>& s);
+  void find_nested_exports_under(CDir *import, CDir *dir, std::set<CDir*>& s);
 
   void init_layouts();
   void create_unlinked_system_inode(CInode *in, inodeno_t ino,
@@ -813,16 +813,16 @@ class MDCache {
    */
   int path_traverse(MDRequestRef& mdr, MDSContextFactory& cf,
                    const filepath& path, int flags,
-                   vector<CDentry*> *pdnvec, CInode **pin=nullptr);
+                   std::vector<CDentry*> *pdnvec, CInode **pin=nullptr);
 
   CInode *cache_traverse(const filepath& path);
 
   void open_remote_dirfrag(CInode *diri, frag_t fg, MDSContext *fin);
   CInode *get_dentry_inode(CDentry *dn, MDRequestRef& mdr, bool projected=false);
 
-  bool parallel_fetch(map<inodeno_t,filepath>& pathmap, set<inodeno_t>& missing);
+  bool parallel_fetch(std::map<inodeno_t,filepath>& pathmap, std::set<inodeno_t>& missing);
   bool parallel_fetch_traverse_dir(inodeno_t ino, filepath& path, 
-                                  set<CDir*>& fetch_queue, set<inodeno_t>& missing,
+                                  std::set<CDir*>& fetch_queue, std::set<inodeno_t>& missing,
                                   C_GatherBuilder &gather_bld);
 
   void open_remote_dentry(CDentry *dn, bool projected, MDSContext *fin,
@@ -830,12 +830,12 @@ class MDCache {
   void _open_remote_dentry_finish(CDentry *dn, inodeno_t ino, MDSContext *fin,
                                  bool want_xlocked, int r);
 
-  void make_trace(vector<CDentry*>& trace, CInode *in);
+  void make_trace(std::vector<CDentry*>& trace, CInode *in);
 
   void kick_open_ino_peers(mds_rank_t who);
   void open_ino(inodeno_t ino, int64_t pool, MDSContext *fin,
                bool want_replica=true, bool want_xlocked=false,
-               vector<inode_backpointer_t> *ancestors_hint=nullptr,
+               std::vector<inode_backpointer_t> *ancestors_hint=nullptr,
                mds_rank_t auth_hint=MDS_RANK_NONE);
 
   void find_ino_peers(inodeno_t ino, MDSContext *c,
@@ -967,30 +967,30 @@ class MDCache {
   // -- client caps --
   uint64_t last_cap_id = 0;
 
-  map<ceph_tid_t, discover_info_t> discovers;
+  std::map<ceph_tid_t, discover_info_t> discovers;
   ceph_tid_t discover_last_tid = 0;
 
   // waiters
-  map<int, map<inodeno_t, MDSContext::vec > > waiting_for_base_ino;
+  std::map<int, std::map<inodeno_t, MDSContext::vec > > waiting_for_base_ino;
 
-  map<inodeno_t,map<client_t, reconnected_cap_info_t> > reconnected_caps;   // inode -> client -> snap_follows,realmino
-  map<inodeno_t,map<client_t, snapid_t> > reconnected_snaprealms;  // realmino -> client -> realmseq
+  std::map<inodeno_t,std::map<client_t, reconnected_cap_info_t> > reconnected_caps;   // inode -> client -> snap_follows,realmino
+  std::map<inodeno_t,std::map<client_t, snapid_t> > reconnected_snaprealms;  // realmino -> client -> realmseq
 
   //  realm inodes
-  set<CInode*> rejoin_pending_snaprealms;
+  std::set<CInode*> rejoin_pending_snaprealms;
   // cap imports.  delayed snap parent opens.
-  map<client_t,set<CInode*> > delayed_imported_caps;
+  std::map<client_t,std::set<CInode*> > delayed_imported_caps;
 
   // subsystems
   std::unique_ptr<Migrator> migrator;
 
   bool did_shutdown_log_cap = false;
 
-  map<ceph_tid_t, find_ino_peer_info_t> find_ino_peer;
+  std::map<ceph_tid_t, find_ino_peer_info_t> find_ino_peer;
   ceph_tid_t find_ino_peer_last_tid = 0;
 
   // delayed cache expire
-  map<CDir*, expiremap> delayed_expire; // subtree root -> expire msg
+  std::map<CDir*, expiremap> delayed_expire; // subtree root -> expire msg
 
   /* Because exports may fail, this set lets us keep track of inodes that need exporting. */
   std::set<CInode *> export_pin_queue;
@@ -1005,7 +1005,7 @@ class MDCache {
   // track leader requests whose peers haven't acknowledged commit
   struct uleader {
     uleader() {}
-    set<mds_rank_t> peers;
+    std::set<mds_rank_t> peers;
     LogSegment *ls = nullptr;
     MDSContext::vec waiters;
     bool safe = false;
@@ -1023,8 +1023,8 @@ class MDCache {
 
   struct open_ino_info_t {
     open_ino_info_t() {}
-    vector<inode_backpointer_t> ancestors;
-    set<mds_rank_t> checked;
+    std::vector<inode_backpointer_t> ancestors;
+    std::set<mds_rank_t> checked;
     mds_rank_t checking = MDS_RANK_NONE;
     mds_rank_t auth_hint = MDS_RANK_NONE;
     bool check_peers = true;
@@ -1071,8 +1071,8 @@ class MDCache {
   CDir* rejoin_invent_dirfrag(dirfrag_t df);
   void handle_cache_rejoin_strong(const cref_t<MMDSCacheRejoin> &m);
   void rejoin_scour_survivor_replicas(mds_rank_t from, const cref_t<MMDSCacheRejoin> &ack,
-                                     set<vinodeno_t>& acked_inodes,
-                                     set<SimpleLock *>& gather_locks);
+                                     std::set<vinodeno_t>& acked_inodes,
+                                     std::set<SimpleLock *>& gather_locks);
   void handle_cache_rejoin_ack(const cref_t<MMDSCacheRejoin> &m);
   void rejoin_send_acks();
   void rejoin_trim_undef_inodes();
@@ -1087,8 +1087,8 @@ class MDCache {
   }
 
   void inode_remove_replica(CInode *in, mds_rank_t rep, bool rejoin,
-                           set<SimpleLock *>& gather_locks);
-  void dentry_remove_replica(CDentry *dn, mds_rank_t rep, set<SimpleLock *>& gather_locks);
+                           std::set<SimpleLock *>& gather_locks);
+  void dentry_remove_replica(CDentry *dn, mds_rank_t rep, std::set<SimpleLock *>& gather_locks);
 
   void rename_file(CDentry *srcdn, CDentry *destdn);
 
@@ -1097,7 +1097,7 @@ class MDCache {
   void _open_ino_traverse_dir(inodeno_t ino, open_ino_info_t& info, int err);
   void _open_ino_fetch_dir(inodeno_t ino, const cref_t<MMDSOpenIno> &m, CDir *dir, bool parent);
   int open_ino_traverse_dir(inodeno_t ino, const cref_t<MMDSOpenIno> &m,
-                           const vector<inode_backpointer_t>& ancestors,
+                           const std::vector<inode_backpointer_t>& ancestors,
                            bool discover, bool want_xlocked, mds_rank_t *hint);
   void open_ino_finish(inodeno_t ino, open_ino_info_t& info, int err);
   void do_open_ino(inodeno_t ino, open_ino_info_t& info, int err);
@@ -1129,7 +1129,7 @@ class MDCache {
   void rdlock_dirfrags_stats_work(MDRequestRef& mdr);
 
   ceph::unordered_map<inodeno_t,CInode*> inode_map;  // map of head inodes by ino
-  map<vinodeno_t, CInode*> snap_inode_map;  // map of snap inodes by ino
+  std::map<vinodeno_t, CInode*> snap_inode_map;  // map of snap inodes by ino
   CInode *root = nullptr; // root inode
   CInode *myin = nullptr; // .ceph/mds%d dir
 
@@ -1138,7 +1138,7 @@ class MDCache {
   int stray_index = 0;
   int stray_fragmenting_index = -1;
 
-  set<CInode*> base_inodes;
+  std::set<CInode*> base_inodes;
 
   std::unique_ptr<PerfCounters> logger;
 
@@ -1146,71 +1146,71 @@ class MDCache {
   std::array<xlist<ClientLease*>, client_lease_pools> client_leases{};
 
   /* subtree keys and each tree's non-recursive nested subtrees (the "bounds") */
-  map<CDir*,set<CDir*> > subtrees;
-  map<CInode*,list<pair<CDir*,CDir*> > > projected_subtree_renames;  // renamed ino -> target dir
+  std::map<CDir*,std::set<CDir*> > subtrees;
+  std::map<CInode*,std::list<std::pair<CDir*,CDir*> > > projected_subtree_renames;  // renamed ino -> target dir
 
   // -- requests --
   ceph::unordered_map<metareqid_t, MDRequestRef> active_requests;
 
   // -- recovery --
-  set<mds_rank_t> recovery_set;
+  std::set<mds_rank_t> recovery_set;
 
   // [resolve]
   // from EImportStart w/o EImportFinish during journal replay
-  map<dirfrag_t, vector<dirfrag_t> > my_ambiguous_imports;
+  std::map<dirfrag_t, std::vector<dirfrag_t> > my_ambiguous_imports;
   // from MMDSResolves
-  map<mds_rank_t, map<dirfrag_t, vector<dirfrag_t> > > other_ambiguous_imports;
+  std::map<mds_rank_t, std::map<dirfrag_t, std::vector<dirfrag_t> > > other_ambiguous_imports;
 
-  map<CInode*, int> uncommitted_peer_rename_olddir;  // peer: preserve the non-auth dir until seeing commit.
-  map<CInode*, int> uncommitted_peer_unlink;  // peer: preserve the unlinked inode until seeing commit.
+  std::map<CInode*, int> uncommitted_peer_rename_olddir;  // peer: preserve the non-auth dir until seeing commit.
+  std::map<CInode*, int> uncommitted_peer_unlink;  // peer: preserve the unlinked inode until seeing commit.
 
-  map<metareqid_t, uleader> uncommitted_leaders;         // leader: req -> peer set
-  map<metareqid_t, upeer> uncommitted_peers;  // peer: preserve the peer req until seeing commit.
+  std::map<metareqid_t, uleader> uncommitted_leaders;         // leader: req -> peer set
+  std::map<metareqid_t, upeer> uncommitted_peers;  // peer: preserve the peer req until seeing commit.
 
-  set<metareqid_t> pending_leaders;
-  map<int, set<metareqid_t> > ambiguous_peer_updates;
+  std::set<metareqid_t> pending_leaders;
+  std::map<int, std::set<metareqid_t> > ambiguous_peer_updates;
 
   bool resolves_pending = false;
-  set<mds_rank_t> resolve_gather;      // nodes i need resolves from
-  set<mds_rank_t> resolve_ack_gather;  // nodes i need a resolve_ack from
-  set<version_t> resolve_snapclient_commits;
-  map<metareqid_t, mds_rank_t> resolve_need_rollback;  // rollbacks i'm writing to the journal
-  map<mds_rank_t, cref_t<MMDSResolve>> delayed_resolve;
+  std::set<mds_rank_t> resolve_gather; // nodes i need resolves from
+  std::set<mds_rank_t> resolve_ack_gather;     // nodes i need a resolve_ack from
+  std::set<version_t> resolve_snapclient_commits;
+  std::map<metareqid_t, mds_rank_t> resolve_need_rollback;  // rollbacks i'm writing to the journal
+  std::map<mds_rank_t, cref_t<MMDSResolve>> delayed_resolve;
 
   // [rejoin]
   bool rejoins_pending = false;
-  set<mds_rank_t> rejoin_gather;      // nodes from whom i need a rejoin
-  set<mds_rank_t> rejoin_sent;        // nodes i sent a rejoin to
-  set<mds_rank_t> rejoin_ack_sent;    // nodes i sent a rejoin to
-  set<mds_rank_t> rejoin_ack_gather;  // nodes from whom i need a rejoin ack
-  map<mds_rank_t,map<inodeno_t,map<client_t,Capability::Import> > > rejoin_imported_caps;
-  map<inodeno_t,pair<mds_rank_t,map<client_t,Capability::Export> > > rejoin_peer_exports;
-
-  map<client_t,entity_inst_t> rejoin_client_map;
-  map<client_t,client_metadata_t> rejoin_client_metadata_map;
-  map<client_t,pair<Session*,uint64_t> > rejoin_session_map;
-
-  map<inodeno_t,pair<mds_rank_t,map<client_t,cap_reconnect_t> > > cap_exports; // ino -> target, client -> capex
-
-  map<inodeno_t,map<client_t,map<mds_rank_t,cap_reconnect_t> > > cap_imports;  // ino -> client -> frommds -> capex
-  set<inodeno_t> cap_imports_missing;
-  map<inodeno_t, MDSContext::vec > cap_reconnect_waiters;
+  std::set<mds_rank_t> rejoin_gather;      // nodes from whom i need a rejoin
+  std::set<mds_rank_t> rejoin_sent;        // nodes i sent a rejoin to
+  std::set<mds_rank_t> rejoin_ack_sent;    // nodes i sent a rejoin to
+  std::set<mds_rank_t> rejoin_ack_gather;  // nodes from whom i need a rejoin ack
+  std::map<mds_rank_t,std::map<inodeno_t,std::map<client_t,Capability::Import> > > rejoin_imported_caps;
+  std::map<inodeno_t,std::pair<mds_rank_t,std::map<client_t,Capability::Export> > > rejoin_peer_exports;
+
+  std::map<client_t,entity_inst_t> rejoin_client_map;
+  std::map<client_t,client_metadata_t> rejoin_client_metadata_map;
+  std::map<client_t,std::pair<Session*,uint64_t> > rejoin_session_map;
+
+  std::map<inodeno_t,std::pair<mds_rank_t,std::map<client_t,cap_reconnect_t> > > cap_exports; // ino -> target, client -> capex
+
+  std::map<inodeno_t,std::map<client_t,std::map<mds_rank_t,cap_reconnect_t> > > cap_imports;  // ino -> client -> frommds -> capex
+  std::set<inodeno_t> cap_imports_missing;
+  std::map<inodeno_t, MDSContext::vec > cap_reconnect_waiters;
   int cap_imports_num_opening = 0;
 
-  set<CInode*> rejoin_undef_inodes;
-  set<CInode*> rejoin_potential_updated_scatterlocks;
-  set<CDir*>   rejoin_undef_dirfrags;
-  map<mds_rank_t, set<CInode*> > rejoin_unlinked_inodes;
+  std::set<CInode*> rejoin_undef_inodes;
+  std::set<CInode*> rejoin_potential_updated_scatterlocks;
+  std::set<CDir*>   rejoin_undef_dirfrags;
+  std::map<mds_rank_t, std::set<CInode*> > rejoin_unlinked_inodes;
 
-  vector<CInode*> rejoin_recover_q, rejoin_check_q;
-  list<SimpleLock*> rejoin_eval_locks;
+  std::vector<CInode*> rejoin_recover_q, rejoin_check_q;
+  std::list<SimpleLock*> rejoin_eval_locks;
   MDSContext::vec rejoin_waiters;
 
   std::unique_ptr<MDSContext> rejoin_done;
   std::unique_ptr<MDSContext> resolve_done;
 
   ceph_tid_t open_ino_last_tid = 0;
-  map<inodeno_t,open_ino_info_t> opening_inodes;
+  std::map<inodeno_t,open_ino_info_t> opening_inodes;
 
   StrayManager stray_manager;
 
@@ -1234,7 +1234,7 @@ class MDCache {
     std::vector<CDir*> dirs;
     std::vector<CDir*> resultfrags;
     MDRequestRef mdr;
-    set<mds_rank_t> notify_ack_waiting;
+    std::set<mds_rank_t> notify_ack_waiting;
     bool finishing = false;
 
     // for deadlock detection
@@ -1244,7 +1244,7 @@ class MDCache {
     int num_remote_waiters = 0;        // number of remote authpin waiters
   };
 
-  typedef map<dirfrag_t,fragment_info_t>::iterator fragment_info_iterator;
+  typedef std::map<dirfrag_t,fragment_info_t>::iterator fragment_info_iterator;
 
   friend class EFragment;
   friend class C_MDC_FragmentFrozen;
@@ -1281,7 +1281,7 @@ class MDCache {
                            MDSContext::vec& waiters,
                            bool replay);
   CDir *force_dir_fragment(CInode *diri, frag_t fg, bool replay=true);
-  void get_force_dirfrag_bound_set(const vector<dirfrag_t>& dfs, set<CDir*>& bounds);
+  void get_force_dirfrag_bound_set(const std::vector<dirfrag_t>& dfs, std::set<CDir*>& bounds);
 
   bool can_fragment(CInode *diri, const std::vector<CDir*>& dirs);
   void fragment_freeze_dirs(const std::vector<CDir*>& dirs);
@@ -1319,8 +1319,8 @@ class MDCache {
   RecoveryQueue recovery_queue;
 
   // shutdown
-  set<inodeno_t> shutdown_exporting_strays;
-  pair<dirfrag_t, string> shutdown_export_next;
+  std::set<inodeno_t> shutdown_exporting_strays;
+  std::pair<dirfrag_t, std::string> shutdown_export_next;
 
   bool opening_root = false, open = false;
   MDSContext::vec waiting_for_open;
@@ -1328,9 +1328,9 @@ class MDCache {
   // -- snaprealms --
   SnapRealm *global_snaprealm = nullptr;
 
-  map<dirfrag_t, ufragment> uncommitted_fragments;
+  std::map<dirfrag_t, ufragment> uncommitted_fragments;
 
-  map<dirfrag_t,fragment_info_t> fragments;
+  std::map<dirfrag_t,fragment_info_t> fragments;
 
   DecayCounter trim_counter;
 
index 090b315674b87efd20226af59df62d4b4975abbf..d9c26d37672db8be06d6433dc8b3ea21dfcb08ff 100644 (file)
@@ -36,6 +36,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << mds->get_nodeid() << ".log "
 
+using namespace std;
+
 // cons/des
 MDLog::~MDLog()
 {
index bb91c39e2cd717919b3d35b43a74b654058ac06d..b6b0be60f9d57a31f1cd564577b8aac8f221bb19 100644 (file)
@@ -173,7 +173,7 @@ public:
 
   MDSRank *mds;
   // replay state
-  std::map<inodeno_t, set<inodeno_t>> pending_exports;
+  std::map<inodeno_t, std::set<inodeno_t>> pending_exports;
 
 protected:
   struct PendingEvent {
@@ -276,15 +276,15 @@ protected:
 
   // -- segments --
   std::map<uint64_t,LogSegment*> segments;
-  set<LogSegment*> expiring_segments;
-  set<LogSegment*> expired_segments;
+  std::set<LogSegment*> expiring_segments;
+  std::set<LogSegment*> expired_segments;
   std::size_t pre_segments_size = 0;            // the num of segments when the mds finished replay-journal, to calc the num of segments growing
   uint64_t event_seq = 0;
   int expiring_events = 0;
   int expired_events = 0;
 
   int64_t mdsmap_up_features = 0;
-  std::map<uint64_t,list<PendingEvent> > pending_events; // log segment -> event list
+  std::map<uint64_t,std::list<PendingEvent> > pending_events; // log segment -> event list
   ceph::mutex submit_mutex = ceph::make_mutex("MDLog::submit_mutex");
   ceph::condition_variable submit_cond;
 
index f5c967736917fa9a3460f7e573f29e5303b6d3c0..4147eec4f03d1614ba2041c3b88d0810d5c5db3a 100644 (file)
 #define dout_subsys ceph_subsys_mds
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << name << ' '
+
+using std::string;
+using std::vector;
 using TOPNSPC::common::cmd_getval;
+
 // cons/des
 MDSDaemon::MDSDaemon(std::string_view n, Messenger *m, MonClient *mc,
                     boost::asio::io_context& ioctx) :
index d92658934bd85227c525a75dafcd8d25f5871dca..b0491f61caf70248749bbd4479d1ff0f35681099 100644 (file)
@@ -50,9 +50,9 @@ class MDSDaemon : public Dispatcher {
   mono_time get_starttime() const {
     return starttime;
   }
-  chrono::duration<double> get_uptime() const {
+  std::chrono::duration<double> get_uptime() const {
     mono_time now = mono_clock::now();
-    return chrono::duration<double>(now-starttime);
+    return std::chrono::duration<double>(now-starttime);
   }
 
   // handle a signal (e.g., SIGTERM)
index 724d6d37f0bac02594bec073127ef7610b9419cc..956dff2d9303dd651a26a8c357aaabb390829a64 100644 (file)
@@ -27,8 +27,9 @@ using std::map;
 using std::multimap;
 using std::ostream;
 using std::pair;
-using std::string;
 using std::set;
+using std::string;
+using std::vector;
 
 using ceph::bufferlist;
 using ceph::Formatter;
index dfbabb044702af74e723a4591c783c789066dccd..2b40cfb338950d219b82603954ac6c8c041542b5 100644 (file)
 #define dout_subsys ceph_subsys_mds
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << whoami << '.' << incarnation << ' '
+
+using std::ostream;
+using std::set;
+using std::string;
+using std::vector;
 using TOPNSPC::common::cmd_getval;
+
 class C_Flush_Journal : public MDSInternalContext {
 public:
   C_Flush_Journal(MDCache *mdcache, MDLog *mdlog, MDSRank *mds,
index a67f6f1c6b97a54fa70e075c72db7fcaf14341b2..acdf11ee4c0484359a66121cfc482e2b9da23323 100644 (file)
@@ -185,9 +185,9 @@ class MDSRank {
     mono_time get_starttime() const {
       return starttime;
     }
-    chrono::duration<double> get_uptime() const {
+    std::chrono::duration<double> get_uptime() const {
       mono_time now = mono_clock::now();
-      return chrono::duration<double>(now-starttime);
+      return std::chrono::duration<double>(now-starttime);
     }
 
     bool is_daemon_stopping() const;
@@ -354,7 +354,7 @@ class MDSRank {
 
     void hit_export_target(mds_rank_t rank, double amount=-1.0);
     bool is_export_target(mds_rank_t rank) {
-      const set<mds_rank_t>& map_targets = mdsmap->get_mds_info(get_nodeid()).export_targets;
+      const std::set<mds_rank_t>& map_targets = mdsmap->get_mds_info(get_nodeid()).export_targets;
       return map_targets.count(rank);
     }
 
@@ -466,7 +466,7 @@ class MDSRank {
     void dump_clientreplay_status(Formatter *f) const;
     void command_scrub_start(Formatter *f,
                              std::string_view path, std::string_view tag,
-                             const vector<string>& scrubop_vec, Context *on_finish);
+                             const std::vector<std::string>& scrubop_vec, Context *on_finish);
     void command_tag_path(Formatter *f, std::string_view path,
                           std::string_view tag);
     // scrub control commands
@@ -559,7 +559,7 @@ class MDSRank {
     MetricsHandler metrics_handler;
     std::unique_ptr<MetricAggregator> metric_aggregator;
 
-    list<cref_t<Message>> waiting_for_nolaggy;
+    std::list<cref_t<Message>> waiting_for_nolaggy;
     MDSContext::que finished_queue;
     // Dispatch, retry, queues
     int dispatch_depth = 0;
@@ -567,7 +567,7 @@ class MDSRank {
     ceph::heartbeat_handle_d *hb = nullptr;  // Heartbeat for threads using mds_lock
     double heartbeat_grace;
 
-    map<mds_rank_t, version_t> peer_mdsmap_epoch;
+    std::map<mds_rank_t, version_t> peer_mdsmap_epoch;
 
     ceph_tid_t last_tid = 0;    // for mds-initiated requests (e.g. stray rename)
 
@@ -577,8 +577,8 @@ class MDSRank {
     MDSContext::que replay_queue;
     bool replaying_requests_done = false;
 
-    map<mds_rank_t, MDSContext::vec > waiting_for_active_peer;
-    map<epoch_t, MDSContext::vec > waiting_for_mdsmap;
+    std::map<mds_rank_t, MDSContext::vec > waiting_for_active_peer;
+    std::map<epoch_t, MDSContext::vec > waiting_for_mdsmap;
 
     epoch_t osd_epoch_barrier = 0;
 
@@ -588,7 +588,7 @@ class MDSRank {
 
     int mds_slow_req_count = 0;
 
-    map<mds_rank_t,DecayCounter> export_targets; /* targets this MDS is exporting to or wants/tries to */
+    std::map<mds_rank_t,DecayCounter> export_targets; /* targets this MDS is exporting to or wants/tries to */
 
     Messenger *messenger;
     MonClient *monc;
index 679633f0c7893b8c8d2f59d3cb78413a132719c9..80b84b8697156d00161a7f7f6108c8e4fc03a379 100644 (file)
@@ -33,6 +33,7 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << rank << "." << table_name << ": "
 
+using namespace std;
 
 class MDSTableIOContext : public MDSIOContextBase
 {
index 07e12f574e3ad091092236b28bfe084c52171fed..daa745ce8dfbca61e7255c9994cb5bee78b04ba9 100644 (file)
@@ -86,6 +86,6 @@ protected:
 
   version_t version = 0, committing_version = 0, committed_version = 0, projected_version = 0;
 
-  map<version_t, MDSContext::vec > waitfor_save;
+  std::map<version_t, MDSContext::vec > waitfor_save;
 };
 #endif
index 38f2122180dd29bcb4216538e7748627a6ae8d42..9ded20bb8a86a017dd9d741aeb96437e0137d837 100644 (file)
@@ -226,9 +226,7 @@ void MDSTableClient::got_journaled_ack(version_t tid)
 
 void MDSTableClient::resend_commits()
 {
-  for (map<version_t,LogSegment*>::iterator p = pending_commit.begin();
-       p != pending_commit.end();
-       ++p) {
+  for (auto p = pending_commit.begin(); p != pending_commit.end(); ++p) {
     dout(10) << "resending commit on " << p->first << dendl;
     auto req = make_message<MMDSTableRequest>(table, TABLESERVER_OP_COMMIT, 0, p->first);
     mds->send_message_mds(req, mds->get_mds_map()->get_tableserver());
@@ -242,9 +240,7 @@ void MDSTableClient::resend_prepares()
     waiting_for_reqid.pop_front();
   }
 
-  for (map<uint64_t, _pending_prepare>::iterator p = pending_prepare.begin();
-       p != pending_prepare.end();
-       ++p) {
+  for (auto p = pending_prepare.begin(); p != pending_prepare.end(); ++p) {
     dout(10) << "resending prepare on " << p->first << dendl;
     auto req = make_message<MMDSTableRequest>(table, TABLESERVER_OP_PREPARE, p->first);
     req->bl = p->second.mutation;
index 2952ec4069d20d72c285926d5796e04e553315bb..7d57f9d85b5309abcb98ab76bb50f9c4979a15a8 100644 (file)
@@ -49,8 +49,8 @@ public:
     ack_waiters[tid].push_back(c);
   }
 
-  set<version_t> get_journaled_tids() const {
-    set<version_t> tids;
+  std::set<version_t> get_journaled_tids() const {
+    std::set<version_t> tids;
     for (auto p : pending_commit)
       tids.insert(p.first);
     return tids;
@@ -88,12 +88,12 @@ protected:
 
   bool server_ready = false;
 
-  map<uint64_t, _pending_prepare> pending_prepare;
-  map<version_t, uint64_t> prepared_update;
-  list<_pending_prepare> waiting_for_reqid;
+  std::map<uint64_t, _pending_prepare> pending_prepare;
+  std::map<version_t, uint64_t> prepared_update;
+  std::list<_pending_prepare> waiting_for_reqid;
 
   // pending commits
-  map<version_t, LogSegment*> pending_commit;
-  map<version_t, MDSContext::vec > ack_waiters;
+  std::map<version_t, LogSegment*> pending_commit;
+  std::map<version_t, MDSContext::vec > ack_waiters;
 };
 #endif
index 3666e0db9e4b86fa74541296c2e9dcdf7d4a17c4..6e542b4e396560091342fc64cb48689ab55636b8 100644 (file)
@@ -24,6 +24,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << rank << ".tableserver(" << get_mdstable_name(table) << ") "
 
+using namespace std;
+
 void MDSTableServer::handle_request(const cref_t<MMDSTableRequest> &req)
 {
   ceph_assert(req->op >= 0);
index 84dc5b87d243f6ce8a720338af51bdfa7f844a77..74800db974ca5900d4fc6e78d0fc3ab167c65eb7 100644 (file)
@@ -83,7 +83,7 @@ public:
   }
 
   // recovery
-  void finish_recovery(set<mds_rank_t>& active);
+  void finish_recovery(std::set<mds_rank_t>& active);
   void _do_server_recovery();
 
   void handle_mds_recovery(mds_rank_t who);
@@ -91,11 +91,11 @@ public:
 protected:
   int table;
   bool recovered = false;
-  set<mds_rank_t> active_clients;
+  std::set<mds_rank_t> active_clients;
 private:
   struct notify_info_t {
     notify_info_t() {}
-    set<mds_rank_t> notify_ack_gather;
+    std::set<mds_rank_t> notify_ack_gather;
     mds_rank_t mds;
     ref_t<MMDSTableRequest> reply = NULL;
     MDSContext *onfinish = nullptr;
@@ -119,9 +119,9 @@ private:
 
   void handle_notify_ack(const cref_t<MMDSTableRequest> &m);
 
-  map<version_t,mds_table_pending_t> pending_for_mds;  // ** child should encode this! **
-  set<version_t> committing_tids;
+  std::map<version_t,mds_table_pending_t> pending_for_mds;  // ** child should encode this! **
+  std::set<version_t> committing_tids;
 
-  map<version_t, notify_info_t> pending_notifies;
+  std::map<version_t, notify_info_t> pending_notifies;
 };
 #endif
index 13bd2652aab2a947e0d1c5c00bb9095c97b0ee17..ce5e4dbd90e2378cf52f125a0e004048e544d584 100644 (file)
@@ -66,6 +66,7 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << mds->get_nodeid() << ".mig " << __func__ << " "
 
+using namespace std;
 
 class MigratorContext : public MDSContext {
 protected:
index f7c094294ae1d5bdbf939a08367b49c30488f989..be24e311100064225c02974aec5d67dee65f735d 100644 (file)
@@ -197,7 +197,7 @@ public:
   }
   
   void maybe_split_export(CDir* dir, uint64_t max_size, bool null_okay,
-                         vector<pair<CDir*, size_t> >& results);
+                         std::vector<std::pair<CDir*, size_t> >& results);
 
   bool export_try_grab_locks(CDir *dir, MutationRef& mut);
   void get_export_client_set(CDir *dir, std::set<client_t> &client_set);
@@ -236,7 +236,7 @@ public:
   void decode_import_inode_caps(CInode *in, bool auth_cap, bufferlist::const_iterator &blp,
                                std::map<CInode*, std::map<client_t,Capability::Export> >& cap_imports);
   void finish_import_inode_caps(CInode *in, mds_rank_t from, bool auth_cap,
-                               const std::map<client_t,pair<Session*,uint64_t> >& smap,
+                               const std::map<client_t,std::pair<Session*,uint64_t> >& smap,
                                const std::map<client_t,Capability::Export> &export_map,
                                std::map<client_t,Capability::Import> &import_map);
   void decode_import_dir(bufferlist::const_iterator& blp,
@@ -290,12 +290,12 @@ protected:
     std::set<mds_rank_t> bystanders;
     std::list<dirfrag_t> bound_ls;
     std::list<ScatterLock*> updated_scatterlocks;
-    std::map<client_t,pair<Session*,uint64_t> > session_map;
+    std::map<client_t,std::pair<Session*,uint64_t> > session_map;
     std::map<CInode*, std::map<client_t,Capability::Export> > peer_exports;
     MutationRef mut;
   };
 
-  typedef map<CDir*, export_state_t>::iterator export_state_iterator;
+  typedef std::map<CDir*, export_state_t>::iterator export_state_iterator;
 
   friend class C_MDC_ExportFreeze;
   friend class C_MDS_ExportFinishLogged;
@@ -325,7 +325,7 @@ protected:
   void export_finish(CDir *dir);
   void child_export_finish(std::shared_ptr<export_base_t>& parent, bool success);
   void encode_export_prep_trace(bufferlist& bl, CDir *bound, CDir *dir, export_state_t &es,
-                               set<inodeno_t> &inodes_added, set<dirfrag_t> &dirfrags_added);
+                               std::set<inodeno_t> &inodes_added, std::set<dirfrag_t> &dirfrags_added);
   void decode_export_prep_trace(bufferlist::const_iterator& blp, mds_rank_t oldauth, MDSContext::vec &finished);
 
   void handle_gather_caps(const cref_t<MGatherCaps> &m);
@@ -345,14 +345,14 @@ protected:
   void import_notify_abort(CDir *dir, std::set<CDir*>& bounds);
   void import_notify_finish(CDir *dir, std::set<CDir*>& bounds);
   void import_logged_start(dirfrag_t df, CDir *dir, mds_rank_t from,
-                          std::map<client_t,pair<Session*,uint64_t> >& imported_session_map);
+                          std::map<client_t,std::pair<Session*,uint64_t> >& imported_session_map);
   void handle_export_finish(const cref_t<MExportDirFinish> &m);
 
   void handle_export_caps(const cref_t<MExportCaps> &m);
   void handle_export_caps_ack(const cref_t<MExportCapsAck> &m);
   void logged_import_caps(CInode *in,
                          mds_rank_t from,
-                         std::map<client_t,pair<Session*,uint64_t> >& imported_session_map,
+                         std::map<client_t,std::pair<Session*,uint64_t> >& imported_session_map,
                          std::map<CInode*, std::map<client_t,Capability::Export> >& cap_imports);
 
   // bystander
@@ -363,7 +363,7 @@ protected:
   uint64_t total_exporting_size = 0;
   unsigned num_locking_exports = 0; // exports in locking state (approx_size == 0)
 
-  std::list<pair<dirfrag_t,mds_rank_t> >  export_queue;
+  std::list<std::pair<dirfrag_t,mds_rank_t> >  export_queue;
   uint64_t export_queue_gen = 1;
 
   std::map<dirfrag_t, import_state_t>  import_state;
index 7e3fb22bd20e56cac7710ef40c88873df1b302ba..39eee47217baefdd57f6333fca9ced9b10ee6e84 100644 (file)
@@ -17,6 +17,8 @@
 #include "CInode.h"
 #include "CDir.h"
 
+using namespace std;
+
 // MutationImpl
 
 void MutationImpl::pin(MDSCacheObject *o)
index d3b0a33bbb56762f57a1dea65d5e668f761ee9d3..a438ee1ddcaad17cc4645087a9730e5ba8a9c9b3 100644 (file)
@@ -36,7 +36,10 @@ enum {
 #define dout_subsys ceph_subsys_mds
 #undef dout_prefix
 #define dout_prefix _prefix(_dout, mds)
-static ostream& _prefix(std::ostream *_dout, MDSRank *mds) {
+
+using namespace std;
+
+static std::ostream& _prefix(std::ostream *_dout, MDSRank *mds) {
   return *_dout << "mds." << mds->get_nodeid() << ".openfiles ";
 }
 
index 058055575e4854508dd20f3642cec837de78251c..d3934f753b4fefa8097f1f172e8c51de3d8f4c26 100644 (file)
@@ -24,6 +24,8 @@ class CDir;
 class CInode;
 class MDSRank;
 
+struct ObjectOperation;
+
 class OpenFileTable
 {
 public:
@@ -59,7 +61,7 @@ public:
 
   bool should_log_open(CInode *in);
 
-  void note_destroyed_inos(uint64_t seq, const vector<inodeno_t>& inos);
+  void note_destroyed_inos(uint64_t seq, const std::vector<inodeno_t>& inos);
   void trim_destroyed_inos(uint64_t seq);
 
 protected:
@@ -105,7 +107,7 @@ protected:
   void _prefetch_dirfrags();
 
   void _get_ancestors(const Anchor& parent,
-                     vector<inode_backpointer_t>& ancestors,
+                     std::vector<inode_backpointer_t>& ancestors,
                      mds_rank_t& auth_hint);
 
   MDSRank *mds;
@@ -115,7 +117,7 @@ protected:
   unsigned omap_num_objs = 0;
   std::vector<unsigned> omap_num_items;
 
-  map<inodeno_t, OpenedAnchor> anchor_map;
+  std::map<inodeno_t, OpenedAnchor> anchor_map;
 
   std::map<inodeno_t, int> dirty_items; // ino -> dirty state
 
@@ -130,7 +132,7 @@ protected:
   int journal_state = 0;
 
   std::vector<std::map<std::string, bufferlist> > loaded_journals;
-  map<inodeno_t, RecoveredAnchor> loaded_anchor_map;
+  std::map<inodeno_t, RecoveredAnchor> loaded_anchor_map;
   MDSContext::vec waiting_for_load;
   bool load_done = false;
 
@@ -144,7 +146,7 @@ protected:
   unsigned num_opening_inodes = 0;
   MDSContext::vec waiting_for_prefetch;
 
-  std::map<uint64_t, vector<inodeno_t> > logseg_destroyed_inos;
+  std::map<uint64_t, std::vector<inodeno_t> > logseg_destroyed_inos;
   std::set<inodeno_t> destroyed_inos_set;
 
   std::unique_ptr<PerfCounters> logger;
index 56c962d19ba83bc1032b144d0dfc9a99428262c2..cb6c389dd431a7e69dc002f3ea475bcc14ec801e 100644 (file)
@@ -23,6 +23,9 @@
 #define dout_subsys ceph_subsys_mds
 #undef dout_prefix
 #define dout_prefix _prefix(_dout, rank) << __func__ << ": "
+
+using namespace std;
+
 static ostream& _prefix(std::ostream *_dout, mds_rank_t rank) {
   return *_dout << "mds." << rank << ".purge_queue ";
 }
index 6d215ccdbbefc6d7d1d5dbb34a7e219e38ba5325..111b270658d1f5131deb00e750c731c917213df6 100644 (file)
@@ -25,6 +25,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << mds->get_nodeid() << " RecoveryQueue::" << __func__ << " "
 
+using namespace std;
+
 class C_MDC_Recover : public MDSIOContextBase {
 public:
   C_MDC_Recover(RecoveryQueue *rq_, CInode *i) :
index 84441fcf6620350c1fef7329e7dd79d672ffba62..f709ecbe271565b47b179e8ca655c309c0bdd099 100644 (file)
 #define dout_subsys ceph_subsys_mds
 #undef dout_prefix
 #define dout_prefix _prefix(_dout, mdcache->mds)
-static ostream& _prefix(std::ostream *_dout, MDSRank *mds) {
+
+using namespace std;
+
+static std::ostream& _prefix(std::ostream *_dout, MDSRank *mds) {
   return *_dout << "mds." << mds->get_nodeid() << ".scrubstack ";
 }
 
index 98b7bb6cc70ca2327162a3d7af11b75f80dbb9df..d40831cd52faa07efb7f2ab8f8d221b385df29b9 100644 (file)
@@ -65,6 +65,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << mds->get_nodeid() << ".server "
 
+using namespace std;
+
 class ServerContext : public MDSContext {
   protected:
   Server *server;
index 7297fd56b62313a8907844df9dd39b1253ddfa54..ec1eddf144a00a2e9f68ebbe5342ee900e6d3a2c 100644 (file)
@@ -121,12 +121,12 @@ public:
   void _session_logged(Session *session, uint64_t state_seq, bool open, version_t pv,
                       const interval_set<inodeno_t>& inos_to_free, version_t piv,
                       const interval_set<inodeno_t>& inos_to_purge, LogSegment *ls);
-  version_t prepare_force_open_sessions(map<client_t,entity_inst_t> &cm,
-                                       map<client_t,client_metadata_t>& cmm,
-                                       map<client_t,pair<Session*,uint64_t> >& smap);
-  void finish_force_open_sessions(const map<client_t,pair<Session*,uint64_t> >& smap,
+  version_t prepare_force_open_sessions(std::map<client_t,entity_inst_t> &cm,
+                                       std::map<client_t,client_metadata_t>& cmm,
+                                       std::map<client_t,std::pair<Session*,uint64_t> >& smap);
+  void finish_force_open_sessions(const std::map<client_t,std::pair<Session*,uint64_t> >& smap,
                                  bool dec_import=true);
-  void flush_client_sessions(set<client_t>& client_set, MDSGatherBuilder& gather);
+  void flush_client_sessions(std::set<client_t>& client_set, MDSGatherBuilder& gather);
   void finish_flush_session(Session *session, version_t seq);
   void terminate_sessions();
   void find_idle_sessions();
@@ -210,13 +210,13 @@ public:
   void handle_client_setlayout(MDRequestRef& mdr);
   void handle_client_setdirlayout(MDRequestRef& mdr);
 
-  int parse_quota_vxattr(string name, string value, quota_info_t *quota);
+  int parse_quota_vxattr(std::string name, std::string value, quota_info_t *quota);
   void create_quota_realm(CInode *in);
-  int parse_layout_vxattr(string name, string value, const OSDMap& osdmap,
+  int parse_layout_vxattr(std::string name, std::string value, const OSDMap& osdmap,
                          file_layout_t *layout, bool validate=true);
   int check_layout_vxattr(MDRequestRef& mdr,
-                          string name,
-                          string value,
+                          std::string name,
+                          std::string value,
                           file_layout_t *layout);
   void handle_set_vxattr(MDRequestRef& mdr, CInode *cur);
   void handle_remove_vxattr(MDRequestRef& mdr, CInode *cur);
@@ -252,7 +252,7 @@ public:
   void handle_peer_link_prep_ack(MDRequestRef& mdr, const cref_t<MMDSPeerRequest> &m);
   void do_link_rollback(bufferlist &rbl, mds_rank_t leader, MDRequestRef& mdr);
   void _link_rollback_finish(MutationRef& mut, MDRequestRef& mdr,
-                            map<client_t,ref_t<MClientSnap>>& split);
+                            std::map<client_t,ref_t<MClientSnap>>& split);
 
   // unlink
   void handle_client_unlink(MDRequestRef& mdr);
@@ -262,7 +262,7 @@ public:
   void _unlink_local_finish(MDRequestRef& mdr,
                            CDentry *dn, CDentry *straydn,
                            version_t);
-  bool _rmdir_prepare_witness(MDRequestRef& mdr, mds_rank_t who, vector<CDentry*>& trace, CDentry *straydn);
+  bool _rmdir_prepare_witness(MDRequestRef& mdr, mds_rank_t who, std::vector<CDentry*>& trace, CDentry *straydn);
   void handle_peer_rmdir_prep(MDRequestRef& mdr);
   void _logged_peer_rmdir(MDRequestRef& mdr, CDentry *srcdn, CDentry *straydn);
   void _commit_peer_rmdir(MDRequestRef& mdr, int r, CDentry *straydn);
@@ -284,8 +284,8 @@ public:
   void _renamesnap_finish(MDRequestRef& mdr, CInode *diri, snapid_t snapid);
 
   // helpers
-  bool _rename_prepare_witness(MDRequestRef& mdr, mds_rank_t who, set<mds_rank_t> &witnesse,
-                              vector<CDentry*>& srctrace, vector<CDentry*>& dsttrace, CDentry *straydn);
+  bool _rename_prepare_witness(MDRequestRef& mdr, mds_rank_t who, std::set<mds_rank_t> &witnesse,
+                              std::vector<CDentry*>& srctrace, std::vector<CDentry*>& dsttrace, CDentry *straydn);
   version_t _rename_prepare_import(MDRequestRef& mdr, CDentry *srcdn, bufferlist *client_map_bl);
   bool _need_force_journal(CInode *diri, bool empty);
   void _rename_prepare(MDRequestRef& mdr,
@@ -306,7 +306,7 @@ public:
   void _commit_peer_rename(MDRequestRef& mdr, int r, CDentry *srcdn, CDentry *destdn, CDentry *straydn);
   void do_rename_rollback(bufferlist &rbl, mds_rank_t leader, MDRequestRef& mdr, bool finish_mdr=false);
   void _rename_rollback_finish(MutationRef& mut, MDRequestRef& mdr, CDentry *srcdn, version_t srcdnpv,
-                              CDentry *destdn, CDentry *staydn, map<client_t,ref_t<MClientSnap>> splits[2],
+                              CDentry *destdn, CDentry *staydn, std::map<client_t,ref_t<MClientSnap>> splits[2],
                               bool finish_mdr);
 
   void evict_cap_revoke_non_responders();
@@ -314,7 +314,7 @@ public:
 
   bool terminating_sessions = false;
 
-  set<client_t> client_reclaim_gather;
+  std::set<client_t> client_reclaim_gather;
 
 private:
   friend class MDSContinuation;
@@ -414,10 +414,10 @@ private:
     return xattr_name.rfind("ceph.dir.layout", 0) == 0 ||
            xattr_name.rfind("ceph.file.layout", 0) == 0 ||
            xattr_name.rfind("ceph.quota", 0) == 0 ||
-           xattr_name == "ceph.dir.subvolume"sv ||
-           xattr_name == "ceph.dir.pin"sv ||
-           xattr_name == "ceph.dir.pin.random"sv ||
-           xattr_name == "ceph.dir.pin.distributed"sv;
+           xattr_name == "ceph.dir.subvolume" ||
+           xattr_name == "ceph.dir.pin" ||
+           xattr_name == "ceph.dir.pin.random" ||
+           xattr_name == "ceph.dir.pin.distributed";
   }
 
   static bool is_allowed_ceph_xattr(std::string_view xattr_name) {
@@ -448,8 +448,8 @@ private:
                             // before proceeding to reconnect_gather_finish
   time reconnect_start = clock::zero();
   time reconnect_last_seen = clock::zero();
-  set<client_t> client_reconnect_gather;  // clients i need a reconnect msg from.
-  set<client_t> client_reconnect_denied;  // clients whose reconnect msg have been denied .
+  std::set<client_t> client_reconnect_gather;  // clients i need a reconnect msg from.
+  std::set<client_t> client_reconnect_denied;  // clients whose reconnect msg have been denied .
 
   feature_bitset_t supported_features;
   feature_bitset_t required_client_features;
index b96fc37d60784f6843ad6a5f31ce50a350d550d1..2364c973e679370d0d8824a7ec6d5008b40d1a4b 100644 (file)
@@ -30,6 +30,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << rank << ".sessionmap "
 
+using namespace std;
+
 namespace {
 class SessionMapIOContext : public MDSIOContextBase
 {
index 9f83ed79e900bfaadd622434219a084af3c3d60f..93abb4afaedd791d686e09e5e67a2195aff6b4ab 100644 (file)
@@ -26,6 +26,8 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << mds->get_nodeid() << ".snapclient "
 
+using namespace std;
+
 void SnapClient::resend_queries()
 {
   if (!waiting_for_version.empty() || (!synced && sync_reqid > 0)) {
index e259f7924932d0beab636dd75e4b6f4ced5287a6..92a1136d342d2281d441c6c086fd3134729b6f6d 100644 (file)
@@ -88,23 +88,23 @@ public:
   snapid_t get_last_created() const { return cached_last_created; }
   snapid_t get_last_destroyed() const { return cached_last_destroyed; }
 
-  void get_snaps(set<snapid_t>& snaps) const;
-  set<snapid_t> filter(const set<snapid_t>& snaps) const;
+  void get_snaps(std::set<snapid_t>& snaps) const;
+  std::set<snapid_t> filter(const std::set<snapid_t>& snaps) const;
   const SnapInfo* get_snap_info(snapid_t snapid) const;
-  void get_snap_infos(map<snapid_t, const SnapInfo*>& infomap, const set<snapid_t>& snaps) const;
+  void get_snap_infos(std::map<snapid_t, const SnapInfo*>& infomap, const std::set<snapid_t>& snaps) const;
 
   int dump_cache(Formatter *f) const;
 
 private:
   version_t cached_version = 0;
   snapid_t cached_last_created = 0, cached_last_destroyed = 0;
-  map<snapid_t, SnapInfo> cached_snaps;
-  map<version_t, SnapInfo> cached_pending_update;
-  map<version_t, pair<snapid_t,snapid_t> > cached_pending_destroy;
+  std::map<snapid_t, SnapInfo> cached_snaps;
+  std::map<version_t, SnapInfo> cached_pending_update;
+  std::map<version_t, std::pair<snapid_t,snapid_t> > cached_pending_destroy;
 
-  set<version_t> committing_tids;
+  std::set<version_t> committing_tids;
 
-  map<version_t, MDSContext::vec > waiting_for_version;
+  std::map<version_t, MDSContext::vec > waiting_for_version;
 
   uint64_t sync_reqid = 0;
   bool synced = false;
index 09ddd9181edb65ebea9d8ac18e4d6571d7f0c376..3eb8976adf561256b887f192213306ff4e9d634b 100644 (file)
 #define dout_subsys ceph_subsys_mds
 #undef dout_prefix
 #define dout_prefix _prefix(_dout, mdcache->mds->get_nodeid(), inode, srnode.seq, this)
-static ostream& _prefix(std::ostream *_dout, int whoami, const CInode *inode,
-                       uint64_t seq, const SnapRealm *realm) {
+
+using namespace std;
+
+static std::ostream& _prefix(std::ostream *_dout, int whoami, const CInode *inode,
+                            uint64_t seq, const SnapRealm *realm) {
   return *_dout << " mds." << whoami
                << ".cache.snaprealm(" << inode->ino()
                << " seq " << seq << " " << realm << ") ";
index f1648003585d689ac984dacc41bd746743114b99..08e27339f95dbe773676a1eecb426ae0aabaae3e 100644 (file)
@@ -32,6 +32,7 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << rank << ".snap "
 
+using namespace std;
 
 void SnapServer::reset_state()
 {
@@ -109,7 +110,7 @@ void SnapServer::_prepare(const bufferlist& bl, uint64_t reqid, mds_rank_t bymds
       // bump last_snap... we use it as a version value on the snaprealm.
       ++last_snap;
 
-      pending_destroy[version] = pair<snapid_t,snapid_t>(snapid, last_snap);
+      pending_destroy[version] = {snapid, last_snap};
       dout(10) << "prepare v" << version << " destroy " << snapid << " seq " << last_snap << dendl;
 
       encode(last_snap, out);
index a1019c3c864f6310ce398565a8f394505d954198..fcab5f3c45a94b689dddd905370739feefb85536 100644 (file)
@@ -68,7 +68,7 @@ public:
   static void generate_test_instances(std::list<SnapServer*>& ls);
 
   bool force_update(snapid_t last, snapid_t v2_since,
-                   map<snapid_t, SnapInfo>& _snaps);
+                   std::map<snapid_t, SnapInfo>& _snaps);
 
 protected:
   void encode_server_state(bufferlist& bl) const override {
@@ -93,11 +93,12 @@ protected:
     if (struct_v >= 2)
       decode(pending_destroy, bl);
     else {
-      map<version_t, snapid_t> t;
+      std::map<version_t, snapid_t> t;
       decode(t, bl);
-      for (map<version_t, snapid_t>::iterator p = t.begin(); p != t.end(); ++p)
-       pending_destroy[p->first].first = p->second; 
-    } 
+      for (auto& [ver, snapid] : t) {
+       pending_destroy[ver].first = snapid;
+      }
+    }
     decode(pending_noop, bl);
     if (struct_v >= 4) {
       decode(last_created, bl);
@@ -127,12 +128,12 @@ protected:
   snapid_t last_snap = 0;
   snapid_t last_created, last_destroyed;
   snapid_t snaprealm_v2_since;
-  map<snapid_t, SnapInfo> snaps;
-  map<int, set<snapid_t> > need_to_purge;
+  std::map<snapid_t, SnapInfo> snaps;
+  std::map<int, std::set<snapid_t> > need_to_purge;
 
-  map<version_t, SnapInfo> pending_update;
-  map<version_t, pair<snapid_t,snapid_t> > pending_destroy; // (removed_snap, seq)
-  set<version_t> pending_noop;
+  std::map<version_t, SnapInfo> pending_update;
+  std::map<version_t, std::pair<snapid_t,snapid_t> > pending_destroy; // (removed_snap, seq)
+  std::set<version_t> pending_noop;
 
   version_t last_checked_osdmap = 0;
 };
index 9bf1a83d3a6e6d025f7f42d500201db4ddf4237f..61e4f23fd7a3b42fe163e08cecfb401ca7db734b 100644 (file)
@@ -29,6 +29,9 @@
 #define dout_subsys ceph_subsys_mds
 #undef dout_prefix
 #define dout_prefix _prefix(_dout, mds)
+
+using namespace std;
+
 static ostream& _prefix(std::ostream *_dout, MDSRank *mds) {
   return *_dout << "mds." << mds->get_nodeid() << ".cache.strays ";
 }
index eb5271c1ba8467eff9da6582969a17a0d6f53475..3709ca8b9b4aff61359c8cb3ecfa3b82b77bc2d3 100644 (file)
@@ -29,13 +29,13 @@ static_assert(feature_names.size() == CEPHFS_FEATURE_MAX + 1);
 std::string_view cephfs_feature_name(size_t id)
 {
   if (id > feature_names.size())
-    return "unknown"sv;
+    return "unknown";
   return feature_names[id];
 }
 
 int cephfs_feature_from_name(std::string_view name)
 {
-  if (name == "reserved"sv) {
+  if (name == "reserved") {
     return -1;
   }
   for (size_t i = 0; i < feature_names.size(); ++i) {
index 41b1208133f4f2c394ad6d90a0294aa1adf94554..6273bf00c821063e45201c0660ffcea2316658ed 100644 (file)
@@ -26,7 +26,7 @@ public:
   explicit ECommitted(metareqid_t r) :
     LogEvent(EVENT_COMMITTED), reqid(r) { }
 
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "ECommitted " << reqid;
   }
 
index 589062db2a159df35e9fe233769a59ea6312c3ad..297b9e99d33a97c9b25e18ae685f4827c8d70cfe 100644 (file)
@@ -28,7 +28,7 @@ public:
   EMetaBlob metablob; // exported dir
 protected:
   dirfrag_t      base;
-  set<dirfrag_t> bounds;
+  std::set<dirfrag_t> bounds;
   mds_rank_t target;
   
 public:
@@ -38,9 +38,9 @@ public:
     LogEvent(EVENT_EXPORT),
     base(dir->dirfrag()), target(t) { }
   
-  set<dirfrag_t> &get_bounds() { return bounds; }
+  std::set<dirfrag_t> &get_bounds() { return bounds; }
   
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "EExport " << base << " to mds." << target << " " << metablob;
   }
 
index 1cbbf7a8a3613095b605b5e40097d1de7ff36995..bb10bf0a51dad64c54d701a7f790ee7ae5023c5c 100644 (file)
@@ -41,7 +41,7 @@ public:
     LogEvent(EVENT_FRAGMENT),
     op(o), ino(df.ino), basefrag(df.frag), bits(b) { }
 
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "EFragment " << op_name(op) << " " << ino << " " << basefrag << " by " << bits << " " << metablob;
   }
 
index 24bb1cd13533fb7e7c03e0703f5221919b8745d4..3848b6c2aaf15a1e7128987c0efa1111b0c793c8 100644 (file)
@@ -32,7 +32,7 @@ class EImportFinish : public LogEvent {
                                     success(s) { }
   EImportFinish() : LogEvent(EVENT_IMPORTFINISH), base(), success(false) { }
   
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "EImportFinish " << base;
     if (success)
       out << " success";
index d4673a84accc73971ba8a50927bda70e8985529e..1d94a161b0a688297410a2d81e9943cbdbfc2054 100644 (file)
@@ -27,7 +27,7 @@ class MDSRank;
 class EImportStart : public LogEvent {
 protected:
   dirfrag_t base;
-  vector<dirfrag_t> bounds;
+  std::vector<dirfrag_t> bounds;
   mds_rank_t from;
 
 public:
@@ -35,13 +35,13 @@ public:
   bufferlist client_map;  // encoded map<__u32,entity_inst_t>
   version_t cmapv{0};
 
-  EImportStart(MDLog *log, dirfrag_t di, const vector<dirfrag_t>& b, mds_rank_t f) :
+  EImportStart(MDLog *log, dirfrag_t di, const std::vector<dirfrag_t>& b, mds_rank_t f) :
     LogEvent(EVENT_IMPORTSTART),
     base(di), bounds(b), from(f) { }
   EImportStart() :
     LogEvent(EVENT_IMPORTSTART), from(MDS_RANK_NONE) { }
   
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "EImportStart " << base << " from mds." << from << " " << metablob;
   }
 
index d555627a3c638419a672263337683b30e4844407..a766504f5f4bc340ec271b1f7ff72cbd3b6bd9a4 100644 (file)
@@ -112,7 +112,7 @@ public:
     bool need_snapflush() const { return (state & STATE_NEED_SNAPFLUSH); }
     bool is_export_ephemeral_random() const { return (state & STATE_EPHEMERAL_RANDOM); }
 
-    void print(ostream& out) const {
+    void print(std::ostream& out) const {
       out << " fullbit dn " << dn << " [" << dnfirst << "," << dnlast << "] dnv " << dnv
          << " inode " << inode->ino
          << " state=" << state;
@@ -121,8 +121,8 @@ public:
       }
       out << std::endl;
     }
-    string state_string() const {
-      string state_string;
+    std::string state_string() const {
+      std::string state_string;
       bool marked_already = false;
       if (is_dirty()) {
        state_string.append("dirty");
@@ -156,7 +156,7 @@ public:
 
     void encode(bufferlist& bl) const;
     void decode(bufferlist::const_iterator &bl);
-    void print(ostream& out) const {
+    void print(std::ostream& out) const {
       out << " remotebit dn " << dn << " [" << dnfirst << "," << dnlast << "] dnv " << dnv
          << " ino " << ino
          << " dirty=" << dirty;
@@ -188,7 +188,7 @@ public:
     void decode(bufferlist::const_iterator &bl);
     void dump(Formatter *f) const;
     static void generate_test_instances(std::list<nullbit*>& ls);
-    void print(ostream& out) const {
+    void print(std::ostream& out) const {
       out << " nullbit dn " << dn << " [" << dnfirst << "," << dnlast << "] dnv " << dnv
          << " dirty=" << dirty << std::endl;
     }
@@ -214,9 +214,9 @@ public:
   private:
     mutable bufferlist dnbl;
     mutable bool dn_decoded;
-    mutable list<fullbit> dfull;
-    mutable vector<remotebit> dremote;
-    mutable vector<nullbit> dnull;
+    mutable std::list<fullbit> dfull;
+    mutable std::vector<remotebit> dremote;
+    mutable std::vector<nullbit> dnull;
 
   public:
     dirlump() : state(0), nfull(0), nremote(0), nnull(0), dn_decoded(true) { }
@@ -234,10 +234,10 @@ public:
     bool is_dirty_dft() { return state & STATE_DIRTYDFT; }
     void mark_dirty_dft() { state |= STATE_DIRTYDFT; }
 
-    const list<fullbit>                        &get_dfull() const { return dfull; }
-    list<fullbit>                      &_get_dfull() { return dfull; }
-    const vector<remotebit>            &get_dremote() const { return dremote; }
-    const vector<nullbit>              &get_dnull() const { return dnull; }
+    const std::list<fullbit>           &get_dfull() const { return dfull; }
+    std::list<fullbit>                 &_get_dfull() { return dfull; }
+    const std::vector<remotebit>       &get_dremote() const { return dremote; }
+    const std::vector<nullbit>         &get_dnull() const { return dnull; }
 
     template< class... Args>
     void add_dfull(Args&&... args) {
@@ -252,7 +252,7 @@ public:
       dnull.emplace_back(std::forward<Args>(args)...);
     }
 
-    void print(dirfrag_t dirfrag, ostream& out) const {
+    void print(dirfrag_t dirfrag, std::ostream& out) const {
       out << "dirlump " << dirfrag << " v " << fnode->version
          << " state " << state
          << " num " << nfull << "/" << nremote << "/" << nnull
@@ -266,8 +266,8 @@ public:
        p.print(out);
     }
 
-    string state_string() const {
-      string state_string;
+    std::string state_string() const {
+      std::string state_string;
       bool marked_already = false;
       if (is_complete()) {
        state_string.append("complete");
@@ -309,16 +309,16 @@ public:
   WRITE_CLASS_ENCODER_FEATURES(dirlump)
 
   // my lumps.  preserve the order we added them in a list.
-  vector<dirfrag_t>         lump_order;
-  map<dirfrag_t, dirlump> lump_map;
-  list<fullbit> roots;
+  std::vector<dirfrag_t>         lump_order;
+  std::map<dirfrag_t, dirlump> lump_map;
+  std::list<fullbit> roots;
 public:
-  vector<pair<__u8,version_t> > table_tids;  // tableclient transactions
+  std::vector<std::pair<__u8,version_t> > table_tids;  // tableclient transactions
 
   inodeno_t opened_ino;
 public:
   inodeno_t renamed_dirino;
-  vector<frag_t> renamed_dir_frags;
+  std::vector<frag_t> renamed_dir_frags;
 private:
   
   // ino (pre)allocation.  may involve both inotable AND session state.
@@ -329,16 +329,16 @@ private:
   entity_name_t client_name;          //            session
 
   // inodes i've truncated
-  vector<inodeno_t> truncate_start;        // start truncate
-  map<inodeno_t, LogSegment::seq_t> truncate_finish;  // finished truncate (started in segment blah)
+  std::vector<inodeno_t> truncate_start;        // start truncate
+  std::map<inodeno_t, LogSegment::seq_t> truncate_finish;  // finished truncate (started in segment blah)
 
 public:
-  vector<inodeno_t> destroyed_inodes;
+  std::vector<inodeno_t> destroyed_inodes;
 private:
 
   // idempotent op(s)
-  vector<pair<metareqid_t,uint64_t> > client_reqs;
-  vector<pair<metareqid_t,uint64_t> > client_flushes;
+  std::vector<std::pair<metareqid_t,uint64_t> > client_reqs;
+  std::vector<std::pair<metareqid_t,uint64_t> > client_flushes;
 
  public:
   void encode(bufferlist& bl, uint64_t features) const;
@@ -365,20 +365,20 @@ private:
   ~EMetaBlob() { }
   EMetaBlob& operator=(const EMetaBlob&) = delete;
 
-  void print(ostream& out) {
+  void print(std::ostream& out) {
     for (const auto &p : lump_order)
       lump_map[p].print(p, out);
   }
 
   void add_client_req(metareqid_t r, uint64_t tid=0) {
-    client_reqs.push_back(pair<metareqid_t,uint64_t>(r, tid));
+    client_reqs.push_back(std::pair<metareqid_t,uint64_t>(r, tid));
   }
   void add_client_flush(metareqid_t r, uint64_t tid=0) {
-    client_flushes.push_back(pair<metareqid_t,uint64_t>(r, tid));
+    client_flushes.push_back(std::pair<metareqid_t,uint64_t>(r, tid));
   }
 
   void add_table_transaction(int table, version_t tid) {
-    table_tids.push_back(pair<__u8, version_t>(table, tid));
+    table_tids.emplace_back(table, tid);
   }
 
   void add_opened_ino(inodeno_t ino) {
@@ -527,7 +527,7 @@ private:
       }
     }
 
-    string empty;
+    std::string empty;
     roots.emplace_back(empty, "", in->first, in->last, 0, pi, pdft, px, in->symlink,
                       in->oldest_snap, snapbl, (dirty ? fullbit::STATE_DIRTY : 0),
                       in->get_old_inodes());
@@ -578,7 +578,7 @@ private:
           opened_ino == 0 && inotablev == 0 && sessionmapv == 0;
   }
 
-  void print(ostream& out) const {
+  void print(std::ostream& out) const {
     out << "[metablob";
     if (!lump_order.empty()) 
       out << " " << lump_order.front() << ", " << lump_map.size() << " dirs";
@@ -605,7 +605,7 @@ WRITE_CLASS_ENCODER(EMetaBlob::remotebit)
 WRITE_CLASS_ENCODER(EMetaBlob::nullbit)
 WRITE_CLASS_ENCODER_FEATURES(EMetaBlob::dirlump)
 
-inline ostream& operator<<(ostream& out, const EMetaBlob& t) {
+inline std::ostream& operator<<(std::ostream& out, const EMetaBlob& t) {
   t.print(out);
   return out;
 }
index 06bfd3e882ea457bb2c9b503e52101f2c8e618e9..35aeee3f9c590478d28dcb7dd0367a8cf7fc4e79 100644 (file)
 class EOpen : public LogEvent {
 public:
   EMetaBlob metablob;
-  vector<inodeno_t> inos;
-  vector<vinodeno_t> snap_inos;
+  std::vector<inodeno_t> inos;
+  std::vector<vinodeno_t> snap_inos;
 
   EOpen() : LogEvent(EVENT_OPEN) { }
   explicit EOpen(MDLog *mdlog) :
     LogEvent(EVENT_OPEN) { }
 
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "EOpen " << metablob << ", " << inos.size() << " open files";
   }
 
index 38f53735eb1c74782ba13cae38f284cd8923faaa..88ddaa264a3ea174bb49d8d4db715b5b4e4afbff 100644 (file)
@@ -52,9 +52,9 @@ WRITE_CLASS_ENCODER(link_rollback)
 struct rmdir_rollback {
   metareqid_t reqid;
   dirfrag_t src_dir;
-  string src_dname;
+  std::string src_dname;
   dirfrag_t dest_dir;
-  string dest_dname;
+  std::string dest_dname;
   bufferlist snapbl;
 
   void encode(bufferlist& bl) const;
@@ -70,7 +70,7 @@ struct rename_rollback {
     utime_t dirfrag_old_mtime;
     utime_t dirfrag_old_rctime;
     inodeno_t ino, remote_ino;
-    string dname;
+    std::string dname;
     char remote_d_type;
     utime_t old_ctime;
 
@@ -118,7 +118,7 @@ public:
    */
   EMetaBlob commit;
   bufferlist rollback;
-  string type;
+  std::string type;
   metareqid_t reqid;
   mds_rank_t leader;
   __u8 op;  // prepare, commit, abort
@@ -132,7 +132,7 @@ public:
     leader(leadermds),
     op(o), origop(oo) { }
 
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     if (type.length())
       out << type << " ";
     out << " " << (int)op;
index cda1b2ecf2df7c508f0265d03e6ce9cbde105dfb..56e136a343d03aab9671d77740189eed3c11e3bc 100644 (file)
@@ -29,7 +29,7 @@ public:
   void encode(bufferlist& bl, uint64_t features) const override;
   void decode(bufferlist::const_iterator& bl) override;
   void dump(Formatter *f) const override;
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "Eurged " << inos.size() << " inos, inotable v" << inotablev;
   }
 
index 302227fc6439154b6d8112ca4563afb2ffe052f2..fba634abba0768b393b1564fb501281ba60b6b79 100644 (file)
@@ -28,7 +28,7 @@ class EResetJournal : public LogEvent {
   void decode(bufferlist::const_iterator& bl) override;
   void dump(Formatter *f) const override;
   static void generate_test_instances(std::list<EResetJournal*>& ls);
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "EResetJournal";
   }
 
index c6586e3b5756361e51ed727712a475f2d0d84d7f..3e755db9071bb194bfd07f1529451b48f48fd254 100644 (file)
@@ -52,7 +52,7 @@ class ESession : public LogEvent {
   void dump(Formatter *f) const override;
   static void generate_test_instances(std::list<ESession*>& ls);
 
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     if (open)
       out << "ESession " << client_inst << " open cmapv " << cmapv;
     else
index fad70212084ea04f6cf9dc42d33aac09d01d5111..e334675f2a795b7899134466493ba464848ccf59 100644 (file)
@@ -26,12 +26,12 @@ protected:
   bool old_style_encode;
 
 public:
-  map<client_t,entity_inst_t> client_map;
-  map<client_t,client_metadata_t> client_metadata_map;
+  std::map<client_t,entity_inst_t> client_map;
+  std::map<client_t,client_metadata_t> client_metadata_map;
 
   ESessions() : LogEvent(EVENT_SESSIONS), cmapv(0), old_style_encode(false) { }
-  ESessions(version_t pv, map<client_t,entity_inst_t>&& cm,
-           map<client_t,client_metadata_t>&& cmm) :
+  ESessions(version_t pv, std::map<client_t,entity_inst_t>&& cm,
+           std::map<client_t,client_metadata_t>&& cmm) :
     LogEvent(EVENT_SESSIONS),
     cmapv(pv), old_style_encode(false),
     client_map(std::move(cm)),
@@ -49,7 +49,7 @@ public:
   void dump(Formatter *f) const override;
   static void generate_test_instances(std::list<ESessions*>& ls);
 
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "ESessions " << client_map.size() << " opens cmapv " << cmapv;
   }
   
index 3dc824087f523b6d36fe6a04e46383dc1427240f..ebddff0439e82d3cc5db2ef78d9332f905d42cf4 100644 (file)
 class ESubtreeMap : public LogEvent {
 public:
   EMetaBlob metablob;
-  map<dirfrag_t, vector<dirfrag_t> > subtrees;
-  set<dirfrag_t> ambiguous_subtrees;
+  std::map<dirfrag_t, std::vector<dirfrag_t> > subtrees;
+  std::set<dirfrag_t> ambiguous_subtrees;
   uint64_t expire_pos;
   uint64_t event_seq;
 
   ESubtreeMap() : LogEvent(EVENT_SUBTREEMAP), expire_pos(0), event_seq(0) { }
   
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "ESubtreeMap " << subtrees.size() << " subtrees " 
        << ", " << ambiguous_subtrees.size() << " ambiguous "
        << metablob;
index 3f6e454e646d71be3ae7bc7d0ff711f1bb16e2aa..18f08923ffedb527f3462f6da58c9314dd2b62e7 100644 (file)
@@ -36,7 +36,7 @@ struct ETableClient : public LogEvent {
   void dump(Formatter *f) const override;
   static void generate_test_instances(std::list<ETableClient*>& ls);
 
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "ETableClient " << get_mdstable_name(table) << " " << get_mdstableserver_opname(op);
     if (tid) out << " tid " << tid;
   }  
index 59fe8ff1cbdab90b109bb23a794e130160ec3c74..b5762d5e727f10f1ad5878ed7f9ad6a3300fef11 100644 (file)
@@ -41,7 +41,7 @@ struct ETableServer : public LogEvent {
   void dump(Formatter *f) const override;
   static void generate_test_instances(std::list<ETableServer*>& ls);
 
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "ETableServer " << get_mdstable_name(table) 
        << " " << get_mdstableserver_opname(op);
     if (reqid) out << " reqid " << reqid;
index d320014a1f036ee422e8d51a236bf4df2475c413..bebd278bf741b6c183982f2c6d85297eb3ce0501 100644 (file)
@@ -23,7 +23,7 @@
 class EUpdate : public LogEvent {
 public:
   EMetaBlob metablob;
-  string type;
+  std::string type;
   bufferlist client_map;
   version_t cmapv;
   metareqid_t reqid;
@@ -34,7 +34,7 @@ public:
     LogEvent(EVENT_UPDATE),
     type(s), cmapv(0), had_peers(false) { }
   
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     if (type.length())
       out << "EUpdate " << type << " ";
     out << metablob;
index ae64a4232a4940ca29fbd5646a9acb4b34b95570..6496f228d59f63325be3679c7049cbbfa99f8ad7 100644 (file)
 #undef dout_prefix
 #define dout_prefix *_dout << "mds." << mds->get_nodeid() << ".journal "
 
+using std::list;
+using std::map;
+using std::ostream;
+using std::pair;
+using std::set;
+using std::string;
+using std::vector;
 
 // -----------------------
 // LogSegment
index f988ca51367488a73708fd49f8a44b16cb788378..c5b8728e927149548d7c02b9d655df9b179a72ce 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "common/Formatter.h"
 
+using namespace std;
 /*
  * SnapInfo
  */