mds: properly initialize MDCache::fragment_info_t

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
This commit is contained in:
Yan, Zheng 2014-03-04 19:32:40 +08:00
parent ed30b83a9a
commit dc52581df5
2 changed files with 4 additions and 4 deletions

View File

@ -11379,7 +11379,7 @@ void MDCache::find_stale_fragment_freeze()
dirfrag_t df = p->first; dirfrag_t df = p->first;
fragment_info_t& info = p->second; fragment_info_t& info = p->second;
++p; ++p;
if (info.dirs_frozen) if (info.has_frozen)
continue; continue;
CDir *dir; CDir *dir;
int total_auth_pins = 0; int total_auth_pins = 0;
@ -11479,7 +11479,7 @@ void MDCache::fragment_frozen(dirfrag_t basedirfrag, int r)
dout(10) << "fragment_frozen " << basedirfrag.frag << " by " << info.bits dout(10) << "fragment_frozen " << basedirfrag.frag << " by " << info.bits
<< " on " << info.dirs.front()->get_inode() << dendl; << " on " << info.dirs.front()->get_inode() << dendl;
info.dirs_frozen = true; info.has_frozen = true;
MDRequest *mdr = request_start_internal(CEPH_MDS_OP_FRAGMENTDIR); MDRequest *mdr = request_start_internal(CEPH_MDS_OP_FRAGMENTDIR);
mdr->more()->fragment_base = basedirfrag; mdr->more()->fragment_base = basedirfrag;

View File

@ -961,11 +961,11 @@ private:
list<CDir*> resultfrags; list<CDir*> resultfrags;
MDRequest *mdr; MDRequest *mdr;
// for deadlock detection // for deadlock detection
bool dirs_frozen; bool has_frozen;
utime_t last_cum_auth_pins_change; utime_t last_cum_auth_pins_change;
int last_cum_auth_pins; int last_cum_auth_pins;
int num_remote_waiters; // number of remote authpin waiters int num_remote_waiters; // number of remote authpin waiters
fragment_info_t() : last_cum_auth_pins(0), num_remote_waiters(0) {} fragment_info_t() : has_frozen(false), last_cum_auth_pins(0), num_remote_waiters(0) {}
}; };
map<dirfrag_t,fragment_info_t> fragments; map<dirfrag_t,fragment_info_t> fragments;