]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Add is_any_replay() method and fill it in as appropriate.
authorGreg Farnum <gregf@hq.newdream.net>
Thu, 6 Jan 2011 23:37:59 +0000 (15:37 -0800)
committerGreg Farnum <gregf@hq.newdream.net>
Thu, 6 Jan 2011 23:37:59 +0000 (15:37 -0800)
This way we don't need to remember to call all three of is_replay(),
is_standby_replay(), is_oneshot_replay().

Signed-off-by: Greg Farnum <gregf@hq.newdream.net>
src/mds/MDCache.cc
src/mds/MDLog.cc
src/mds/MDS.cc
src/mds/MDS.h

index 0fbc2af114c88666f3b32f74b95256d98e4749c5..d0602d659180ad6f30cba31b1154600887e6d5ed 100644 (file)
@@ -662,7 +662,7 @@ void MDCache::adjust_subtree_auth(CDir *dir, pair<int,int> auth, bool do_eval)
   dout(7) << "adjust_subtree_auth " << dir->get_dir_auth() << " -> " << auth
          << " on " << *dir << dendl;
 
-  if (mds->is_replay() || mds->is_resolve())
+  if (mds->is_any_replay() || mds->is_resolve())
     do_eval = false;
 
   show_subtrees();
@@ -766,7 +766,7 @@ void MDCache::try_subtree_merge_at(CDir *dir)
   assert(subtrees.count(dir));
 
   bool do_eval = true;
-  if (mds->is_replay() || mds->is_resolve())
+  if (mds->is_any_replay() || mds->is_resolve())
     do_eval = false;
 
   // merge with parent?
index 30f5c43b6e43a70f0e296d8475389aa0e549c595..7d1cc33165c88940758e1243e91d111e300f2984 100644 (file)
@@ -153,7 +153,7 @@ void MDLog::append()
 
 void MDLog::submit_entry( LogEvent *le, Context *c, bool wait_safe ) 
 {
-  assert(!mds->is_replay());
+  assert(!mds->is_any_replay());
   assert(le == cur_event);
   cur_event = NULL;
 
index 5b1513be7f8e3f41a7481a3b94c553af12037748..322064cb4374752633fcd094f6fd81698e4790b5 100644 (file)
@@ -908,8 +908,7 @@ void MDS::handle_mds_map(MMDSMap *m)
 
       if (is_active()) {
         active_start();
-      } else if (is_replay() || is_oneshot_replay() ||
-          is_standby_replay()) {
+      } else if (is_any_replay()) {
         replay_start();
       } else if (is_resolve()) {
         resolve_start();
@@ -1148,7 +1147,7 @@ void MDS::boot_start(int step, int r)
     }
 
   case 3:
-    if (is_replay() || is_oneshot_replay() || is_standby_replay()) {
+    if (is_any_replay()) {
       dout(2) << "boot_start " << step << ": replaying mds log" << dendl;
       if(is_oneshot_replay() || is_standby_replay())
         mdlog->get_journaler()->set_readonly();
@@ -1161,7 +1160,7 @@ void MDS::boot_start(int step, int r)
     }
 
   case 4:
-    if (is_replay() || is_oneshot_replay() || is_standby_replay()) {
+    if (is_any_replay()) {
       replay_done();
       break;
     }
index 1da2a9a91afb30f8efa5abb95f0de9d8157f52ef..04c04b4b72f004971d1ff042ead9e576e619668d 100644 (file)
@@ -231,6 +231,8 @@ class MDS : public Dispatcher {
   bool is_stopping() { return state == MDSMap::STATE_STOPPING; }
 
   bool is_oneshot_replay()   { return state == MDSMap::STATE_ONESHOT_REPLAY; }
+  bool is_any_replay() { return (is_replay() || is_standby_replay() ||
+                                 is_oneshot_replay()); }
 
   bool is_stopped()  { return mdsmap->is_stopped(whoami); }