X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Flibrbd%2Foperation%2FSnapshotRollbackRequest.h;fp=src%2Fceph%2Fsrc%2Flibrbd%2Foperation%2FSnapshotRollbackRequest.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=a32a84dc27b0cf504ddc8d16b968bb28681314d5;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/librbd/operation/SnapshotRollbackRequest.h b/src/ceph/src/librbd/operation/SnapshotRollbackRequest.h deleted file mode 100644 index a32a84d..0000000 --- a/src/ceph/src/librbd/operation/SnapshotRollbackRequest.h +++ /dev/null @@ -1,114 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab - -#ifndef CEPH_LIBRBD_OPERATION_SNAPSHOT_ROLLBACK_REQUEST_H -#define CEPH_LIBRBD_OPERATION_SNAPSHOT_ROLLBACK_REQUEST_H - -#include "librbd/operation/Request.h" -#include "librbd/ImageCtx.h" -#include "librbd/internal.h" -#include "librbd/journal/Types.h" -#include - -class Context; - -namespace librbd { - -class ProgressContext; - -namespace operation { - -template -class SnapshotRollbackRequest : public Request { -public: - /** - * Snap Rollback goes through the following state machine: - * - * @verbatim - * - * ---------\ - * | - * v - * STATE_BLOCK_WRITES - * | - * v - * STATE_RESIZE_IMAGE (skip if resize not - * | required) - * v - * STATE_ROLLBACK_OBJECT_MAP (skip if object - * | map disabled) - * v - * STATE_ROLLBACK_OBJECTS - * | - * v - * STATE_REFRESH_OBJECT_MAP (skip if object - * | map disabled) - * v - * STATE_INVALIDATE_CACHE (skip if cache - * | disabled) - * v - * - * - * @endverbatim - * - * The _RESIZE_IMAGE state is skipped if the image doesn't need to be resized. - * The _ROLLBACK_OBJECT_MAP state is skipped if the object map isn't enabled. - * The _INVALIDATE_CACHE state is skipped if the cache isn't enabled. - */ - - SnapshotRollbackRequest(ImageCtxT &image_ctx, Context *on_finish, - const cls::rbd::SnapshotNamespace &snap_namespace, - const std::string &snap_name, - uint64_t snap_id, - uint64_t snap_size, ProgressContext &prog_ctx); - ~SnapshotRollbackRequest() override; - -protected: - void send_op() override; - bool should_complete(int r) override { - return true; - } - - journal::Event create_event(uint64_t op_tid) const override { - return journal::SnapRollbackEvent(op_tid, m_snap_namespace, m_snap_name); - } - -private: - cls::rbd::SnapshotNamespace m_snap_namespace; - std::string m_snap_name; - uint64_t m_snap_id; - uint64_t m_snap_size; - ProgressContext &m_prog_ctx; - - NoOpProgressContext m_no_op_prog_ctx; - - bool m_blocking_writes = false; - decltype(ImageCtxT::object_map) m_object_map; - - void send_block_writes(); - Context *handle_block_writes(int *result); - - void send_resize_image(); - Context *handle_resize_image(int *result); - - void send_rollback_object_map(); - Context *handle_rollback_object_map(int *result); - - void send_rollback_objects(); - Context *handle_rollback_objects(int *result); - - Context *send_refresh_object_map(); - Context *handle_refresh_object_map(int *result); - - Context *send_invalidate_cache(); - Context *handle_invalidate_cache(int *result); - - void apply(); -}; - -} // namespace operation -} // namespace librbd - -extern template class librbd::operation::SnapshotRollbackRequest; - -#endif // CEPH_LIBRBD_OPERATION_SNAPSHOT_ROLLBACK_REQUEST_H