From 0035f4e090c0f19786130632964f7e481f8a3d9a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 12 Mar 2021 14:40:47 +0800 Subject: [PATCH] osd: drop OSD::create_context() OSD::create_context() was used for creating PeeringCtx from OSD's require_osd_release. but since the check against require_osd_release is not required anymore, let's drop this helper. Signed-off-by: Kefu Chai --- src/osd/OSD.cc | 16 +++++----------- src/osd/OSD.h | 1 - 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index c94b9d94ff082..c3fa5b0544364 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4860,8 +4860,6 @@ PGRef OSD::handle_pg_create_info(const OSDMapRef& osdmap, return nullptr; } - PeeringCtx rctx = create_context(); - OSDMapRef startmap = get_map(info->epoch); if (info->by_mon) { @@ -4895,6 +4893,7 @@ PGRef OSD::handle_pg_create_info(const OSDMapRef& osdmap, << "the pool allows ec overwrites but is not stored in " << "bluestore, so deep scrubbing will not detect bitrot"; } + PeeringCtx rctx; create_pg_collection( rctx.transaction, pgid, pgid.get_split_bits(pp->get_pg_num())); init_pg_ondisk(rctx.transaction, pgid, pp); @@ -8589,7 +8588,7 @@ void OSD::_finish_splits(set& pgs) ++i) { PG *pg = i->get(); - PeeringCtx rctx = create_context(); + PeeringCtx rctx; pg->lock(); dout(10) << __func__ << " " << *pg << dendl; epoch_t e = pg->get_osdmap_epoch(); @@ -9244,11 +9243,6 @@ void OSD::handle_pg_create(OpRequestRef op) // ---------------------------------------- // peering and recovery -PeeringCtx OSD::create_context() -{ - return PeeringCtx(); -} - void OSD::dispatch_context(PeeringCtx &ctx, PG *pg, OSDMapRef curmap, ThreadPool::TPHandle *handle) { @@ -9691,7 +9685,7 @@ void OSD::do_recovery( << " on " << *pg << dendl; if (do_unfound) { - PeeringCtx rctx = create_context(); + PeeringCtx rctx; rctx.handle = &handle; pg->find_unfound(queued, rctx); dispatch_context(rctx, pg, pg->get_osdmap()); @@ -9880,7 +9874,6 @@ void OSD::dequeue_peering_evt( PGPeeringEventRef evt, ThreadPool::TPHandle& handle) { - PeeringCtx rctx = create_context(); auto curmap = sdata->get_osdmap(); bool need_up_thru = false; epoch_t same_interval_since = 0; @@ -9891,7 +9884,8 @@ void OSD::dequeue_peering_evt( derr << __func__ << " unrecognized pg-less event " << evt->get_desc() << dendl; ceph_abort(); } - } else if (advance_pg(curmap->get_epoch(), pg, handle, rctx)) { + } else if (PeeringCtx rctx; + advance_pg(curmap->get_epoch(), pg, handle, rctx)) { pg->do_peering_event(evt, rctx); if (pg->is_deleted()) { pg->unlock(); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 90d2f800fb841..b5944c5a515bd 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1895,7 +1895,6 @@ protected: double scrub_sleep_time(bool must_scrub); // -- generic pg peering -- - PeeringCtx create_context(); void dispatch_context(PeeringCtx &ctx, PG *pg, OSDMapRef curmap, ThreadPool::TPHandle *handle = NULL); -- 2.39.5