}
void CInode::scrub_initialize(CDentry *scrub_parent,
- const ScrubHeaderRefConst& header, Context *f)
+ const ScrubHeaderRefConst& header,
+ MDSInternalContextBase *f)
{
dout(20) << __func__ << " with scrub_version " << get_version() << dendl;
assert(!scrub_infop || !scrub_infop->scrub_in_progress);
si.last_scrub_version = si.scrub_start_version;
}
-void CInode::scrub_finished(Context **c) {
+void CInode::scrub_finished(MDSInternalContextBase **c) {
dout(20) << __func__ << dendl;
assert(scrub_info()->scrub_in_progress);
for (std::map<frag_t, scrub_stamp_info_t>::iterator i =
}
*c = scrub_infop->on_finish;
+ scrub_infop->on_finish = NULL;
if (scrub_infop->header && scrub_infop->header->origin == this) {
// We are at the point that a tagging scrub was initiated
class scrub_info_t : public scrub_stamp_info_t {
public:
CDentry *scrub_parent;
- Context *on_finish;
+ MDSInternalContextBase *on_finish;
bool last_scrub_dirty; /// are our stamps dirty with respect to disk state?
bool scrub_in_progress; /// are we currently scrubbing?
* directory's get_projected_version())
*/
void scrub_initialize(CDentry *scrub_parent,
- const ScrubHeaderRefConst& header, Context *f);
+ const ScrubHeaderRefConst& header,
+ MDSInternalContextBase *f);
/**
* Get the next dirfrag to scrub. Gives you a frag_t in output param which
* you must convert to a CDir (and possibly load off disk).
* @param c An out param which is filled in with a Context* that must
* be complete()ed.
*/
- void scrub_finished(Context **c);
+ void scrub_finished(MDSInternalContextBase **c);
/**
* Report to the CInode that alldirfrags it owns have been scrubbed.
*/
void scrub_children_finished() {
scrub_infop->children_scrubbed = true;
}
- void scrub_set_finisher(Context *c) {
+ void scrub_set_finisher(MDSInternalContextBase *c) {
assert(!scrub_infop->on_finish);
scrub_infop->on_finish = c;
}
// want to block asok caller on long running scrub
if (!header->recursive) {
Context *fin = cs->take_finisher();
- mds->scrubstack->enqueue_inode_top(in, header, fin);
+ mds->scrubstack->enqueue_inode_top(in, header,
+ new MDSInternalContextWrapper(mds, fin));
} else
mds->scrubstack->enqueue_inode_bottom(in, header, NULL);
void ScrubStack::_enqueue_inode(CInode *in, CDentry *parent,
const ScrubHeaderRefConst& header,
- Context *on_finish, bool top)
+ MDSInternalContextBase *on_finish, bool top)
{
dout(10) << __func__ << " with {" << *in << "}"
<< ", on_finish=" << on_finish << ", top=" << top << dendl;
}
void ScrubStack::enqueue_inode(CInode *in, const ScrubHeaderRefConst& header,
- Context *on_finish, bool top)
+ MDSInternalContextBase *on_finish, bool top)
{
_enqueue_inode(in, NULL, header, on_finish, top);
kick_off_scrubs();
#endif
const ScrubHeaderRefConst header = in->scrub_info()->header;
- Context *c = NULL;
+ MDSInternalContextBase *c = NULL;
in->scrub_finished(&c);
if (!header->recursive && in == header->origin) {
* was initiated
*/
void enqueue_inode_top(CInode *in, const ScrubHeaderRefConst& header,
- Context *on_finish) {
+ MDSInternalContextBase *on_finish) {
enqueue_inode(in, header, on_finish, true);
}
/** Like enqueue_inode_top, but we wait for all pending scrubs before
* starting this one.
*/
void enqueue_inode_bottom(CInode *in, const ScrubHeaderRefConst& header,
- Context *on_finish) {
+ MDSInternalContextBase *on_finish) {
enqueue_inode(in, header, on_finish, false);
}
* the given scrub params, and then try and kick off more scrubbing.
*/
void enqueue_inode(CInode *in, const ScrubHeaderRefConst& header,
- Context *on_finish, bool top);
+ MDSInternalContextBase *on_finish, bool top);
void _enqueue_inode(CInode *in, CDentry *parent, const ScrubHeaderRefConst& header,
- Context *on_finish, bool top);
+ MDSInternalContextBase *on_finish, bool top);
/**
* Kick off as many scrubs as are appropriate, based on the current
* state of the stack.