]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/mirror/snapshot/SetImageStateRequest.h
df903a279ab878798df30fd40f32e6622d97fe4e
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_SET_IMAGE_STATE_REQUEST_H
5 #define CEPH_LIBRBD_MIRROR_SNAPSHOT_SET_IMAGE_STATE_REQUEST_H
7 #include "librbd/mirror/snapshot/Types.h"
21 template <typename ImageCtxT
= librbd::ImageCtx
>
22 class SetImageStateRequest
{
24 static SetImageStateRequest
*create(ImageCtxT
*image_ctx
, uint64_t snap_id
,
26 return new SetImageStateRequest(image_ctx
, snap_id
, on_finish
);
29 SetImageStateRequest(ImageCtxT
*image_ctx
, uint64_t snap_id
,
31 : m_image_ctx(image_ctx
), m_snap_id(snap_id
), m_on_finish(on_finish
) {
52 * UPDATE_PRIMARY_SNAPSHOT
60 ImageCtxT
*m_image_ctx
;
64 ImageState m_image_state
;
67 bufferlist m_state_bl
;
69 void get_snap_limit();
70 void handle_get_snap_limit(int r
);
73 void handle_get_metadata(int r
);
75 void write_image_state();
76 void handle_write_image_state(int r
);
78 void update_primary_snapshot();
79 void handle_update_primary_snapshot(int r
);
84 } // namespace snapshot
88 extern template class librbd::mirror::snapshot::SetImageStateRequest
<librbd::ImageCtx
>;
90 #endif // CEPH_LIBRBD_MIRROR_SNAPSHOT_SET_IMAGE_STATE_REQUEST_H