MDSInternalContextBase *f)
{
dout(20) << __func__ << " with scrub_version " << get_version() << dendl;
- assert(!scrub_infop || !scrub_infop->scrub_in_progress);
+ assert(!scrub_is_in_progress());
scrub_info();
if (!scrub_infop)
scrub_infop = new scrub_info_t();
- else
- assert(!scrub_infop->scrub_in_progress);
if (get_projected_inode()->is_dir()) {
// fill in dirfrag_stamps with initial state
int CInode::scrub_dirfrag_next(frag_t* out_dirfrag)
{
dout(20) << __func__ << dendl;
- assert(scrub_infop && scrub_infop->scrub_in_progress);
+ assert(scrub_is_in_progress());
if (!is_dir()) {
return -ENOTDIR;
void CInode::scrub_dirfrag_finished(frag_t dirfrag)
{
dout(20) << __func__ << " on frag " << dirfrag << dendl;
- assert(scrub_infop && scrub_infop->scrub_in_progress);
+ assert(scrub_is_in_progress());
std::map<frag_t, scrub_stamp_info_t>::iterator i =
scrub_infop->dirfrag_stamps.find(dirfrag);
void CInode::scrub_finished(MDSInternalContextBase **c) {
dout(20) << __func__ << dendl;
- assert(scrub_info()->scrub_in_progress);
+ assert(scrub_is_in_progress());
for (std::map<frag_t, scrub_stamp_info_t>::iterator i =
scrub_infop->dirfrag_stamps.begin();
i != scrub_infop->dirfrag_stamps.end();
scrub_info_create();
return scrub_infop;
}
+
+ bool scrub_is_in_progress() const {
+ return (scrub_infop && scrub_infop->scrub_in_progress);
+ }
/**
* Start scrubbing on this inode. That could be very short if it's
* a file, or take a long time if we're recursively scrubbing a directory.
return false;
}
+ if (diri->scrub_is_in_progress()) {
+ dout(7) << "can_fragment: scrub in progress" << dendl;
+ return false;
+ }
+
for (list<CDir*>::iterator p = dirs.begin(); p != dirs.end(); ++p) {
CDir *dir = *p;
if (dir->state_test(CDir::STATE_FRAGMENTING)) {