if (!diri->is_auth()) {
if (dir->get_num_ref() > 1) // only subtree pin
continue;
+ list<CDir*> ls;
+ diri->get_subtree_dirfrags(ls);
+ if (diri->get_num_ref() > (int)ls.size()) // only pinned by subtrees
+ continue;
+
// don't trim subtree root if its auth MDS is recovering.
// This simplify the cache rejoin code.
if (dir->is_subtree_root() &&
!base->is_waiting_for_dentry(want_path[0].c_str(), snap) || !onfinish) {
discover_info_t& d = _create_discover(from);
d.ino = base->ino();
- d.pin_base(base);
+ d.pin_base(base->inode);
d.frag = base->get_frag();
d.snap = snap;
d.want_path = want_path;
frag_t frag;
snapid_t snap;
filepath want_path;
- MDSCacheObject *base;
+ CInode *basei;
bool want_base_dir;
bool want_xlocked;
discover_info_t() :
- tid(0), mds(-1), snap(CEPH_NOSNAP), base(NULL),
+ tid(0), mds(-1), snap(CEPH_NOSNAP), basei(NULL),
want_base_dir(false), want_xlocked(false) {}
~discover_info_t() {
- if (base)
- base->put(MDSCacheObject::PIN_DISCOVERBASE);
+ if (basei)
+ basei->put(MDSCacheObject::PIN_DISCOVERBASE);
}
- void pin_base(MDSCacheObject *b) {
- base = b;
- base->get(MDSCacheObject::PIN_DISCOVERBASE);
+ void pin_base(CInode *b) {
+ basei = b;
+ basei->get(MDSCacheObject::PIN_DISCOVERBASE);
}
};