}
}
}
+
+ early_kick_flushing_caps(session);
+
session->con->send_message(m);
mount_cond.Signal();
}
}
+void Client::early_kick_flushing_caps(MetaSession *session)
+{
+ for (xlist<Inode*>::iterator p = session->flushing_caps.begin(); !p.end(); ++p) {
+ Inode *in = *p;
+ if (!in->flushing_caps)
+ continue;
+ assert(in->auth_cap);
+ Cap *cap = in->auth_cap;
+
+ // if flushing caps were revoked, we re-send the cap flush in client reconnect
+ // stage. This guarantees that MDS processes the cap flush message before issuing
+ // the flushing caps to other client.
+ bool send_now = (in->flushing_caps & in->auth_cap->issued) != in->flushing_caps;
+
+ if (send_now)
+ ldout(cct, 20) << " reflushing caps (revoked) on " << *in
+ << " to mds." << session->mds_num << dendl;
+
+ for (map<ceph_tid_t,int>::iterator q = in->flushing_cap_tids.begin();
+ q != in->flushing_cap_tids.end();
+ ++q) {
+ if (send_now) {
+ send_cap(in, session, cap, (get_caps_used(in) | in->caps_dirty()),
+ in->caps_wanted(), (cap->issued | cap->implemented),
+ q->second, q->first);
+ }
+ }
+ }
+}
+
void Client::kick_maxsize_requests(MetaSession *session)
{
xlist<Cap*>::iterator iter = session->caps.begin();
// mds requests
ceph_tid_t last_tid;
ceph_tid_t oldest_tid; // oldest incomplete mds request, excluding setfilelock requests
- ceph_tid_t last_flush_tid;
map<ceph_tid_t, MetaRequest*> mds_requests;
+ // cap flushing
+ ceph_tid_t last_flush_tid;
+
void dump_mds_requests(Formatter *f);
void dump_mds_sessions(Formatter *f);
void flush_caps();
void flush_caps(Inode *in, MetaSession *session);
void kick_flushing_caps(MetaSession *session);
+ void early_kick_flushing_caps(MetaSession *session);
void kick_maxsize_requests(MetaSession *session);
int get_caps(Inode *in, int need, int want, int *have, loff_t endoff);
int get_caps_used(Inode *in);