mirror of
https://github.com/ceph/ceph
synced 2025-02-24 11:37:37 +00:00
create a new function end_session to end client sessions
This commit is contained in:
parent
6dce782635
commit
196f277912
@ -415,18 +415,24 @@ void Server::find_idle_sessions()
|
||||
mds->logclient.log(LOG_INFO, ss);
|
||||
|
||||
dout(10) << "autoclosing stale session " << session->inst << " last " << session->last_cap_renew << dendl;
|
||||
mds->sessionmap.set_state(session, Session::STATE_STALE_PURGING);
|
||||
if (session->prealloc_inos.empty()) {
|
||||
_finish_session_purge(session);
|
||||
} else {
|
||||
C_Gather *fin = new C_Gather(new C_MDS_session_purged(this, session));
|
||||
for (map<inodeno_t,inodeno_t>::iterator p = session->prealloc_inos.m.begin();
|
||||
p != session->prealloc_inos.m.end();
|
||||
p++) {
|
||||
inodeno_t last = p->first + p->second;
|
||||
for (inodeno_t i = p->first; i < last; i = i + 1)
|
||||
mds->mdcache->purge_prealloc_ino(i, fin->new_sub());
|
||||
}
|
||||
end_session(session);
|
||||
}
|
||||
}
|
||||
|
||||
void Server::end_session (Session *session)
|
||||
{
|
||||
assert (session);
|
||||
mds->sessionmap.set_state(session, Session::STATE_STALE_PURGING);
|
||||
if (session->prealloc_inos.empty()) {
|
||||
_finish_session_purge(session);
|
||||
} else {
|
||||
C_Gather *fin = new C_Gather(new C_MDS_session_purged(this, session));
|
||||
for (map<inodeno_t,inodeno_t>::iterator p = session->prealloc_inos.m.begin();
|
||||
p != session->prealloc_inos.m.end();
|
||||
p++) {
|
||||
inodeno_t last = p->first + p->second;
|
||||
for (inodeno_t i = p->first; i < last; i = i + 1)
|
||||
mds->mdcache->purge_prealloc_ino(i, fin->new_sub());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ public:
|
||||
void finish_force_open_sessions(map<client_t,entity_inst_t> &cm);
|
||||
void terminate_sessions();
|
||||
void find_idle_sessions();
|
||||
void end_session (Session *session);
|
||||
void reconnect_clients();
|
||||
void handle_client_reconnect(class MClientReconnect *m);
|
||||
//void process_reconnect_cap(CInode *in, int from, ceph_mds_cap_reconnect& capinfo);
|
||||
|
Loading…
Reference in New Issue
Block a user