bool scrub_recursive; /// true if we are scrubbing everything under this
bool scrub_children; /// true if we have to scrub all direct children
bool dentry_scrubbing; /// safety check
+ bool dentry_children_done; /// safety check
+ bool inode_validated; /// Has our inode's validate_disk_state run?
Context *on_finish; /// called when we finish scrubbing
ScrubHeaderRefConst header;
- bool inode_validated; /// Has our inode's validate_disk_state run?
scrub_info_t() :
scrub_parent(NULL), scrub_recursive(false),
- scrub_children(false), dentry_scrubbing(false), on_finish(NULL),
- inode_validated(false)
+ scrub_children(false), dentry_scrubbing(false),
+ dentry_children_done(false), inode_validated(false),
+ on_finish(NULL)
{}
};
ScrubHeaderRefConst header,
Context *f);
void scrub_finished(Context **c);
+ void scrub_children_finished() {
+ scrub_infop->dentry_children_done = true;
+ }
private:
/**
scrub_infop->others_scrubbed.clear();
scrub_infop->directory_scrubbing = false;
- scrub_infop->last_scrub_dirty = true;
-
scrub_infop->last_recursive = scrub_infop->recursive_start;
scrub_infop->last_scrub_dirty = true;
}
list<CDir*>::iterator i = scrubbing_cdirs.begin();
bool all_frags_terminal = true;
bool all_frags_done = true;
- bool finally_done = false;
while (g_conf->mds_max_scrub_ops_in_progress > scrubs_in_progress) {
// select next CDir
CDir *cur_dir = NULL;
// OK, so now I can... fire off a validate on the dir inode, and
// when it completes, come through here again, noticing that we've
// set a flag to indicate the the validate happened, and
-
- scrub_dir_dentry_final(dn, &finally_done);
+ scrub_dir_dentry_final(dn);
}
*terminal = all_frags_terminal;
- *done = all_frags_done && finally_done;
+ *done = all_frags_done;
dout(10) << __func__ << " is exiting " << *terminal << " " << *done << dendl;
return;
}
};
-void ScrubStack::scrub_dir_dentry_final(CDentry *dn, bool *finally_done)
+void ScrubStack::scrub_dir_dentry_final(CDentry *dn)
{
dout(20) << __func__ << *dn << dendl;
// doing our validate_disk_state on the inode
// FIXME: the magic-constructing scrub_info() is going to leave
// an unneeded scrub_infop lying around here
- *finally_done = !dn->scrub_info()->dentry_scrubbing;
- if (!*finally_done) {
+ if (!dn->scrub_info()->dentry_children_done) {
+ dn->scrub_children_finished();
CInode *in = dn->get_projected_inode();
C_InodeValidated *fin = new C_InodeValidated(mdcache->mds, this, dn);
MDRequestRef null_mdr;
* Scrub a directory-representing dentry.
*
* @param dn The CDentry of the directory we're doing final scrub on.
- * @param done Set to true if the dentry scrub is finished. (That
- * won't every actually happen, right? It needs disk accesses? I forget.)
*/
- void scrub_dir_dentry_final(CDentry *dn, bool *done);
+ void scrub_dir_dentry_final(CDentry *dn);
/**
* Get a CDir into memory, and return it if it's already complete.