From: Sage Weil Date: Fri, 19 Jul 2013 15:08:02 +0000 (-0700) Subject: Message,OSD,PG: make Connection::features private X-Git-Tag: v0.67-rc1~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f0feabe81faa0152f6f3f4615354e1ef201c0113;p=ceph.git Message,OSD,PG: make Connection::features private Use has_feature() method too. Signed-off-by: Samuel Just Signed-off-by: Sage Weil --- diff --git a/src/msg/Message.h b/src/msg/Message.h index ad2bc8249b74..3ed8ee667d24 100644 --- a/src/msg/Message.h +++ b/src/msg/Message.h @@ -172,7 +172,9 @@ struct Connection : private RefCountedObject { RefCountedObject *priv; int peer_type; entity_addr_t peer_addr; +private: uint64_t features; +public: RefCountedObject *pipe; bool failed; /// true if we are a lossy connection that has failed. diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 2dc59b32f4f5..1ee4c09a63e1 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -5840,7 +5840,7 @@ bool OSD::compat_must_dispatch_immediately(PG *pg) continue; ConnectionRef conn = service.get_con_osd_cluster(*i, pg->get_osdmap()->get_epoch()); - if (conn && !(conn->features & CEPH_FEATURE_INDEP_PG_MAP)) { + if (conn && !conn->has_feature(CEPH_FEATURE_INDEP_PG_MAP)) { return true; } } @@ -5894,7 +5894,7 @@ void OSD::do_notifies( if (!con) continue; _share_map_outgoing(it->first, con.get(), curmap); - if ((con->features & CEPH_FEATURE_INDEP_PG_MAP)) { + if (con->has_feature(CEPH_FEATURE_INDEP_PG_MAP)) { dout(7) << "do_notify osd." << it->first << " on " << it->second.size() << " PGs" << dendl; MOSDPGNotify *m = new MOSDPGNotify(curmap->get_epoch(), @@ -5934,7 +5934,7 @@ void OSD::do_queries(map< int, map >& query_map, if (!con) continue; _share_map_outgoing(who, con.get(), curmap); - if ((con->features & CEPH_FEATURE_INDEP_PG_MAP)) { + if (con->has_feature(CEPH_FEATURE_INDEP_PG_MAP)) { dout(7) << "do_queries querying osd." << who << " on " << pit->second.size() << " PGs" << dendl; MOSDPGQuery *m = new MOSDPGQuery(curmap->get_epoch(), pit->second); @@ -5973,7 +5973,7 @@ void OSD::do_infos(map > >& info if (!con) continue; _share_map_outgoing(p->first, con.get(), curmap); - if ((con->features & CEPH_FEATURE_INDEP_PG_MAP)) { + if (con->has_feature(CEPH_FEATURE_INDEP_PG_MAP)) { MOSDPGInfo *m = new MOSDPGInfo(curmap->get_epoch()); m->pg_list = p->second; cluster_messenger->send_message(m, con.get()); diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 6f8ee0c44c74..2a07887a2a31 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3329,7 +3329,7 @@ void PG::scrub(ThreadPool::TPHandle &handle) ConnectionRef con = osd->get_con_osd_cluster(acting[i], get_osdmap()->get_epoch()); if (!con) continue; - if (!(con->features & CEPH_FEATURE_CHUNKY_SCRUB)) { + if (!con->has_feature(CEPH_FEATURE_CHUNKY_SCRUB)) { dout(20) << "OSD " << acting[i] << " does not support chunky scrubs, falling back to classic" << dendl; @@ -5478,7 +5478,7 @@ PG::RecoveryState::WaitRemoteBackfillReserved::WaitRemoteBackfillReserved(my_con ConnectionRef con = pg->osd->get_con_osd_cluster( pg->backfill_target, pg->get_osdmap()->get_epoch()); if (con) { - if ((con->features & CEPH_FEATURE_BACKFILL_RESERVATION)) { + if (con->has_feature(CEPH_FEATURE_BACKFILL_RESERVATION)) { unsigned priority = pg->is_degraded() ? OSDService::BACKFILL_HIGH : OSDService::BACKFILL_LOW; pg->osd->send_message_osd_cluster( @@ -5734,7 +5734,7 @@ PG::RecoveryState::WaitRemoteRecoveryReserved::react(const RemoteRecoveryReserve if (acting_osd_it != context< Active >().sorted_acting_set.end()) { ConnectionRef con = pg->osd->get_con_osd_cluster(*acting_osd_it, pg->get_osdmap()->get_epoch()); if (con) { - if ((con->features & CEPH_FEATURE_RECOVERY_RESERVATION)) { + if (con->has_feature(CEPH_FEATURE_RECOVERY_RESERVATION)) { pg->osd->send_message_osd_cluster( new MRecoveryReserve(MRecoveryReserve::REQUEST, pg->info.pgid, @@ -5782,7 +5782,7 @@ void PG::RecoveryState::Recovering::release_reservations() continue; ConnectionRef con = pg->osd->get_con_osd_cluster(*i, pg->get_osdmap()->get_epoch()); if (con) { - if ((con->features & CEPH_FEATURE_RECOVERY_RESERVATION)) { + if (con->has_feature(CEPH_FEATURE_RECOVERY_RESERVATION)) { pg->osd->send_message_osd_cluster( new MRecoveryReserve(MRecoveryReserve::RELEASE, pg->info.pgid,