OSD: Initialize pool and recovery_state in the order they are defined

Currently we call get_pool on the PeeringState before the PeeringState
has been initialized.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
Adam C. Emerson 2019-05-02 12:48:44 -04:00 committed by Kefu Chai
parent 975fafed35
commit 6248c40d54
2 changed files with 5 additions and 6 deletions

View File

@ -176,7 +176,6 @@ PG::PG(OSDService *o, OSDMapRef curmap,
coll(p),
osd(o),
cct(o->cct),
pool(recovery_state.get_pool()),
osdriver(osd->store, coll_t(), OSD::make_snapmapper_oid()),
snap_mapper(
cct,
@ -208,6 +207,7 @@ PG::PG(OSDService *o, OSDMapRef curmap,
curmap,
this,
this),
pool(recovery_state.get_pool()),
info(recovery_state.get_info())
{
#ifdef PG_DEBUG_REFS

View File

@ -595,8 +595,6 @@ public:
protected:
CephContext *cct;
const PGPool &pool;
// locking and reference counting.
// I destroy myself when the reference count hits zero.
// lock() should be called before doing anything.
@ -1488,9 +1486,10 @@ protected:
protected:
PeeringState recovery_state;
/**
* Ref to pg_info_t in Peering state
*/
// ref to recovery_state.pool
const PGPool &pool;
// ref to recovery_state.info
const pg_info_t &info;
};