From 3f3f8a15cb7fb6b99693d1c607b4bdd5acb89432 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Fri, 23 Mar 2018 22:46:02 +0100 Subject: [PATCH] osd: don't memcpy hobject_t in PrimaryLogPG::close_op_ctx(). Signed-off-by: Radoslaw Zarzynski --- src/osd/PrimaryLogPG.h | 4 ++-- src/osd/osd_internal_types.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index c9a8f880e45..4f9952c4914 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -814,7 +814,7 @@ protected: */ void release_object_locks( ObcLockManager &lock_manager) { - list > > to_req; + list > > to_req; bool requeue_recovery = false; bool requeue_snaptrim = false; lock_manager.put_locks( @@ -829,7 +829,7 @@ protected: if (!to_req.empty()) { // requeue at front of scrub blocking queue if we are blocked by scrub for (auto &&p: to_req) { - if (write_blocked_by_scrub(p.first.get_head())) { + if (write_blocked_by_scrub(p.first->obs.oi.soid.get_head())) { for (auto& op : p.second) { op->mark_delayed("waiting for scrub"); } diff --git a/src/osd/osd_internal_types.h b/src/osd/osd_internal_types.h index 4217767e677..57201627e1e 100644 --- a/src/osd/osd_internal_types.h +++ b/src/osd/osd_internal_types.h @@ -434,10 +434,10 @@ public: } void put_locks( - list > > *to_requeue, + list > > *to_requeue, bool *requeue_recovery, bool *requeue_snaptrimmer) { - for (auto p: locks) { + for (auto& p: locks) { list _to_requeue; p.second.obc->put_lock_type( p.second.type, @@ -445,10 +445,10 @@ public: requeue_recovery, requeue_snaptrimmer); if (to_requeue) { - to_requeue->push_back( - make_pair( - p.second.obc->obs.oi.soid, - std::move(_to_requeue))); + // We can safely std::move here as the whole `locks` is going + // to die just after the loop. + to_requeue->emplace_back(std::move(p.second.obc), + std::move(_to_requeue)); } } locks.clear(); -- 2.47.3