From 7783072a5b5db82fec7a9da45fa7201e137d241f Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Tue, 3 Mar 2020 23:29:13 +0100 Subject: [PATCH] crimson/osd, osd: switch PG::request_local_background_io_reservation() to uptr. Signed-off-by: Radoslaw Zarzynski --- src/crimson/osd/pg.h | 4 ++-- src/osd/PG.cc | 8 ++++---- src/osd/PG.h | 4 ++-- src/osd/PeeringState.cc | 12 ++++++------ src/osd/PeeringState.h | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index d45d329bf3926..3b7df08fdaf30 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 607833ee15f8f..cb6da21cc85b8 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 50a968de78cf2..170e8b8f1f7fe 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 437a56fb02624..8db3db7625a40 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 5a765e03017c6..1944f9de429d7 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; -- 2.39.5