diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index e6bf3930e91..10a65298540 100644 --- a/src/mds/Beacon.cc +++ b/src/mds/Beacon.cc @@ -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); } } diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 51f967e4be6..1bb0f500094 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -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); diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index e531744fe44..018c6333d1b 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -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 diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index f65615e5229..d0cdaca2bd1 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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; diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 59c9d5e0b50..4b9732fd3d3 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -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(); diff --git a/src/mds/Server.cc b/src/mds/Server.cc index c2170c788f7..79e49a7b167 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -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); diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index d59217dd56b..ce1b0946922 100644 --- a/src/mds/SessionMap.cc +++ b/src/mds/SessionMap.cc @@ -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; } diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h index 50ffde9cc04..2480a74b7de 100644 --- a/src/mds/SessionMap.h +++ b/src/mds/SessionMap.h @@ -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();