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_DEMOTE_REQUEST_H
5 #define CEPH_LIBRBD_MIRROR_DEMOTE_REQUEST_H
7 #include "cls/rbd/cls_rbd_types.h"
8 #include "librbd/mirror/Types.h"
18 template <typename ImageCtxT = librbd::ImageCtx>
21 static DemoteRequest *create(ImageCtxT &image_ctx, Context *on_finish) {
22 return new DemoteRequest(image_ctx, on_finish);
25 DemoteRequest(ImageCtxT &image_ctx, Context *on_finish)
26 : m_image_ctx(image_ctx), m_on_finish(on_finish) {
41 * ACQUIRE_LOCK * * * *
50 * <finish> < * * * * *
55 ImageCtxT &m_image_ctx;
59 bool m_blocked_requests = false;
61 cls::rbd::MirrorImage m_mirror_image;
62 PromotionState m_promotion_state;
65 void handle_get_info(int r);
68 void handle_acquire_lock(int r);
71 void handle_demote(int r);
74 void handle_release_lock(int r);
83 extern template class librbd::mirror::DemoteRequest<librbd::ImageCtx>;
85 #endif // CEPH_LIBRBD_MIRROR_DEMOTE_REQUEST_H