]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Message,OSD,PG: make Connection::features private
authorSage Weil <sage@inktank.com>
Fri, 19 Jul 2013 15:08:02 +0000 (08:08 -0700)
committerSage Weil <sage@inktank.com>
Fri, 19 Jul 2013 15:09:09 +0000 (08:09 -0700)
Use has_feature() method too.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
src/msg/Message.h
src/osd/OSD.cc
src/osd/PG.cc

index ad2bc8249b74485bae8f72288a46695dda789eb0..3ed8ee667d242c07b00e50450901f39c36429b7c 100644 (file)
@@ -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.
 
index 2dc59b32f4f5d03bdf8810131d8b08032896a00e..1ee4c09a63e1f71fd9ccd7922e2277daf85abe88 100644 (file)
@@ -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<pg_t,pg_query_t> >& 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<int,vector<pair<pg_notify_t, pg_interval_map_t> > >& 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());
index 6f8ee0c44c748013274bdfa8942aee7d56ad6697..2a07887a2a314e3346ccb92eacc0e8a6a079186e 100644 (file)
@@ -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,