]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/mirror/snapshot/CreatePrimaryRequest.h
69c0ed4470198423a80bad74b558599d657f4a14
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_LIBRBD_MIRROR_SNAPSHOT_CREATE_PRIMARY_REQUEST_H
5 #define CEPH_LIBRBD_MIRROR_SNAPSHOT_CREATE_PRIMARY_REQUEST_H
7 #include "include/buffer.h"
8 #include "include/rados/librados.hpp"
9 #include "cls/rbd/cls_rbd_types.h"
10 #include "librbd/mirror/snapshot/Types.h"
24 template <typename ImageCtxT
= librbd::ImageCtx
>
25 class CreatePrimaryRequest
{
27 static CreatePrimaryRequest
*create(ImageCtxT
*image_ctx
,
28 const std::string
& global_image_id
,
29 uint32_t flags
, uint64_t *snap_id
,
31 return new CreatePrimaryRequest(image_ctx
, global_image_id
, flags
, snap_id
,
35 CreatePrimaryRequest(ImageCtxT
*image_ctx
,
36 const std::string
& global_image_id
,
37 uint32_t flags
, uint64_t *snap_id
, Context
*on_finish
);
57 * UNLINK_PEER (skip if not needed,
65 ImageCtxT
*m_image_ctx
;
66 std::string m_global_image_id
;
67 const uint32_t m_flags
;
71 librados::IoCtx m_default_ns_ctx
;
72 std::set
<std::string
> m_mirror_peer_uuids
;
73 std::string m_snap_name
;
77 void get_mirror_peers();
78 void handle_get_mirror_peers(int r
);
80 void create_snapshot();
81 void handle_create_snapshot(int r
);
84 void handle_refresh_image(int r
);
87 void handle_unlink_peer(int r
);
92 } // namespace snapshot
96 extern template class librbd::mirror::snapshot::CreatePrimaryRequest
<librbd::ImageCtx
>;
98 #endif // CEPH_LIBRBD_MIRROR_SNAPSHOT_CREATE_PRIMARY_REQUEST_H