mirror of
https://github.com/ceph/ceph
synced 2025-01-19 09:32:00 +00:00
mds: scan stray dir, eval strays on mds startup
This commit is contained in:
parent
2e1b0d3590
commit
80c42d0639
@ -6927,6 +6927,22 @@ void MDCache::_snaprealm_create_finish(MDRequest *mdr, Mutation *mut, CInode *in
|
||||
// -------------------------------------------------------------------------------
|
||||
// STRAYS
|
||||
|
||||
void MDCache::scan_stray_dir()
|
||||
{
|
||||
dout(10) << "scan_stray_dir" << dendl;
|
||||
|
||||
list<CDir*> ls;
|
||||
for (list<CDir*>::iterator p = ls.begin(); p != ls.end(); p++) {
|
||||
CDir *dir = *p;
|
||||
for (CDir::map_t::iterator q = dir->items.begin(); q != dir->items.end(); q++) {
|
||||
CDentry *dn = q->second;
|
||||
CDentry::linkage_t *dnl = dn->get_projected_linkage();
|
||||
if (dnl->is_primary())
|
||||
maybe_eval_stray(dnl->get_inode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct C_MDC_EvalStray : public Context {
|
||||
MDCache *mdcache;
|
||||
CDentry *dn;
|
||||
|
@ -994,6 +994,7 @@ public:
|
||||
|
||||
// -- stray --
|
||||
public:
|
||||
void scan_stray_dir();
|
||||
void eval_stray(CDentry *dn);
|
||||
void eval_remote(CDentry *dn);
|
||||
|
||||
|
@ -1180,6 +1180,7 @@ void MDS::active_start()
|
||||
mdcache->open_root();
|
||||
|
||||
mdcache->clean_open_file_lists();
|
||||
mdcache->scan_stray_dir();
|
||||
finish_contexts(waiting_for_replay); // kick waiters
|
||||
finish_contexts(waiting_for_active); // kick waiters
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user