MDS::BootStep nextstep;
public:
C_MDS_BootStart(MDS *m, MDS::BootStep n) : mds(m), nextstep(n) {}
- void finish(int r) { mds->boot_start(nextstep, r); }
+ void finish(int r) {
+ Mutex::Locker l(mds->mds_lock);
+ mds->boot_start(nextstep, r);
+ }
};
{
mdcache->init_layouts();
- C_GatherBuilder gather(g_ceph_context, new C_MDS_BootStart(this, MDS_BOOT_OPEN_ROOT));
+ C_GatherBuilder gather(g_ceph_context, new C_OnFinisher(new C_MDS_BootStart(this, MDS_BOOT_OPEN_ROOT), &finisher));
dout(2) << "boot_start " << step << ": opening inotable" << dendl;
inotable->load(gather.new_sub());
{
dout(2) << "boot_start " << step << ": loading/discovering base inodes" << dendl;
- C_GatherBuilder gather(g_ceph_context, new C_MDS_BootStart(this, MDS_BOOT_PREPARE_LOG));
+ C_GatherBuilder gather(g_ceph_context, new C_OnFinisher(new C_MDS_BootStart(this, MDS_BOOT_PREPARE_LOG), &finisher));
mdcache->open_mydir_inode(gather.new_sub());
case MDS_BOOT_PREPARE_LOG:
if (is_any_replay()) {
dout(2) << "boot_start " << step << ": replaying mds log" << dendl;
- mdlog->replay(new C_MDS_BootStart(this, MDS_BOOT_REPLAY_DONE));
+ mdlog->replay(new C_OnFinisher(new C_MDS_BootStart(this, MDS_BOOT_REPLAY_DONE), &finisher));
} else {
dout(2) << "boot_start " << step << ": positioning at end of old mds log" << dendl;
mdlog->append();
dout(1) << " waiting for osdmap " << mdsmap->get_last_failure_osd_epoch()
<< " (which blacklists prior instance)" << dendl;
objecter->wait_for_map(mdsmap->get_last_failure_osd_epoch(),
- new C_MDS_BootStart(this, MDS_BOOT_INITIAL));
+ new C_OnFinisher(C_MDS_BootStart(this, MDS_BOOT_INITIAL)));
}
}
dout(1) << " waiting for osdmap " << mdsmap->get_last_failure_osd_epoch()
<< " (which blacklists prior instance)" << dendl;
objecter->wait_for_map(mdsmap->get_last_failure_osd_epoch(),
- new C_MDS_BootStart(this, MDS_BOOT_PREPARE_LOG));
+ new C_OnFinisher(new C_MDS_BootStart(this, MDS_BOOT_PREPARE_LOG)));
} else {
mdlog->get_journaler()->reread_head_and_probe(
new C_MDS_StandbyReplayRestartFinish(this, mdlog->get_journaler()->get_read_pos()));