From: Radoslaw Zarzynski Date: Tue, 3 Mar 2020 22:29:13 +0000 (+0100) Subject: crimson/osd, osd: switch PG::request_local_background_io_reservation() to uptr. X-Git-Tag: v16.1.0~1720^2~31 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7783072a5b5db82fec7a9da45fa7201e137d241f;p=ceph.git crimson/osd, osd: switch PG::request_local_background_io_reservation() to uptr. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index d45d329bf392..3b7df08fdaf3 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -202,8 +202,8 @@ public: } void request_local_background_io_reservation( unsigned priority, - PGPeeringEventRef on_grant, - PGPeeringEventRef on_preempt) final { + PGPeeringEventURef on_grant, + PGPeeringEventURef on_preempt) final { shard_services.local_reserver.request_reservation( pgid, on_grant ? make_lambda_context([this, on_grant=std::move(on_grant)] (int) { diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 607833ee15f8..cb6da21cc85b 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1620,15 +1620,15 @@ void PG::schedule_event_after( void PG::request_local_background_io_reservation( unsigned priority, - PGPeeringEventRef on_grant, - PGPeeringEventRef on_preempt) { + PGPeeringEventURef on_grant, + PGPeeringEventURef on_preempt) { osd->local_reserver.request_reservation( pg_id, on_grant ? new QueuePeeringEvt( - this, on_grant) : nullptr, + this, std::move(on_grant)) : nullptr, priority, on_preempt ? new QueuePeeringEvt( - this, on_preempt) : nullptr); + this, std::move(on_preempt)) : nullptr); } void PG::update_local_background_io_priority( diff --git a/src/osd/PG.h b/src/osd/PG.h index 50a968de78cf..170e8b8f1f7f 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -407,8 +407,8 @@ public: float delay) override; void request_local_background_io_reservation( unsigned priority, - PGPeeringEventRef on_grant, - PGPeeringEventRef on_preempt) override; + PGPeeringEventURef on_grant, + PGPeeringEventURef on_preempt) override; void update_local_background_io_priority( unsigned priority) override; void cancel_local_background_io_reservation() override; diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 437a56fb0262..8db3db7625a4 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -4870,11 +4870,11 @@ PeeringState::WaitLocalBackfillReserved::WaitLocalBackfillReserved(my_context ct ps->state_set(PG_STATE_BACKFILL_WAIT); pl->request_local_background_io_reservation( ps->get_backfill_priority(), - std::make_shared( + std::make_unique( ps->get_osdmap_epoch(), ps->get_osdmap_epoch(), LocalBackfillReserved()), - std::make_shared( + std::make_unique( ps->get_osdmap_epoch(), ps->get_osdmap_epoch(), DeferBackfill(0.0))); @@ -5234,11 +5234,11 @@ PeeringState::WaitLocalRecoveryReserved::WaitLocalRecoveryReserved(my_context ct ps->state_set(PG_STATE_RECOVERY_WAIT); pl->request_local_background_io_reservation( ps->get_recovery_priority(), - std::make_shared( + std::make_unique( ps->get_osdmap_epoch(), ps->get_osdmap_epoch(), LocalRecoveryReserved()), - std::make_shared( + std::make_unique( ps->get_osdmap_epoch(), ps->get_osdmap_epoch(), DeferRecovery(0.0))); @@ -6253,11 +6253,11 @@ PeeringState::WaitDeleteReserved::WaitDeleteReserved(my_context ctx) pl->cancel_local_background_io_reservation(); pl->request_local_background_io_reservation( context().priority, - std::make_shared( + std::make_unique( ps->get_osdmap_epoch(), ps->get_osdmap_epoch(), DeleteReserved()), - std::make_shared( + std::make_unique( ps->get_osdmap_epoch(), ps->get_osdmap_epoch(), DeleteInterrupted())); diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index 5a765e03017c..1944f9de429d 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -310,8 +310,8 @@ public: */ virtual void request_local_background_io_reservation( unsigned priority, - PGPeeringEventRef on_grant, - PGPeeringEventRef on_preempt) = 0; + PGPeeringEventURef on_grant, + PGPeeringEventURef on_preempt) = 0; /// Modify pending local background reservation request priority virtual void update_local_background_io_priority( unsigned priority) = 0;