From 2a3e66c388892efcecebd8eb3d7bf082be485bab Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Wed, 24 May 2017 00:19:51 -0700 Subject: [PATCH] osd: use PGRef instead of boost::intrusive_ptr everywhere Signed-off-by: Greg Farnum (cherry picked from commit 306ad85f0fb4597ba3bb3c04a67abdaba556ba74) --- src/osd/OSD.cc | 15 ++++++++------- src/osd/OSD.h | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 7def76cf49426..038bfee213296 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7341,7 +7341,7 @@ bool OSD::advance_pg( epoch_t osd_epoch, PG *pg, ThreadPool::TPHandle &handle, PG::RecoveryCtx *rctx, - set > *new_pgs) + set *new_pgs) { assert(pg->is_locked()); epoch_t next_epoch = pg->get_osdmap()->get_epoch() + 1; @@ -7641,7 +7641,7 @@ bool OSD::require_same_or_newer_map(OpRequestRef& op, epoch_t epoch, void OSD::split_pgs( PG *parent, - const set &childpgids, set > *out_pgs, + const set &childpgids, set *out_pgs, OSDMapRef curmap, OSDMapRef nextmap, PG::RecoveryCtx *rctx) @@ -9089,20 +9089,21 @@ void OSD::dequeue_op( struct C_CompleteSplits : public Context { OSD *osd; - set > pgs; - C_CompleteSplits(OSD *osd, const set > &in) + set pgs; + C_CompleteSplits(OSD *osd, const set &in) : osd(osd), pgs(in) {} void finish(int r) { Mutex::Locker l(osd->osd_lock); if (osd->is_stopping()) return; PG::RecoveryCtx rctx = osd->create_context(); - for (set >::iterator i = pgs.begin(); + for (set::iterator i = pgs.begin(); i != pgs.end(); ++i) { osd->pg_map_lock.get_write(); (*i)->lock(); - osd->add_newly_split_pg(&**i, &rctx); + PG *pg = (*i).get(); + osd->add_newly_split_pg(pg, &rctx); if (!((*i)->deleting)) { set to_complete; to_complete.insert((*i)->info.pgid); @@ -9131,7 +9132,7 @@ void OSD::process_peering_events( for (list::const_iterator i = pgs.begin(); i != pgs.end(); ++i) { - set > split_pgs; + set split_pgs; PG *pg = *i; pg->lock_suspend_timeout(handle); curmap = service.get_osdmap(); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index fc5cbdb6bbd97..c09cd2d81f4bf 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1993,7 +1993,7 @@ private: epoch_t advance_to, PG *pg, ThreadPool::TPHandle &handle, PG::RecoveryCtx *rctx, - set > *split_pgs + set *split_pgs ); void consume_map(); void activate_map(); @@ -2110,7 +2110,7 @@ protected: void split_pgs( PG *parent, - const set &childpgids, set > *out_pgs, + const set &childpgids, set *out_pgs, OSDMapRef curmap, OSDMapRef nextmap, PG::RecoveryCtx *rctx); -- 2.39.5