]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: tidy up cdir scrub_initialize in scrubstack
authorJohn Spray <john.spray@redhat.com>
Thu, 16 Jul 2015 14:02:49 +0000 (15:02 +0100)
committerYan, Zheng <zyan@redhat.com>
Wed, 4 Nov 2015 09:17:25 +0000 (17:17 +0800)
...now that I grok how long the dir is meant to be complete

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/ScrubStack.cc

index b0a43520628b8ad622e8ec72a31b153a24451e38..ebc1c16c6733653a5e829d68c7bec0b00b533da6 100644 (file)
@@ -153,9 +153,6 @@ void ScrubStack::scrub_dir_dentry(CDentry *dn,
     // the stack... or actually is that right?  Should we perhaps
     // only see ourselves once on the way down and once on the way
     // back up again, and not do this?
-
-    // Hmm, bigger problem, we can only actually 
-
     in->scrub_initialize(in->get_version());
   }
 
@@ -288,18 +285,15 @@ void ScrubStack::scrub_dirfrag(CDir *dir, bool *added_children,
   *is_terminal = false;
   *done = false;
 
-  // XXX HACK get the frag complete before calling
-  // scrub intiialize
-  if (!dir->is_complete()) {
-    dir->fetch(new C_KickOffScrubs(mdcache->mds, this));
-    return;
-  }
-
   if (!dir->scrub_info()->directory_scrubbing) {
-    // FIXME: greg - the CDir API seems inconsistent here, as
-    // scrub_initialize wants the dir to be complete before
-    // we start, but scrub_dentry_next handles incompleteness
-    // via its EAGAIN path.
+    // Get the frag complete before calling
+    // scrub initialize, so that it can populate its lists
+    // of dentries.
+    if (!dir->is_complete()) {
+      dir->fetch(new C_KickOffScrubs(mdcache->mds, this));
+      return;
+    }
+
     dir->scrub_initialize();
   }