summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-19 08:08:02 -0700
committerSage Weil <sage@inktank.com>2013-07-19 08:09:09 -0700
commitf0feabe81faa0152f6f3f4615354e1ef201c0113 (patch)
treebcbb59d8a3e125459fad953f14f10d276920a5bd
parentd1b47f40e793d2a710aff9c9ad109485118dd192 (diff)
downloadceph-f0feabe81faa0152f6f3f4615354e1ef201c0113.tar.gz
Message,OSD,PG: make Connection::features private
Use has_feature() method too. Signed-off-by: Samuel Just <sam.just@inktank.com> Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/msg/Message.h2
-rw-r--r--src/osd/OSD.cc8
-rw-r--r--src/osd/PG.cc8
3 files changed, 10 insertions, 8 deletions
diff --git a/src/msg/Message.h b/src/msg/Message.h
index ad2bc8249b7..3ed8ee667d2 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 2dc59b32f4f..1ee4c09a63e 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<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());
diff --git a/src/osd/PG.cc b/src/osd/PG.cc
index 6f8ee0c44c7..2a07887a2a3 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,