<< dendl;
ls->truncating_inodes.insert(in);
-
+ in->get(CInode::PIN_TRUNCATING);
+
_truncate_inode(in, ls);
}
<< pi->truncate_from << " -> " << pi->truncate_size
<< " on " << *in << dendl;
- in->get(CInode::PIN_TRUNCATING);
in->auth_pin(this);
SnapRealm *realm = in->find_snaprealm();
void MDCache::add_recovered_truncate(CInode *in, LogSegment *ls)
{
ls->truncating_inodes.insert(in);
+ in->get(CInode::PIN_TRUNCATING);
+}
+
+void MDCache::remove_recovered_truncate(CInode *in, LogSegment *ls)
+{
+ // if we have the logseg the truncate started in, it must be in our list.
+ set<CInode*>::iterator p = ls->truncating_inodes.find(in);
+ assert(p != ls->truncating_inodes.end());
+ ls->truncating_inodes.erase(p);
+ in->put(CInode::PIN_TRUNCATING);
}
void MDCache::start_recovered_truncates()
void truncate_inode_logged(CInode *in, Mutation *mut);
void add_recovered_truncate(CInode *in, LogSegment *ls);
- void remove_recovered_truncate(CInode *in);
+ void remove_recovered_truncate(CInode *in, LogSegment *ls);
void start_recovered_truncates();
if (ls) {
CInode *in = mds->mdcache->get_inode(p->first);
assert(in);
- ls->truncating_inodes.erase(in);
+ mds->mdcache->remove_recovered_truncate(in, ls);
}
}