}
}
+void Client::flush_mdlog_sync()
+{
+
+ for (map<mds_rank_t,MetaSession*>::iterator p = mds_sessions.begin();
+ p != mds_sessions.end();
+ ++p) {
+ MetaSession *s = p->second;
+ flush_mdlog(s);
+ }
+}
+
+void Client::flush_mdlog(MetaSession *session)
+{
+ MClientSession *m = new MClientSession(CEPH_SESSION_REQUEST_FLUSH_MDLOG);
+ session->con->send_message(m);
+}
+
+
void Client::unmount()
{
Mutex::Locker lock(client_lock);
while (!mds_requests.empty()) {
ldout(cct, 10) << "waiting on " << mds_requests.size() << " requests" << dendl;
+ flush_mdlog_sync();
mount_cond.Wait(client_lock);
}
bool use_faked_inos() { return _use_faked_inos; }
vinodeno_t map_faked_ino(ino_t ino);
-
+
+ //notify the mds to flush the mdlog
+ void flush_mdlog_sync();
+ void flush_mdlog(MetaSession *session);
+
// ----------------------
// fs ops.
private:
CEPH_SESSION_FORCE_RO,
// A response to REQUEST_OPEN indicating that the client should
// permanently desist from contacting the MDS
- CEPH_SESSION_REJECT
+ CEPH_SESSION_REJECT,
+ CEPH_SESSION_REQUEST_FLUSH_MDLOG
};
extern const char *ceph_session_op_name(int op);