Signed-off-by: Samuel Just <sjust@redhat.com>
return recovery_state.get_osdmap();
}
- epoch_t get_osdmap_epoch() const override {
+ epoch_t get_osdmap_epoch() const override final {
return recovery_state.get_osdmap()->get_epoch();
}
void PGStateHistory::enter(const utime_t entime, const char* state)
{
if (pi == nullptr) {
- pi = std::unique_ptr<PGStateInstance>(new PGStateInstance);
+ pi = std::make_unique<PGStateInstance>();
}
pi->enter_state(entime, state);
}
void PGStateHistory::exit(const char* state) {
- pi->setepoch(es->get_osdmap_epoch());
+ pi->setepoch(es.get_osdmap_epoch());
pi->exit_state(ceph_clock_now());
if (pi->empty()) {
reset();
class PGStateHistory {
public:
- PGStateHistory(EpochSource *es) : buffer(10), es(es) {}
+ PGStateHistory(const EpochSource &es) : buffer(10), es(es) {}
void enter(const utime_t entime, const char* state);
private:
std::unique_ptr<PGStateInstance> pi;
boost::circular_buffer<std::unique_ptr<PGStateInstance>> buffer;
- EpochSource *es;
+ const EpochSource &es;
};
OSDMapRef curmap,
DoutPrefixProvider *dpp,
PeeringListener *pl)
- : state_history(pl),
+ : state_history(*pl),
cct(cct),
spgid(spgid),
dpp(dpp),