Signed-off-by: Yan, Zheng <zyan@redhat.com>
}
}
-
+void CInode::split_need_snapflush(CInode *cowin, CInode *in)
+{
+ dout(10) << "split_need_snapflush [" << cowin->first << "," << cowin->last << "] for " << *cowin << dendl;
+ for (map<snapid_t, set<client_t> >::iterator p = client_need_snapflush.lower_bound(cowin->first);
+ p != client_need_snapflush.end() && p->first <= cowin->last;
+ ++p) {
+ assert(!p->second.empty());
+ cowin->auth_pin(this);
+ in->auth_unpin(this);
+ }
+}
void CInode::mark_dirty_rstat()
{
void add_need_snapflush(CInode *snapin, snapid_t snapid, client_t client);
void remove_need_snapflush(CInode *snapin, snapid_t snapid, client_t client);
+ void split_need_snapflush(CInode *cowin, CInode *in);
protected:
SnapRealm *realm = in->find_snaprealm();
const set<snapid_t>& snaps = realm->get_snaps();
+ if (in->last != CEPH_NOSNAP) {
+ CInode *head_in = get_inode(in->ino());
+ assert(head_in);
+ head_in->split_need_snapflush(oldin, in);
+ }
+
// clone caps?
for (map<client_t,Capability*>::iterator p = in->client_caps.begin();
p != in->client_caps.end();