From 16d388bdae16db92b6911f7e6149906103a5f52f Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 2 Apr 2019 11:39:31 -0700 Subject: [PATCH] osd/: move min_peer_*_features and helpers Signed-off-by: Samuel Just --- src/osd/PG.h | 9 --------- src/osd/PeeringState.cc | 10 +++++----- src/osd/PeeringState.h | 11 +++++++++++ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/osd/PG.h b/src/osd/PG.h index f1fe3f4b3d6..60939cd36c9 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1398,15 +1398,6 @@ protected: bool delete_needs_sleep = false; protected: - void reset_min_peer_features() { - peer_features = CEPH_FEATURES_SUPPORTED_DEFAULT; - } - uint64_t get_min_peer_features() const { return peer_features; } - void apply_peer_features(uint64_t f) { peer_features &= f; } - - uint64_t get_min_acting_features() const { return acting_features; } - uint64_t get_min_upacting_features() const { return upacting_features; } - bool hard_limit_pglog() const { return (get_osdmap()->test_flag(CEPH_OSDMAP_PGLOG_HARDLIMIT)); } diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 8009032553d..00f1eadbfa3 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -4460,7 +4460,7 @@ PeeringState::GetInfo::GetInfo(my_context ctx) prior_set = ps->build_prior(); - pg->reset_min_peer_features(); + ps->reset_min_peer_features(); get_infos(); if (prior_set.pg_down) { post_event(IsDown()); @@ -4542,13 +4542,13 @@ boost::statechart::result PeeringState::GetInfo::react(const MNotifyRec& infoevt } psdout(20) << "Adding osd: " << infoevt.from.osd << " peer features: " << hex << infoevt.features << dec << dendl; - pg->apply_peer_features(infoevt.features); + ps->apply_peer_features(infoevt.features); // are we done getting everything? if (peer_info_requested.empty() && !prior_set.pg_down) { - psdout(20) << "Common peer features: " << hex << pg->get_min_peer_features() << dec << dendl; - psdout(20) << "Common acting features: " << hex << pg->get_min_acting_features() << dec << dendl; - psdout(20) << "Common upacting features: " << hex << pg->get_min_upacting_features() << dec << dendl; + psdout(20) << "Common peer features: " << hex << ps->get_min_peer_features() << dec << dendl; + psdout(20) << "Common acting features: " << hex << ps->get_min_acting_features() << dec << dendl; + psdout(20) << "Common upacting features: " << hex << ps->get_min_upacting_features() << dec << dendl; post_event(GotInfo()); } } diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index 33778a3af2c..0c5bc133b75 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -1594,6 +1594,17 @@ public: return missing_loc.num_unfound(); } +private: + void apply_peer_features(uint64_t f) { peer_features &= f; } + void reset_min_peer_features() { + peer_features = CEPH_FEATURES_SUPPORTED_DEFAULT; + } +public: + uint64_t get_min_peer_features() const { return peer_features; } + uint64_t get_min_acting_features() const { return acting_features; } + uint64_t get_min_upacting_features() const { return upacting_features; } + + // Flush control interface private: void start_flush(ObjectStore::Transaction *t) { -- 2.39.5