}
};
-template <typename I>
-struct Replayer<I>::C_TrackedOp : public Context {
- Replayer *replayer;
- Context* ctx;
-
- C_TrackedOp(Replayer* replayer, Context* ctx)
- : replayer(replayer), ctx(ctx) {
- replayer->m_in_flight_op_tracker.start_op();
- }
-
- void finish(int r) override {
- ctx->complete(r);
- replayer->m_in_flight_op_tracker.finish_op();
- }
-};
-
template <typename I>
struct Replayer<I>::RemoteJournalerListener
: public ::journal::JournalMetadataListener {
RemoteJournalerListener(Replayer* replayer) : replayer(replayer) {}
void handle_update(::journal::JournalMetadata*) override {
- auto ctx = new C_TrackedOp(replayer, new LambdaContext([this](int r) {
- replayer->handle_remote_journal_metadata_updated();
- }));
+ auto ctx = new C_TrackedOp(
+ replayer->m_in_flight_op_tracker,
+ new LambdaContext([this](int r) {
+ replayer->handle_remote_journal_metadata_updated();
+ }));
replayer->m_threads->work_queue->queue(ctx, 0);
}
};
void Replayer<I>::flush(Context* on_finish) {
dout(10) << dendl;
- flush_local_replay(new C_TrackedOp(this, on_finish));
+ flush_local_replay(new C_TrackedOp(m_in_flight_op_tracker, on_finish));
}
template <typename I>
return false;
}
- on_finish = new C_TrackedOp(this, on_finish);
+ on_finish = new C_TrackedOp(m_in_flight_op_tracker, on_finish);
return m_replay_status_formatter->get_or_send_update(description,
on_finish);
}
dout(10) << dendl;
- auto ctx = new C_TrackedOp(this, new LambdaContext(
+ auto ctx = new C_TrackedOp(m_in_flight_op_tracker, new LambdaContext(
[this](int) {
m_replayer_listener->handle_notification();
}));
}
};
-template <typename I>
-struct Replayer<I>::C_TrackedOp : public Context {
- Replayer *replayer;
- Context* ctx;
-
- C_TrackedOp(Replayer* replayer, Context* ctx)
- : replayer(replayer), ctx(ctx) {
- replayer->m_in_flight_op_tracker.start_op();
- }
-
- void finish(int r) override {
- ctx->complete(r);
- replayer->m_in_flight_op_tracker.finish_op();
- }
-};
-
template <typename I>
struct Replayer<I>::DeepCopyHandler : public librbd::deep_copy::Handler {
Replayer *replayer;
&op, m_local_snap_id_end, m_local_mirror_snap_ns.complete,
m_local_mirror_snap_ns.last_copied_object_number);
- auto ctx = new C_TrackedOp(this, new LambdaContext([this, complete](int r) {
+ auto ctx = new C_TrackedOp(
+ m_in_flight_op_tracker, new LambdaContext([this, complete](int r) {
handle_update_non_primary_snapshot(complete, r);
}));
auto aio_comp = create_rados_callback(ctx);
ceph_assert(ceph_mutex_is_locked_by_me(m_lock));
dout(10) << dendl;
- auto ctx = new C_TrackedOp(this, new LambdaContext(
+ auto ctx = new C_TrackedOp(m_in_flight_op_tracker, new LambdaContext(
[this](int) {
m_replayer_listener->handle_notification();
}));