Merge PR #19693 into master

* refs/pull/19693/head:
	mds: use session.get_client()

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Zheng Yan <zyan@redhat.com>
This commit is contained in:
Patrick Donnelly 2018-01-09 16:56:17 -08:00
commit 2cdf087d29
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB
8 changed files with 13 additions and 13 deletions

View File

@ -412,7 +412,7 @@ void Beacon::notify_health(MDSRank const *mds)
std::ostringstream oss;
oss << "Client " << session->get_human_name() << " failing to respond to cache pressure";
MDSHealthMetric m(MDS_HEALTH_CLIENT_RECALL, HEALTH_WARN, oss.str());
m.metadata["client_id"] = stringify(session->info.inst.name.num());
m.metadata["client_id"] = stringify(session->get_client());
late_recall_metrics.push_back(m);
} else {
dout(20) << " within timeout " << session->recalled_at << " vs. " << cutoff << dendl;
@ -425,7 +425,7 @@ void Beacon::notify_health(MDSRank const *mds)
std::ostringstream oss;
oss << "Client " << session->get_human_name() << " failing to advance its oldest client/flush tid";
MDSHealthMetric m(MDS_HEALTH_CLIENT_OLDEST_TID, HEALTH_WARN, oss.str());
m.metadata["client_id"] = stringify(session->info.inst.name.num());
m.metadata["client_id"] = stringify(session->get_client());
large_completed_requests_metrics.push_back(m);
}
}

View File

@ -3034,7 +3034,7 @@ int CInode::get_xlocker_mask(client_t client) const
int CInode::get_caps_allowed_for_client(Session *session, inode_t *file_i) const
{
client_t client = session->info.inst.name.num();
client_t client = session->get_client();
int allowed;
if (client == get_loner()) {
// as the loner, we get the loner_caps AND any xlocker_caps for things we have xlocked
@ -3161,7 +3161,7 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
unsigned max_bytes,
int getattr_caps)
{
client_t client = session->info.inst.name.num();
client_t client = session->get_client();
assert(snapid);
assert(session->connection);

View File

@ -1915,7 +1915,7 @@ Capability* Locker::issue_new_caps(CInode *in,
// my needs
assert(session->info.inst.name.is_client());
client_t my_client = session->info.inst.name.num();
client_t my_client = session->get_client();
int my_want = ceph_caps_for_mode(mode);
// register a capability

View File

@ -5733,7 +5733,7 @@ void MDCache::do_cap_import(Session *session, CInode *in, Capability *cap,
uint64_t p_cap_id, ceph_seq_t p_seq, ceph_seq_t p_mseq,
int peer, int p_flags)
{
client_t client = session->info.inst.name.num();
client_t client = session->get_client();
SnapRealm *realm = in->find_snaprealm();
if (realm->have_past_parents_open()) {
dout(10) << "do_cap_import " << session->info.inst.name << " mseq " << cap->get_mseq() << " on " << *in << dendl;

View File

@ -2050,7 +2050,7 @@ void MDSRankDispatcher::evict_clients(const SessionFilter &filter, MCommand *m)
C_GatherBuilder gather(g_ceph_context, reply);
for (const auto s : victims) {
std::stringstream ss;
evict_client(s->info.inst.name.num(), false,
evict_client(s->get_client().v, false,
g_conf->mds_session_blacklist_on_evict, ss, gather.new_sub());
}
gather.activate();

View File

@ -533,7 +533,7 @@ void Server::_session_logged(Session *session, uint64_t state_seq, bool open, ve
Capability *cap = session->caps.front();
CInode *in = cap->get_inode();
dout(20) << " killing capability " << ccap_string(cap->issued()) << " on " << *in << dendl;
mds->locker->remove_client_cap(in, session->info.inst.name.num());
mds->locker->remove_client_cap(in, session->get_client());
}
while (!session->leases.empty()) {
ClientLease *r = session->leases.front();
@ -773,7 +773,7 @@ void Server::find_idle_sessions()
if (g_conf->mds_session_blacklist_on_timeout) {
std::stringstream ss;
mds->evict_client(session->info.inst.name.num(), false, true,
mds->evict_client(session->get_client().v, false, true,
ss, nullptr);
} else {
kill_session(session, NULL);
@ -1042,7 +1042,7 @@ void Server::reconnect_tick()
if (g_conf->mds_session_blacklist_on_timeout) {
std::stringstream ss;
mds->evict_client(session->info.inst.name.num(), false, true, ss,
mds->evict_client(session->get_client().v, false, true, ss,
gather.new_sub());
} else {
kill_session(session, NULL);

View File

@ -1043,10 +1043,10 @@ bool SessionFilter::match(
std::ostream& operator<<(std::ostream &out, const Session &s)
{
if (s.get_human_name() == stringify(s.info.inst.name.num())) {
if (s.get_human_name() == stringify(s.get_client())) {
out << s.get_human_name();
} else {
out << s.get_human_name() << " (" << std::dec << s.info.inst.name.num() << ")";
out << s.get_human_name() << " (" << std::dec << s.get_client() << ")";
}
return out;
}

View File

@ -547,7 +547,7 @@ public:
p != session_map.end();
++p)
if (p->second->info.inst.name.is_client())
s.insert(p->second->info.inst.name.num());
s.insert(p->second->get_client());
}
void get_client_session_set(set<Session*>& s) const {
for (ceph::unordered_map<entity_name_t,Session*>::const_iterator p = session_map.begin();