return session;
}
+void Client::_close_mds_session(MetaSession *s)
+{
+ ldout(cct, 2) << "_close_mds_session mds." << s->mds_num << " seq " << s->seq << dendl;
+ s->state = MetaSession::STATE_CLOSING;
+ messenger->send_message(new MClientSession(CEPH_SESSION_REQUEST_CLOSE, s->seq),
+ s->inst);
+}
+
void Client::_closed_mds_session(int mds, MetaSession *s)
{
mount_cond.Signal();
switch (m->get_op()) {
case CEPH_SESSION_OPEN:
renew_caps(session);
+ session->state = MetaSession::STATE_OPEN;
if (unmounting) {
- session->state = MetaSession::STATE_CLOSING;
- messenger->send_message(new MClientSession(CEPH_SESSION_REQUEST_CLOSE, session->seq),
- mdsmap->get_inst(from));
+ _close_mds_session(session);
} else {
- session->state = MetaSession::STATE_OPEN;
connect_mds_targets(from);
}
break;
s->seq++;
ldout(cct, 10) << " mds." << mds << " seq now " << s->seq << dendl;
- if (s->state == MetaSession::STATE_CLOSING)
+ if (s->state == MetaSession::STATE_CLOSING) {
messenger->send_message(new MClientSession(CEPH_SESSION_REQUEST_CLOSE, s->seq),
s->inst);
+ }
}
void Client::handle_lease(MClientLease *m)
for (map<int,MetaSession*>::iterator p = mds_sessions.begin();
p != mds_sessions.end();
++p) {
- ldout(cct, 2) << "sending client_session close to mds." << p->first
- << " seq " << p->second->seq << dendl;
if (p->second->state != MetaSession::STATE_CLOSING) {
- p->second->state = MetaSession::STATE_CLOSING;
- messenger->send_message(new MClientSession(CEPH_SESSION_REQUEST_CLOSE, p->second->seq),
- mdsmap->get_inst(p->first));
+ _close_mds_session(p->second);
}
}
void got_mds_push(int mds);
MetaSession *_get_or_open_mds_session(int mds);
MetaSession *_open_mds_session(int mds);
+ void _close_mds_session(MetaSession *s);
void _closed_mds_session(int mds, MetaSession *s);
void handle_client_session(MClientSession *m);
void send_reconnect(int mds);