]>
git.proxmox.com Git - ceph.git/blob - ceph/src/tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.h
913bfd1c242c23207b4b873b826086e9f37a694e
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef RBD_MIRROR_IMAGE_REPLAYER_PREPARE_LOCAL_IMAGE_REQUEST_H
5 #define RBD_MIRROR_IMAGE_REPLAYER_PREPARE_LOCAL_IMAGE_REQUEST_H
7 #include "include/buffer.h"
10 namespace librados
{ struct IoCtx
; }
11 namespace librbd
{ struct ImageCtx
; }
18 namespace image_replayer
{
20 template <typename ImageCtxT
= librbd::ImageCtx
>
21 class PrepareLocalImageRequest
{
23 static PrepareLocalImageRequest
*create(librados::IoCtx
&io_ctx
,
24 const std::string
&global_image_id
,
25 std::string
*local_image_id
,
26 std::string
*tag_owner
,
27 ContextWQ
*work_queue
,
29 return new PrepareLocalImageRequest(io_ctx
, global_image_id
, local_image_id
,
30 tag_owner
, work_queue
, on_finish
);
33 PrepareLocalImageRequest(librados::IoCtx
&io_ctx
,
34 const std::string
&global_image_id
,
35 std::string
*local_image_id
,
36 std::string
*tag_owner
,
37 ContextWQ
*work_queue
,
39 : m_io_ctx(io_ctx
), m_global_image_id(global_image_id
),
40 m_local_image_id(local_image_id
), m_tag_owner(tag_owner
),
41 m_work_queue(work_queue
), m_on_finish(on_finish
) {
64 librados::IoCtx
&m_io_ctx
;
65 std::string m_global_image_id
;
66 std::string
*m_local_image_id
;
67 std::string
*m_tag_owner
;
68 ContextWQ
*m_work_queue
;
73 void get_local_image_id();
74 void handle_get_local_image_id(int r
);
76 void get_mirror_state();
77 void handle_get_mirror_state(int r
);
80 void handle_get_tag_owner(int r
);
86 } // namespace image_replayer
90 extern template class rbd::mirror::image_replayer::PrepareLocalImageRequest
<librbd::ImageCtx
>;
92 #endif // RBD_MIRROR_IMAGE_REPLAYER_PREPARE_LOCAL_IMAGE_REQUEST_H