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_PROMOTE_REQUEST_H
5 #define CEPH_LIBRBD_MIRROR_PROMOTE_REQUEST_H
7 #include "cls/rbd/cls_rbd_types.h"
8 #include "librbd/mirror/Types.h"
18 template <typename ImageCtxT = librbd::ImageCtx>
19 class PromoteRequest {
21 static PromoteRequest *create(ImageCtxT &image_ctx, bool force,
23 return new PromoteRequest(image_ctx, force, on_finish);
26 PromoteRequest(ImageCtxT &image_ctx, bool force, Context *on_finish)
27 : m_image_ctx(image_ctx), m_force(force), m_on_finish(on_finish) {
53 ImageCtxT &m_image_ctx;
57 cls::rbd::MirrorImage m_mirror_image;
58 PromotionState m_promotion_state;
61 void handle_get_info(int r);
64 void handle_promote(int r);
73 extern template class librbd::mirror::PromoteRequest<librbd::ImageCtx>;
75 #endif // CEPH_LIBRBD_MIRROR_PROMOTE_REQUEST_H