Skip to content

Commit 4dc4e36

Browse files
authored
Merge pull request ceph#59490 from Suyashd999/fix-mfr1
rgw/rgw_aio: forwarding reference passed to std::move() Reviewed-By: Adam Emerson <[email protected]>, Yuval Lifshitz <[email protected]>
2 parents 93ba7b0 + 81fb5ae commit 4dc4e36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rgw/rgw_aio.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void cb(librados::completion_t, void* arg) {
5252

5353
template <typename Op>
5454
Aio::OpFunc aio_abstract(librados::IoCtx ctx, Op&& op, jspan_context* trace_ctx = nullptr) {
55-
return [ctx = std::move(ctx), op = std::move(op), trace_ctx] (Aio* aio, AioResult& r) mutable {
55+
return [ctx = std::move(ctx), op = std::forward<Op>(op), trace_ctx] (Aio* aio, AioResult& r) mutable {
5656
constexpr bool read = std::is_same_v<std::decay_t<Op>, librados::ObjectReadOperation>;
5757
// use placement new to construct the rados state inside of user_data
5858
auto s = new (&r.user_data) state(aio, ctx, r);
@@ -92,7 +92,7 @@ template <typename Op>
9292
Aio::OpFunc aio_abstract(librados::IoCtx ctx, Op&& op,
9393
boost::asio::yield_context yield,
9494
jspan_context* trace_ctx) {
95-
return [ctx = std::move(ctx), op = std::move(op), yield, trace_ctx] (Aio* aio, AioResult& r) mutable {
95+
return [ctx = std::move(ctx), op = std::forward<Op>(op), yield, trace_ctx] (Aio* aio, AioResult& r) mutable {
9696
// arrange for the completion Handler to run on the yield_context's strand
9797
// executor so it can safely call back into Aio without locking
9898
auto ex = yield.get_executor();

0 commit comments

Comments
 (0)