From f6a928e4d2698cfc1d1495499a2b6ecde4de422e Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Sun, 3 Jul 2022 12:18:58 +0000 Subject: [PATCH] osd/PrimaryLogPG: make_writeable nit fixes Signed-off-by: Matan Breizman --- src/osd/PrimaryLogPG.cc | 23 +++++++++++------------ src/osd/PrimaryLogPG.h | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 58a065f96dc79..c4153bd0cb0ff 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -8485,7 +8485,7 @@ void PrimaryLogPG::_do_rollback_to(OpContext *ctx, ObjectContextRef rollback_to, void PrimaryLogPG::_make_clone( OpContext *ctx, PGTransaction* t, - ObjectContextRef obc, + ObjectContextRef clone_obc, const hobject_t& head, const hobject_t& coid, object_info_t *poi) { @@ -8493,8 +8493,8 @@ void PrimaryLogPG::_make_clone( encode(*poi, bv, get_osdmap()->get_features(CEPH_ENTITY_TYPE_OSD, nullptr)); t->clone(coid, head); - setattr_maybe_cache(obc, t, OI_ATTR, bv); - rmattr_maybe_cache(obc, t, SS_ATTR); + setattr_maybe_cache(clone_obc, t, OI_ATTR, bv); + rmattr_maybe_cache(clone_obc, t, SS_ATTR); } void PrimaryLogPG::make_writeable(OpContext *ctx) @@ -8555,14 +8555,12 @@ void PrimaryLogPG::make_writeable(OpContext *ctx) hobject_t coid = soid; coid.snap = snapc.seq; - unsigned l; - for (l = 1; - l < snapc.snaps.size() && snapc.snaps[l] > ctx->new_snapset.seq; - l++) ; - - vector snaps(l); - for (unsigned i=0; i ctx->new_snapset.seq; }); + return vector{begin(snapc.snaps), last}; + }(); // prepare clone object_info_t static_snap_oi(coid); @@ -8626,8 +8624,9 @@ void PrimaryLogPG::make_writeable(OpContext *ctx) // clone_overlap should contain an entry for each clone // (an empty interval_set if there is no overlap) ctx->new_snapset.clone_overlap[coid.snap]; - if (ctx->obs->oi.size) + if (ctx->obs->oi.size) { ctx->new_snapset.clone_overlap[coid.snap].insert(0, ctx->obs->oi.size); + } // log clone dout(10) << " cloning v " << ctx->obs->oi.version diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 2605c992bca33..b60fd36c85a5e 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -1152,7 +1152,7 @@ protected: void _make_clone( OpContext *ctx, PGTransaction* t, - ObjectContextRef obc, + ObjectContextRef clone_obc, const hobject_t& head, const hobject_t& coid, object_info_t *poi); void execute_ctx(OpContext *ctx); -- 2.39.5