From: John Spray Date: Thu, 16 Jul 2015 14:02:49 +0000 (+0100) Subject: mds: tidy up cdir scrub_initialize in scrubstack X-Git-Tag: v10.0.1~51^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6ba5befcfb030d7c5c4705539cb95d2eafb327d5;p=ceph.git mds: tidy up cdir scrub_initialize in scrubstack ...now that I grok how long the dir is meant to be complete Signed-off-by: John Spray --- diff --git a/src/mds/ScrubStack.cc b/src/mds/ScrubStack.cc index b0a43520628b..ebc1c16c6733 100644 --- a/src/mds/ScrubStack.cc +++ b/src/mds/ScrubStack.cc @@ -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(); }