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_IS_PRIMARY_REQUEST_H
5 #define RBD_MIRROR_IMAGE_REPLAYER_IS_PRIMARY_REQUEST_H
7 #include "include/buffer.h"
11 namespace librbd { class ImageCtx; }
15 namespace image_replayer {
17 template <typename ImageCtxT = librbd::ImageCtx>
18 class IsPrimaryRequest {
20 static IsPrimaryRequest* create(ImageCtxT *image_ctx, bool *primary,
22 return new IsPrimaryRequest(image_ctx, primary, on_finish);
25 IsPrimaryRequest(ImageCtxT *image_ctx, bool *primary, Context *on_finish);
36 * GET_MIRROR_STATE * * * * *
39 * IS_TAG_OWNER * * * * * * * (error)
42 * <finish> < * * * * * * * *
46 ImageCtxT *m_image_ctx;
52 void send_get_mirror_state();
53 void handle_get_mirror_state(int r);
55 void send_is_tag_owner();
56 void handle_is_tag_owner(int r);
61 } // namespace image_replayer
65 extern template class rbd::mirror::image_replayer::IsPrimaryRequest<librbd::ImageCtx>;
67 #endif // RBD_MIRROR_IMAGE_REPLAYER_IS_PRIMARY_REQUEST_H