#include "ObjectCopyRequest.h"
#include "common/errno.h"
#include "librbd/Utils.h"
+#include "librbd/deep_copy/Handler.h"
#include "librbd/deep_copy/Utils.h"
#include "librbd/image/CloseRequest.h"
#include "librbd/image/OpenRequest.h"
bool flatten,
const ObjectNumber &object_number,
const SnapSeqs &snap_seqs,
- ProgressContext *prog_ctx,
+ Handler *handler,
Context *on_finish)
: RefCountedObject(dst_image_ctx->cct), m_src_image_ctx(src_image_ctx),
m_dst_image_ctx(dst_image_ctx), m_src_snap_id_start(src_snap_id_start),
m_src_snap_id_end(src_snap_id_end), m_dst_snap_id_start(dst_snap_id_start),
m_flatten(flatten), m_object_number(object_number), m_snap_seqs(snap_seqs),
- m_prog_ctx(prog_ctx), m_on_finish(on_finish), m_cct(dst_image_ctx->cct),
+ m_handler(handler), m_on_finish(on_finish), m_cct(dst_image_ctx->cct),
m_lock(ceph::make_mutex(unique_lock_name("ImageCopyRequest::m_lock", this))) {
}
[this, ono](int r) {
handle_object_copy(ono, r);
});
- ObjectCopyRequest<I> *req = ObjectCopyRequest<I>::create(
+ auto req = ObjectCopyRequest<I>::create(
m_src_image_ctx, m_dst_image_ctx, m_src_snap_id_start, m_dst_snap_id_start,
- m_snap_map, ono, m_flatten, ctx);
+ m_snap_map, ono, m_flatten, m_handler, ctx);
req->send();
return 0;
}
uint64_t progress_object_no = *m_object_number + 1;
m_updating_progress = true;
m_lock.unlock();
- m_prog_ctx->update_progress(progress_object_no, m_end_object_no);
+ m_handler->update_progress(progress_object_no, m_end_object_no);
m_lock.lock();
ceph_assert(m_updating_progress);
m_updating_progress = false;