]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make `whoami` and `incarnation` private
authorJohn Spray <john.spray@redhat.com>
Tue, 7 Jul 2015 08:55:04 +0000 (09:55 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 28 Jul 2015 08:05:08 +0000 (09:05 +0100)
get_nodeid was used many places but not everywhere.

These can also be const now that MDSRank isn't constructed
until a rank is assigned.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDBalancer.cc
src/mds/MDCache.cc
src/mds/MDS.cc
src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mds/MDSTable.cc
src/mds/Migrator.cc
src/mds/Server.cc
src/mds/SessionMap.cc
src/mds/journal.cc

index e806e52d8def4bef24b6992c93049ff6bed70a7d..263c21ad14e5967dd8892ff2516cc85a44f1b6c0 100644 (file)
@@ -758,7 +758,7 @@ void MDBalancer::try_rebalance()
 bool MDBalancer::check_targets()
 {
   // get MonMap's idea of my_targets
-  const set<mds_rank_t>& map_targets = mds->mdsmap->get_mds_info(mds->whoami).export_targets;
+  const set<mds_rank_t>& map_targets = mds->mdsmap->get_mds_info(mds->get_nodeid()).export_targets;
 
   bool send = false;
   bool ok = true;
index 4d4fafc5d5b4e00c43ccfcb5eeb0f1737b1d0fe6..223b1a83f2e7bd64838ccfd0f6eca22ab6b60903 100644 (file)
@@ -378,7 +378,7 @@ void MDCache::create_unlinked_system_inode(CInode *in, inodeno_t ino,
 
   if (in->is_base()) {
     if (in->is_root())
-      in->inode_auth = mds_authority_t(mds->whoami, CDIR_AUTH_UNKNOWN);
+      in->inode_auth = mds_authority_t(mds->get_nodeid(), CDIR_AUTH_UNKNOWN);
     else
       in->inode_auth = mds_authority_t(mds_rank_t(in->ino() - MDS_INO_MDSDIR_OFFSET), CDIR_AUTH_UNKNOWN);
     in->open_snaprealm();  // empty snaprealm
@@ -411,7 +411,7 @@ void MDCache::create_empty_hierarchy(MDSGather *gather)
 
   // force empty root dir
   CDir *rootdir = root->get_or_open_dirfrag(this, frag_t());
-  adjust_subtree_auth(rootdir, mds->whoami);   
+  adjust_subtree_auth(rootdir, mds->get_nodeid());   
   rootdir->dir_rep = CDir::REP_ALL;   //NONE;
 
   rootdir->fnode.accounted_fragstat = rootdir->fnode.fragstat;
@@ -433,17 +433,17 @@ void MDCache::create_mydir_hierarchy(MDSGather *gather)
 {
   // create mds dir
   char myname[10];
-  snprintf(myname, sizeof(myname), "mds%d", int(mds->whoami));
-  CInode *my = create_system_inode(MDS_INO_MDSDIR(mds->whoami), S_IFDIR);
+  snprintf(myname, sizeof(myname), "mds%d", int(mds->get_nodeid()));
+  CInode *my = create_system_inode(MDS_INO_MDSDIR(mds->get_nodeid()), S_IFDIR);
 
   CDir *mydir = my->get_or_open_dirfrag(this, frag_t());
-  adjust_subtree_auth(mydir, mds->whoami);   
+  adjust_subtree_auth(mydir, mds->get_nodeid());   
 
   LogSegment *ls = mds->mdlog->get_current_segment();
 
   // stray dir
   for (int i = 0; i < NUM_STRAY; ++i) {
-    CInode *stray = create_system_inode(MDS_INO_STRAY(mds->whoami, i), S_IFDIR);
+    CInode *stray = create_system_inode(MDS_INO_STRAY(mds->get_nodeid(), i), S_IFDIR);
     CDir *straydir = stray->get_or_open_dirfrag(this, frag_t());
     stringstream name;
     name << "stray" << i;
@@ -581,7 +581,7 @@ struct C_MDS_RetryOpenRoot : public MDSInternalContext {
 
 void MDCache::open_root_inode(MDSInternalContextBase *c)
 {
-  if (mds->whoami == mds->mdsmap->get_root()) {
+  if (mds->get_nodeid() == mds->mdsmap->get_root()) {
     CInode *in;
     in = create_system_inode(MDS_INO_ROOT, S_IFDIR|0755);  // initially inaccurate!
     in->fetch(c);
@@ -592,7 +592,7 @@ void MDCache::open_root_inode(MDSInternalContextBase *c)
 
 void MDCache::open_mydir_inode(MDSInternalContextBase *c)
 {
-  CInode *in = create_system_inode(MDS_INO_MDSDIR(mds->whoami), S_IFDIR|0755);  // initially inaccurate!
+  CInode *in = create_system_inode(MDS_INO_MDSDIR(mds->get_nodeid()), S_IFDIR|0755);  // initially inaccurate!
   in->fetch(c);
 }
 
@@ -604,12 +604,12 @@ void MDCache::open_root()
     open_root_inode(new C_MDS_RetryOpenRoot(this));
     return;
   }
-  if (mds->whoami == mds->mdsmap->get_root()) {
+  if (mds->get_nodeid() == mds->mdsmap->get_root()) {
     assert(root->is_auth());  
     CDir *rootdir = root->get_or_open_dirfrag(this, frag_t());
     assert(rootdir);
     if (!rootdir->is_subtree_root())
-      adjust_subtree_auth(rootdir, mds->whoami);   
+      adjust_subtree_auth(rootdir, mds->get_nodeid());   
     if (!rootdir->is_complete()) {
       rootdir->fetch(new C_MDS_RetryOpenRoot(this));
       return;
@@ -624,13 +624,13 @@ void MDCache::open_root()
   }
 
   if (!myin) {
-    CInode *in = create_system_inode(MDS_INO_MDSDIR(mds->whoami), S_IFDIR|0755);  // initially inaccurate!
+    CInode *in = create_system_inode(MDS_INO_MDSDIR(mds->get_nodeid()), S_IFDIR|0755);  // initially inaccurate!
     in->fetch(new C_MDS_RetryOpenRoot(this));
     return;
   }
   CDir *mydir = myin->get_or_open_dirfrag(this, frag_t());
   assert(mydir);
-  adjust_subtree_auth(mydir, mds->whoami);
+  adjust_subtree_auth(mydir, mds->get_nodeid());
 
   populate_mydir();
 }
@@ -670,7 +670,7 @@ void MDCache::populate_mydir()
       straydn = mydir->lookup("stray");
 
     if (!straydn || !straydn->get_linkage()->get_inode()) {
-      _create_system_file(mydir, name.str().c_str(), create_system_inode(MDS_INO_STRAY(mds->whoami, i), S_IFDIR),
+      _create_system_file(mydir, name.str().c_str(), create_system_inode(MDS_INO_STRAY(mds->get_nodeid(), i), S_IFDIR),
                          new C_MDS_RetryOpenRoot(this));
       return;
     }
@@ -2511,7 +2511,7 @@ ESubtreeMap *MDCache::create_subtree_map()
 
     // so not
     //   !me, *
-    if (dir->get_dir_auth().first != mds->whoami)
+    if (dir->get_dir_auth().first != mds->get_nodeid())
       continue;
 
     if (migrator->is_ambiguous_import(dir->dirfrag()) ||
@@ -2655,7 +2655,7 @@ void MDCache::resolve_start(MDSInternalContext *resolve_done_)
   assert(resolve_done == NULL);
   resolve_done = resolve_done_;
 
-  if (mds->mdsmap->get_root() != mds->whoami) {
+  if (mds->mdsmap->get_root() != mds->get_nodeid()) {
     // if we don't have the root dir, adjust it to UNKNOWN.  during
     // resolve we want mds0 to explicit claim the portion of it that
     // it owns, so that anything beyond its bounds get left as
@@ -2756,7 +2756,7 @@ void MDCache::send_subtree_resolves()
   for (set<mds_rank_t>::iterator p = recovery_set.begin();
        p != recovery_set.end();
        ++p) {
-    if (*p == mds->whoami)
+    if (*p == mds->get_nodeid())
       continue;
     if (mds->is_resolve() || mds->mdsmap->is_resolve(*p))
       resolves[*p] = new MMDSResolve;
@@ -3007,7 +3007,7 @@ void MDCache::handle_mds_recovery(mds_rank_t who)
     CDir *dir = p->first;
 
     if (dir->authority().first != who ||
-       dir->authority().second == mds->whoami)
+       dir->authority().second == mds->get_nodeid())
       continue;
     assert(!dir->is_auth());
    
@@ -3489,7 +3489,7 @@ void MDCache::disambiguate_imports()
   other_ambiguous_imports.clear();
 
   // my ambiguous imports
-  mds_authority_t me_ambig(mds->whoami, mds->whoami);
+  mds_authority_t me_ambig(mds->get_nodeid(), mds->get_nodeid());
   while (!my_ambiguous_imports.empty()) {
     map<dirfrag_t, vector<dirfrag_t> >::iterator q = my_ambiguous_imports.begin();
 
@@ -3505,7 +3505,7 @@ void MDCache::disambiguate_imports()
       CDir *root = get_subtree_root(dir);
       if (root != dir)
        dout(10) << "  subtree root is " << *root << dendl;
-      assert(root->dir_auth.first != mds->whoami);  // no us!
+      assert(root->dir_auth.first != mds->get_nodeid());  // no us!
       try_trim_non_auth_subtree(root);
 
       mds->mdlog->start_submit_entry(new EImportFinish(dir, false));
@@ -3699,7 +3699,7 @@ void MDCache::recalc_auth_bits(bool replay)
 
   if (root) {
     root->inode_auth.first = mds->mdsmap->get_root();
-    bool auth = mds->whoami == root->inode_auth.first;
+    bool auth = mds->get_nodeid() == root->inode_auth.first;
     if (auth) {
       root->state_set(CInode::STATE_AUTH);
     } else {
@@ -4078,7 +4078,7 @@ void MDCache::rejoin_send_rejoins()
     rejoin_ack_gather.insert(p->first);
     mds->send_message_mds(p->second, p->first);
   }
-  rejoin_ack_gather.insert(mds->whoami);   // we need to complete rejoin_gather_finish, too
+  rejoin_ack_gather.insert(mds->get_nodeid());   // we need to complete rejoin_gather_finish, too
   rejoins_pending = false;
 
   // nothing?
@@ -5142,8 +5142,8 @@ void MDCache::rejoin_gather_finish()
   rejoin_send_acks();
   
   // signal completion of fetches, rejoin_gather_finish, etc.
-  assert(rejoin_ack_gather.count(mds->whoami));
-  rejoin_ack_gather.erase(mds->whoami);
+  assert(rejoin_ack_gather.count(mds->get_nodeid()));
+  rejoin_ack_gather.erase(mds->get_nodeid());
 
   // did we already get our acks too?
   if (rejoin_ack_gather.empty()) {
@@ -6287,7 +6287,7 @@ bool MDCache::trim(int max, int count)
     CDir *subtree = *s;
     if (subtree->inode->is_mdsdir()) {
       mds_rank_t owner = mds_rank_t(MDS_INO_MDSDIR_OWNER(subtree->inode->ino()));
-      if (owner == mds->whoami) {
+      if (owner == mds->get_nodeid()) {
         continue;
       }
 
@@ -6325,7 +6325,7 @@ bool MDCache::trim(int max, int count)
   if (max == 0) {
     for (set<CInode*>::iterator p = base_inodes.begin();
          p != base_inodes.end(); ++p) {
-      if (MDS_INO_MDSDIR_OWNER((*p)->ino()) != mds->whoami) {
+      if (MDS_INO_MDSDIR_OWNER((*p)->ino()) != mds->get_nodeid()) {
         dout(20) << __func__ << ": maybe trimming base: " << *(*p) << dendl;
         if ((*p)->get_num_ref() == 0) {
           trim_inode(NULL, *p, NULL, expiremap);
@@ -6793,7 +6793,7 @@ void MDCache::try_trim_non_auth_subtree(CDir *dir)
   get_subtree_bounds(dir, bounds);
   for (set<CDir*>::iterator p = bounds.begin(); p != bounds.end(); ++p) {
     CDir *bd = *p;
-    if (bd->get_dir_auth().first != mds->whoami &&  // we are not auth
+    if (bd->get_dir_auth().first != mds->get_nodeid() &&  // we are not auth
        bd->get_num_any() == 0 && // and empty
        can_trim_non_auth_dirfrag(bd)) {
       CInode *bi = bd->get_inode();
@@ -6812,7 +6812,7 @@ void MDCache::try_trim_non_auth_subtree(CDir *dir)
     while (true) {
       CInode *diri = dir->get_inode();
       if (diri->is_base()) {
-       if (!diri->is_root() && diri->authority().first != mds->whoami) {
+       if (!diri->is_root() && diri->authority().first != mds->get_nodeid()) {
          dout(10) << " closing empty non-auth subtree " << *dir << dendl;
          remove_subtree(dir);
          dir->mark_clean();
@@ -6828,7 +6828,7 @@ void MDCache::try_trim_non_auth_subtree(CDir *dir)
 
       CDir *psub = get_subtree_root(diri->get_parent_dir());
       dout(10) << " parent subtree is " << *psub << dendl;
-      if (psub->get_dir_auth().first == mds->whoami)
+      if (psub->get_dir_auth().first == mds->get_nodeid())
        break;  // we are auth, keep.
 
       dout(10) << " closing empty non-auth subtree " << *dir << dendl;
@@ -6983,7 +6983,7 @@ void MDCache::handle_cache_expire(MCacheExpire *m)
        CInode *diri = get_inode(it->first.ino);
        if (diri) {
          if (mds->is_rejoin() &&
-             rejoin_ack_gather.count(mds->whoami) && // haven't sent rejoin ack yet
+             rejoin_ack_gather.count(mds->get_nodeid()) && // haven't sent rejoin ack yet
              !diri->is_replica(from)) {
            list<CDir*> ls;
            diri->get_nested_dirfrags(ls);
@@ -8549,7 +8549,7 @@ void MDCache::find_ino_peers(inodeno_t ino, MDSInternalContextBase *c, mds_rank_
   fip.tid = tid;
   fip.fin = c;
   fip.hint = hint;
-  fip.checked.insert(mds->whoami);
+  fip.checked.insert(mds->get_nodeid());
   _do_find_ino_peer(fip);
 }
 
@@ -8570,7 +8570,7 @@ void MDCache::_do_find_ino_peer(find_ino_peer_info_t& fip)
     fip.hint = MDS_RANK_NONE;
   } else {
     for (set<mds_rank_t>::iterator p = active.begin(); p != active.end(); ++p)
-      if (*p != mds->whoami &&
+      if (*p != mds->get_nodeid() &&
          fip.checked.count(*p) == 0) {
        m = *p;
        break;
index 98486c9a1674ab10abbf60640c39565cb745235f..bffd42faf6d11c6fbaefc6a13cea20904a24291b 100644 (file)
@@ -174,7 +174,7 @@ bool MDS::asok_command(string command, cmdmap_t& cmdmap, string format,
     f->open_object_section("status");
     f->dump_stream("cluster_fsid") << monc->get_fsid();
     if (mds_rank) {
-      f->dump_unsigned("whoami", mds_rank->whoami);
+      f->dump_unsigned("whoami", mds_rank->get_nodeid());
     } else {
       f->dump_unsigned("whoami", MDS_RANK_NONE);
     }
@@ -914,11 +914,13 @@ void MDS::handle_mds_map(MMDSMap *m)
 
     // Did I previously not hold a rank?  Initialize!
     if (mds_rank == NULL) {
-      mds_rank = new MDSRankDispatcher(mds_lock, clog, timer, beacon, mdsmap,
-          messenger, monc, objecter,
+      mds_rank = new MDSRankDispatcher(whoami, incarnation, mds_lock, clog,
+          timer, beacon, mdsmap, messenger, monc, objecter,
           new C_VoidFn(this, &MDS::respawn),
           new C_VoidFn(this, &MDS::suicide));
-      mds_rank->init(whoami, incarnation);
+      dout(10) <<  __func__ << ": initializing MDS rank "
+               << mds_rank->get_nodeid() << dendl;
+      mds_rank->init();
     }
 
     // MDSRank is active: let him process the map, we have no say.
index fe1e6d790b6b8a6855aa09fcf0d81c9ac0e5eebf..a4b848e0563a597c9449983d8febae493d5eb845 100644 (file)
@@ -39,6 +39,8 @@
 #define dout_prefix *_dout << "mds." << whoami << '.' << incarnation << ' '
 
 MDSRank::MDSRank(
+    mds_rank_t whoami_,
+    int incarnation_,
     Mutex &mds_lock_,
     LogChannelRef &clog_,
     SafeTimer &timer_,
@@ -50,8 +52,8 @@ MDSRank::MDSRank(
     Context *respawn_hook_,
     Context *suicide_hook_)
   :
-    whoami(MDS_RANK_NONE),
-    incarnation(0),
+    whoami(whoami_),
+    incarnation(incarnation_),
     mds_lock(mds_lock_), clog(clog_), timer(timer_),
     mdsmap(mdsmap_),
     objecter(objecter_),
@@ -130,14 +132,11 @@ MDSRank::~MDSRank()
   respawn_hook = NULL;
 }
 
-void MDSRankDispatcher::init(mds_rank_t rank_, int incarnation_)
+void MDSRankDispatcher::init()
 {
   update_log_config();
   create_logger();
 
-  incarnation = incarnation;
-  whoami = rank_;
-
   // Expose the OSDMap (already populated during MDS::init) to anyone
   // who is interested in it.
   handle_osd_map();
@@ -2371,6 +2370,8 @@ bool MDSRankDispatcher::handle_command_legacy(std::vector<std::string> args)
 }
 
 MDSRankDispatcher::MDSRankDispatcher(
+    mds_rank_t whoami_,
+    int incarnation_,
     Mutex &mds_lock_,
     LogChannelRef &clog_,
     SafeTimer &timer_,
@@ -2381,7 +2382,7 @@ MDSRankDispatcher::MDSRankDispatcher(
     Objecter *objecter_,
     Context *respawn_hook_,
     Context *suicide_hook_)
-  : MDSRank(mds_lock_, clog_, timer_, beacon_, mdsmap_, msgr, monc_, objecter_,
-            respawn_hook_, suicide_hook_)
+  : MDSRank(whoami_, incarnation_, mds_lock_, clog_, timer_, beacon_, mdsmap_,
+      msgr, monc_, objecter_, respawn_hook_, suicide_hook_)
 {}
 
index 7307d187b9ed4e43325080ebb31fa67c8b41d3ea..deadc7ec7f2c914e01349b9cb8a928a791014863 100644 (file)
@@ -115,15 +115,14 @@ class MMDSMap;
  * to the other subsystems, and message-sending calls.
  */
 class MDSRank {
-  public:
-    // FIXME: this should be private in favour of getter
-    mds_rank_t whoami;
+  protected:
+    const mds_rank_t whoami;
 
     // Incarnation as seen in MDSMap at the point where a rank is
-    // assigned.  FIXME this shoudl be a const once MDSRank
-    // is only constructed upon a rank being issued.
-    int incarnation;
+    // assigned.
+    const int incarnation;
 
+  public:
     mds_rank_t get_nodeid() const { return whoami; }
     uint64_t get_metadata_pool();
 
@@ -266,6 +265,8 @@ class MDSRank {
     }
 
     MDSRank(
+        mds_rank_t whoami_,
+        int incarnation_,
         Mutex &mds_lock_,
         LogChannelRef &clog_,
         SafeTimer &timer_,
@@ -480,7 +481,7 @@ public:
 class MDSRankDispatcher : public MDSRank
 {
 public:
-  void init(mds_rank_t rank, int incarnation);
+  void init();
   void tick();
   void shutdown();
   bool handle_asok_command(std::string command, cmdmap_t& cmdmap,
@@ -495,6 +496,8 @@ public:
   bool ms_dispatch(Message *m);
 
   MDSRankDispatcher(
+      mds_rank_t whoami_,
+      int incarnation_,
       Mutex &mds_lock_,
       LogChannelRef &clog_,
       SafeTimer &timer_,
index 11790bca8f8f4998728227e0ba5975b1763c25b3..1d0c76412e073a89115b8ce239a037ea0b9c5a9b 100644 (file)
@@ -134,7 +134,7 @@ object_t MDSTable::get_object_name()
 {
   char n[50];
   if (per_mds)
-    snprintf(n, sizeof(n), "mds%d_%s", int(mds->whoami), table_name);
+    snprintf(n, sizeof(n), "mds%d_%s", int(mds->get_nodeid()), table_name);
   else
     snprintf(n, sizeof(n), "mds_%s", table_name);
   return object_t(n);
index 6f6eba45a5e684d16ed33c2191133119cbd735dc..d807fb628840119f0493471025e3ea9b277817b4 100644 (file)
@@ -2566,7 +2566,7 @@ void Migrator::import_logged_start(dirfrag_t df, CDir *dir, mds_rank_t from,
   dout(7) << "sending ack for " << *dir << " to old auth mds." << from << dendl;
 
   // test surviving observer of a failed migration that did not complete
-  //assert(dir->replica_map.size() < 2 || mds->whoami != 0);
+  //assert(dir->replica_map.size() < 2 || mds->get_nodeid() != 0);
 
   MExportDirAck *ack = new MExportDirAck(dir->dirfrag(), it->second.tid);
   ::encode(imported_caps, ack->imported_caps);
@@ -2696,7 +2696,7 @@ void Migrator::import_finish(CDir *dir, bool notify, bool last)
   mds->mdcache->maybe_send_pending_resolves();
 
   // did i just import mydir?
-  if (dir->ino() == MDS_INO_MDSDIR(mds->whoami))
+  if (dir->ino() == MDS_INO_MDSDIR(mds->get_nodeid()))
     cache->populate_mydir();
 
   // is it empty?
index 72f9df5be450ee6dac232813fe1de2687a24fb91..875a26d42e20208df434c419eb3f4df51e44ab6e 100644 (file)
@@ -2227,7 +2227,7 @@ CInode* Server::prepare_new_inode(MDRequestRef& mdr, CDir *dir, inodeno_t useino
     dout(0) << "WARNING: client specified " << useino << " and i allocated " << in->inode.ino << dendl;
     mds->clog->error() << mdr->client_request->get_source()
        << " specified ino " << useino
-       << " but mds." << mds->whoami << " allocated " << in->inode.ino << "\n";
+       << " but mds." << mds->get_nodeid() << " allocated " << in->inode.ino << "\n";
     //assert(0); // just for now.
   }
     
@@ -6006,7 +6006,7 @@ void Server::handle_client_rename(MDRequestRef& mdr)
     rdlocks.insert(&srctrace[i]->lock);
   xlocks.insert(&srcdn->lock);
   mds_rank_t srcdirauth = srcdn->get_dir()->authority().first;
-  if (srcdirauth != mds->whoami) {
+  if (srcdirauth != mds->get_nodeid()) {
     dout(10) << " will remote_wrlock srcdir scatterlocks on mds." << srcdirauth << dendl;
     remote_wrlocks[&srcdn->get_dir()->inode->filelock] = srcdirauth;
     remote_wrlocks[&srcdn->get_dir()->inode->nestlock] = srcdirauth;
@@ -6309,7 +6309,7 @@ bool Server::_need_force_journal(CInode *diri, bool empty)
   bool force_journal = false;
   if (empty) {
     for (list<CDir*>::iterator p = ls.begin(); p != ls.end(); ++p) {
-      if ((*p)->is_subtree_root() && (*p)->get_dir_auth().first == mds->whoami) {
+      if ((*p)->is_subtree_root() && (*p)->get_dir_auth().first == mds->get_nodeid()) {
        dout(10) << " frag " << (*p)->get_frag() << " is auth subtree dirfrag, will force journal" << dendl;
        force_journal = true;
        break;
@@ -6325,7 +6325,7 @@ bool Server::_need_force_journal(CInode *diri, bool empty)
       CDir *dir = *p;
       for (list<CDir*>::iterator q = subtrees.begin(); q != subtrees.end(); ++q) {
        if (dir->contains(*q)) {
-         if ((*q)->get_dir_auth().first == mds->whoami) {
+         if ((*q)->get_dir_auth().first == mds->get_nodeid()) {
            dout(10) << " frag " << (*p)->get_frag() << " contains (maybe) auth subtree, will force journal "
                     << **q << dendl;
            force_journal = true;
@@ -6746,14 +6746,14 @@ void Server::_rename_apply(MDRequestRef& mdr, CDentry *srcdn, CDentry *destdn, C
   }
 
   if (srcdn->get_dir()->inode->is_stray() &&
-      srcdn->get_dir()->inode->get_stray_owner() == mds->whoami) {
+      srcdn->get_dir()->inode->get_stray_owner() == mds->get_nodeid()) {
     // A reintegration event or a migration away from me
     dout(20) << __func__ << ": src dentry was a stray, updating stats" << dendl;
     mdcache->notify_stray_removed();
   }
 
   if (destdn->get_dir()->inode->is_stray() &&
-      destdn->get_dir()->inode->get_stray_owner() == mds->whoami) {
+      destdn->get_dir()->inode->get_stray_owner() == mds->get_nodeid()) {
     // A stray migration (to me)
     dout(20) << __func__ << ": dst dentry was a stray, updating stats" << dendl;
     mdcache->notify_stray_created();
index a95f37d037019b5d97ceaf2fcc8111811872f79f..dc0ba711694de90a08b7a82cb4a40819352ed57b 100644 (file)
@@ -64,7 +64,7 @@ void SessionMap::dump()
 object_t SessionMap::get_object_name()
 {
   char s[30];
-  snprintf(s, sizeof(s), "mds%d_sessionmap", int(mds->whoami));
+  snprintf(s, sizeof(s), "mds%d_sessionmap", int(mds->get_nodeid()));
   return object_t(s);
 }
 
index 7d684f11ee984fbf43be2a156200c32dc8afff08..ee94dd392cc4973ebaaa91bc6f1215dd6a3bbba9 100644 (file)
@@ -2542,7 +2542,7 @@ void ESubtreeMap::replay(MDSRank *mds)
        ++errors;
        continue;
       }
-      if (dir->get_dir_auth().first != mds->whoami) {
+      if (dir->get_dir_auth().first != mds->get_nodeid()) {
        mds->clog->error() << " replayed ESubtreeMap at " << get_start_off()
                          << " subtree root " << p->first
                          << " is not mine in cache (it's " << dir->get_dir_auth() << ")";
@@ -2596,7 +2596,7 @@ void ESubtreeMap::replay(MDSRank *mds)
     mds->mdcache->list_subtrees(subs);
     for (list<CDir*>::iterator p = subs.begin(); p != subs.end(); ++p) {
       CDir *dir = *p;
-      if (dir->get_dir_auth().first != mds->whoami)
+      if (dir->get_dir_auth().first != mds->get_nodeid())
        continue;
       if (subtrees.count(dir->dirfrag()) == 0) {
        mds->clog->error() << " replayed ESubtreeMap at " << get_start_off()
@@ -3022,13 +3022,13 @@ void EResetJournal::replay(MDSRank *mds)
   mds->sessionmap.wipe();
   mds->inotable->replay_reset();
 
-  if (mds->mdsmap->get_root() == mds->whoami) {
+  if (mds->mdsmap->get_root() == mds->get_nodeid()) {
     CDir *rootdir = mds->mdcache->get_root()->get_or_open_dirfrag(mds->mdcache, frag_t());
-    mds->mdcache->adjust_subtree_auth(rootdir, mds->whoami);   
+    mds->mdcache->adjust_subtree_auth(rootdir, mds->get_nodeid());   
   }
 
   CDir *mydir = mds->mdcache->get_myin()->get_or_open_dirfrag(mds->mdcache, frag_t());
-  mds->mdcache->adjust_subtree_auth(mydir, mds->whoami);   
+  mds->mdcache->adjust_subtree_auth(mydir, mds->get_nodeid());   
 
   mds->mdcache->recalc_auth_bits(true);