]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/object_map/SnapshotRollbackRequest.h
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_OBJECT_MAP_SNAPSHOT_ROLLBACK_REQUEST_H
5 #define CEPH_LIBRBD_OBJECT_MAP_SNAPSHOT_ROLLBACK_REQUEST_H
7 #include "include/int_types.h"
8 #include "librbd/object_map/Request.h"
16 namespace object_map
{
18 class SnapshotRollbackRequest
: public Request
{
21 * Snapshot rollback goes through the following state machine:
28 * STATE_READ_MAP * * * * > STATE_INVALIDATE_MAP
31 * STATE_WRITE_MAP -------> <finish>
35 * If an error occurs within the READ_MAP state, the associated snapshot's
36 * object map will be flagged as invalid. Otherwise, an error from any state
37 * will result in the HEAD object map being flagged as invalid via the base
46 SnapshotRollbackRequest(ImageCtx
&image_ctx
, uint64_t snap_id
,
48 : Request(image_ctx
, CEPH_NOSNAP
, on_finish
),
49 m_snap_id(snap_id
), m_ret_val(0) {
50 assert(snap_id
!= CEPH_NOSNAP
);
56 bool should_complete(int r
) override
;
66 void send_invalidate_map();
67 void send_write_map();
71 } // namespace object_map
74 #endif // CEPH_LIBRBD_OBJECT_MAP_SNAPSHOT_ROLLBACK_REQUEST_H