Skip to content

Commit 9e0744f

Browse files
committed
refactored the code to remove use-after-move warning generation. bl length would be stored before moving
Signed-off-by: Suyash Dongre <[email protected]>
1 parent 3139c54 commit 9e0744f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/osd/PrimaryLogPG.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6130,11 +6130,12 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
61306130
int r = osd->store->fiemap(ch, ghobject_t(soid, ghobject_t::NO_GEN,
61316131
info.pgid.shard),
61326132
op.extent.offset, op.extent.length, bl);
6133-
osd_op.outdata = std::move(bl);
6133+
auto bl_length = bl.length();
6134+
osd_op.outdata = std::move(bl);
61346135
if (r < 0)
61356136
result = r;
61366137
else
6137-
ctx->delta_stats.num_rd_kb += shift_round_up(bl.length(), 10);
6138+
ctx->delta_stats.num_rd_kb += shift_round_up(bl_length, 10);
61386139
ctx->delta_stats.num_rd++;
61396140
dout(10) << " map_extents done on object " << soid << dendl;
61406141
}

0 commit comments

Comments
 (0)