From: Suyash Dongre Date: Thu, 13 Jun 2024 15:16:12 +0000 (+0530) Subject: refactored the code to remove use-after-move warning generation. bl length would... X-Git-Tag: testing/wip-vshankar-testing-20240806.164130-debug~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9e0744f85923b4453f15e104fd5b723c91297fac;p=ceph-ci.git refactored the code to remove use-after-move warning generation. bl length would be stored before moving Signed-off-by: Suyash Dongre --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index a7e6d90a8fe..1f77f74cea3 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -6130,11 +6130,12 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) int r = osd->store->fiemap(ch, ghobject_t(soid, ghobject_t::NO_GEN, info.pgid.shard), op.extent.offset, op.extent.length, bl); - osd_op.outdata = std::move(bl); + auto bl_length = bl.length(); + osd_op.outdata = std::move(bl); if (r < 0) result = r; else - ctx->delta_stats.num_rd_kb += shift_round_up(bl.length(), 10); + ctx->delta_stats.num_rd_kb += shift_round_up(bl_length, 10); ctx->delta_stats.num_rd++; dout(10) << " map_extents done on object " << soid << dendl; }